Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-31-2012, 09:44 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 03-31-2012, 10:57 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 04-01-2012, 07:08 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Doh!, it was approaching midnight here when i was attempting it, thanks for the explanation.
Reply With Quote
  #4  
Old 04-01-2012, 07:13 AM
Pandemikk Pandemikk is offline
 
Join Date: Jul 2009
Posts: 292
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 04-01-2012, 08:02 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 04-01-2012, 08:16 AM
Pandemikk Pandemikk is offline
 
Join Date: Jul 2009
Posts: 292
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay. Glad you got it worked out. But that's still not concatenation.
Reply With Quote
  #7  
Old 04-01-2012, 08:29 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Pandemikk View Post
Okay. Glad you got it worked out. But that's still not concatenation.
Exactly. Not in the true sense, anyway.
Reply With Quote
  #8  
Old 04-01-2012, 10:50 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Simon Lloyd View Post
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 View Post
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...".
Reply With Quote
  #9  
Old 04-01-2012, 11:34 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
...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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:15 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.04132 seconds
  • Memory Usage 2,242KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_html
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete