vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   New to vB plugin programming and need some help (https://vborg.vbsupport.ru/showthread.php?t=233815)

ErnestA 01-22-2010 02:49 AM

New to vB plugin programming and need some help
 
Hi everyone, I'm not too bad in PHP, but some of the vB specific nuances ellude me.

I'm trying to upgrade the following plugin to vB4 myself:
https://vborg.vbsupport.ru/showthrea...otator&page=13

It's a very simple mod and I'm pretty think only one line of code needs fixing to get it running in the HEADER template.

Here is the original vB3.x template line:

<a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a>

Here is what the mod changes it to:

<center><a href="<if condition="$ban['url']">$ban[url]<else />$vboptions[forumhome].php$session[sessionurl_q]</if>" target="_blank">$banner</a></center>

Here is the default equivalent vB4 line:

<a name="top" href="{vb:raw vboptions.forumhome}.php{vb:raw session.sessionurl_q}" class="logo-image"><img src="{vb:stylevar titleimage}" alt="{vb:rawphrase x_powered_by_vbulletin, {vb:raw vboptions.bbtitle}}" /></a>

Here are the two attempts I've made to adapt it to vB4:

<center><a name="top" href="<if condition="{vb:raw ban.url}">{vb:raw ban.url}<else />{vb:raw vboptions.forumhome}.php{vb:raw session.sessionurl_q}</if>" target="_blank">{vb:raw banner}</a></center>

<center><a name="top" href="<if condition="$ban['url']">$ban[url]<else />{vb:raw vboptions.forumhome}.php{vb:raw session.sessionurl_q}</if>" target="_blank">$banner</a></center>


In both attempts, vBulletin complains about the if condition:

The following error occurred when attempting to evaluate this template:

The conditional on line 4 appears to be missing its beginning tag (<if>). This may cause unexpected behavior.

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.


If anyone has any ideas on how I could properly mod this, or point me to the vB documentation that describes what all the variables mean and how everything should be structured.

Thanks for any info you can provide.

BBR-APBT 01-22-2010 03:05 AM

Do not use {vb:raw ban.url} in your conditionals.
Check here for conditionals help: https://vborg.vbsupport.ru/showthread.php?t=231525


You also have to register variables.
Look here for help with registering variables: https://vborg.vbsupport.ru/showthread.php?t=228078

ErnestA 01-22-2010 08:19 PM

Thanks for the info! Didn't fix it, so I think I may start from scratch and write my own banner rotator...


All times are GMT. The time now is 01:16 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.02700 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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