PDA

View Full Version : SEO Smart Links for vBulletin


eh69
05-05-2011, 03:52 PM
Hello, im requesting modification from Wordpress (look here: http://imageshack.us/photo/my-images/98/seosmartlinksoptionsalf.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/9563/alfaromeo156.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:


$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:


$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:
$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