TinyPortal

Development => Support => Topic started by: Rostam on January 19, 2009, 08:23:37 PM

Title: "Read More" URL has extra "/" in the URL
Post by: Rostam on January 19, 2009, 08:23:37 PM
I am displaying the recent posts on the home page. At the bottom of some of the blocks you see "Read More" which is pointing to the actual post in the forum. The URL has an extra slash "/" before the post name which makes the URL invalid. I.E http://www.mydomain.com/forum//topic.html I looked in the code. This is coming from the following code in the TPmodules.php
$row['body'] .= '...... <a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '".0>' . $txt['tp-readmore'] . '</a>';

So it looks like "ID_TOPIC" has an extra / at the beginning?   How can I fix this?


PS. I have also SEO4SMF installed and turned on pretty URL. Could that have anything to do with this?
Title: Re: "Read More" URL has extra "/" in the URL
Post by: G6Cad on January 19, 2009, 08:26:44 PM
QuotePS. I have also SEO4SMF installed and turned on pretty URL. Could that have anything to do with this?

Yes, it just might  ;)

Please take your time and fill in the needed info according to this.

Please read the Posting Guidelines.html (http://www.tinyportal.net/index.php/topic,581)
Title: Re: "Read More" URL has extra "/" in the URL
Post by: Rostam on January 19, 2009, 08:35:57 PM
Thanks for the quick reply. Here is the needed information:

Link to my site: http://www.brostalk.com
SMF version: SMF ver. 1.1.7
TP version: TP ver. 1.0.6
Theme name and version: Megapolis
Mods installed: SEO4SMF, Time-Logged-in, Super Admin
Related Error messages: No Error message. But the "Read More" link at the bottom of recent posts doesnt work, because it has an extra slash "/".
Title: Re: "Read More" URL has extra "/" in the URL
Post by: G6Cad on January 19, 2009, 08:40:10 PM
What happends if you turn off the SEO and Search friendly url ?
Title: Re: "Read More" URL has extra "/" in the URL
Post by: Rostam on January 19, 2009, 08:56:38 PM
I just tried it out and this is what happen:

With SEO & Friendly URL: http://www.brostalk.com/forum//fast_sex-t68.0.html;  (Doesnt work)
Without SEO: http://www.brostalk.com/forum/index.php/topic,68.html  (Works)
Without Friendly URL: http://www.brostalk.com/forum/index.php?topic=68 (Works)

So when both are turned on (default) it doesnt work. I would like to keep them both so SE come by often to index my site.
Any idea how I can fix this?
Title: Re: "Read More" URL has extra "/" in the URL
Post by: G6Cad on January 19, 2009, 09:07:55 PM
Will have to leave that question for Bloc or IchBin to answer, i know Bloc is working on using it for this site, so it would not be impossible, jut cant say how to make it happend though.
Title: Re: "Read More" URL has extra "/" in the URL
Post by: Rostam on January 19, 2009, 09:23:55 PM
Thanks for your help.
I will wait on Bloc or IchBin to see if they have a solution for this issue.
Title: Re: "Read More" URL has extra "/" in the URL
Post by: Rostam on January 21, 2009, 04:01:28 AM
Hi Bloc and IchBin,
Have you had a chance to take a look into this issue? Thanks in advance.
Title: Re: "Read More" URL has extra "/" in the URL
Post by: IchBin on January 21, 2009, 07:20:52 AM
It is a friendly URL issue. I'm not sure what is causing it. I thought I remembered someone having this problem before, but I can't find the post here.
Title: Re: "Read More" URL has extra "/" in the URL
Post by: Rostam on January 21, 2009, 01:40:38 PM
Thanks for the prompt reply. Since this is coming from below line of code:
$row['body'] .= '...... <a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '".0>' . $txt['tp-readmore'] . '[/url]';

Is there a way to change ID_TOPIC? IE. remove the extra "/" Sorry I am not a php expert. Your help is appreciated.
Title: Re: "Read More" URL has extra "/" in the URL
Post by: JPDeni on January 21, 2009, 02:34:50 PM
The friendly URL code is what's adding the / characters, so it would seem you would have to change that code, not the TP code.

I would contact the mod creator and ask him/her about it. Somewhere there should be (probably) a line of code that would check for any double / characters and remove one of them.
Title: Re: "Read More" URL has extra "/" in the URL
Post by: Rostam on January 21, 2009, 05:30:44 PM
Thanks for the info. Friendly URL is not a mod.  it is actually part of SMF 1.1.7 release.
But I will surely open a thread in SMF forum and see what what they say about it.
What I am really surprised about is, that nobody else has run into this issue.
Title: Re: "Read More" URL has extra "/" in the URL
Post by: IchBin on January 21, 2009, 05:47:02 PM
I'm assuming by friendly url's that the SEO4SMF mod is what is the cause. Not the built in apache URL rewrites for SMF.
Title: Re: "Read More" URL has extra "/" in the URL
Post by: Rostam on January 21, 2009, 08:07:47 PM
Quote from: IchBinâ„¢ on January 21, 2009, 05:47:02 PM
I'm assuming by friendly url's that the SEO4SMF mod is what is the cause. Not the built in apache URL rewrites for SMF.
No actually I am referring to the SMF option on the adminCP under "Features and Options" called "Search Engine Friendly URL". That is an option on the SMF 1.1.7 and doesnt have anything to do with the SEO4SMF. Anyway when I uncheck that option (Search Engine Friendly URL), then the Read More link underneat the recent page works. Because now it shows up like this:

http://www.brostalk.com/forum/index.php?topic=68

So to answer your question, I dont think this issue is caused by SEO4SMF. Any idea how I can fix it?
Title: Re: "Read More" URL has extra "/" in the URL
Post by: IchBin on January 21, 2009, 09:08:35 PM
When you are asked what mods you have installed. You replied SEO4SMF. So which is it? A mod, or the SMF setting? Why would you mention SEO4SMF if you do not have it installed?
Title: Re: "Read More" URL has extra "/" in the URL
Post by: Rostam on January 21, 2009, 09:16:06 PM
Quote from: IchBinâ„¢ on January 21, 2009, 09:08:35 PM
When you are asked what mods you have installed. You replied SEO4SMF. So which is it? A mod, or the SMF setting? Why would you mention SEO4SMF if you do not have it installed?

Sorry for the confusion. I have SEO4SMF mod installed. That is correct.
But "Search engine friendly URLs" option was there from the get go. I set that right after I installed SMF (before I installed SE04SMF). So I think that option has nothing to do with SEO4SMF.
Am I wrong or missing something?   
Title: Re: "Read More" URL has extra "/" in the URL
Post by: IchBin on January 21, 2009, 09:25:51 PM
SEO4SMF rewrites the URL's. Just like prettyURL's mod. This is where the problem is happening. It is not happening because of TP. Its a conflict between your SEO4SMF mod and TP. That is why its important to be precise and clear about your setup. As I said before, this has been talked about already so please use the search. I do believe the mod author has made many fixes to make his mod compatible with TP. If there is something he can suggest to TP to help, I'm sure Bloc would be glad to make some changes.

Title: Re: "Read More" URL has extra "/" in the URL
Post by: Rostam on January 22, 2009, 03:45:48 AM
All right. Fair enough. Thanks for taking the time to explain this to me.
I will open a separate thread and see if I can get some help/support from the mod author.
I will let you know how it goes.
Title: Re: "Read More" URL has extra "/" in the URL
Post by: Rostam on January 22, 2009, 02:30:10 PM
You know what they are telling me? "They (SEO4SMF and SE friendly URL) are not meant to be used together". Is that right? I thought they are two different things, do different things and meant to be used together. Am I wrong?
Title: Re: "Read More" URL has extra "/" in the URL
Post by: G6Cad on January 22, 2009, 02:39:01 PM
Cant really say as we dont develop any of them  :-\
Title: Re: "Read More" URL has extra "/" in the URL
Post by: IchBin on January 22, 2009, 02:39:46 PM
They both do the same thing, probably just different ways.