The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to add a widget to a popup window
I'll preface this by saying I'm not a coder but, through trial and error, I managed to get this to work.
The shape of most widgets make them difficult to place neatly anywhere on a vbulletin forum. The only alternative is to make them popup in a new window which has the same dimensions as the popup. The java-based widget I wanted to add to my cricket forum can be found at Cricinfo. Go to my World A Team cricket forum to see a demo. Click the "Live Scores" link on the navbar. The popup window opens first. The widget inside the window is a little slower to load. You must have java enabled in your browser. What you will need to edit or create: 1. Create a standard phrase. I created Varname: live_scores; Text: Live Scores. So, the phrase variable in the navbar template is $vbphrase[live_scores]. 2. Create a plugin. Plugin Title: live_scores; Hook Location: misc_start; Plugin PHP Code: Code:
// ############################### start live scores ############################### if ($_REQUEST['do'] == 'livescores') { eval('print_output("' . fetch_template('live_scores') . '");'); } 4. Edit navbar template. I used the code for the Buddy List popup as a template for the widget popup and replaced references to buddylist with livescores. I also ammended the Width and Height values to match the widget W&H values. Buddy List popup code looks like this: Code:
<td class="vbmenu_control"><a href="#" onclick="window.open('misc.php?$session[sessionurl]do=buddylist&focus=1','buddylist','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300'); return false;">$vbphrase[open_buddy_list]</a></td> Code:
<!-- Live Scores --> <td class="vbmenu_control"><a href="#" onclick="window.open('misc.php?$session[sessionurl]do=livescores&focus=1','livescores','statusbar=no,menubar=no,toolbar=no,scrollbars=no,resizable=no,width=400,height=270'); return false;">$vbphrase[live_scores]</a></td> <!-- End Live Scores --> 5. Edit misc.php. Add your template to get it pre-cached. I added the code red and bolded: Code:
// pre-cache templates used by specific actions 'showsmilies' => array( 'help_smilies', 'help_smilies_smilie', 'help_smilies_category', ), 'livescores' => array( 'live_scores', ) ); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|