2010-12-12, 12:42 PM
In view of the upcoming holidays I thought to upload the snow on my forum. I realize that
some may not like this idea so I wrote a script that checks whether a given View Member Profile
group, "Snow." If it appears the snow. I do not know where I insert my script. And imparted to like
retrieve the name of the currently logged on user. I put the following script:
some may not like this idea so I wrote a script that checks whether a given View Member Profile
group, "Snow." If it appears the snow. I do not know where I insert my script. And imparted to like
retrieve the name of the currently logged on user. I put the following script:
<?php
$sql = mysql_connect ("localhost","----","---")
or die ("Nie można się połączyć");
$db= mysql_select_db("-----", $sql)
or die ("Nie można wybrać bazy danych");
$nr=12;
// $mybb->user['username']; <---- z tego co wyczytałem ale to chyba w js jest
$z = mysql_query("SELECT `mybb_users`.`additionalgroups` FROM mybb_users WHERE (`mybb_users`.`username` ='kreteda') LIMIT 1");
while($row=mysql_fetch_array($z))
{
$pieces = explode(",", $row['additionalgroups']);
/// wiem, że mozna pętlą ale nie miałem czasu na sprawdzenie poprawności.
if($pieces[0]==$nr || $pieces[1]==$nr || $pieces[2]==$nr || $pieces[3]==$nr || $pieces[4]==$nr || $pieces[5]==$nr || $pieces[6]==$nr || $pieces[7]==$nr || $pieces[8]==$nr || $pieces[9]==$nr || $pieces[10]==$nr || $pieces[11]==$nr)
{
echo "<script src='/jscripts/snowstorm.js'></script>";
}}
mysql_close($sql);
?>