Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Post Replacements Details »»
Post Replacements
Version: 1.8, by DrewM DrewM is offline
Developer Last Online: May 2015 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.6.3 Rating:
Released: 08-29-2006 Last Update: 11-12-2006 Installs: 74
Uses Plugins
 
No support by the author.

Post Replacements 1.8

About
This hack allows you to have replacements for posts, for example you say you wanted every word that says vbulletin to say vbulletin.com you just have to put that in the option in vbulletin settings.

Important
When putting your replacements in the option read the description first to understand how it works.

Change Log
1.1; Fixed the plugin thanks Stoebi
1.5; Replacements now don't interfere with words that include the replacement. Thanks again to Stoebi .

A big thanks to Stoebi for providing most of the code!

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 09-10-2006, 08:50 PM
Stoebi Stoebi is offline
 
Join Date: Apr 2006
Location: Germany, Berlin
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi

These lines should solve all problems which i had and others posted:

@Larrysw
Replace -> Post Replacements (Hook: postbit_display_complete)
Code:
//$this->post[message]
if ($this->registry->options['post_replacements_enabled'] == '1') 
{
	$replacments_array_mine = explode("|||", $this->registry->options['post_Replacements_option']);
	foreach ($replacments_array_mine as $post_replace)
	{
		$post_explode_rple = explode("===", $post_replace);
		$this->post['message']  = preg_replace("/\s(" . $post_explode_rple['0'] . ")\s?\b/iU", " " . $post_explode_rple['1'], $this->post['message']);
	}
}


Edit:
This fine addon works fine with "Hide Links From Guests". You only need to set the "Execution Order" from 5 to 4 in "Plugin Manager" -> Guests will not see links in posts (Hook: postbit_display_complete)


Kind Regards,

Stoebi
Reply With Quote
  #43  
Old 09-10-2006, 11:58 PM
C_P's Avatar
C_P C_P is offline
 
Join Date: Sep 2004
Posts: 262
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Stoebi
Hi

These lines should solve all problems which i had and others posted:

@Larrysw
Replace -> Post Replacements (Hook: postbit_display_complete)
Code:
//$this->post[message]
if ($this->registry->options['post_replacements_enabled'] == '1') 
{
    $replacments_array_mine = explode("|||", $this->registry->options['post_Replacements_option']);
    foreach ($replacments_array_mine as $post_replace)
    {
        $post_explode_rple = explode("===", $post_replace);
        $this->post['message']  = preg_replace("/\s(" . $post_explode_rple['0'] . ")\s?\b/iU", " " . $post_explode_rple['1'], $this->post['message']);
    }
}

Edit:
This fine addon works fine with "Hide Links From Guests". You only need to set the "Execution Order" from 5 to 4 in "Plugin Manager" -> Guests will not see links in posts (Hook: postbit_display_complete)


Kind Regards,

Stoebi
Code replacement worked excellent! Thank you. Maybe you should add this in a read me for the original hack?
Reply With Quote
  #44  
Old 09-11-2006, 11:48 AM
Nj?rd Eriksson Nj?rd Eriksson is offline
 
Join Date: Jul 2003
Location: Midg?rd
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by outlaw621
Working now with the updated code. Thank you. I have a feature request if possible. Can you make the text replacement case insensitive? For example, typing test or Test would be able to have the replacement text applied instead of having to setup several of the same replacements to compensate for case.
If you run PHP5, replacing str_replace with str_ireplace should do the job.
Reply With Quote
  #45  
Old 09-13-2006, 09:42 AM
DrewM DrewM is offline
 
Join Date: Oct 2005
Posts: 564
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Stoebi
Hi

These lines should solve all problems which i had and others posted:

@Larrysw
Replace -> Post Replacements (Hook: postbit_display_complete)
Code:
//$this->post[message]
if ($this->registry->options['post_replacements_enabled'] == '1') 
{
	$replacments_array_mine = explode("|||", $this->registry->options['post_Replacements_option']);
	foreach ($replacments_array_mine as $post_replace)
	{
		$post_explode_rple = explode("===", $post_replace);
		$this->post['message']  = preg_replace("/\s(" . $post_explode_rple['0'] . ")\s?\b/iU", " " . $post_explode_rple['1'], $this->post['message']);
	}
}


Edit:
This fine addon works fine with "Hide Links From Guests". You only need to set the "Execution Order" from 5 to 4 in "Plugin Manager" -> Guests will not see links in posts (Hook: postbit_display_complete)


Kind Regards,

Stoebi
thanks again Stoebi I will update the hack.
Reply With Quote
  #46  
Old 09-13-2006, 03:38 PM
Stoebi Stoebi is offline
 
Join Date: Apr 2006
Location: Germany, Berlin
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi

@Larrysw
I have to thank you! Thank you very much!


Regards, Stoebi
Reply With Quote
  #47  
Old 09-14-2006, 07:51 AM
DeanoG DeanoG is offline
 
Join Date: Feb 2002
Location: UK
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Working perfectly ...

but I have noticed another small problem

Replacement Code.....

--------------------
Ultimate===<a href="http://www.xxxxxxxx.com" target="_blank">Ultimate</a>|||Ultimate DVDR===<a href="http://www.ultimate-dvdr.com" target="_blank">Ultimate DVDR</a>
--------------------


The second condition gets ignored due to the fact the Word "Ultimate" has already been replaced in the first condition.

or is it because of the Space between "Ultimate DVDR" ?

is this possible to fix ?


DeanoG
Reply With Quote
  #48  
Old 09-14-2006, 12:01 PM
Stoebi Stoebi is offline
 
Join Date: Apr 2006
Location: Germany, Berlin
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi

Ultimate DVDR===<a href="http://www.ultimate-dvdr.com" target="_blank">Ultimate DVDR</a>|||Ultimate===<a href="http://www.xxxxxxxx.com" target="_blank">Ultimate</a>


Regards, Stoebi


Quote:
Originally Posted by DeanoG

is this possible to fix ?


DeanoG
Reply With Quote
  #49  
Old 09-17-2006, 12:41 PM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, thank you!
Reply With Quote
  #50  
Old 10-06-2006, 01:39 AM
red24 red24 is offline
 
Join Date: May 2005
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this may sound like a silly question, but i installed the mod and i cant find the place where the replament codes go...... could someone please direct me

--edit--

do i just stick those into the replacement variable manager?
Reply With Quote
  #51  
Old 10-06-2006, 08:06 AM
Stoebi Stoebi is offline
 
Join Date: Apr 2006
Location: Germany, Berlin
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by red24
this may sound like a silly question, but i installed the mod and i cant find the place where the replament codes go...... could someone please direct me

--edit--

do i just stick those into the replacement variable manager?
Hi

Admin -> vBulletin Options -> vBulletin Options and on the right search for Replacement Options


Regards, Stoebi
Reply With Quote
Reply


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 01:08 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05024 seconds
  • Memory Usage 2,310KB
  • Queries Executed 26 (?)
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
  • (3)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete