vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Can't modify $post['signature'] in plugin... (https://vborg.vbsupport.ru/showthread.php?t=254346)

BirdOPrey5 11-28-2010 06:58 AM

Can't modify $post['signature'] in plugin...
 
I can modify $post['message'] and $post['title'] no problem... I'm trying to modify $post['signature'] by searching for a string, if it's found, replacing it with a different string.

I tried postbit_display_complete first and while it worked for message and title it didn't do anything for signature...

So then I changed it to postbit_display_start and nothing from there either- I get no errors but the text never gets replaced.

This is frustrating because I have another custom plugin running on the same hook which modifies $post['signature'] already and it works. (I disabled that plugin while testing the new one.)

The working plugin evaluates a template on the signature start template hook and then "erases" the existing sig with the line:
Code:

$post['signature'] = '';
and like I said that definitely works. I can't figure out what is different in the old plugin that it works where as the new one doesn't. Is there something screwy about $post['signature'] I'm missing?:confused:

Boofo 11-28-2010 07:00 AM

You need to look in the db and see what it shows for the string you are looking for before it is parsed.

BirdOPrey5 11-28-2010 01:58 PM

So would a different hook be better- after it is parsed? I would think postbit_display_complete would be after parsing...

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

GOT IT!!

This is absolutely ridiculous but in postbit_display_complete it does work IF I use:
$post[signatue]
but doesn't work if I use
$post['signature']

Lynne 11-28-2010 02:55 PM

I assume you mean $post[signature]? But actually, if you look at the code around postbit_display_complete, you'll see the proper variable to use is $this->post, so it should be $this->post['signature'] . (however, I tried $post['signature'] and it worked fine for me. :/ )

BirdOPrey5 11-28-2010 06:11 PM

You know it was 4am... I'm not sure of anything at this point.:p


All times are GMT. The time now is 01:06 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.00956 seconds
  • Memory Usage 1,716KB
  • 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_code_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