SimplePortal

Support => English Support => Topic started by: allemand1 on April 21, 2010, 01:40:50 PM

Title: Recent Topics Modification!
Post by: allemand1 on April 21, 2010, 01:40:50 PM
Hi, i need a little change in recent topics.
The problem is that when you clic some url in this block, it takes you to the last post of the topic, and i want it to take you to the first message of the topic....

How can I do it....

This is the url that uses this block: <a href="', $item['href'], '">
Title: Re: Recent Topics Modification!
Post by: AngelinaBelle on April 22, 2010, 11:04:30 AM
This is really a customization request, but I'll give it a whirl  :nervous-happy:
 
That block calls ssi_recentTopics or ssi_recentPost, depending on your selection.
I just looked in SSI.php to find out that $item['href'] always has a URL to the last message in the topic.
And that $row['href']=$scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new'
And that $row['id_topic'] is available, and returned to sp_recent.
 
So you can make up your own replacement for href, by replacing the ".msg" stuff with ".0"
 
Code: (find) [Select]
<a href="', $item['href'], '">
Code: (replace) [Select]
<a href="', $scripturl, '?topic=' , $item['id_topic'], '.0;topicseen#new">

Please give it a try and see if it works.
Title: Re: Recent Topics Modification!
Post by: allemand1 on April 22, 2010, 04:51:09 PM
Yes that works great, but the problem is that I use SimpleSEF, so the url of the topic is not forum.com/?topic=1 for example, and if i use that url, google will detect duplicate content (not good for SEO).

So i modified SSI.php, the function ssi_recentTopics.

from this: 'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new',
to this: 'href' => $scripturl . '?topic=' . $row['id_topic'] ,

And now it works great with the SimpleSEF.

Thanks for your help!!!!
Title: Re: Recent Topics Modification!
Post by: AngelinaBelle on April 22, 2010, 05:21:57 PM
Sure -- you could construct that URL either in SSI.php or on PortalBlocks.php.
 
You can decide which one is easier for you to maintain, and which will have the best effect on your website.
 
 
SimplePortal 2.3.8 © 2008-2024, SimplePortal