vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=263)
-   -   Weird situation on template condition (https://vborg.vbsupport.ru/showthread.php?t=323916)

Replicant 11-23-2016 08:54 PM

Weird situation on template condition
 
1 Attachment(s)
Ok guys, Here's the deal. I'm doing a simple if condition

<vb:if condition="$channelid == $url.channelid">

....do something

Here's the problem, I can't get the two to equal each other. See the screen of the var_dump.

{vb:debugvardump $channelid} = string(2) 36
{vb:debugvardump $url.channelid} = string(2) 36

<vb:if condition="$.urlchannelid == 36"> FALSE

<vb:if condition="$channelid == 36">TRUE

So obviously, there is an issue with $url.channelid.
I tried this
{vb:set url.channelid, '36'}, still nothing. I'm at a loss here because the two values are equal.

Dave 11-23-2016 09:48 PM

I'm not too up-to-date regarding the vBulletin 5 template syntax, but shouldn't the template condition be formatted this way:

HTML Code:

<vb:if condition="$channelid == $url['channelid']">

Replicant 11-23-2016 10:46 PM

Quote:

Originally Posted by Dave (Post 2578610)
I'm not too up-to-date regarding the vBulletin 5 template syntax, but shouldn't the template condition be formatted this way:

HTML Code:

<vb:if condition="$channelid == $url['channelid']">

I tried it that way as well. This has been mind boggling.

Dave 11-23-2016 10:51 PM

Hmmm maybe it's part of an object?
Try $url->channelid in the condition.

noypiscripter 11-24-2016 12:42 AM

Can you post the entire code? There might something else going on somewhere.

Replicant 11-24-2016 01:18 AM

That was most of the code. url.channelid came from an api call and the other was an existing template variable.
I got tired of messing with it, scrapped it and went another direction.


All times are GMT. The time now is 06:54 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.01129 seconds
  • Memory Usage 1,721KB
  • 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_html_printable
  • (1)bbcode_quote_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