No one has any insight for those of us who can't get this to work?
Geoserv


![]() |
| | Thread Tools | Display Modes |
| |||
|
No one has any insight for those of us who can't get this to work? Geoserv |
| |||
|
Can This mod be adapted so related stories will be based on the Category? this would be awesome. Does anyone also have code to display a pre-defined number of stories per category on the front page, like your typical newspaper... THanks noyP Noyp |
| |||
|
Related stories wasn't working for me. The main problem was with this line: Code: $related_tags="'".str_replace(", ","', '",addslashes($related_tags))."'"; // This gives us the proper string structure for IN SQL statement Code: $related_tags="'".str_replace(",","', '",addslashes($related_tags))."'"; // This gives us the proper string structure for IN SQL statement Code: function related_stories($storyid, $related_tags, $category){
// this returns similar stories based on tags in common and in the same category
global $db;
$related_tags="'".str_replace(",","', '",addslashes($related_tags))."'"; // This gives us the proper string structure for IN SQL statement
// Select 10 stories that share tags with the current story and order them by number of tags they share
$sql = "SELECT ".table_links.".link_title, ".table_links.".link_title_url, COUNT( ".table_tags.".tag_link_id ) AS relevance, ".table_tags.".tag_link_id FROM ".table_tags.", ".table_links." WHERE ".table_tags.".tag_words IN ( ".$related_tags." ) AND ".table_tags.".tag_link_id = ".table_links.".link_id AND ".table_links.".link_status != 'discard' AND ".table_links.".link_id != ".$storyid;
//comment the following line out if you want this to work accross categories
//$sql.= " AND ".table_links.".link_category = ".$category;
$sql.= " GROUP BY ".table_tags.".tag_link_id, ".table_links.".link_title, ".table_links.".link_title_url ORDER BY relevance DESC LIMIT 10";
$related_stories = mysql_query($sql);
$related_story = array();
while ($rows = mysql_fetch_array ($related_stories, MYSQL_ASSOC)) array_push ($related_story, $rows);
return $related_story;
} |
| |||
|
I´m a little bit confused. Is this mod the same as the standard function of v9.5 (Only Search 'Title' and 'Tags' |
| |||
| Quote: Please read the license, specially 2. d), which is part of Pligg's software. You're are making something illegal when you removed the copyright notice on the site and the link to the license and code download address. Don't take this personally. I believe that you did it with no harm but you were careless and didn't read the license before using it. This is Free Software and not Public Domain. Best, Lopo |
| ||||
|
I can't believe I just found this thread :-P So I used diablos code and everything is working a-ok. Another 'bug' that is inherent in Pligg shows up here - discarded stories with the same title as a non-discarded story shows up. I went into the database and deleted the dupe entries and everything is cool now. |
| |||
| Quote:
|
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Related Stories from Digg, Twitter, YouTube | alpapa23 | Questions and Comments | 0 | 08-04-2009 04:50 PM |
| Related Stories on Story Page | canadianguy33 | Questions and Comments | 8 | 03-22-2008 03:39 PM |
| Related Stories | Geoserv | Questions and Comments | 15 | 07-08-2007 12:21 PM |
| Related stories empty when tags separated by space | aaronpais | Questions and Comments | 5 | 06-18-2007 11:32 PM |
| How can you make "Queued Stories" display promoted stories as well? | gragland | Questions and Comments | 0 | 06-18-2006 01:24 AM |