

![]() |
| | LinkBack | Thread Tools | Display Modes |
| ||||
| Still need fix for this willing to pay. |
| |||
| Says I have to post before I can view attachments - Here it is. |
| |||
| Okay, I think I've discovered the reason for the problem, but, unfortunately, not the solution. It appears that related links only works if you have MySQL 5.X, but not 4.X. I'd like to confirm this before sending a bug report. For those of you having this problem: 1. What version of MySQL are you using? 2. What version of PHP are you using? 3. What URL method are you using (1 or 2)? Remember, this is for people who cannot get related links to work under any circumstances. Last edited by fingerprn; 11-16-2007 at 11:32 PM. |
| ||||
| I have php4 and mysql 4.1.10, if u use the last svn version of pligg, try that ***************** 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;
$sql.= " GROUP BY ".table_tags.".tag_link_id, ".table_links.".link_title, ".table_links.".link_title_url ORDER BY relevance DESC LIMIT 10";
$related_story = $db->get_results($sql);
$related_story = object_2_array($related_story);
return $related_story;
}
Last edited by peppolone; 11-19-2007 at 09:33 PM. |
| |||
| Quote:
For anyone else with this problem, the modified file is /libs/html1.php |
| ||||
click on my thank button lol |
| ||||
| outstanding, that fixed my issue as well. |
| ||||
| I still can't seem to get the related links working can anybody offer a suggestion, my link is Graphic Design Links / Published News Thanks |
| |||
| I tried your first fix and it caused an error on the home page at BE and I have no clue what to do with your second post for advice. Where do we add that too in that file? Please be more specific ![]() Thanks, bbrian017 |
| ||||
| bbrian017, what you need to do is copy that code from peppolone and replace it in the libs\html1.php I believe it is lines 51-63. I replaced it on my sites and it worked like a champ. hope that helps. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Activating Google adsense Sharing | chat2fanna | Questions and Comments | 0 | 07-30-2008 11:49 AM |
| Are "paid links" bad? | Simon | Questions and Comments | 4 | 04-19-2007 09:14 PM |