vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Mini Mods - Replace Word in Pagetext (https://vborg.vbsupport.ru/showthread.php?t=235769)

Andy 02-12-2010 10:00 PM

Replace Word in Pagetext
 
1 Attachment(s)
This plugin is designed to replace words in the pagetext. For example to always make sure there is a www in your forums url.

Search: http://vbulletin.org
Replace: http://www.vbulletin.org

You will need to create two plugins.

PHP Code:

Productvbulletin
Hook Location
postdata_presave
Title
Replace Word postdata
Execution Order
5
Plugin PHP Code
:

$search = array(
'http://vbulletin.com',
'http://vbulletin.org',
);
$replace = array(
'http://www.vbulletin.com',
'http://www.vbulletin.org',
);
$this->post['pagetext'] = str_replace($search$replace$this->post['pagetext']); 

PHP Code:

Productvbulletin
Hook Location
threaddata_presave
Title
Replace Word Threaddata
Execution Order
5
Plugin PHP Code
:

$search = array(
'http://vbulletin.com',
'http://vbulletin.org',
);
$replace = array(
'http://www.vbulletin.com',
'http://www.vbulletin.org',
);
$this->post['pagetext'] = str_replace($search$replace$this->post['pagetext']); 


BSMedia 02-13-2010 07:02 PM

why not use replacement manager built in?

Andy 02-13-2010 07:23 PM

Quote:

Originally Posted by BSMedia (Post 1981561)
why not use replacement manager built in?

Replacement manager doesn't actually change the pagetext, it simply replaces the html that is outputted. This can be a problem when a member is searching for a particular word. Therefore it's better to correct the word in the database. I don't recommend using the Replacement Manager.

MarkJW 02-13-2010 10:05 PM

So this is a wordfilter type thing? Awesome, I can screw with my members by making words change! :3

wolfyman 02-20-2010 03:49 PM

alert!

I installed this and thought it was working great.. but for some reason, the Replace Word postdata plugin causes a weird error.

With this enabled, when you move a thread from one forum to another.... the first post gets stripped of data.

wtf is that all about?!

Here is my php code:

PHP Code:

$search = array(
'this1',
'this2',
);
$replace = array(
'that1',
'that 2',
);
$this->post['pagetext'] = str_replace($search$replace$this->post['pagetext']); 


black hours 03-16-2010 09:43 PM

I want this plugin Turns to product Contain a control panel to be the best

Shogo 04-27-2010 12:38 PM

Wat is the hook location for the same effect in the title of the threads?

Thx

Best regards

alhindasi 08-14-2010 08:42 PM

can you do it in "product" to be easy to control it


All times are GMT. The time now is 08:42 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.01039 seconds
  • Memory Usage 1,741KB
  • 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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