vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Variables plugin (https://vborg.vbsupport.ru/showthread.php?t=240347)

Asterix_ita 04-13-2010 07:14 AM

Variables plugin
 
I made an addon for VB4 and everything works fine, now I wanted to convert VB3 and popular option that variables are not interpreted in the same way

Eg.

$ok = "OK if true" . $vbulletin->options[bip_ct_padding_botton]." admin";

With this formula in the plugins and reporting $ok in postbit the result is
?OK if true admin

Then the variable at the center is not powered, but the value is there because if I enter $vboptions[bip_ct_padding_botton] on postbit the value is displayed.

I ask you what I miss? Other eg. Not Working

$post[message] .= ?test?

thanks

PS The addon I would like to convert it Birthday image

Lynne 04-13-2010 02:45 PM

Perhaps $vbulletin isn't valid there (you didn't mention what hook location)? Find the hook in the code (do a search in the files for it) and then look at the code used around it and see if it's valid or if you need to call it a different way.

Asterix_ita 04-13-2010 04:38 PM

maybe I explained evil, the plugin runs from VB3, but not all variables are fed into the plugin,

eg.

hook postbit_display_complete

$post[message] .= $myvartemp;

in vb4 is ok in vb3 does nothing

now the problem I cheated by making a manual change to the template postbit but I'd like to understand why the merge between variables does not work

thanks

Marco van Herwaarden 04-14-2010 08:46 AM

My guess is that this is a scope question. Try adding a global for the variables you are using in top of the plugin.

Asterix_ita 04-14-2010 11:37 AM

thanks for the answers, today I tried another way written several times in this forum, but this had little effect.

I wish that the template was added postbit a variable automatically just before
<!-- / message -->

I state that if I enter manually works. in order to get this

$ct_birthday
<!-- / message -->

to do this I read that many use this syntax

Code:

$find = "<!-- / message -->";
$replace = $ct_birthday;

$vbulletin->templatecache['postbit'] = str_replace($find, $replace . $find, $vbulletin->templatecache['postbit']);

the variable $ ct_birthday draws my template which is already in cache

the plugin is invoked by postbit_start.

To see if my template is not loaded I tried to insert the variable manually in the template and it works fine Another test I made is to assign the value to $ replace "mouse" but not reported

Now I do not understand where the error can be seen in many utilizzan syntax similar and I would like to avoid manual editing still Excuse for English but use a translator

Edit:

Created a new plugin for the exchange of cache, global hook allocated start, now works


All times are GMT. The time now is 04:02 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.01093 seconds
  • Memory Usage 1,719KB
  • 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