PDA

View Full Version : How to call style Vb Stylesheet outside vb


Vizionz
11-30-2005, 01:47 AM
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
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] :(

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

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

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.

ConKien
12-29-2005, 06:06 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.

I tried to include the global.php file inside phpnuke just to test it out and chdir back but it DID break the enviroment like you predicted Merk! :)