vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   friendlyurl in headerinclude (https://vborg.vbsupport.ru/showthread.php?t=249119)

BirdOPrey5 08-22-2010 12:58 PM

friendlyurl in headerinclude
 
I'm trying to get the friendly url (current url) of a page, it looks like it should be in:
{vb:raw vboptions.friendlyurl}

But whenever I use this in headerinclude template it resolves to '1' and not a full URL like I'd expect... anyone know how I'd get the URL of the current page?

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

I got this:

Code:

<http://www.example.com/forums/{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_post}}
But the problem is it always has "showthread" in the result even if I'm not in showthread but in a profile or forumdisplay.... this isn't that big a deal but I guess I'd need to but a conditional to prevent this from displaying if not in showthread- which I can do but was hoping for a more elegant solution that would work anywhere...

Lynne 08-22-2010 02:08 PM

{vb:link thread... is going to give you a thread link... a showthread page.
vboptions.friendlyurl will return the option you picked in vboptions > friendly urls > url type

(There is an article on the friendly urls in the vb4 articles forum)

BirdOPrey5 08-22-2010 03:07 PM

Thanks Lynne, I'll take a look at the article but...

I have Friendly URL's set to "basic friendly" in vBulletin options but wherever I use {vb:raw vboptions.friendlyurl} in the headerinclude template it always resolves to "1" - any ideas why that is?

Edit- when I change from "basic friendly" to "advanced friendly" it changes from '1' to '2'...

Lynne 08-22-2010 11:37 PM

The value for Basic Friendly is 1. For Standard URLs, it's 0. For Advanced Friendly URLs, it's 2, and for Mod Rewrite Friendly URLs, it's (Just look in the source code to see the values.)

BirdOPrey5 08-23-2010 12:35 AM

I see... I thought vboptions.friendlyurl would give me the actual URL as opposed to what type of url was being used... BTW I looked for the article but didn't see any with "url" or "friendly" in the titles at all- do you know if it was called something else by chance? I guess I could search posts if need be.

Lynne 08-23-2010 02:28 AM

vboptions are Options. They are your settings that you set in vboptions.

vBulletin 4 Template Syntax: Links

BirdOPrey5 08-23-2010 02:38 AM

many thanks. :)


All times are GMT. The time now is 01:15 AM.

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.01026 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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