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

Reply
 
Thread Tools Display Modes
  #1  
Old 04-26-2010, 12:33 AM
Mr Happy Mr Happy is offline
 
Join Date: Aug 2009
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [SOLVED] How to get the Current URL Page Location

Basically what I had on a vBulletin 3 skin was:
PHP Code:
href="$_SERVER[PHP_SELF]?<vb:if condition="$_SERVER['QUERY_STRING']">$_SERVER[QUERY_STRING]&amp;</vb:if>styleid=1 
and it was a quick link that would return you to the default skin.

Problem is none of the $_SERVER bit's work in vBulletin 4 templates. I'm wondering if their's a variable like {vb:raw url} or something that I could use to get the current page url address.
That or any other suggestion on how to do it from just editing the template would be great.

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

I stumbled across {vb:raw relpath} while working in who's online where it's used to refresh the page your on. I managed to get something to work with this for anyone who comes across this in Google with a similar problem
Reply With Quote
  #2  
Old 09-11-2010, 06:28 AM
dr.tawy dr.tawy is offline
 
Join Date: Feb 2010
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

U Sir are a GOD

What an amazing Post

i was looking for the current url code for 3 hours now and finally i found it

Thanks alot

=========

for all those looking for VBulletin Current Page Url Code (just to make sure google gets it now)

the code is

{vb:raw relpath}
Reply With Quote
  #3  
Old 03-22-2011, 09:01 PM
jayrobinson's Avatar
jayrobinson jayrobinson is offline
 
Join Date: Mar 2011
Location: Palo Alto, California
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, `{vb:raw relpath}` is the best answer. I found this when I searched for "current URL in vBulletin templates".

The variable spits out the current page like `$_SERVER['PHP_SELF']`, without anything else. If you are on the Forum homepage, for example, it won't spit out anything. Here is how I used this code to submit an email signup form back to the current page on our site:

Code:
<form action="/forum/{vb:raw relpath}#footer" ...
Reply With Quote
  #4  
Old 06-11-2013, 02:45 PM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This solution is what I was looking for... brilliant idea. Big Thanks
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 11:48 PM.


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.03798 seconds
  • Memory Usage 2,191KB
  • 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
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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_postinfo_query
  • fetch_postinfo
  • 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