vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Replace Post Content in vBulletin (https://vborg.vbsupport.ru/showthread.php?t=301339)

bankcroft 08-18-2013 01:44 PM

Replace Post Content in vBulletin
 
Hi there,

as I haven't found a solution to this on my own, here's my question:

How is it possible to automatically replace certain post content with other content?

I'm using vBulletin 4 and the included thread creation from RSS. Some special characters aren't imported the way they should be (for example: ' turns out to be displayed as ').

I'd like to create a replacement that whenever ' is posted, it get's replaced by '.

Any ideas on how to achieve this?

Kind regards,
Cornelius

DF031 08-18-2013 02:17 PM

As long as it is one replacement issue you could (I think) use the censorship feature of VB

Lynne 08-18-2013 03:16 PM

If you do a search, you will find a word replacement modification and you could probably modify that to only work in certain forums (the ones where you have the RSS feeds posted).

bankcroft 08-19-2013 11:27 AM

Quote:

Originally Posted by Lynne (Post 2439578)
If you do a search, you will find a word replacement modification and you could probably modify that to only work in certain forums (the ones where you have the RSS feeds posted).

I did a search and I found no modification for vBulletin 4.

--------------- Added [DATE]1376915322[/DATE] at [TIME]1376915322[/TIME] ---------------

Quote:

Originally Posted by DF031 (Post 2439543)
As long as it is one replacement issue you could (I think) use the censorship feature of VB

The censorship feature would replace content with ****.
I want to define what content should be used for the replacement of a word.

Lynne 08-19-2013 02:50 PM

hook location - postbit_display_complete

PHP Code:

$word = array( 
'WordA'
'WordB'
); 

$link = array( 
'ReplaceA'
'ReplaceB'
); 

 
$this->post['message'] = str_ireplace($word$link$this->post['message']); 

Modify to suite....


All times are GMT. The time now is 05:23 AM.

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.01870 seconds
  • Memory Usage 1,722KB
  • 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_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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