Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 01-18-2009, 08:44 AM
Super Jinni Super Jinni is offline
 
Join Date: Mar 2008
Posts: 437
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default if condition depending on url or address

Hi everyone,
I'm wondering if there is anyway to set an if condition depending on page url or address and on the last part of url, like:

when user go to usercp and go to edit his signature I want him to get notification on the header or change the header or something like that

the links are usually like this
Code:
http://www.xxxxx.com/forum/profile.php?do=buddylist
http://www.xxxxx.com/album.php?u=1
http://www.xxxxx.com/private.php?do=newpm
http://www.xxxxx.com/forumdisplay.php?f=10
so what I want is:
1- set a condition depending on the last part - which is in red- of the link.

2- set a condition depending on the whole link.

is there anyway to do that?
appreciate your help

best wishes
Reply With Quote
  #2  
Old 01-18-2009, 09:56 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't understand what you're trying to do there.
Reply With Quote
  #3  
Old 01-18-2009, 10:17 AM
Super Jinni Super Jinni is offline
 
Join Date: Mar 2008
Posts: 437
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, let me say it in this way,

I have some customized header, so I want to change depending on the page that user going to visit, so some pictures will change in the main header, and some colors will change too.

so, I want to do that according to the url of the page that user visit. or according to the last part of the the url like what in red in the first post in this thread.

so, I want to do it in this way,

<if condition (the url is:www.whatever)> show this header</if>

or

<if condition (the last part of the url is: (/?do=buddylist or whatever)>show this or do this</if>

so I want to set a condition for whatever according to and depending on url or part of it.

I hope I could explain it clear enough. and sorry for my poor English.

so, is there any way to do something like that?

thanks again
Reply With Quote
  #4  
Old 01-18-2009, 03:24 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If do=buddylist is in the url of the page you want to post your message on, have you tried just doing:
HTML Code:
<if condition="$_REQUEST['do'] == 'buddylist'>
whatever
</if>
Reply With Quote
  #5  
Old 01-18-2009, 03:47 PM
Super Jinni Super Jinni is offline
 
Join Date: Mar 2008
Posts: 437
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, I'll give that a try,
and what about the whole url?

I mean like in this thread's url

Code:
<if condition = the whole url is "https://vborg.vbsupport.ru/showthread.php?t=202215">
whatever
</if>
is that possible?
Reply With Quote
  #6  
Old 01-18-2009, 03:56 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not exactly. You can do a condition on (THIS_SCRIPT == 'showthread') or a condition on ($thread[threadid] == 202215) though.
Reply With Quote
  #7  
Old 01-18-2009, 06:24 PM
Super Jinni Super Jinni is offline
 
Join Date: Mar 2008
Posts: 437
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, thanks Lynne. I used (THIS_SCRIPT) before and I think the ($_REQUEST ['do'] == whatever) will work for now.

really appreciate your help

thanks a lot
Reply With Quote
  #8  
Old 01-19-2009, 05:00 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can actually find the request string (everything after the domain) using $_SERVER['REQUEST_URI'].
Reply With Quote
  #9  
Old 01-19-2009, 11:27 AM
Super Jinni Super Jinni is offline
 
Join Date: Mar 2008
Posts: 437
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your reply,
but I have a dumb question though :
how could I use that exactly? can you give an example please?
Reply With Quote
  #10  
Old 01-19-2009, 11:42 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<if condition="$_SERVER['REQUEST_URI'] == '/forum/member.php?u=1'">
This shouldn't really be used, ideally, you should use the THIS_SCRIPT constant along with other conditionals.
Reply With Quote
Reply

Thread Tools
Display Modes

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 02:55 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04477 seconds
  • Memory Usage 2,248KB
  • Queries Executed 11 (?)
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
  • (3)bbcode_code
  • (1)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete