Activating "Related Links"

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old 11-10-2007, 11:51 AM
NeoSys's Avatar
Pligg Donor
Pligg Version: Modified 9.9
Pligg Template: Custom
 
Join Date: Sep 2007
Location: San Juan, PR
Posts: 26
Send a message via Skype™ to NeoSys
Still need fix for this willing to pay.
Reply With Quote
  #22 (permalink)  
Old 11-10-2007, 12:25 PM
New Pligger
Pligg Version: Beta 9.8.2
Pligg Template: Standard
 
Join Date: Nov 2007
Posts: 1
Says I have to post before I can view attachments - Here it is.
Reply With Quote
  #23 (permalink)  
Old 11-16-2007, 08:53 PM
Pligg Donor
Pligg Version: 9.8.2 +
Pligg Template: yget
 
Join Date: Jul 2007
Posts: 123
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.
Reply With Quote
  #24 (permalink)  
Old 11-19-2007, 09:29 PM
peppolone's Avatar
Pligg Donor
Pligg Version: 995-54
Pligg Template: upnews.it
 
Join Date: Dec 2006
Location: rome
Posts: 177
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.
Reply With Quote
  #25 (permalink)  
Old 11-21-2007, 05:33 PM
Pligg Donor
Pligg Version: 9.8.2 +
Pligg Template: yget
 
Join Date: Jul 2007
Posts: 123
Quote:
Originally Posted by peppolone View Post
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;    
}
****************************
That's it!!! Thank you so very much!

For anyone else with this problem, the modified file is /libs/html1.php
Reply With Quote
  #26 (permalink)  
Old 11-21-2007, 09:20 PM
peppolone's Avatar
Pligg Donor
Pligg Version: 995-54
Pligg Template: upnews.it
 
Join Date: Dec 2006
Location: rome
Posts: 177
click on my thank button lol
Reply With Quote
  #27 (permalink)  
Old 12-14-2007, 03:09 PM
modernste's Avatar
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: yget
 
Join Date: Nov 2007
Posts: 34
outstanding, that fixed my issue as well.
Reply With Quote
  #28 (permalink)  
Old 12-19-2007, 07:07 AM
Toon's Avatar
Casual Pligger
Pligg Version: 995
 
Join Date: Oct 2007
Location: Sheffield, UK
Posts: 36
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
Reply With Quote
  #29 (permalink)  
Old 12-19-2007, 12:10 PM
Banned
Pligg Version: 9.9.5
 
Join Date: Oct 2007
Location: Canada
Posts: 804
Quote:
Originally Posted by peppolone View Post
click on my thank button lol
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
Reply With Quote
  #30 (permalink)  
Old 12-19-2007, 12:32 PM
modernste's Avatar
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: yget
 
Join Date: Nov 2007
Posts: 34
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.


Quote:
Originally Posted by bbrian017 View Post
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
Reply With Quote
Reply

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


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development