FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » hey guys, any seo urls plugins?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
hey guys, any seo urls plugins? [message #162493] Sun, 23 May 2010 04:54 Go to next message
karlim is currently offline  karlim   China
Messages: 5
Registered: May 2010
Karma: 0
Junior Member
hey guys, any seo urls plugins?
the forum's great
Re: hey guys, any seo urls plugins? [message #162498 is a reply to message #162493] Sun, 23 May 2010 06:56 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
You don't need a plugin, just enable the PATH_INFO theme. For details, see "Can I change the URL format/ use search engine friendly URLs?" at FAQ.
Re: hey guys, any seo urls plugins? [message #162567 is a reply to message #162498] Thu, 10 June 2010 05:38 Go to previous messageGo to next message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma: 0
Senior Member
The PATH_INFO theme is not complete, it just contains links, where is it defined which main theme it gets the rest of the layout from? Can I change that to other than the default somehow?

IE, I have a theme, I wanna try to use the SEO, what do I do?


Re: hey guys, any seo urls plugins? [message #162569 is a reply to message #162567] Thu, 10 June 2010 06:28 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
All themes are based on the default theme. The same applies to PATH_INFO. You can create custom PATH_INFO themes by combining PATH_INFO with one of the other themes (manual merge of files).
Re: hey guys, any seo urls plugins? [message #162570 is a reply to message #162569] Thu, 10 June 2010 06:49 Go to previous messageGo to next message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma: 0
Senior Member
I was hoping there wouldnt have to be a "manual" in the merge hehe - Anyhow, just figured out that SEO URLS can co-exist with regular URLs so slowly merging them together.

However, something I just realized is that FUDs SEO URLS arent very attractive, since they do not list a topic title in the URL.

Example:
http://www.searchenginejournal.com/seo-best-practices-for-url-structure/721 6/

I *WAS* gonna say, see how it doesn't care if you edit the title, but actually it does care hehe so poor example.

Aaaanyway, wouldn't sort of the whole point with the SEO to have the topic title in the URL? As a not-used variable if nothing else?

IE:
fudforum.org/forum/index.php/t/21102/hey-guys,-any-seo-url-plugins?/

Where the last part, the title, is ignored by the system, it only reads the threadID like usual.

Hrmm, maybe one should add in the thread.php.t a new variable called like "thread_title_SEO" and then format it somehow by replacing spaces with "-"'s and then just append it to the {SECTION: whatever_lnk} templates? Shouldn't that work and make search engines index your pages better?


Re: hey guys, any seo urls plugins? [message #162571 is a reply to message #162570] Thu, 10 June 2010 07:02 Go to previous messageGo to next message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma: 0
Senior Member
Yeah, that worked fine, would I need to strip the URL further than what has already been done before it was input into the database as the topic title, or is it safe? IE, can someone use some special chars in creating a topic title to be able to do some nasty XSS script attacks or anything like that?

Re: hey guys, any seo urls plugins? [message #162577 is a reply to message #162571] Fri, 11 June 2010 05:39 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
You should be OK if you do a urlencode() on the subject.

PS: It would be great if you can post a patch so we can also implement it on our forums.
Re: hey guys, any seo urls plugins? [message #162597 is a reply to message #162577] Tue, 15 June 2010 19:52 Go to previous messageGo to next message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma: 0
Senior Member
I ended up doing this and put it in thread.php.t and index.php.t (Guess it could have been put in some other file that is included in both those, but I am a worthless coder, so I dont care):
/* begin URL SEO HACK */
		$forum_title_SEO = str_replace(" ","-",$r[10]);
		$forum_title_SEO = strtolower($forum_title_SEO);
		$forum_title_SEO = preg_replace('/[^a-z0-9_]/i', '-', $forum_title_SEO);
		$forum_title_SEO = preg_replace('/_[_]*/i', '-', $forum_title_SEO);
		$forum_title_SEO = str_replace('---', '-', $forum_title_SEO);
		$forum_title_SEO = str_replace('--', '-', $forum_title_SEO);
		$forum_title_SEO = str_replace('-s-', 's-', $forum_title_SEO);
		$forum_title_SEO = str_replace("%","",$forum_title_SEO);
		$forum_title_SEO = str_replace("/","",$forum_title_SEO);


There is also a problem if the thread title starts with numbers, so I also had to edit users.inc.t:
We just add an isnumeric check (should have been there from the start imo!)

			case 't': /* view thread */
				$_GET['t'] = 0;
				$_GET['th'] = $p[1];
				if (isset($p[2])&&is_numeric($p[2])) {
					$_GET['start'] = $p[2];
					if (!empty($p[3])) {
						$_GET[$p[3]] = 1;
					}
				}
				break;

switch ($p[0]) {
			case 'm': /* goto specific message */
				$_GET['t'] = 0;
				$_GET['goto'] = $p[1];
				if (isset($p[2])) {
					$_GET['th'] = $p[2];
					if (isset($p[3])&&is_numeric($p[3])) {
						$_GET['start'] = $p[3];
						if (is_numeric($p[3])) {
							$_GET['t'] = 'msg';
							unset($_GET['goto']);
						}



or well, for correctness sake, everywhere where it checks for stuff that's supposed to be only numbers Razz - This way, things will not get messed up if a thread is called "12 monkeys"


Re: hey guys, any seo urls plugins? [message #162598 is a reply to message #162597] Tue, 15 June 2010 19:59 Go to previous messageGo to next message
Ernesto is currently offline  Ernesto   Sweden
Messages: 413
Registered: August 2005
Karma: 0
Senior Member
Then I just added the variable after each URL link, sorta

Re: hey guys, any seo urls plugins? [message #162927 is a reply to message #162598] Tue, 31 August 2010 16:45 Go to previous messageGo to next message
INVY is currently offline  INVY   Italy
Messages: 33
Registered: November 2009
Karma: 0
Member
hello,

you can explain in detail, files and code to change?

Thanks
Re: hey guys, any seo urls plugins? [message #168398 is a reply to message #162927] Fri, 26 April 2013 04:54 Go to previous messageGo to next message
cpreston is currently offline  cpreston   United States
Messages: 160
Registered: July 2012
Location: Oceanside
Karma: 6
Senior Member
I think this looks like an awesome hack. I think it should be in the core code, but it would have to support allowing people to turn it on/off.

To put this in the core code, what would be more proper:

- Core Code development (like above), with an added Global Config variable to turn the feature on/off
- Writing this as a plugin that can be turned on/off
Re: hey guys, any seo urls plugins? [message #168786 is a reply to message #168398] Thu, 25 July 2013 04:53 Go to previous messageGo to next message
cpreston is currently offline  cpreston   United States
Messages: 160
Registered: July 2012
Location: Oceanside
Karma: 6
Senior Member
Ernesto

Can you get back to us with these details?

[Updated on: Thu, 25 July 2013 04:54]

Report message to a moderator

Re: hey guys, any seo urls plugins? [message #168822 is a reply to message #168786] Sat, 27 July 2013 13:31 Go to previous message
naudefj is currently offline  naudefj   
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
This mod was implemented in core and will be part of the FUDforum 3.0.5 release.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: set post image to accept it
Next Topic: Not getting any emails from FUDforum
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 21 17:53:09 GMT 2024

Total time taken to generate the page: 0.02897 seconds