Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-13-2010, 07:14 AM
Asterix_ita's Avatar
Asterix_ita Asterix_ita is offline
 
Join Date: Aug 2009
Location: Italy
Posts: 312
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 04-13-2010, 02:45 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 04-13-2010, 04:38 PM
Asterix_ita's Avatar
Asterix_ita Asterix_ita is offline
 
Join Date: Aug 2009
Location: Italy
Posts: 312
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 04-14-2010, 08:46 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My guess is that this is a scope question. Try adding a global for the variables you are using in top of the plugin.
Reply With Quote
  #5  
Old 04-14-2010, 11:37 AM
Asterix_ita's Avatar
Asterix_ita Asterix_ita is offline
 
Join Date: Aug 2009
Location: Italy
Posts: 312
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:04 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05481 seconds
  • Memory Usage 2,200KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete