vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Id appreciate it if anyone could answer this.. (https://vborg.vbsupport.ru/showthread.php?t=120811)

ZombieAndy 07-10-2006 01:52 PM

Id appreciate it if anyone could answer this..
 
ive just added this code in

Code:

<div>Style: <if condition="$post['styleid']==2"><a href="http://www.xample.com/forum/index.php?styleid=2">Blue</a></if></div>
to my users postbit's to allow them to see which styles other members are using. all is going well except it is showing blank for the Default style.. for members who havn't changed it all, its just showing

Style:

in the postbit.

i already have the style name and colour in, so i know its not that, can anyone tell me how to get it to recognise the default style?

peterska2 07-10-2006 02:05 PM

use an if as above but leave the end me it blank ie ' '

ZombieAndy 07-10-2006 02:18 PM

Quote:

Originally Posted by peterska2
use an if as above but leave the end me it blank ie ' '

like this?

Code:

<if condition="$post['styleid']=="><a href="http://www.example.com/forums/index.php?styleid=2">Blue</a></if></div>
becuase my forums wont let me do that, when i try to save the template it says

Code:

The following error occurred when attempting to evaluate this template:

Parse error: syntax error, unexpected ')' in /includes/adminfunctions_template.php(3537) : eval()'d code on line 68

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.


peterska2 07-10-2006 07:44 PM

Code:

<if condition="$post['styleid']==''"><a href="http://www.example.com/forums/index.php?styleid=2">Blue</a></if>
Thats ' ' " with no spaces

ZombieAndy 07-10-2006 08:27 PM

still no :(

im not missing something really obvious am i? like rebuilding update counters?

tehste 07-10-2006 08:37 PM

HTML Code:

<div>Style: <if condition="$post['styleid']==2"><a href="http://www.xample.com/forum/index.php?styleid=2">Blue</a><else /><a href="http://www.xample.com/forum/index.php?styleid=1">Default</if></div>
If you have lots of styles then do something like:
HTML Code:

<if condition="$post['styleid']==2">
1
<else />
 <if condition="$post['styleid']==3">
2
 <else />
  <if condition="$post['styleid']==4">
3
  <else />
default
  </if>
 </if>
</if>


ZombieAndy 07-10-2006 08:52 PM

thanks alot man thats working :)

thanks alot for your help, both of ye :)

tehste 07-10-2006 09:09 PM

of course it is!

it's all about the if structure!!!
Fastest form of flow controll in any environment! (I can't substantiate that)


All times are GMT. The time now is 11:22 PM.

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.00940 seconds
  • Memory Usage 1,731KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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