vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   specific word replacement (https://vborg.vbsupport.ru/showthread.php?t=235725)

Lynne 02-23-2010 01:59 PM

Quote:

Originally Posted by wolfyman (Post 1989595)
so the code stays the same, I just replace 'pagetext' with 'message'?

I posted what I use above and it looks like we just do the replace on a different field. (Although the are closely related.) It could be that your search/replace is not playing nice with some regular stuff on the page, but without seeing exactly what you have in the plugin, it is hard to tell.

wolfyman 02-23-2010 02:10 PM

this is my plugin

PHP Code:

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


Lynne 02-23-2010 02:15 PM

I can't think of why that would cause the issue you are seeing. I just took a look at that link and it looks like it tells you to make two plugins at different locations. You may want to ask for help in that modification thread for this. I really don't know why he uses those locations unless he is actually changing the text before it's saved? The way I was doing it just changes the output. Anyway, you really should be asking for help in the modification thread and see if others have had the same issue.

wolfyman 02-25-2010 11:39 PM

I'd prefer to do it your way, but I don't understand exactly how it's done. Is this your plugin? What hook do you use?

PHP Code:

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

Thank you lynne

Lynne 02-25-2010 11:47 PM

I just used postbit_display_complete


All times are GMT. The time now is 01:18 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.02171 seconds
  • Memory Usage 1,725KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete