Activating "Related Links"

Register an Account
Reply
 
Thread Tools Display Modes
  #31 (permalink)  
Old 12-19-2007, 12:36 PM
Banned
Pligg Version: 9.9.5
 
Join Date: Oct 2007
Location: Canada
Posts: 784
Is this what needs to be replaced?

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
or it that too much code

line 101 -107 I can't find it on the lines you mentioned
Reply With Quote
  #32 (permalink)  
Old 12-19-2007, 12:40 PM
modernste's Avatar
Casual Pligger
Pligg Version: 9.8.2
Pligg Template: yget
 
Join Date: Nov 2007
Posts: 34
hm, I guess it's different in some templates.

That is the start of the code, but make sure and grab all the way to the closing } tag, it's about 12 full lines of code.

the code of peppolone's will repalce that entire section of code for related stories.
Reply With Quote
  #33 (permalink)  
Old 12-19-2007, 12:42 PM
Banned
Pligg Version: 9.9.5
 
Join Date: Oct 2007
Location: Canada
Posts: 784
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 NOT ".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 changed all that code and it worked great thanks for the help!

bbrian017
Reply With Quote
  #34 (permalink)  
Old 12-19-2007, 12:52 PM
Banned
Pligg Version: 9.9.5
 
Join Date: Oct 2007
Location: Canada
Posts: 784
Seems it's only working for specific users do we know why this is happening? How does it collect the information and decide what is related and what isn't?

What's the difference from this link, Blog Engage

or this link, Blog Engage - KnotGypsy's Kitchen Chronicles: Shopping for Holiday Recipes

Last edited by bbrian017; 12-19-2007 at 12:56 PM.
Reply With Quote
  #35 (permalink)  
Old 01-19-2008, 12:43 PM
New Pligger
Pligg Version: 9.9
Pligg Template: heavily moded yGet
 
Join Date: Jan 2008
Posts: 22
This fix worked for me
MYSQL 4.1.21
PHP 5.2.0
Thanks!
Reply With Quote
  #36 (permalink)  
Old 01-19-2008, 05:57 PM
Casual Pligger
 
Join Date: May 2007
Posts: 46
I think that in nexts releases it will be interesting to show related links not only with tags... do you know what i mean? Because if a write a tag like: "tomato", but in nexts news i write "tomatoes", the first new is not in related links... at least in my pligg O_o

Well, sorry for my english, i'm on it

Last edited by GDFH; 01-19-2008 at 06:01 PM.
Reply With Quote
  #37 (permalink)  
Old 01-24-2008, 07:41 PM
New Pligger
 
Join Date: Jul 2007
Posts: 12
Is it possible to change easily the link of the related ?

I got :
Ex.: story.php?title=Title_Here

I would like to have:
Ex.: story.php?id=30

Note : I use 9.9.0 And story Title is set to false.
The bug is in Related News Only

Last edited by Coolaid; 01-24-2008 at 07:45 PM.
Reply With Quote
  #38 (permalink)  
Old 01-24-2008, 11:23 PM
Constant Pligger
Pligg Version: Pligg 9.9
Pligg Template: Custom
 
Join Date: Jul 2007
Location: Ottawa, Ontario
Posts: 146
I'm working on a new site, so I gave this a try and it's working properly. But I have an important remark to make. I am using 9.9.

The related stories have for example the following url:

http://www.website.com/story/title/google-test

It actually points to the right article (no 404)

Unfortunately, the problem is, if you are using URL Method 2, the same story has the following url:

http://www.website.com/CATEGORYNAME/google-test/

Which I think google might consider as duplicate content, knowing that the links on a story page are follow, index.

Is there a way to make the related story URL's use the same format as what the admin's prefered URL Method (1 or 2), instead of the current way?
Reply With Quote
  #39 (permalink)  
Old 02-28-2008, 11:34 AM
New Pligger
Pligg Version: 9.9
 
Join Date: Feb 2007
Posts: 22
That fixed the problem, thanks a lot!

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;    
}
****************************
Reply With Quote
  #40 (permalink)  
Old 02-29-2008, 01:20 AM
New Pligger
Pligg Version: 9.9
 
Join Date: Feb 2008
Posts: 1
Quote:
Originally Posted by Unknown View Post
I'm working on a new site, so I gave this a try and it's working properly. But I have an important remark to make. I am using 9.9.

The related stories have for example the following url:

http://www.website.com/story/title/google-test

It actually points to the right article (no 404)

Unfortunately, the problem is, if you are using URL Method 2, the same story has the following url:

http://www.website.com/CATEGORYNAME/google-test/

Which I think google might consider as duplicate content, knowing that the links on a story page are follow, index.

Is there a way to make the related story URL's use the same format as what the admin's prefered URL Method (1 or 2), instead of the current way?
My solution, change the meta.tpl file logic for writing robots tags to

Code:
{if $indexit eq "1" OR $pagename eq "register" OR $pagename eq "cloud" OR $pagename eq "topusers"}
	<meta name="robots" content="index,follow" />
{elseif $pagename eq "story"}
	<meta name="robots" content="index,nofollow" />
{else}
	<meta name="robots" content="noindex,follow" />
{/if}
Its working at alexxxa.com (the site is "adult only")
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