vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to call style Vb Stylesheet outside vb (https://vborg.vbsupport.ru/showthread.php?t=101913)

Vizionz 11-30-2005 01:47 AM

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 :(

Lea Verou 11-30-2005 03:51 AM

You can store the vbulletin stylesheet as a file, if that's any help :)
(look at your vBulletin Settings, yes that looong list)

Vizionz 11-30-2005 04:59 AM

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] :(

TyleR 11-30-2005 05:00 AM

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.

Lea Verou 11-30-2005 05:01 AM

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...

TyleR 11-30-2005 05:07 AM

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. ;)

Lea Verou 11-30-2005 05:08 AM

Thanks, nice to know that! :D

Vizionz 11-30-2005 05:10 AM

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

Nakor 12-01-2005 09:48 AM

Try:
PHP Code:

chdir('Forum');
require_once(
'global.php'); 


merk 12-01-2005 10:44 AM

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.


All times are GMT. The time now is 10:57 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.01309 seconds
  • Memory Usage 1,768KB
  • 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
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete