Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 05-05-2011, 03:52 PM
eh69 eh69 is offline
 
Join Date: Feb 2009
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 05-09-2011, 04:29 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 05-09-2011, 04:47 PM
eh69 eh69 is offline
 
Join Date: Feb 2009
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Look at screen:


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

How to fix it?
Reply With Quote
  #4  
Old 05-09-2011, 05:07 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 05-13-2011, 10:13 AM
eh69 eh69 is offline
 
Join Date: Feb 2009
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 05-13-2011, 05:32 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes that would complicate things. I'll see if I can work on a solution.
Reply With Quote
  #7  
Old 05-16-2011, 12:59 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:56 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.04322 seconds
  • Memory Usage 2,222KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete