vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Plugin Used By Multiple Skins - Minor Issue (https://vborg.vbsupport.ru/showthread.php?t=162188)

Amross 11-08-2007 01:55 AM

Plugin Used By Multiple Skins - Minor Issue
 
I apologize for my beginner knowledge, however I am new to vBulletin and as such, also new to coding for vBulletin.

I have a plugin with the following code:

PHP Code:

if (!$this->post['avatarurl'])
{
     
$this->post['avatarurl'] = "themes/icy/images/noavatar.gif";
}
if (
$this->registry->userinfo['showavatars']) 
{
     
$show['avatar'] = true;


It works great and all, however I have multiple skins installed that utilize this plugin. The issue comes in where the url 'themes/icy/images/noavatar.gif' is hard coded in the plugin and thus no matter which one of my installed skins are being used by the user, it always uses the no avatar image associated with the 'icy' skin. Is there a predefined vb variable that I can use to replace the skin name (in this case, 'icy') or at the very least a variable to replace the entire path (in this case 'themes/icy/images/') so that no matter which skin is loaded, it will always reference the correct noavatar.gif image for that particular skin?

Thanks in advance.

sunilvarma 11-08-2007 02:40 PM

you can access the misc directory of any skin using the $stylevar[imgdir_misc]. so put three the noavatar gifs in the three misc folders and change the url in the plugin to:

Code:

$this->post['avatarurl'] = "$stylevar[imgdir_misc]/noavatar.gif";
let me know if it works. :)

Amross 11-08-2007 11:59 PM

Thanks for your help, sunilvarma. I took what you said and even pushed the plugin one step further.

After your response, I read through the stylevars vBulletin documentation and it provided a lot of insight. I guess it's definitely a worth while read for those new to the world of vBulletin coding.


All times are GMT. The time now is 06:49 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.01545 seconds
  • Memory Usage 1,714KB
  • 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)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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