vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   SEO Smart Links for vBulletin (https://vborg.vbsupport.ru/showthread.php?t=263204)

eh69 05-05-2011 03:52 PM

SEO Smart Links for vBulletin
 
Hello, im requesting modification from Wordpress (look here: http://imageshack.us/photo/my-images...ptionsalf.jpg/ ). Any1 can made simple mod for vBulletin?

I know that similar mod is available (https://vborg.vbsupport.ru/showthread.php?t=237479), but is simplest and have bug. Author dont fixing it.

BirdOPrey5 05-09-2011 04:29 PM

Have you ever used the "Replacement variable manager" in your Admin CP / Styles?

You can do this stuff with that. For example you can set it to replace all occurrences of the word "Amazon" with <a href="http://www.amazon.com">Amazon</a> so they'd become links.

eh69 05-09-2011 04:47 PM

Thank You. Its working but adding meta descripiton in header.

Look at screen:
http://img546.imageshack.us/img546/9...faromeo156.jpg

And second problem - this replace all "Alfa Romeo 156", including this words in topic name and navbar.

How to fix it?

BirdOPrey5 05-09-2011 05:07 PM

ahhh yeah I see... Unfortunately if using replacement variables they will work everywhere, I guess I didn't have "Amazon" in my header at the time.

You could do a custom plugin on the hook postbit_display_complete

with php code:

PHP Code:

$find 'amazon';
$replace '<a href="http://www.amazon.com">Amazon</a>';
$post['message'] = str_ireplace ($find$replace$post['message']); 

That will replace all instances of "amazon" irregardless of case in posts ONLY and replace with the link.

There are various ways of coding this but the easiest is just to copy and paste additional lines for as many sites as you have, such as:

PHP Code:

$find 'amazon';
$replace '<a href="http://www.amazon.com">Amazon</a>';
$post['message'] = str_ireplace ($find$replace$post['message']);

$find 'ebay';
$replace '<a href="http://www.ebay.com">Ebay</a>';
$post['message'] = str_ireplace ($find$replace$post['message']);

$find 'woot';
$replace '<a href="http://www.woot.com">WOOT</a>';
$post['message'] = str_ireplace ($find$replace$post['message']); 

... and so on...

This could be an interesting mod- is the only one out there really that buggy?

eh69 05-13-2011 10:13 AM

Thank You very much! I didnt know that its simple!

But I have one problem.

when I set:
Code:

$find = 'Alfa Romeo 156';
$replace = '<a href="http://www.forum.alfaholicy.org/156/">Alfa Romeo 156</a>';
$post['message'] = str_ireplace ($find, $replace, $post['message']);

$find = 'Alfa 156';
$replace = '<a href="http://www.forum.alfaholicy.org/156/">Alfa 156</a>';
$post['message'] = str_ireplace ($find, $replace, $post['message']);

$find = '156';
$replace = '<a href="http://www.forum.alfaholicy.org/156/">156</a>';
$post['message'] = str_ireplace ($find, $replace, $post['message']);

Then Alfa 156 and Alfa Romeo 156 dont showing corectly (because in one phrase I have 2 links) :)

I can fix it with simple IF php function?

EDIT
And how fix it:

I have 2 replace for Alfa Romeo's models:
Alfa Romeo GT
Alfa Romeo GTV

And this script replace only 'Alfa Romeo GT' in phrase 'Alfa Romeo GTV' too

BirdOPrey5 05-13-2011 05:32 PM

Yes that would complicate things. I'll see if I can work on a solution.

BirdOPrey5 05-16-2011 12:59 AM

Getting everything to work as expected actually turned out to be pretty challenging but I think I've got all the bugs worked out.

I have released it as a mod here: https://vborg.vbsupport.ru/showthread.php?t=263699


All times are GMT. The time now is 03:48 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01321 seconds
  • Memory Usage 1,734KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete