Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
aaly
Newbie
Newbie



Joined: Mar 08, 2007
Posts: 3

PostPosted: Wed Sep 17, 2008 4:30 pm Reply with quote

I got it working nice but then i discovered that the url on site for example :

http://mydomain.com/article-78--0-0.html

is in the search engines http://mydomain.com/article78.html

how can this be fixed both urls work but I dont want to be penalized for duplicated content Confused
 
View user's profile Send private message
pHaNtOm309
Newbie
Newbie



Joined: Sep 12, 2008
Posts: 5

PostPosted: Thu Sep 18, 2008 1:57 am Reply with quote

You can thank nuke for that one - ShortLinks is actually working as it should.
The first link is from the article 'comments' link in the article the second one is the article proper.
The code behind the comment link takes user preferences into consideration i.e if the user wants to see comments nested or flat and that is the reason for the two '0' in the url.

The code responsible is $r_options which is in modules/News/index.php
Code:

      $story_link = '<a href="modules.php?name=News&amp;file=article&amp;sid='.$sid.$r_options.'">';

You may have something similar in your themes theme.php file too.

I do not have time to dig out the exact code but on one of my sites I modified that to something like
Code:

if(is_user($user)) {
      $story_link = '<a href="modules.php?name=News&amp;file=article&amp;sid='.$sid.'">'; }
else {
      $story_link = '<a href="modules.php?name=News&amp;file=article&amp;sid='.$sid.$r_options.'">';
}

What that basically does is wrap the link in an is_user check so the comment view 'option' is only seen by a logged in user but a none logged in users/search engines will only see the aticle78.html type link.
On the downside, that isn't a perfect solution as you now have two links with different anchor text, one is 'readmore' the other 'comments'.
 
View user's profile Send private message
aaly
Newbie
Newbie



Joined: Mar 08, 2007
Posts: 3

PostPosted: Thu Sep 18, 2008 4:20 am Reply with quote

This has to be fixed somehow, can we hardcode the short url ? I did this to the social bookmarks buttons, they showed the normal nuke url instead the rewritten one :

$articleurl = $nukeurl."/article$sid.html";
 
View user's profile Send private message
aaly
Newbie
Newbie



Joined: Mar 08, 2007
Posts: 3

PostPosted: Thu Sep 18, 2008 4:29 am Reply with quote

Ok I found a solution this is the hard code way. Inside modules/news open index.php

find
Code:
$story_link = '<a href="modules.php?name=News&amp;file=article&amp;sid='.$sid.$r_options.'">';


replace with :

Code:
  $story_link = '<a href="/article'.$sid.'.html">';


Demo : www.itmag.org
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Thu Sep 18, 2008 7:54 am Reply with quote

The real problem is that *nuke passes the comment threading parameters on the URL rather than as hidden form variables or stored in cookies, which ends up producing many different links to essentially the same content.

As Phantom has said, this is an unfortunate consequence of using *nuke.

BTW, it is something Guardian and I of the RavenNuke(tm) Team have been thinking about for quite some time. It is time to change this mess!

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Fri Sep 19, 2008 8:49 am Reply with quote

Yes, News is definitely "lacking" when it come to consistency on how it presents links and SE relevant data.

Another thing on my gripe list; there should be no need to use any news/article related code inside of themes (though they all do) with the exception of perhaps calling a 'what should be displayed in 'home' type function - I just don't see why you have to have almost duplicated code in the theme as well as the News module (news index.php and news article.php).

Anyway, I'm rambling and this is moving off-topic Smile

BTW aaly - thanks for putting the link back Smile
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch