The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
if in usergroup id
i created a template where i have:
Code:
<if condition="is_member_of($post, $popbbgperm) AND $post[pbext] !== ''"> Code:
<hookname>postbit_display_complete</hookname> <phpcode><![CDATA[ $popbbgperm = explode(',' , $vbulletin->options['drcpo_sup_pb_perm']); eval('$popbbg = "' . fetch_template('pb_bg_img') . '";'); ]]></phpcode> noting i do is working and its frustrating me like crazy, ive looked over some of BOPS scripts and the only difference i can rly see are i use is_member_of inside a template. can anyone help me get it so if post user is member of usergroup show this. |
#2
|
|||
|
|||
You need to declare $vbulletin as global, or else use $this->registry instead, like $this->registry->options['drcpo_sup_pb_perm'].
Yeah, I know. That's one issue with the hook system. What you can do and what variables are there has to do with where they decided to put the hook. Eventually you get to what's goign on around the "popular" hooks, but I think the only way to really be able to write plugins its to set up the code so you can search all the files (I use notepad++ on my PC) and search for the hook name, and look at the code there. |
Благодарность от: | ||
Brandon Sheley |
#3
|
||||
|
||||
so declareing vbulletin global is that just using the requireonce global.php?
this is what its looking like Code:
<template name="pb_bg_img" templatetype="template" date="0" username="DrCustUmz" version="1.0"><![CDATA[ <if condition="is_member_of($post,array($vboptions[drcpo_sup_pb_perm])) AND $post[pbext] !== ''">./$vboptions[drcpo_sup_pb_img_dir]/$post[userid].$post[pbext]<else />http://popoverdose.com/greig/upload/soft3.png</if> ]]></template> </templates> <plugins> <plugin active="1" executionorder="5"> <title>cache supreme options template</title> <hookname>cache_templates</hookname> <phpcode><![CDATA[if (THIS_SCRIPT == 'profile'){ $globaltemplates = array_merge($globaltemplates, array('supreme')); } if (THIS_SCRIPT == 'showthread'){ $globaltemplates = array_merge($globaltemplates, array('pb_bg_img')); } ]]></phpcode> </plugin> <plugin active="1" executionorder="5"> <title>varible for postbit</title> <hookname>postbit_display_complete</hookname> <phpcode><![CDATA[require_once('./global.php'); $popbbgperm = explode(',' , $vbulletin->options['drcpo_sup_pb_perm']); eval('$popbbg = "' . fetch_template('pb_bg_img') . '";'); ]]></phpcode> </plugin> |
#4
|
|||
|
|||
Oh, sorry. I meant, put this line in your plugin code somewhere before you use $vbulletin:
Code:
global $vbulletin; I'm not even sure "declaring it global" is the right php way to say it, it's just what I call it. |
#5
|
||||
|
||||
scratch that we got it =)
Code:
$popbbgperm = explode(',' , $this->registry->options['drcpo_sup_pb_perm']); |
Благодарность от: | ||
Brandon Sheley |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|