Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-30-2005, 01:47 AM
Vizionz Vizionz is offline
 
Join Date: Jul 2003
Location: Chicago
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to call style Vb Stylesheet outside vb

okay in postnuke i could use iframes that would allow me to grab the style sheet for the theme i was using so i could use outside scripts to work with my site. now i am trying to bring something into vb right now with vbadvanced as a page but its not working because of how vbadvanced calls pages ?page=whatever.. now for the script it wont work so only way i am thinking is to i frame the script so it just lies within that module and then with a call to the style sheet the member is using i can match the Script to vb theme the current user is using.. see in post nuke i could call it

$theme = pnUserGetVar('theme');
echo "<link rel=\"StyleSheet\" href=\"themes/$theme/style/style.css\" type=\"text/css\">";
echo "<link rel=\"StyleSheet\" href=\"themes/$theme/style/styleNN.css\" type=\"text/css\">";

but in vb i dont know how i could achieve this can anyone help

move this thread as well sorry posted in the wrong forum
Reply With Quote
  #2  
Old 11-30-2005, 03:51 AM
Lea Verou Lea Verou is offline
 
Join Date: Jul 2005
Location: Greece
Posts: 1,856
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can store the vbulletin stylesheet as a file, if that's any help
(look at your vBulletin Settings, yes that looong list)
Reply With Quote
  #3  
Old 11-30-2005, 04:59 AM
Vizionz Vizionz is offline
 
Join Date: Jul 2003
Location: Chicago
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i figured it out it has to do with calling the global file then echoing the style


now i need to figure out how to echo the user name on a page outside of vb that wont work with a echo $userinfo[musername]
Reply With Quote
  #4  
Old 11-30-2005, 05:00 AM
TyleR's Avatar
TyleR TyleR is offline
 
Join Date: Nov 2004
Location: North Carolina
Posts: 349
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Vizionz
i figured it out it has to do with calling the global file then echoing the style


now i need to figure out how to echo the user name on a page outside of vb that wont work with a echo $userinfo[musername]
PHP Code:
$vbulletin->userinfo['musername'
Make sure you include global.php before adding this.
Reply With Quote
  #5  
Old 11-30-2005, 05:01 AM
Lea Verou Lea Verou is offline
 
Join Date: Jul 2005
Location: Greece
Posts: 1,856
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Print out the array $vbulletin->userinfo and see which one stores the username and use that .
*not sure it will work, my memory sucks*

edit: Woops Tyler posted while I was posting.
Tyler does this echo the formatted username? Cause I thought it was just username for the name but not sure...
Reply With Quote
  #6  
Old 11-30-2005, 05:07 AM
TyleR's Avatar
TyleR TyleR is offline
 
Join Date: Nov 2004
Location: North Carolina
Posts: 349
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Michelle
edit: Woops Tyler posted while I was posting.
Tyler does this echo the formatted username? Cause I thought it was just username for the name but not sure...
yes, it does.
Reply With Quote
  #7  
Old 11-30-2005, 05:08 AM
Lea Verou Lea Verou is offline
 
Join Date: Jul 2005
Location: Greece
Posts: 1,856
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, nice to know that!
Reply With Quote
  #8  
Old 11-30-2005, 05:10 AM
Vizionz Vizionz is offline
 
Join Date: Jul 2003
Location: Chicago
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks tyler and michelle for the help

Having a little bit more of an issue

Code:
<?
chdir('/home/httpd/vhosts/httpdocs/Forum'); 
require_once('./global.php');

?> <? echo $style['css']; ?>
<center><body bgcolor="alt1">
</head>
<!--BEGIN WORD FILTER JAVASCRIPT--> 
<script language="JavaScript"> 
// Word Filter 2.0 
// (c) 2002 Premshree Pillai 
// Created : 29 September 2002 
// http://www.qiksearch.com 
// http://javascript.qik.cjb.net 
// E-mail : qiksearch@rediffmail.com 

var swear_words_arr=new Array("www","http://"); 
var swear_alert_arr=new Array(); 
var swear_alert_count=0; 

function reset_alert_count() 
{ 
swear_alert_count=0; 
} 

function wordFilter(form,fields) 
{ 
   reset_alert_count(); 
   var compare_text; 
   var fieldErrArr=new Array(); 
   var fieldErrIndex=0; 
   for(var i=0; i<fields.length; i++) 
   { 
      eval('compare_text=document.' + form + '.' + fields[i] + '.value;'); 
      for(var j=0; j<swear_words_arr.length; j++) 
      { 
         for(var k=0; k<(compare_text.length); k++) 
         { 
            if(swear_words_arr[j]==compare_text.substring(k,(k+swear_words_arr[j].length)).toLowerCase()) 
            { 
               swear_alert_arr[swear_alert_count]=compare_text.substring(k,(k+swear_words_arr[j].length)); 
               swear_alert_count++; 
               fieldErrArr[fieldErrIndex]=i; 
               fieldErrIndex++; 
            } 
         } 
      } 
   } 
   var alert_text=""; 
   for(var k=1; k<=swear_alert_count; k++) 
   { 
      alert_text+="\n" + "(" + k + ")  " + swear_alert_arr[k-1]; 
      eval('compare_text=document.' + form + '.' + fields[fieldErrArr[0]] + '.focus();'); 
      eval('compare_text=document.' + form + '.' + fields[fieldErrArr[0]] + '.select();'); 
   } 
   if(swear_alert_count>0) 
   { 
      alert("Sorry You cant ad this request: found:\n_______________________________\n" + alert_text + "\n_______________________________"); 
      return false; 
   } 
   else 
   { 
      return true; 
   } 
} 
</script> 
<!--END WORD FILTER JAVASCRIPT-->
<body topmargin="0" leftmargin="0" bgcolor="alt2">
<? echo $style['css']; ?>
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
<tr><td valign="top">

<table border="0" width="100%" bgcolor="tcat" cellspacing="1" cellpadding="3">
  <tr>
    <td width="1%"></td>
    <td width="99%"><p class="bodycopy"><font color="#FFFFFF"><b>Your request has sucessfully
    been delivered to the DJ application and should play shortly.</b></font></td>
  </tr>
</table>

<table border="0" width="100%" cellspacing="4" cellpadding="4" bgcolor="alt2">
  <tr>
    <td valign="top" align="center"><table border="0" cellpadding="2">

	
<? if($song["haspicture"]){?>
      <tr>
        <td valign="top" align="center">

<br>    </td>
      </tr>
<?}?>	  
	  
      <tr>
        <td valign="top" align="center">
		
		</td>
      </tr>
    </table>
	
    </td>
    <td valign="top" width="99%"><div align="center"><center>
	<table border="0" cellspacing="0"
    cellpadding="3">
	<tr><td colspan=2><font size=2><b>Song information</b></font></td></tr>
      <tr>
        <td><p class="bodycopy">Artist</td>
        <td><p class="bodycopy"><? echo $song["artist"]; ?></td>
      </tr>
      <tr>
        <td><p class="bodycopy">Title</td>
        <td><p class="bodycopy"><? echo $song["title"]; ?></td>
      </tr>
      <tr>
        <td><p class="bodycopy">Album</td>
        <td><p class="bodycopy"><? echo $song["album"]; ?></td>
      </tr>
      <tr>
        <td><p class="bodycopy">Buy CD</td>
        <td align="center"><p class="bodycopy"><a href="<? echo $song['buycd']; ?>" target="_blank">Buy Cd</a></td>
      </tr>
      
    </table>
    </center></div></td>
    <td valign="top">
<?
 if($dedicated)
   require("req/dedication.info.html");
 else
   require("req/dedication.form.php");
?>

</td></tr>
</table>
</td></tr></table>
</body>
</html>
chdir('/home/httpd/vhosts/httpdocs/Forum');
require_once('./global.php');
when i throw that in it completely kills the page after the call to the global
Reply With Quote
  #9  
Old 12-01-2005, 09:48 AM
Nakor Nakor is offline
 
Join Date: Nov 2004
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try:
PHP Code:
chdir('Forum');
require_once(
'global.php'); 
Reply With Quote
  #10  
Old 12-01-2005, 10:44 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If its for a postnuke page, you might find including vbulletin's global file will mess up PHP's enviroment and stop it from working. I cant imagine it doing any real damage anymore since most things are stored inside classes.

You might have to chdir back to the directory your file is located in otherwise it wont be able to require the extra files that are required at the bottom of the code you pasted.
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 01:15 AM.


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.07759 seconds
  • Memory Usage 2,268KB
  • Queries Executed 11 (?)
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
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete