| Author |
Message |
aaly
Newbie


Joined: Mar 08, 2007
Posts: 3
|
Posted:
Wed Sep 17, 2008 4:30 pm |
|
|
|
 |
pHaNtOm309
Newbie


Joined: Sep 12, 2008
Posts: 5
|
Posted:
Thu Sep 18, 2008 1:57 am |
|
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&file=article&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&file=article&sid='.$sid.'">'; }
else {
$story_link = '<a href="modules.php?name=News&file=article&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'. |
| |
|
|
 |
aaly
Newbie


Joined: Mar 08, 2007
Posts: 3
|
Posted:
Thu Sep 18, 2008 4:20 am |
|
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"; |
| |
|
|
 |
aaly
Newbie


Joined: Mar 08, 2007
Posts: 3
|
Posted:
Thu Sep 18, 2008 4:29 am |
|
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&file=article&sid='.$sid.$r_options.'">'; |
replace with :
| Code: |
| $story_link = '<a href="/article'.$sid.'.html">'; |
Demo : www.itmag.org |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 945
|
Posted:
Thu Sep 18, 2008 7:54 am |
|
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 |
|
|
 |
Guardian
Site Admin


Joined: Jul 18, 2005
Posts: 307
|
Posted:
Fri Sep 19, 2008 8:49 am |
|
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
BTW aaly - thanks for putting the link back  |
_________________ Spam Stopper - Comments Modules - Security News - Script Installer |
|
|
 |
|
|