vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   What is the correct way to concatenate THIS_SCRIPT? (https://vborg.vbsupport.ru/showthread.php?t=280947)

Simon Lloyd 03-31-2012 09:44 PM

What is the correct way to concatenate THIS_SCRIPT?
 
Hi all,
I've attempted to concatenate two THIS_SCRIPTs like this
HTML Code:

<if condition="THIS_SCRIPT != 'subscription' or THIS_SCRIPT != 'search'">
but it doesn't appear to work?

Is that the correct way?

--------------- Added [DATE]1333234232[/DATE] at [TIME]1333234232[/TIME] ---------------

For some strange reason i changed it to this
HTML Code:

<if condition="THIS_SCRIPT != 'subscription' AND THIS_SCRIPT != 'search'">
and it works!? wonder why it wouldn't work with OR?

kh99 03-31-2012 10:57 PM

If you think about it, since it can't be both 'subscription' and 'search' at the same time it's always going to be != to one of them, so in your first example the condition will always be true.

Simon Lloyd 04-01-2012 07:08 AM

Doh!, it was approaching midnight here when i was attempting it, thanks for the explanation.

Pandemikk 04-01-2012 07:13 AM

I'm also going to add this has nothing to do with string concatenation- or any form of concatenating.

What you're doing is simple expression evaluating with comparison operators.

And lastly, what exactly are you trying to do? :D

Simon Lloyd 04-01-2012 08:02 AM

Well, that depends how you read it, to concatenate means to link or join together, so yes it is concatenating as i wanted to "join" two THIS_SCRIPTs.

As for what i'm trying to acheive, i wanted to only show a variable for all pages except "subscription" and "search :)

The second part of my message shows that i've done that, it was really late when i first posted, i then thought i'll just try the AND operator and it worked, i wasn't thinking too clearly at the time, KH99 pointed out why, i should have seen it really.

Pandemikk 04-01-2012 08:16 AM

Okay. Glad you got it worked out. But that's still not concatenation. ;)

Boofo 04-01-2012 08:29 AM

Quote:

Originally Posted by Pandemikk (Post 2315637)
Okay. Glad you got it worked out. But that's still not concatenation. ;)

Exactly. Not in the true sense, anyway.

kh99 04-01-2012 10:50 AM

Quote:

Originally Posted by Simon Lloyd (Post 2315630)
Well, that depends how you read it, to concatenate means to link or join together, so yes it is concatenating as i wanted to "join" two THIS_SCRIPTs.


I agree with that. What Pandemikk is talking about is string concatenation (which *is* what is normally meant by concatenation when you're talking programming) but that doesn't mean you couldn't use that word for what you're doing. I knew what you meant.


Quote:

Originally Posted by Simon Lloyd (Post 2315618)
Doh!, it was approaching midnight here when i was attempting it, thanks for the explanation.

...and I didn't mean to imply that you hadn't thought about it, I guess what I meant to say was "If you think about it like this...".

Simon Lloyd 04-01-2012 11:34 AM

Quote:

Originally Posted by kh99 (Post 2315680)
...and I didn't mean to imply that you hadn't thought about it, I guess what I meant to say was "If you think about it like this...".

Lol, i know, and no i didn't think of it that way last night :)


All times are GMT. The time now is 10:36 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.01115 seconds
  • Memory Usage 1,732KB
  • 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
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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