vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   {IF} as a Replacement Variable (https://vborg.vbsupport.ru/showthread.php?t=305804)

Digital Jedi 12-12-2013 09:05 PM

{IF} as a Replacement Variable
 
I saw this a long time ago, in someone's Admin CP when I was troubleshooting some things for them. And I've never seen it again. But it seems to work, and I'm wondering if anyone can see a flaw with this method I'm not seeing.

Basically, you just prepend all your stylevar entries with {IF}.

Code:

{IF}/misc
{IF}/buttons
{IF}/editor

Then make {IF} a replacement variable that becomes the full directory to my style folder. What this does is make it to where I only have to edit one thing if I ever decide to change the name of my styles folder. And it solves a bunch of issues with modifications like vBadvanced, when you often create pages outside the forum root, but the images are looking for them in the local directory.

Am I just now catching on or would this be considered "bad practice"?

tbworld 12-12-2013 09:38 PM

Are you just talking about using a replacement variable in the stylevar section of the admincp. I thought it was designed to use in that fashion. I have found a few places, a replacement variable would not parse, but that could have been me misusing the situation. Anyway, it worked for me when I tried it way back when.

You literally did not mean to use "{IF}" right? You just meant something like "{foo}"?

Or did I miss your concept?

Digital Jedi 12-12-2013 09:43 PM

I actually saw {IF} the first time I saw it used. But, yeah, I meant something like that...I'm not using {IF}... anymore. >_>

Honestly, though, this is the first time I ever found a use for a Replacement Variable for something that wasn't incidental or specific to fixing a problem I couldn't get to otherwise.

tbworld 12-12-2013 09:49 PM

When I did use that method, which was the early days of vb4, it worked fine except for a few areas, like I stated. Since then I have not really explored if they could be used in other areas of vBulletin.

Let me know if you find out anything interesting. :)

Digital Jedi 12-12-2013 10:05 PM

So far I've tried it for the stylevar directories and, even better, in the CSS options. It always bugged me that I always had to put the full file path there, and edit every reference to it in the CSS and the stylevars when I realized my directory name was stupid. I'm just a little perturbed that I never realized I could do this before. What can I say. It's my first day.


All times are GMT. The time now is 03:49 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.01066 seconds
  • Memory Usage 1,716KB
  • 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
  • (5)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