vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Question I could really use help with (https://vborg.vbsupport.ru/showthread.php?t=181162)

sccrgy789 06-01-2008 12:15 AM

Question I could really use help with
 
I'm trying to make a plugin and some template changes but am having issues.

I have added a plugin:
Hook: global_start
Execution Order: 5
Code:
Code:

$niImage = array(58054);
As you can see it's very simple...

Now, in my posbit, I am trying to do an in_array on that array. I always end up with PHP error saying there is a bad second argument for in_array.

Basically, my array is not defined in the postbit where I want to use it.

Other Info:
1. I am using global_start because I want this array available in MANY places. (Posbit, viewtopic, viewprofile, etc.)
2. I tried putting a "global $niImage;" and it didn't seem to help...
3. I also tried using:
Code:

$vbulletin->niImage = array(58054);
(I'm not sure if that was the right syntax)
4. I am using vBulletin 3.6.4 and can not upgrade it.

So I would like to know either what hook to use to achieve this or how to properly define my variable so I can use it in all of those places...

Thanks!

Dismounted 06-01-2008 10:01 AM

You have one element in your array, can't you just use a variable?

sccrgy789 06-01-2008 03:16 PM

Well that array was an example... There will be more elements...

sccrgy789 06-02-2008 07:50 PM

Ok can anyone help me? I really do need to know the answer to this.

Lynne 06-02-2008 08:09 PM

I think you need to explode your array in the plugin before using it in the template.

$niImageEx= explode(",", $niImage);

Then in the template:
<if condition="in_array($whatever, $niImageEx)">

Opserty 06-02-2008 09:17 PM

In the postbit you need to have:
PHP Code:

global $niImage

In a nearby plugin, like postbit_display_start for example then you should be able to use it in the postbit template.


All times are GMT. The time now is 03:03 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.02287 seconds
  • Memory Usage 1,717KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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