Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

SEO URLs for PHPFusion | Alpha Testing

Asked Modified Viewed 24,255 times
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
asked
Veteran Member

Hello Guyz,

I have Coded an Infusion which will provide you the ability to make your website URLs SEO Friendly. I hope that you will like it.

I tested it thoroughly but I think that people would test it more better.

Infusion Algorithm:

This infusion is based on REGEX/Regular Expression search.

1. Search for :
http://mysite.com/news.php?readmore={some number}

2. Replace it with :
http://mysite.com/News-{some number}-News-Description

3. Similarly do this for other URLs of Core.

Working:

As you know, it is quite impossible to implement it for all kind of URLs in the system, on basis of using Regex, you may find some little areas to be normal as they are in the system.

But I've tried my best to make each and every possible URL to be user friendly.

Testing and Reporting:

Currently, its Live Demo and Testing is done at : http://fusion8.co.cc/

Please Test it by Downloading and Installing it from below and kindly Report any "Errors" from the Error Log.

Installation:

1. Download and install seo_friendly_urls_panel and Infuse it.

2. Add the Panel seo_friendly_urls_panel to Panels and Display it on all pages if you are adding it as Upper/Lower Panel.

3. A Small Change in maincore.php :

Find :
define("TRUE_PHP_SELF", $current_page);

Replace with :
Use this Code if you have Choose SEO URLs Type as Plain : http://yoursite.com/news
if (preg_match("/\/(administration)\//", $current_page))
{
   define("TRUE_PHP_SELF", $current_page);
}
else if (preg_match("/".preg_replace("/([a-zA-Z0-9_]+)(\.php|\.html)?/", "$1", $settings['opening_page'])."/", preg_replace("/\/([a-zA-Z0-9_]+)(\.php|\.html)?/", "$1", $current_page)))
{
   define("TRUE_PHP_SELF", preg_replace("/\/([a-zA-Z0-9_]+)(\.php|\.html)?/", "/$1", $current_page));
}
else
{
   define("TRUE_PHP_SELF", $current_page);
}


Use this Code if you have Choose SEO URLs Type as HTML : http://yoursite.com/news.html
if (preg_match("/\/(administration)\//", $current_page))
{
   define("TRUE_PHP_SELF", $current_page);
}
else if (preg_match("/".preg_replace("/([a-zA-Z0-9_]+)(\.php|\.html)?/", "$1", $settings['opening_page'])."/", preg_replace("/\/([a-zA-Z0-9_]+)(\.php|\.html)?/", "$1", $current_page)))
{
   define("TRUE_PHP_SELF", preg_replace("/\/([a-zA-Z0-9_]+)(\.php|\.html)?/", "/$1.html", $current_page));
}
else
{
   define("TRUE_PHP_SELF", $current_page);
}


Done !!!

EDIT : Sorry I forgot to include the code from HTACCESS

Also, You must paste the code in your .htaccess file.

.htaccess File attached now !
Edited by Ankur on 18-07-2012 18:30,
Ankur attached the following file:
seo_friendly_urls_panel.zip [No information available / 765 Downloads]
htaccess.zip [No information available / 756 Downloads]
0 replies

25 posts

H
Hal Ricard
H
Hal Ricard
  • Member, joined since
  • Contributed 95 posts on the community forums.
  • Started 12 threads in the forums
answered
Member

-

Seems like a great job. This feature already is natively in version 8? I'm sorry, but I'm still not fully up to date on the project v8. :)

-
0 replies
R
Rush_
R
Rush_ 10
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 3 threads in the forums
answered
Junior Member

that's good. but not...
for each link replaced it need to make a db query to get "news-description". do u think its normal, me not. brrrr
0 replies
S
Sprunkas
S
  • Junior Member, joined since
  • Contributed 24 posts on the community forums.
  • Started 8 threads in the forums
answered
Junior Member

define("[b]TURE[/b]_PHP_SELF", $current_page);
i think it's mistake, here need to be TRUE i think.
Edited by Sprunkas on 17-07-2012 17:29,
0 replies
J
jikaka
J
jikaka 10
www.rusfusion.ru - russian nss
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 82 threads in the forums
answered
Veteran Member

@Ankur, my anti-virus swears at this link
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
answered
Veteran Member

Quote

halisson wrote:

-

Seems like a great job. This feature already is natively in version 8? I'm sorry, but I'm still not fully up to date on the project v8. :)

-


Thats a custom Mod for 7.02+, no where related to v8 :)

Quote

Rush_ wrote:

that's good. but not...
for each link replaced it need to make a db query to get "news-description". do u think its normal, me not. brrrr


This doesn't work in that way which will make bunch of DB Queries to database. Here is how it works :

1. Find How many News links are there on the page.
Ex: http://mysite.com/news.php?readmore=1
http://mysite.com/news.php?readmore=2
http://mysite.com/news.php?readmore=3

And it will combine it to a single/1 query :
dbquery("SELECT news_subject FROM ".DB_NEWS." WHERE news_id IN(1,2,3) " )

And this is all done before the page loads. Hence, time efficient and memory efficient ;)

Quote

Sprunkas wrote:

i think it's mistake, here need to be TRUE i think.


Oops ! Sorry ! You're right ! Actually, I was testing this on an old version, in which it is TURE_PHP_SELF by mistake...

Quote

jikaka wrote:

@Ankur, my anti-virus swears at this link


Thats surely not due to this, but due to co.cc link B)
0 replies
J
jikaka
J
jikaka 10
www.rusfusion.ru - russian nss
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 82 threads in the forums
answered
Veteran Member

great work!
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
answered
Veteran Member

Hoping for more feedback and errors... or I may proceed to submit it to Addons...

Quote

jikaka wrote:

great work!


Thanks... :)
0 replies
Y
Yodix
Y
Yodix 10
Happy Hunger Games! And may the odds be ever in your favor.
  • Member, joined since
  • Contributed 62 posts on the community forums.
  • Started 20 threads in the forums
answered
Member

A great solution. You would not have anything against it, to use it in modification for PHPFusion v8? :)
0 replies
S
Sprunkas
S
  • Junior Member, joined since
  • Contributed 24 posts on the community forums.
  • Started 8 threads in the forums
answered
Junior Member

I tested at my site this addon. I saw that when replacing maincore.php:

define("TRUE_PHP_SELF", $current_page);

with:

if (preg_match("/\/(administration)\//", $current_page))
{
   define("TRUE_PHP_SELF", $current_page);
}
else if (preg_match("/".preg_replace("/(.*)(\.php|\.html)?/", "$1", $settings['opening_page'])."/", preg_replace("/(.*)(\.php|\.html)?/", "$1", $current_page)))
{
   define("TRUE_PHP_SELF", preg_replace("/(.*)(\.php|\.html)/", "$1", $current_page));
}
else
{
   define("TRUE_PHP_SELF", $current_page);
}


Then don't displays forum threads at the main page.
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
answered
Veteran Member

Quote

Sprunkas wrote:

I tested at my site this addon. I saw that when replacing maincore.php:

Then don't displays forum threads at the main page.


Really ? You forgot to change Site Opening Page link in Main Settings, I guess.

However, What is your website link? It would be more useful B)

Quote

Yodix wrote:

A great solution. You would not have anything against it, to use it in modification for PHPFusion v8? :)


Pardon me... but I didn't got your point... hmm?

Sorry for my bad english... :|
0 replies
J
jikaka
J
jikaka 10
www.rusfusion.ru - russian nss
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 82 threads in the forums
answered
Veteran Member

instead of this:

Quote

http://fusion8.co.cc/Article-Category-2-PHPFusion-v7-Tutorials


better way:

Quote

http://fusion8.co.cc/article-category-2-php-fusion-v7-tutorials


best of all urls in lower case
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
answered
Veteran Member

Quote

jikaka wrote:

instead of this:

Quote

http://fusion8.co.cc/Article-Category-2-PHPFusion-v7-Tutorials


better way:

Quote

http://fusion8.co.cc/article-category-2-php-fusion-v7-tutorials


best of all urls in lower case


That can be simply achieved by changing text in seo_friendly_urls_panel/includes/seo_functions.php :G
0 replies
S
Sprunkas
S
  • Junior Member, joined since
  • Contributed 24 posts on the community forums.
  • Started 8 threads in the forums
answered
Junior Member

After editing maincore.php:
img3.imageshack.us/img3/3953/91929617.png

Before editing maincore.php:
img29.imageshack.us/img29/2524/23545615.png


P.S Forum threads only displays when you tick box in the panel to display at all pages.
P.S.S Not only last forum threads not displaying at main page.
Edited by Sprunkas on 18-07-2012 11:47,
0 replies
Y
Yodix
Y
Yodix 10
Happy Hunger Games! And may the odds be ever in your favor.
  • Member, joined since
  • Contributed 62 posts on the community forums.
  • Started 20 threads in the forums
answered
Member

Quote

Ankur wrote:

Quote

Sprunkas wrote:

I tested at my site this addon. I saw that when replacing maincore.php:

Then don't displays forum threads at the main page.


Really ? You forgot to change Site Opening Page link in Main Settings, I guess.

However, What is your website link? It would be more useful B)

Quote

Yodix wrote:

A great solution. You would not have anything against it, to use it in modification for PHPFusion v8? :)


Pardon me... but I didn't got your point... hmm?

Sorry for my bad english... :|

Can I use this plugin as a modification to the PHPFusion v8? Suffice it to just slightly modify it :|
0 replies
S
spunk
S
spunk 10
www.duesseltag.de/../../images/banner/banner209x69.png
  • Member, joined since
  • Contributed 92 posts on the community forums.
  • Started 6 threads in the forums
answered
Member

Nice! Very very good work! :G

And yes... the forum_thread_lists_panel is not working.

But otherwise on my Testsite SEO works well, i donĀ“t see any problems...
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
answered
Veteran Member

Quote

Sprunkas wrote:

P.S Forum threads only displays when you tick box in the panel to display at all pages.
P.S.S Not only last forum threads not displaying at main page.


Quote

spunk wrote:

And yes... the forum_thread_lists_panel is not working.


Weird :|

This is working OK for me.

Please ensure that you have set correct Site Opening Page in Settings --> Main --> Site Opening Page

In SEO Admin Settings, if you have choosen the URL Template as Plain (http://yoursite.com/news), then site opening page should be news
Otherwise, if you have choose the template as HTML (http://yoursite.com/news.html), then site opening page should be news.html B)
0 replies
S
spunk
S
spunk 10
www.duesseltag.de/../../images/banner/banner209x69.png
  • Member, joined since
  • Contributed 92 posts on the community forums.
  • Started 6 threads in the forums
answered
Member

Hmmm Opening Page is: news.html

There is no forum_thread_list_panel :|

http://dev.spicker.info
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
answered
Veteran Member

Quote

spunk wrote:

Hmmm Opening Page is: news.html

There is no forum_thread_list_panel :|

http://dev.spicker.info


Try this Code in replacement in maincore.php : It works for me !

if (preg_match("/\/(administration)\//", $current_page))
{
   define("TRUE_PHP_SELF", $current_page);
}
else if (preg_match("/".preg_replace("/([a-zA-Z0-9_]+)(\.php|\.html)?/", "$1", $settings['opening_page'])."/", preg_replace("/\/([a-zA-Z0-9_]+)(\.php|\.html)?/", "$1", $current_page)))
{
   define("TRUE_PHP_SELF", preg_replace("/\/([a-zA-Z0-9_]+)(\.php|\.html)?/", "/$1.html", $current_page));
}
else
{
   define("TRUE_PHP_SELF", $current_page);
}
0 replies
S
spunk
S
spunk 10
www.duesseltag.de/../../images/banner/banner209x69.png
  • Member, joined since
  • Contributed 92 posts on the community forums.
  • Started 6 threads in the forums
answered
Member

Ahhh THIS works!

Thank you Ankur! :G

The Code in Post #1 is different...
0 replies

Category Forum

Addons Open Testing

Labels

None yet

Statistics

  • Views 0 views
  • Posts 25 posts
  • Votes 0 votes
  • Topic users 9 members

9 participants

H
H
Hal Ricard
  • Member, joined since
  • Contributed 95 posts on the community forums.
  • Started 12 threads in the forums
J
J
jikaka 10
www.rusfusion.ru - russian nss
  • Veteran Member, joined since
  • Contributed 946 posts on the community forums.
  • Started 82 threads in the forums
Y
Y
Yodix 10
Happy Hunger Games! And may the odds be ever in your favor.
  • Member, joined since
  • Contributed 62 posts on the community forums.
  • Started 20 threads in the forums
S
S
spunk 10
www.duesseltag.de/../../images/banner/banner209x69.png
  • Member, joined since
  • Contributed 92 posts on the community forums.
  • Started 6 threads in the forums
A
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
  • Started this discussions
R
R
Rush_ 10
  • Junior Member, joined since
  • Contributed 34 posts on the community forums.
  • Started 3 threads in the forums
S
S
  • Junior Member, joined since
  • Contributed 24 posts on the community forums.
  • Started 8 threads in the forums
K
K
KasteR 10
  • Senior Member, joined since
  • Contributed 290 posts on the community forums.
  • Started 1 thread in the forums
A
A
  • Junior Member, joined since
  • Contributed 25 posts on the community forums.
  • Started 3 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet