vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   best way to link to images? (https://vborg.vbsupport.ru/showthread.php?t=88456)

sabret00the 02-11-2004 10:55 PM

best way to link to images?
 
i normally just use images/whatever/image.gif but i'm aware that theirs a better way so i'm wondering what's the best way and why use stuff like $stylevars etc. (sorry just trying to learn)

AN-net 02-11-2004 11:55 PM

$stylevar[imagesfolder] that takes you right to your images folder and i guess u can go from there;):D

Zachery 02-12-2004 01:32 AM

That only worked in vB3 pre beta 7 ;)

its now $stylevar[imgdir_*]/

either hard code it

http://www.bla.com/forum/images/buttons/crap.gif

or use relative location :)

AN-net 02-12-2004 02:26 AM

some of the templates i see still use it>_>

Zachery 02-12-2004 02:35 AM

then your using old templates ;)

sabret00the 02-12-2004 06:31 PM

nice one, thanks everyone, i thought i better standardize my style set coding before i got too far into it :)

AN-net 02-12-2004 08:19 PM

Quote:

Originally Posted by Faranth
then your using old templates ;)

well im not using vb3 beta 7 templates im using at least vb3 rc3 templates
can u just use $stylevar[imgdir]?
ok tried $stylevar[imgdir] and $stylevar[imgdir_*] and $stylevar[imgdir_gradients], they dont work>_>

sabret00the 02-12-2004 09:13 PM

she's right, i just tried to link to an image which is located at
Code:

images/forumhome/$forum[forumid].gif
as
Code:

$stylevar[imgdir_forumhome]/$forum[forumid].gif
and it missed the whole directory off :(

Logikos 02-12-2004 11:27 PM

Example:
If your style settings were set to http://www.asite.com/forums/stylename

then

$stylevar[imgdir_misc]/boo.gif

will call

http://www.asite.com/forums/stylename/misc/boo.gif

when he said $stylevar[imgdir_*] he ment replace * with the dir name where the image is stored.

Hope this helps

sabret00the 02-12-2004 11:38 PM

but i have my images stored in /images/forumhome so where as images stored in images/misc i can just use $stylevar[imgdir_misc]/image.gif i have made a new directory i want to store my images in and i want to call them dynamically.

assassingod 02-12-2004 11:39 PM

Quote:

Originally Posted by sabret00the
but i have my images stored in /images/forumhome so where as images stored in images/misc i can just use $stylevar[imgdir_misc]/image.gif i have made a new directory i want to store my images in and i want to call them dynamically.

Unless i've missed something in vB3, you can't do that without hacking.

sabret00the 02-12-2004 11:52 PM

is there anyway i can link to the images directory just using the $stylevar variable?

sabret00the 02-13-2004 05:17 PM

*bump* :happysad:

Logikos 02-14-2004 04:18 AM

Not for the way you want to do it,

sabret00the 02-14-2004 10:02 AM

so theirs no way for me to do
Code:

$stylevar[imgdir]/forumhome

Brad 02-14-2004 03:05 PM

Try sticking this in your phpinclude_start template. This will let you use $stylevar[imgdir_forumhome] instead of hard coding it. I did not test it because im about to go to sleep, but if it dose not work it is probbly just something little I missed in my sleepy state :)

PHP Code:

if (!empty($loo_stylebit))
{
    unset(
$loo_stylebit);

}
    
$loo_stylebit 'images/forumhome';
    
$stylevar2 = array('imgdir_forumhome' => '$loo_stylebit');
    
$stylevar array_merge($stylevar$stylevar2); 

See I forgot the code and had to edit :)

Logikos 02-14-2004 06:54 PM

Well look at that :) nice!

sabret00the 02-15-2004 01:21 PM

wouldn't that be the same as just adding a replacement variable to the style?

sabret00the 02-15-2004 02:35 PM

does $stylevar[imgdir_gradients] not exist or is it just me?

AN-net 02-15-2004 07:26 PM

it might be gradient, like the buttons folder is actually $stylevar[imgdir_button](i think)
i dont know>_< vb should include in the next version a list of the style vars, actually they should a release a guide explaining the if statements etc. but thats my 2 cents

sabret00the 02-15-2004 11:27 PM

gradient don't work either :(

sabret00the 02-17-2004 01:58 AM

*bump* still need help with this :(

Brad 02-17-2004 11:33 AM

Quote:

Originally Posted by sweet22
it might be gradient, like the buttons folder is actually $stylevar[imgdir_button](i think)
i dont know>_< vb should include in the next version a list of the style vars, actually they should a release a guide explaining the if statements etc. but thats my 2 cents

Documentation comes with the gold release

sabret00the: your right it is, sometimes I forget I can even add replacements ;)

AN-net 02-17-2004 06:38 PM

Quote:

Originally Posted by Brad.loo
Documentation comes with the gold release

sabret00the: your right it is, sometimes I forget I can even add replacements ;)

i have to wait for a gold release :(


All times are GMT. The time now is 02:56 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.01610 seconds
  • Memory Usage 1,757KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)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