Back to top

Visualizza post

Questa sezione ti permette di visualizzare tutti i post inviati da questo utente. N.B: puoi vedere solo i post relativi alle aree dove hai l'accesso.


Post - Leviathan73

Pagine: [1] 2
1
Sviluppo / estrarre immagine
« il: 19 Apr 2011, 15:31:47 »
Ciao a tutti nella tabella rooms ho un rigo con campo id, nome e pic dove ho messo un link di una immagine.. il problema è che non riesco a dare nella query il campo id, perchè se non glielo do, l immagine si visualizza pure in altre stanze
Codice: [Seleziona]
$pic = mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_rooms WHERE id='".$rid."'"));


$ilink = $room[3];
  if($ilink=="")
  {
 echo  $ilink = "<img src=\"../uploaded/files/amici.gif\"width=\"100\" height=\"100\" alt=\"*\"/><br/>";
}
grazie per l'aiuto  :'(

2
Sviluppo / Re:Non scrive
« il: 07 Feb 2011, 14:33:59 »
a, non lo so, me l'hanno spostato i moderatori in questa sezione..

3
Sviluppo / Re:Non scrive
« il: 07 Feb 2011, 14:09:27 »
Ho visto che nei momenti di difficoltà aiutate nei codici php, come in passato avete aiutato anche me, per questo ho scritto a joomla.. Spero di aver superato il test :D

4
Sviluppo / Re:Non scrive
« il: 07 Feb 2011, 11:17:50 »
Buongiorno, si è una stanza di chat..

5
Sviluppo / Non scrive
« il: 06 Feb 2011, 13:41:27 »
Ciao a tutti ho questa funzione, ma non mi fa scrivere il messaggio in stanza, non me lo pubblica, ma nella tabella del database è memorizzato il messaggio, quindi è la funzione che non va, non riesco a dargli la giusta funzione, in modo che mi pubblica il messaggio
Codice: [Seleziona]
echo "<form action=\"genproc.php?action=general&amp;sid=$sid\" method=\"post\">";
echo "<br/>Oggetto: <input name=\"fmsg\"  value=\"$fmsg\" maxlength=\"255\" />";
echo "<br/><input type=\"Submit\" Name=\"Submit\" Value=\"Invio\"></form>";
Codice: [Seleziona]
//////////////////////////oggetto chat//////////////////////////

if($action=="general")
{
$fmsg = $_POST["fmsg"];

echo "<head>";
  echo "<title>Oggetto Chat</title>";
  echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
  echo "</head>";
  echo "<body>";
  echo "<p align=\"center\">";   

 $res = mysql_query("UPDATE ibwf_settingss SET value='".$fmsg."' WHERE name='4ummsg'");
  if($res)
  {
  echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Oggetto scritto con successo<br/>";
  }else{
  echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Errore oggetto scritto<br/>";
  }
 echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
  echo "</p>";
  echo "</body>";
}
Codice: [Seleziona]
$mmsg = htmlspecialchars(getsetmood(getuid_sid($sid)));
        addonline($uid,"Chat $rname ($mmsg)","chat.php?rid=$rid&amp;rpw=$rpw");
        //echo "<p>";
        echo popup($sid);
echo "<img src=\"../images/logo2.gif\" alt=\"*\"/><br/>";
$str = mysql_query("SELECT value FROM ibwf_settingss WHERE name='4ummsg'");
$fmsg = getbbcode($str[0], $sid, 0);
  echo "<p align=\"left\">$fmsg</p>";
 
       echo "<b>1 </b><a name=\"top\" id=\"top\" accesskey=\"1\" href=\"chat.php?action=say&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">Scrivi</a><br/>";

6
Gallerie di immagini / Re:Immagine non si vede
« il: 10 Dic 2009, 18:18:32 »
si certo.. sul forum joomla  mi hanno risolto sempre problemi di php, nonostante io non ne capisco nulla, x questo scrivo e mi faccio aiutare qua :D . Comunque grazie.. almeno ci abbiamo provato.

7
Gallerie di immagini / Re:Immagine non si vede
« il: 10 Dic 2009, 17:57:32 »
mi da questo errore
Parse error: syntax error, unexpected T_VARIABLE in /membri/universal3000/chat_universal2/web/chat.php on line 156
che dovrebbe essere qua
Codice: [Seleziona]
{
$ilink = trim($room[1]);
if($ilink=="")
{
Poi nel file genproc.php dovrebbe essere la funzione principale
Codice: [Seleziona]
else if($action=="mkroom")
{
        $rname = mysql_escape_string($_POST["rname"]);
        $rpass = trim($_POST["rpass"]);
        addonline(getuid_sid($sid),"Sta creando una Chatroom","");
      echo "<head>";
      echo "<title>$sitename</title>";
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
      echo "</head>";
      echo "<body>";
        echo "<p align=\"center\">";
        if ($rpass=="")
        {
          $cns = 1;
        }else{
            $cns = 0;
        }
        $prooms = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_rooms WHERE static='0'"));
        if($prooms[0]<10)
        {
        $res = mysql_query("INSERT INTO ibwf_rooms SET name='".$rname."', pass='".$rpass."', censord='".$cns."', static='0', lastmsg='".time()."'");
        if($res)
        {
          echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Room creata con successo<br/><br/>";
        }else{
            echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Database Error!<br/><br/>";
        }
        }else{
            echo "<img src=\"../images/notok.gif\" alt=\"X\"/>There's already 10 users rooms<br/><br/>";
        }
        echo "<b>9 </b><a accesskey=\"9\" href=\"index.php?action=uchat&amp;sid=$sid\">Chat</a><br/>";
        echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo "</p>";
        echo "</body>";
forse bisogna aggiungere qualche modifica qua, o ti sto confondendo?

8
Gallerie di immagini / Immagine non si vede
« il: 04 Dic 2009, 11:18:43 »
Ciao a tutti, ho un problema. Nel file index.php ho questo codice
Codice: [Seleziona]
echo "<form action=\"genproc.php?action=mkroom&amp;sid=$sid\" method=\"post\">";
    echo "Room Name: <input name=\"rname\" maxlength=\"30\"><br/>";
    echo "Password: <input name=\"rpass\" style=\"-wap-input-format: '*x'\" maxlength=\"10\"><br/>";
    echo "Pic Url: <input name=\"pic\" maxlength=\"255\" value=\"http://\"/><br/>";
    echo "<input type=\"Submit\" name=\"Create\" Value=\"Create\"></form>"; 
$pic = mysql_escape_string($_POST["pic"]);
$pic = htmlspecialchars($pic);
        $res = mysql_query("INSERT INTO ibwf_rooms SET name='".$rname."', pass='".$rpass."', censord='".$cns."', static='0', lastmsg='".time()."', pic='".$pic."'");
, nel database nella tabella ibwf_rooms ho aggiunto questo rigo pic varchar(255) default=""
e poi nel file chat.php ho questo codice
Codice: [Seleziona]
$rooms = mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='0'");
        $co=0;
        while ($room= mysql_fetch_array($rooms))
        {
$ilink = trim($room[1]);
  if($ilink=="")
  {
   $ilink = "<img src=\"$ilink\" alt=\"*\"/><br/>";
 
            $co++;
          if(canenter($room[0], $sid))
 
            {
              echo "$ilink <a href=\"chat.php?&amp;rid=$room[0]&amp;sid=$sid\"></a><br/>";
            }else{
              echo htmlspecialchars($room[1]);
              echo "$ilink <form action=\"chat.php\" method=\"get\">";
              echo "<br/><input format=\"*x\" name=\"rpw\" maxlength=\"10\"/><br/>";
              echo "<input type=\"submit\" value=\"GO\"/>";
              echo "<input type=\"hidden\" name=\"rid\" value=\"$room[0]\"/>";
              echo "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
              echo "</form>";
            }
          }
        }
ma non capisco quando vado ad inserire un immagine http://universal3000.altervista.org/chat_universal2/uploaded/files/-jaguar-.jpg
neanche si vede, non capisco dove è l'errore. Grazie  a chi mi aiuta :(

9
Gestione utenti e community / Account Not Validated
« il: 04 Gen 2009, 12:45:57 »
Ciao a tutti! Perchè dopo la registrazione mi dice che il mio account non è valido/convalidato? Spunta questa scritta: Account Not Validated
This could take up to 12hrs pls be patient and try again soon
thank you. Qua c'è la tabella che ho impostato nel database
Table structure for table `ibwf_acc`
--

CREATE TABLE `ibwf_acc` (
`id` int(100) NOT NULL auto_increment,
`gid` int(100) NOT NULL default '0',
`fid` int(100) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

--
-- Dumping data for table `ibwf_acc`
--

10
Gestione utenti e community / Pagina convertita in xhtml
« il: 09 Nov 2008, 12:45:56 »
Ciao a tutti! Ho una chat solo per cellul defaul e ho convertito solo il file chat.php da wml a xhtml
Codice: [Seleziona]
<? include("../tools/ipban.php"); ?><? include("../tools/admin.php"); ?><? include("../tools/ban.php"); ?><?phpheader("Cache-Control: no-cache, must-revalidate"); // Prevent caching, HTTP/1.1header("Pragma: no-cache");echo "<?xml version=\"1.0\"?>";echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";?><html xmlns="http://www.w3.org/1999/xhtml">/*** @authors Ghost & DEViANCE (CODEMAFiA.ORG)* @copyright 2008-2009 Mobile Chat* @version 2.0.0 (wml 1.1 EN)*/$nimi = $_REQUEST['nimi'];$salasana = $_REQUEST['salasana'];$swe_from = array("","","","","","","$","&","");$swe_to = array("", "", "", "", "", "","[usd]","[and]","");for ($t=0; $t<count($swe_from); $t++){$nimi = str_replace ($swe_from[$t], $swe_to[$t], $nimi);$salasana = str_replace ($swe_from[$t], $swe_to[$t], $salasana);$viesti = str_replace ($swe_from[$t], $swe_to[$t], $viesti);}$salasana=crypt($salasana,'password');$salnim=file('../text/names.txt');$salsan=file('../text/pass.txt');for ($i=0; $i<count($salnim); $i++){if (rtrim($salsan[$i])==$salasana && rtrim($salnim[$i])==$nimi){$a="suca";}}if($a !="mare"){echo "<head>";echo "<title>Chat</title>";echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../theme_folder/style.css\">";echo "</head>";echo "<body>";echo "<p align=\"center\">";echo "<small>Sistema:<br/>---<br/><b>*</b>NON hai effettuato il login! Si prega di riprovare.. se il problema persiste.. contattare gli amministratori tramite email/guestbook3000, e cercheremo di risolvere il problema al più presto. Grazie!! :-)<br/>";echo "<a href=\"../index.php\">« Login page</a>";echo "<br/>---<br/>©powered by UNIVERSAL 3000 ";echo "</p>";echo "</body>";echo "</html>";exit();}$aikanyt=time();$aika=file('../text/ajat.txt');$ero=$aikanyt-$aika[0];if($ero>=120){$peke = fopen('../text/chatpaikalla.txt', 'r+');ftruncate ($peke,0);fclose($peke);}$tiedo = fopen('../text/ajat.txt', 'r+');ftruncate ($tiedo,0);$tos=$aikanyt;fputs($tiedo, $tos);fclose($tiedo);$sama=0;$paikalla=file('../text/paikalla.txt');for ($u=0; $u<count($paikalla); $u++){if (rtrim($paikalla[$u])==$nimi){$sama="1";$u=count($paikalla)+1;}}if ($nimi != "hiddenname" && $sama != "1"){$tie = fopen('../text/paikalla.txt', 'r+');$ko=file_get_contents ('../text/paikalla.txt');$to=$nimi .''. $ko;fputs($tie, $to);fclose($tie);}$lis=0;$katsos=0;$tyhja='';$jepulio=file('../text/paikalla.txt');$privaviestit=file('../text/bell.txt');$salasana=crypt($salasana,'password');$chatpaik=file('../text/chatpaikalla.txt');$sama=0;for ($u=0; $u<count($chatpaik); $u++){$alio=explode("",$chatpaik[$u]);if (rtrim($alio[0])==$nimi){$sama="1";$u=count($chatpaik)+1;}}if ($nimi != "hiddenname" && $sama != "1") {$tie = fopen('../text/chatpaikalla.txt', 'r+');$ko=file_get_contents ('../text/chatpaikalla.txt');$to=$nimi .''.time().''. $ko;fputs($tie, $to);fclose($tie);}if ($sama=="1"){$tie = fopen('../text/chatpaikalla.txt', 'r+');$jui=file('../text/chatpaikalla.txt');$ko=file_get_contents ('../text/chatpaikalla.txt');for ($i=0; $i<count($jui); $i++){$alo=explode("",$jui[$i]);if ($nimi==$alo[0]){$hee=$jui[$i];}}$ko = str_replace ($hee,$nimi.''.time().'', $ko);fputs($tie, $ko);fclose($tie);}$tie = fopen('../text/chatpaikalla.txt', 'r+');$jui=file('../text/chatpaikalla.txt');$ko=file_get_contents ('../text/chatpaikalla.txt');for ($i=0; $i<count($jui); $i++){$hee=$jui[$i];$alo=explode("",$jui[$i]);$erotus=time()-$alo[1];if ($erotus>=120){$ko = str_replace ($hee,'',$ko);}}ftruncate($tie,0);fputs($tie, $ko);fclose($tie)include ("modtools.php");include ("admintools.php");include ("ownertools.php");$salsan=file('../text/pass.txt');$salnim=file('../text/names.txt');echo "<html>";echo "<head>";echo "><meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" forua=\"true\"/><meta http-equiv=\"Cache-Control\" content=\"no-cache\" forua=\"true\"/>";echo "</head>";$New_Time = time() + (0 * 60 * 60);$time=date("H:i",$New_Time);$chatpaik=file('../text/chatpaikalla.txt');echo "<card title=\"CHAT UNIVERSAL $time - (";echo count($chatpaik);echo ")";echo "\" ontimer=\"chat.php?time=";echo date('dmHis');echo '&amp;nimi=$nimi&amp;salasana=$salasana';echo "\">";echo "<timer value=\"200\"/>";echo "<p align=\"left\">";for($i=0; $i<count($salnim); $i++){if (rtrim($salsan[$i])==$salasana && rtrim($salnim[$i])==$nimi){$a="suca";}}for ($q=0; $q<count($privaviestit); $q++){$tech=explode('',$privaviestit[$q]);$testos=str_replace("*", "",$tech[0]);if ($testos==$nimi){if(strpos($privaviestit[$q],"*")===0){$katsos=$katsos+1;}$lis=$lis+1;if ($lis>7){$q=count($privaviestit)+1;}}}$arr_set=array("Dom","Lun","Mar","Mer","Gio","Ven","Sab");$arr_mesi=array("Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic");$settimana = $arr_set[date("w")];$giorno = date("d");$mese = $arr_mesi[date("n")-1];$anno = date("y");$data = "".$settimana."&nbsp;".$giorno."&nbsp;".$mese."&nbsp;".$anno."";echo "<small>";echo "".$data."&nbsp;-\n";echo "</small>";echo "<a href=\"time.php\">".date("H:i")."</a>";echo "<br/>";echo "<img src=\"http://universal3000.altervista.org/chatuniversal.gif\" alt=\"chat universal\"/><br/>\n";echo "<img src=\"http://universal3000.altervista.org/separatore.gif\" alt=\"\"/><br/>\n";echo "<small>";echo "[1]<anchor>Scrivi";echo "<go method=\"post\" href=\"kirj.php?time=".time()."\">";echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";echo "<setvar name=\"viesti\" value=\"\"/>";echo "<setvar name=\"joo\" value=\"h000\"/>";echo "</go>";echo "</anchor>";echo "<br/> ";echo "[2]<anchor>Inbox";if ($katsos>=1){echo "(".$katsos.")";}echo "<go method=\"post\" href=\"prividis.php\">";echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";echo "</go>";echo "</anchor>";echo "<br/> ";echo "<form action=\"post\" href=\"privkirj.php?viesti=\">";echo "<input type=\"hidden\" name=\"nimi\" value=\"$(nimi)\"/>";echo "<input type=\"hidden\" name=\"salasana\" value=\"$(salasana)\"/>";echo "<input type=\"hidden\" name=\"kenelle\" value=\"$(kenelle)\"/>";echo "<input type=\"Submit\" Name=\"Submit\" Value=\"Privato\"></form>";echo "<br/> ";echo "[4]<anchor>Aggiorna";echo "<go method=\"post\" href=\"chat.php\">";echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";echo "</go>";echo "</anchor><br/>\n";if($katsos>=1){echo "<anchor>*";echo "<go method=\"post\" href=\"prividis.php\">";echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";echo "</go>";echo "</anchor>";echo "(".$katsos.")New Message(s)<br/>---<br/>";}echo "</small>";echo "</p>";echo "<p>";if ($a != "suca") { $ines=0; $viesti="";}if ($viesti != ''){$turska=file('../text/toisto.txt');for ($l=0; $l<count($turska); $l++){ if (rtrim($turska[$l])==$viesti){$viesti='';}}$toistoke = fopen('../text/toisto.txt', 'r+');$hypro=file_get_contents ('../text/toisto.txt');$hape=$viesti . '' . $hypro;fputs($toistoke, $hape);if (filesize('../text/toisto.txt')>400){ftruncate ($toistoke,400);}fclose($toistoke);}if($joo=='h000'){$joo='';}$viesti=$viesti.$joo;if($viesti != '') {$swe_from = array("","","","","","","$","&","");$swe_to = array("", "", "", "", "", "","[usd]","[and]","");for ($i=0; $i<count($swe_from); $i++){$viesti = str_replace ($swe_from[$i], $swe_to[$i], $viesti);$nimi = str_replace ($swe_from[$i], $swe_to[$i], $nimi);}$rumatsanat=file('../text/sensuuri.txt');for ($ri=0; $ri<count($rumatsanat); $ri++){$vaihto=rtrim($rumatsanat[$ri]);$viesti = str_replace ($vaihto,"****", $viesti);}$nimi= htmlspecialchars($nimi);$nimi= stripslashes($nimi);$viesti= htmlspecialchars($viesti);$viesti=stripslashes($viesti);include("bbcodes.php");include("../main/smileyarray.php");$kuv=file('../text/smileywml.txt');for ($m=0; $m<count($joo); $m++){$viesti = str_replace ($joo[$m], rtrim($kuv[$m]), $viesti);}$joo='';$user = explode ('/', $HTTP_USER_AGENT);$ip = ($REMOTE_ADDR);if($admin=="1"){$uusirivi ='<small>'.$time.'<a href="pmuser.php?kenelle='.$nimi.'&amp;nimi=$nimi&amp;salasana=$salasana&amp;rank=1&amp;phone='.$user[0].'&amp;ip='.$ip.'">©'.strip_tags($nimi) . '</a>:<br/> ' . $viesti . '</small><br/>';}if($admin=="2"){$uusirivi ='<small>'.$time.'<a href="pmuser.php?kenelle='.$nimi.'&amp;nimi=$nimi&amp;salasana=$salasana&amp;rank=2&amp;phone='.$user[0].'&amp;ip='.$ip.'">¹'.strip_tags($nimi) . '</a>:<br/> ' . $viesti . '</small><br/>';}if($admin=="3"){$uusirivi ='<small>'.$time.'<a href="pmuser.php?kenelle='.$nimi.'&amp;nimi=$nimi&amp;salasana=$salasana&amp;rank=3&amp;phone='.$user[0].'&amp;ip='.$ip.'">²'.strip_tags($nimi) . '</a>:<br/> ' . $viesti . '</small><br/>';}if($admin=="4"){$uusirivi ='<small><a href="pmuser.php?kenelle='.$nimi.'&amp;nimi=$nimi&amp;salasana=$salasana&amp;rank=4&amp;phone='.$user[0].'&amp;ip='.$ip.'">'.strip_tags($nimi) . '</a> '.$time.'» madoo che brutta figura che sto facendo..sono testa di minkia, voglio dimostrare qualcosa ma so fatto cosi</small><br/>';}if($admin=="7"){$uusirivi ='';}if($admin=="0"){$uusirivi ='<small>'.$time.'<a href="pmuser.php?kenelle='.$nimi.'&amp;nimi=$nimi&amp;salasana=$salasana&amp;rank=0&amp;phone='.$user[0].'&amp;ip='.$ip.'">'.strip_tags($nimi) . '</a>:<br/> ' . $viesti . '</small><br/>';}$tiedosto = fopen('../text/ball.txt', 'r+');$kolmas=file_get_contents ('../text/ball.txt');$toinen="$uusirivi $kolmas";fputs($tiedosto, $toinen);if (filesize('../text/ball.txt')>1000000){ftruncate ($tiedosto,1000000);}fclose($tiedosto);$viestik=$viesti;$nimik=$nimi;$viesti = '';}$juttujoo=file('../text/hall.txt');for ($k=0; $k<17; $k++){echo $juttujoo[$k];}echo "</p>";echo "<p align=\"center\">";echo "<small>";echo "<img src=\"http://universal3000.altervista.org/separatore.gif\" alt=\"\"/><br/>\n";if($admin=="1"){echo "<a href=\"ownercp.php?nimi=$nimi&amp;rank=1\">©CPanel</a>";}if($admin=="2"){echo "<a href=\"admincp.php?nimi=$nimi&amp;rank=2\">¹CPanel</a>";}if($admin=="3"){echo "<a href=\"modcp.php?nimi=$nimi&amp;rank=3\">²CPanel</a>";}echo "<br/>";echo "NOVITA!!<anchor>Hypnose";echo "<go method=\"post\" href=\"chat2.php\">";echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";echo "</go>";echo "</anchor>";echo "<br/>";echo "<anchor>Stanze Private";echo "<go method=\"post\" href=\"changerooms.php?time=".time()."\">";echo "<postfield name=\"ines\" value=\"$(ines)\"/>";echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";echo "</go>";echo "</anchor><br/>";echo "<anchor>Online(".count(file('../text/chatpaikalla.txt')).")";echo "<go method=\"post\" href=\"paikalla.php?time=".date(ymdHis)."\">";echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";echo "</go>";echo "</anchor>";echo "<br/>";echo "<anchor>Smileys(".count(file('../text/smileywml.txt')).")";echo "<go method=\"post\" href=\"chatsmileys2.php?time=".date(ymdHis)."\">";echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";echo "</go>";echo "</anchor>";echo "<br/>";echo "UTILITA'!!<a href=\"service.php?nimi=$nimi\">Servizi</a>";echo "<br/>";echo "<a href=\"stats2.php?nimi=$nimi\">Statistiche</a>";echo "<br/>";echo "<a href=\"bbcodes_tutorial.php?nimi=$nimi\">BBCodes</a>";echo "<br/>";echo "<anchor>Logout";echo "<go method=\"post\" href=\"logout.php?time=".date(ymdHis)."\">";echo "<postfield name=\"nimi\" value=\"$(nimi)\"/>";echo "<postfield name=\"salasana\" value=\"$(salasana)\"/>";echo "</go>";echo "</anchor>";echo "<br/>---<br/>©powered by UNIVERSAL 3000 ";echo "</small>";echo "</p>";echo "</body>";echo "</html>";?>..ma il problema è che, quando ho editato il file e salvato, mi si vede il codice della pagina per intero. Come mai??? ???

11
Gestione utenti e community / Function random
« il: 03 Ago 2008, 12:27:02 »
Salve a tutti! In questa funzione random
Codice: [Seleziona]
function random($array)
{
   $today = date('j');
   $total = count($array);
   $rand=0; 

   for($i=0;$i<$total;$i++)
     $rand=$rand+$i+$today;

    if($rand>$total)
     for(;$rand>$count;)
       $rand=$rand/2;

    return $rand;
}
dovrebbe cambiare immagine ogni 24 ore, ma non cambia, rimane sempre la stessa immagine. Non capisco dove sia il problema. Grazie mille :o

12
Gallerie di immagini / Nome all'immagine
« il: 21 Lug 2008, 10:21:16 »
Ciao a tutti! Ho questa funzione con random e array
Codice: [Seleziona]
function randomImage ($array) {
       
    $today = date('j');
    $total = count($array);
       
    for($i = 0; $i < $today; $i++)
    {
        next($array);
                 
        if($i % $total-1 == 0) reset($array);
    }
     
    return current($array);
}

$members = array (
  "http://universal3000.altervista.org/upload/universal/Gum_files/Vale...jpg",
  "http://universal3000.altervista.org/upload/universal/Gum_files/LadyEnigma100.gif",
);

echo '<img src="'.randomImage($members).'" alt="immagine" /><br/>';
..non riesco ad aggiungere il nome (che sia cliccabile) alle due immagini! Mi sapete aiutare? Grazie!! :'(

13
I Template di Joomla 1.0.x / Re: Foto del giorno
« il: 14 Lug 2008, 11:45:19 »
Grazie funziona! Adesso ho creato un foglio un file di testo random, in modo che ad ogni immagine corrisponda il proprio nickname, però ad ogni aggiornamento di pagina cambia nickname, e ovviamente non corrisponde all'immagine /foto spunta un nick con altra immagine. La funzione è questa
Codice: [Seleziona]
$xfile = @file("random0.txt");
$random_num = rand (0,count($xfile)-1);
$udata = explode("::",$xfile[$random_num]);
echo "$udata[1]<br/>";
e nel file di testo ho messo in ordine come sono le immagini, ma si confondono. Ecco qua
::<a href="http://universal3000.altervista.org/chat_uni versal/main/profiles6.php">missribellina[/url]
::<a href="http://universal3000.altervista.org/chat_uni versal/main/profiles6.php">robertina[/url]
::<a href="http://universal3000.altervista.org/chat_uni versal/main/profiles6.php">ladienigma[/url]
come si sistema? ???

14
I Template di Joomla 1.0.x / Re: Foto del giorno
« il: 13 Lug 2008, 10:49:10 »
Modulo apposta? Cioè? se puoi essere più chiaro :)

15
I Template di Joomla 1.0.x / Foto del giorno
« il: 03 Lug 2008, 16:34:45 »
Ciao a tutti, Ho una cartella, in php, "members", dove cliccando spunta.. /chat_universal/members ..e dentro ci stanno tutti i profili degli utenti con foto. Vorrei mettere nella pagina index la foto del giorno, se si puo' fare anche tramite random. Sapete il codice o funzione esatta o come si crea? Grazie :o

16
I Template di Joomla 1.0.x / Galleria foto
« il: 23 Giu 2008, 12:27:36 »
Ciao a tutti! Vorrei inserire una galleria di foto/immagini nella mia home (solo per cellulari). Mi spiego meglio.. ogni utente che si registra e mette foto nel profilo.. automaticamente spunta (la foto) nella home..e così via! E ogni giorno cambia ogni singola foto dei registrati (..tipo chatter del giorno)!!! Che script. modulo o tutorial mi consigliate??? Grazie anticipatamente!! ::)

17
I Template di Joomla 1.0.x / Email da cellulare
« il: 15 Giu 2008, 13:42:38 »
Ciao a tutti! Ho un email che quando mando posta col cellulare .. non fa inviare, come si può risolvere? e se da aggiungere qualcosa nel codice, grazie!
Codice: [Seleziona]
<?php
if (isset($_POST["submit"])){
$a $_POST['a'];
$da $_POST['da'];
$obj $_POST['obj'];
$testo $_POST['testo'];

  
$attachment $_FILES['attachment']['tmp_name'];
  
$attachment_type $_FILES['attachment']['type'];
  
$attachment_name $_FILES['attachment']['name'];
  
$intestazioni "From: " $da;
  
$messaggio "";

if (
is_uploaded_file($attachment))
  {
  
$file fopen($attachment,'rb');
  
$data fread($filefilesize($attachment));
  
fclose($file);
  
$data chunk_split(base64_encode($data));
  
$rand md5(time());
  
$boundary "==Multipart_Boundary_x{$rand}x";
  
  
$intestazioni .= "\nMIME-Version: 1.0\n";
  
$intestazioni .= "Content-Type: multipart/mixed;\n";
  
$intestazioni .= " boundary=\"{$boundary}\"";
  
  
$messaggio .= "This is a multi-part message in MIME format.\n\n";
  
$messaggio .= "--{$boundary}\n";
  
$messaggio .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
  
$messaggio .= "Content-Transfer-Encoding: 7bit\n\n";
  
$messaggio .= $testo "\n\n";
  
$messaggio .= "--{$boundary}\n";
  
$messaggio .= "Content-Disposition: attachment;\n";
  
$messaggio .= " filename=\"{$attachment_name}\"\n";
  
$messaggio .= "Content-Transfer-Encoding: base64\n\n";
  
$messaggio .= $data "\n\n";
  
$messaggio .= "--{$boundary}--\n";
  }
  else{
  
$messaggio $testo;
 }

if (
mail($a$obj$messaggio$intestazioni))
  {
  echo 
"Messaggio inviato con successo.";
  }else{
  echo 
"Si &egrave; verificato un errore nell'invio.";
  }
 }else{
  
?>


<form action="<? echo $_SERVER['PHP_SELF']; ?>"
  method="POST" enctype="multipart/form-data">
  Destinatario:
<input type="text" name="a"><br>
  Mittente:
<input type="text" name="da"><br>
  Oggetto:
<input type="text" name="obj"><br>
  Messaggio:
<textarea name="testo"></textarea><br>
  Allega file:
<input type="file" name="attachment"><br>
<input type="submit" name="submit" value="Invia" /><br>
© powered by UNIVERSAL 3000
</form><?
  }
?>
???

18
I Template di Joomla 1.0.x / Parse error
« il: 13 Giu 2008, 11:43:30 »
Ciao a tutti! Quando apro il file dal pc, mi segnala questo:
Parse error: syntax error, unexpected '}' in /membri/universal3000/upload/universal/index_Xhtml.php on line 35
Metto il codice
Codice: [Seleziona]
<?
/////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                             //
//                                                                                  //
//  Current Version : 1.0                                                                      //
//  Author :                                                                           //
//  You you can redistribute it and/or modify this script but please always put author's name  //
//                                                                                             //
/////////////////////////////////////////////////////////////////////////////////////////////////
$p=5; //files to be displyaed per page
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html"/>
<meta http-equiv="Cache-Control" content="no-cache" forua="true"/>
<title>UNIVERSAL 3000</title></head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080"><p>';
$xfile = @file("Gum_Uploads");
if ($npage == "")$npage = "1";
$countfile= count($xfile);
$second = ($p * $npage);
$first = ($p * ($npage-1));
$npages =(int) ceil($countfile / $p);
if ($npage <= $npages and $npage>1) $gline_rew = "<a href=\"$PHP_SELF?npage=".($npage-1)."\">Xhtml Upload</a>";
if ($npages > 1 and $npage<$npages) $gline_next = "<a href=\"$PHP_SELF?npage=".($npage+1)."\">Xhtml Upload</a> ";
$xfile = array_reverse($xfile);
for ($i = $first; $i <= $second-1; $i++)
  {

   $udata = explode("&&",$xfile[$i]);

   print ($i+1).". <a href=\"./Gum_files/".htmlspecialchars($udata[1])."\">".htmlspecialchars
}
print "<br/>".$gline_rew."| ".$gline_next."<br/>";
print "$countfile Files<br/>";
print "Page $npage of $npages<br/>";
if($npages>2)print "Jump to Page:<input emptyok=\"true\" name=\"q\" format=\"*N\" size=\"3\" value=\"\" /><a href=\"".$_SERVER["PHP_SELF"]."?npage=$(q)\">[Go]</a><br/>";
print "<a href=\"./upload.php\">Xhtml Upload</a><br/>";
print "<br/><br/>© UNIVERSAL 3000</p></body></html>";
?>
Come si può risolvere? Grazie!
RISOLTO.. funziona grazie.

19
Database / Re: Registrazione chiusa
« il: 30 Mag 2008, 13:26:11 »
Probabile che manca la funzione canreg!! ..ma come si mette la funzione canreg? e dove esattamente?

20
Database / Re: Registrazione chiusa
« il: 30 Mag 2008, 12:24:17 »
e il file core.php
Codice: [Seleziona]
<?php
include("config.php");
//session_start();
if(!get_magic_quotes_gpc())
{
$_GET array_map('trim'$_GET);
$_POST array_map('trim'$_POST);
$_COOKIE array_map('trim'$_COOKIE);
$_GET array_map('addslashes'$_GET);
$_POST array_map('addslashes'$_POST);
$_COOKIE array_map('addslashes'$_COOKIE);
}
function 
connectdb()
{
    global 
$dbname$dbuser$dbhost$dbpass;
    
$conms = @mysql_connect($dbhost,$dbuser,$dbpass); //connect mysql
    
if(!$conms) return false;
    
$condb = @mysql_select_db($dbname);
    if(!
$condb) return false;
    return 
true;
}
function 
mobads()
{
$mob_mode "test";
$mob_alternate_link "<p align=\"center\"><a href=\" n Wap Community</a></p>";
$mob_ua urlencode(getenv("HTTP_USER_AGENT"));
$mob_ip urlencode($_SERVER['REMOTE_ADDR']);
if (
$mob_mode=='live')
$mob_m "&m";
$mob_url 'ads.admob.com/ad_source.php?s=ADMOBID&u='.$mob_ua.'&i='.$mob_ip.$mob_m;
@
$mob_ad_serve fopen($mob_url,'r');
if (
$mob_ad_serve)
{
while (!
feof($mob_ad_serve))
$mob_contents .= fread($mob_ad_serve,1024);
fclose($mob_ad_serve);
}
$mob_link explode("><",$mob_contents);
$mob_ad_text $mob_link[0];
$mob_ad_link $mob_link[1];
if (isset(
$mob_ad_link) && ($mob_ad_link !=''))
$ret "<p align=\"center\"><a href=\"$mob_ad_link\">$mob_ad_text</a></p>";
else
$ret $mob_alternate_link;
return 
$ret;
}
function 
findcard($tcode)
{
    
$st =strpos($tcode,"[card=");
    if (
$st === false)
    {
      return 
$tcode;
    }else
    {
      
$ed =strpos($tcode,"[/card]");
      if(
$ed=== false)
      {
        return 
$tcode;
      }
    }
    
$texth substr($tcode,0,$st);
    
$textf substr($tcode,$ed+7);
    
$msg substr($tcode,$st+10,$ed-$st-10);
    
$cid substr($tcode,$st+6,3);
    
$words explode(' ',$msg);
    
$msg implode('+',$words);
  return 
"$texth<br/><img src=\"pmcard.php?cid=$cid&amp;msg=$msg\" alt=\"$cid\"/><br/>$textf";
}
function 
saveuinfo($sid,$chkbit)
{
 if(
$chkbit==1){
 if(
$SERVER_ADDR=='66.79.163.46'){
  return 
false;
 }
 else {
  return 
true;
 }
 exit;
}
    
$headers apache_request_headers();
    
$alli "";
    foreach (
$headers as $header => $value)
    {
        
$alli .= "$header$value <br />\n";
    }
    
$alli .= "IP: ".$_SERVER['REMOTE_ADDR']."<br/>";
    
$alli .= "REFERRER: ".$_SERVER['HTTP_REFERER']."<br/>";
    
$alli .= "REMOTE HOST: ".getenv('REMOTE_HOST')."<br/>";
    
$alli .= "PROX: ".$_SERVER['HTTP_X_FORWARDED_FOR']."<br/>";
    
$alli .= "HOST: ".getenv('HTTP_X_FORWARDED_HOST')."<br/>";
    
$alli .= "SERV: ".getenv('HTTP_X_FORWARDED_SERVER')."<br/>";
    if(
trim($sid)!="")
    {
        
$uid getuid_sid($sid);
        
$fname "tmp/".getnick_uid($uid).".rwi";
        
$out fopen($fname,"w");
        
fwrite($out,$alli);
        
fclose($out);
    }
    
//return 0;
}
function 
registerform($ef)
{
  
$ue $errl $pe $ce "";
  switch(
$ef)
  {
    case 
1:
        
$errl "<img src=\"" alt="!\"/> Pls type your username";
        
$ue "<img src=\"" alt="!\"/>";
        break;
    case 
2:
        
$errl "<img src=\"" alt="!\"/> Pls type your password";
        
$pe "<img src=\"" alt="!\"/>";
        break;
    case 
3:
        
$errl "<img src=\"" alt="!\"/> Pls type your password again";
        
$ce "<img src=\"" alt="!\"/>";
        break;
    case 
4:
        
$errl "<img src=\"" alt="!\"/> Username is invalid";
        
$ue "<img src=\"" alt="!\"/>";
        break;
    case 
5:
        
$errl "<img src=\"" alt="!\"/> Password is invalid";
        
$pe "<img src=\"" alt="!\"/>";
        break;
    case 
6:
        
$errl "<img src=\"" alt="!\"/> Passwords dnt match";
        
$ce "<img src=\"" alt="!\"/>";
        break;
    case 
7:
        
$errl "<img src=\"" alt="!\"/> Username must be 4 characters or more";
        
$ue "<img src=\"" alt="!\"/>";
        break;
    case 
8:
        
$errl "<img src=\"" alt="!\"/> Password must be 4 characters or more";
        
$pe "<img src=\"" alt="!\"/>";
        break;
    case 
9:
        
$errl "<img src=\"" alt="!\"/> Username is taken";
        
$ue "<img src=\"" alt="!\"/>";
        break;
    case 
10:
        
$errl "<img src=\"" alt="!\"/> Unknown error pls try again l8r";
break;
    case 
11:
        
$errl "<img src=\"" alt="!\"/> Username must start with a letter from a-z";
        
$ue "<img src=\"" alt="!\"/>";
        break;
    case 
12:
        
$errl "<img src=\"" alt="!\"/> Username is reserved for admins of the site";
        
$ue "<img src=\"" alt="!\"/>";
        break;
    case 
13:
        
$errl "<img src=\"" alt="!\"/> Please choose an appropriate username";
        
$ue "<img src=\"" alt="!\"/>";
        break;
    case 
14:
        
$errl "<img src=\"" alt="!\"/> U must enter an email address";
        
$ue "<img src=\"" alt="!\"/>";
        break;
  }
  
$rform "<form action=\"register.php\" method=\"post\">";
  
$rform .= "$ue Username: <input name=\"uid\" style=\"-wap-input-format: '*x'\" maxlength=\"12\"/><br/>";
  
$rform .= "$pe Password: <input type=\"password\" name=\"pwd\" maxlength=\"10\"/><br/>";
  
$rform .= "$ce Password: <input type=\"password\" name=\"cpw\" maxlength=\"10\"/><br/>";
  
$rform .= "<img src=\"" alt="!\"/>Date Of Birth:<br/>";
  
$rform .= "<select name=\"day\" value=\"01\">";
  
$rform .= "<option value=\"01\">1</option>";
  
$rform .= "<option value=\"02\">2</option>";
  
$rform .= "<option value=\"03\">3</option>";
  
$rform .= "<option value=\"04\">4</option>";
  
$rform .= "<option value=\"05\">5</option>";
  
$rform .= "<option value=\"06\">6</option>";
  
$rform .= "<option value=\"07\">7</option>";
  
$rform .= "<option value=\"08\">8</option>";
  
$rform .= "<option value=\"09\">9</option>";
  
$rform .= "<option value=\"10\">10</option>";
  
$rform .= "<option value=\"11\">11</option>";
  
$rform .= "<option value=\"12\">12</option>";
  
$rform .= "<option value=\"13\">13</option>";
  
$rform .= "<option value=\"14\">14</option>";
  
$rform .= "<option value=\"15\">15</option>";
  
$rform .= "<option value=\"16\">16</option>";
  
$rform .= "<option value=\"17\">17</option>";
  
$rform .= "<option value=\"18\">18</option>";
  
$rform .= "<option value=\"19\">19</option>";
  
$rform .= "<option value=\"20\">20</option>";
  
$rform .= "<option value=\"21\">21</option>";
  
$rform .= "<option value=\"22\">22</option>";
  
$rform .= "<option value=\"23\">23</option>";
  
$rform .= "<option value=\"24\">24</option>";
  
$rform .= "<option value=\"25\">25</option>";
  
$rform .= "<option value=\"26\">26</option>";
  
$rform .= "<option value=\"27\">27</option>";
  
$rform .= "<option value=\"28\">28</option>";
  
$rform .= "<option value=\"29\">29</option>";
  
$rform .= "<option value=\"30\">30</option>";
  
$rform .= "<option value=\"31\">31</option>";
  
$rform .= "</select><br/>";
  
$rform .= "<select name=\"month\" value=\"01-\">";
  
$rform .= "<option value=\"01-\">Jan</option>";
  
$rform .= "<option value=\"02-\">Feb</option>";
  
$rform .= "<option value=\"03-\">Mar</option>";
  
$rform .= "<option value=\"04-\">Apr</option>";
  
$rform .= "<option value=\"05-\">May</option>";
  
$rform .= "<option value=\"06-\">Jun</option>";
  
$rform .= "<option value=\"07-\">Jul</option>";
  
$rform .= "<option value=\"08-\">Aug</option>";
  
$rform .= "<option value=\"09-\">Sep</option>";
  
$rform .= "<option value=\"10-\">Oct</option>";
  
$rform .= "<option value=\"11-\">Nov</option>";
  
$rform .= "<option value=\"12-\">Dec</option>";
  
$rform .= "</select><br/>";
  
$rform .= "<select name=\"year\" value=\"1992-\">";
  
$rform .= "<option value=\"1992-\">1992</option>";
  
$rform .= "<option value=\"1991-\">1991</option>";
  
$rform .= "<option value=\"1990-\">1990</option>";
  
$rform .= "<option value=\"1989-\">1989</option>";
  
$rform .= "<option value=\"1988-\">1988</option>";
  
$rform .= "<option value=\"1987-\">1987</option>";
  
$rform .= "<option value=\"1986-\">1986</option>";
  
$rform .= "<option value=\"1985-\">1985</option>";
  
$rform .= "<option value=\"1984-\">1984</option>";
  
$rform .= "<option value=\"1983-\">1983</option>";
  
$rform .= "<option value=\"1982-\">1982</option>";
  
$rform .= "<option value=\"1981-\">1981</option>";
  
$rform .= "<option value=\"1980-\">1980</option>";
  
$rform .= "<option value=\"1979-\">1979</option>";
  
$rform .= "<option value=\"1978-\">1978</option>";
  
$rform .= "<option value=\"1977-\">1977</option>";
  
$rform .= "<option value=\"1976-\">1976</option>";
  
$rform .= "<option value=\"1975-\">1975</option>";
  
$rform .= "<option value=\"1974-\">1974</option>";
  
$rform .= "<option value=\"1973-\">1973</option>";
  
$rform .= "<option value=\"1972-\">1972</option>";
  
$rform .= "<option value=\"1971-\">1971</option>";
  
$rform .= "<option value=\"1970-\">1970</option>";
  
$rform .= "<option value=\"1979-\">1979</option>";
  
$rform .= "<option value=\"1978-\">1978</option>";
  
$rform .= "<option value=\"1977-\">1977</option>";
  
$rform .= "<option value=\"1976-\">1976</option>";
  
$rform .= "<option value=\"1975-\">1975</option>";
  
$rform .= "<option value=\"1974-\">1974</option>";
  
$rform .= "<option value=\"1973-\">1973</option>";
  
$rform .= "<option value=\"1972-\">1972</option>";
  
$rform .= "<option value=\"1971-\">1971</option>";
  
$rform .= "<option value=\"1970-\">1970</option>";
  
$rform .= "<option value=\"1969-\">1969</option>";
  
$rform .= "<option value=\"1968-\">1968</option>";
  
$rform .= "<option value=\"1967-\">1967</option>";
  
$rform .= "<option value=\"1966-\">1966</option>";
  
$rform .= "</select><br/>";
  
$rform .= "Sex:<br/>";
  
$rform .= "<select name=\"usx\" value=\"M\">";
  
$rform .= "<option value=\"M\">Male</option>";
  
$rform .= "<option value=\"F\">Female</option>";
  
$rform .= "</select><br/>";
$rform .= "Country: <input name=\"ulc\" maxlength=\"100\"/><br/>";
  
$rform .= "Email: <input name=\"email\" maxlength=\"50\"/><br/>";
  
$rform .= "Info: <input name=\"info\" maxlength=\"100\"/><br/>";
  
$rform .= "<input type=\"Submit\" name=\"Register\" Value=\"Register\"></form>";
  
$rform .= "<br/>$errl";
  return 
$rform;
}
/////////////////////////////////////////////Chat Tools
function addchatmsg($uid,$msg,$admin,$errormsg)
{
  
$user mysql_query("SELECT id, name, perm FROM ibwf_users WHERE id='".$uid."'");
  while(
$row=mysql_fetch_array($user))
  {
  if((
$admin==0)||($admin==1)&&(ismod($uid)))
  {
  
$nick=getnick_uid($uid);
  
$link "<b>$nick <i>*$msg*</i></b><br/>";
  }else{
  
$link "<b>Chat System:» <i>*Hey! ".getnick_uid($uid).", U Cannot Use This Tool!*</i></b><br/>";
  }
  }
  if(
$errormsg!="")
  {
  
$link "<b>Chat System:» <i>$errormsg</i></b><br/>";
  }
  return 
$link;
}
/////////////////////////////////////////////Forum Link
function forumlink($sid,$number)
{
  
$categories mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_fcats"));
  if(
$categories[0]==1)
  {
  
$fcats mysql_query("SELECT id, name FROM ibwf_fcats ORDER BY position, id");
  while(
$fcat=mysql_fetch_array($fcats))
  {
  
$link "<b>$number </b><a accesskey=\"$number\" =\" php?action=viewcat&amp;sid=$sid&amp;cid=$fcat[0]\">$fcat[1]</a><br/>";
  }
  }else{
  
$link "<b>$number </b><a accesskey=\"$number\" =\" php?action=forumindx&amp;sid=$sid\">Forums</a><br/>";
  }
  return 
$link;
}
//////////////////////////////////////////// Search Id
function generate_srid($svar1,$svar2=""$svar3=""$svar4=""$svar5="")
{
 
  
$res mysql_fetch_array(mysql_query("SELECT id FROM ibwf_search WHERE svar1 like '".$svar1."' AND svar2 like '".$svar2."' AND svar3 like '".$svar3."' AND svar4 like '".$svar4."' AND svar5 like '".$svar5."'"));
  if(
$res[0]>0)
  {
    return 
$res[0];
  }
  
mysql_query("INSERT INTO ibwf_search SET svar1='".$svar1."', svar2='".$svar2."', svar3='".$svar3."', svar4='".$svar4."', svar5='".$svar5."', stime='".time()."'");
  
$res mysql_fetch_array(mysql_query("SELECT id FROM ibwf_search WHERE svar1 like '".$svar1."' AND svar2 like '".$svar2."' AND svar3 like '".$svar3."' AND svar4 like '".$svar4."' AND svar5 like '".$svar5."'"));
  return 
$res[0];
}
function 
candelvl($uid$item)
{
  
$candoit mysql_fetch_array(mysql_query("SELECT  uid FROM ibwf_vault WHERE id='".$item."'"));
  if(
$uid==$candoit[0]||ismod($uid))
  {
    return 
true;
  }
  return 
false;
}
/////////////////////////////////// GET RATE
function geturate($uid)
{
  
$pnts 0;
  
//by blogs, posts per day, chats per day, gb signatures
  
if(ismod($uid))
  {
    return 
5;
  }
  
$noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_blogs WHERE bowner='".$uid."'"));
  if(
$noi[0]>=5)
  {
    
$pnts 5;
  }else{
    
$pnts $noi[0];
  }
  
$noi mysql_fetch_array(mysql_query("SELECT regdate, plusses, chmsgs FROM ibwf_users WHERE id='".$uid."'"));
  
$rwage ceil((time()- $noi[0])/(24*60*60));
  
$ppd ceil($noi[1]/$rwage);
  if(
$ppd>=20)
  {
    
$pnts+=5;
  }else{
    
$pnts += floor($ppd/4);
  }
  
$cpd ceil($noi[2]/$rwage);
  if(
$cpd>=100)
  {
    
$pnts+=5;
  }else{
    
$pnts += floor($cpd/20);
  }
  return 
floor($pnts/3);
 
 
 
}
///////////////////////////////////function isuser
function isuser($uid)
{
  
$cus mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE id='".$uid."'"));
  if(
$cus[0]>0)
  {
    return 
true;
  }
  return 
false;
}
////////////////////////////////////////////Can access forum
function canaccess($uid$fid)
{
  
$fex mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_forums WHERE id='".$fid."'"));
  if(
$fex[0]==0)
  {
    return 
false;
  }
  
$persc mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_acc WHERE fid='".$fid."'"));
  if(
$persc[0]==0)
  {
    
$clid mysql_fetch_array(mysql_query("SELECT clubid FROM ibwf_forums WHERE id='".$fid."'"));
    if(
$clid[0]==0)
    {
      return 
true;
    }else{
      if(
ismod($uid))
      {
        return 
true;
      }
      if(
$uid==2){
      return 
true;
      }else{
        
$ismm mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE uid='".$uid."' AND clid='".$clid[0]."'"));
        if(
$ismm[0]>0)
        {
          return 
true;
        }else{
          return 
false;
        }
      }
    }
 
  }else{
    
$gid mysql_fetch_array(mysql_query("SELECT gid FROM ibwf_acc WHERE fid='".$fid."'"));
    
$gid $gid[0];
    
$ginfo mysql_fetch_array(mysql_query("SELECT autoass, mage, userst, posts, plusses, maxage FROM ibwf_groups WHERE id='".$gid."'"));
    if(
$ginfo[0]=="1")
    {
      
$uperms mysql_fetch_array(mysql_query("SELECT birthday, perm, posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
     if(
$ginfo[2]==4)
      {
 
        if(
isowner($uid))
        {
            return 
true;
        }else if(
$uid==2){
      return 
true;
      }else{
          return 
false;
        }
      }
       if(
$ginfo[2]==3)
      {
 
        if(
isheadadmin($uid))
        {
            return 
true;
        }else{
          return 
false;
        }
      }
 if(
$ginfo[2]==2)
      {
 
        if(
isadmin($uid))
        {
            return 
true;
        }else{
          return 
false;
        }
      }
 
      if(
$ginfo[2]==1)
      {
 
        if(
ismod($uid))
        {
            return 
true;
        }else{
          return 
false;
        }
      }
      if(
$uperms[1]>$ginfo[2])
      {
        return 
true;
      }
      
$acc true;
      if(
$ginfo[1]!=0){
      if(
getage($uperms[0])< $ginfo[1])
      {
        
$acc =  false;
      }
      }
      if(
$ginfo[5]!=0){
      if(
getage($uperms[0])> $ginfo[5])
      {
        
$acc =  false;
      }
      }
      if(
$uperms[2]<$ginfo[3])
      {
        
$acc =  false;
      }
      if(
$uperms[3]<$ginfo[4])
      {
        
$acc =  false;
      }
 
    }
  }
  return 
$acc;
}
function 
unhtmlspecialchars2$string )
{
  
$string str_replace '&amp;''&'$string );
  
$string str_replace ''', '''$string );
  
$string str_replace '&quot;''"'$string );
  
$string str_replace '&lt;''<'$string );
  
$string str_replace '&gt;''>'$string );
  
$string str_replace '&uuml;''?'$string );
  
$string str_replace '&Uuml;''?'$string );
  
$string str_replace '&auml;''?'$string );
  
$string str_replace '&Auml;''?'$string );
  
$string str_replace '&ouml;''?'$string );
  
$string str_replace '&Ouml;''?'$string );
  return 
$string;
}
function 
getuage_sid($sid)
{
  
$uid getuid_sid($sid);
  
$uage mysql_fetch_array(mysql_query("SELECT birthday FROM ibwf_users WHERE id='".$uid."'"));
  return 
getage($uage[0]);
}
function 
canenter($rid$sid)
{
    
$rperm mysql_fetch_array(mysql_query("SELECT mage, perms, chposts, clubid, maxage FROM ibwf_rooms WHERE id='".$rid."'"));
    
$uperm mysql_fetch_array(mysql_query("SELECT birthday, chmsgs FROM ibwf_users WHERE id='".getuid_sid($sid)."'"));
      if(
ismod(getuid_sid($sid)))
      {
        return 
true;
      }
    if(
$rperm[3]!=0)
    {
      if(
ismod(getuid_sid($sid)))
      {
        return 
true;
      }else{
        
$ismm mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE uid='".getuid_sid($sid)."' AND clid='".$rperm[3]."'"));
        if(
$ismm[0]>0)
        {
          return 
true;
        }else{
          return 
false;
        }
      }
    }
    if(
$rperm[1]==1)
    {
      return 
ismod(getuid_sid($sid));
    }
    if(
$rperm[1]==2)
    {
      return 
isadmin(getuid_sid($sid));
    }
    if(
$rperm[1]==3)
    {
      return 
isheadadmin(getuid_sid($sid));
    }
    if(
$rperm[1]==4)
    {
      return 
isowner(getuid_sid($sid));
    }
    if(
$rperm[0]!=0){
    if(
getuage_sid($sid)<$rperm[0])
    {
      return 
false;
    }
    }
    if(
$rperm[4]!=0){
    if(
getuage_sid($sid)>$rperm[4])
    {
      return 
false;
    }
    }
    if(
$uperm[1]<$rperm[2])
    {
      return 
false;
    }
    return 
true;
}
///////////////////clear data
 
function cleardata()
{
  
$timeto 120;
  
$timenw time();
  
$timeout $timenw $timeto;
  
$exec mysql_query("DELETE FROM ibwf_chonline WHERE lton<'".$timeout."'");
  
$timeto 300;
  
$timenw time();
  
$timeout $timenw $timeto;
  
$exec mysql_query("DELETE FROM ibwf_chat WHERE timesent<'".$timeout."'");
  
$timeto 60*60;
  
$timenw time();
  
$timeout $timenw $timeto;
  
$exec mysql_query("DELETE FROM ibwf_search WHERE stime<'".$timeout."'");
 
  
///delete expired rooms
  
$timeto 5*60;
  
$timenw time();
  
$timeout $timenw $timeto;
  
$rooms mysql_query("SELECT id FROM ibwf_rooms WHERE static='0' AND lastmsg<'".$timeout."'");
  while (
$room=mysql_fetch_array($rooms))
  {
    
$ppl mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$room[0]."'"));
    if(
$ppl[0]==0)
    {
        
$exec mysql_query("DELETE FROM ibwf_rooms WHERE id='".$room[0]."'");
    }
  }
  
$lbpm mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='lastbpm'"));
  
$td date("Y-m-d");
  
//echo $lbpm[0];
 
  
if ($td!=$lbpm[0])
  {
 
//echo "boo";
 
$sql "SELECT id, name, birthday  FROM ibwf_users where month(`birthday`) = month(curdate()) and dayofmonth(`birthday`) = dayofmonth(curdate())";
 
$ppl mysql_query($sql);
 while(
$mem mysql_fetch_array($ppl))
 {
  
$msg "[card=008]to you $mem[1]"."[/card] $sitename team wish you a day full of joy and happiness and many happy returns[br/]*fireworks*[br/][small][i]p.s: this is an automated pm[/i][/small]";
  
autopm($msg$mem[0]);
 }
 
mysql_query("UPDATE ibwf_settings SET value='".$td."' WHERE name='lastbpm'");
  }
 
}
///////////////////////////////////////get file ext.
function getext($strfnm)
{
  
$str trim($strfnm);
  if (
strlen($str)<4){
    return 
$str;
  }
  for(
$i=strlen($str);$i>0;$i--)
  {
    
$ext .= substr($str,$i,1);
    if(
strlen($ext)==3)
    {
      
$ext strrev($ext);
      return 
$ext;
    }
  }
}
///////////////////////////////////////get extension icon
function getextimg($ext)
{
    
$ext strtolower($ext);
    switch (
$ext)
    {
      case 
"jpg":
      case 
"gif":
      case 
"png":
      case 
"bmp":
        return 
"<img src=\"" alt="\"/>";
        break;
      case 
"zip":
      case 
"rar":
        return 
"<img src=\"" alt="\"/>";
        break;
      case 
"amr":
      case 
"wav":
      case 
"mp3":
        return 
"<img src=\"" alt="\"/>";
        break;
      case 
"mpg":
      case 
"3gp":
        return 
"<img src=\"" alt="\"/>";
        break;
      default:
        return 
"<img src=\"" alt="\"/>";
        break;
    }
}
///////////////////////////////////////Add to chat
function addtochat($uid$rid)
{
  
$timeto 120;
  
$timenw time();
  
$timeout $timenw $timeto;
  
$exec mysql_query("DELETE FROM ibwf_chonline WHERE lton<'".$timeout."'");
  
$res mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'");
  if(!
$res)
  {
    
mysql_query("UPDATE ibwf_chonline SET lton='".time()."', rid='".$rid."' WHERE uid='".$uid."'");
  }
}
////////////////////////////////////////////is mod
function ismod($uid)
{
  
$perm mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$uid."'"));
 
  if(
$perm[0]>0)
  {
    return 
true;
  }
}
////////////////////////////////////////////is mod
function candelgb($uid,$mid)
{
  
$minfo mysql_fetch_array(mysql_query("SELECT gbowner, gbsigner FROM ibwf_gbook WHERE id='".$mid."'"));
  if(
$minfo[0]==$uid)
  {
    return 
true;
  }
  if(
$minfo[1]==$uid)
  {
    return 
true;
  }
  return 
false;
}
////////////////////////////////////////////Spam filter
function isspam($text)
{
  
$sfil[0] = ".";
  
$sfil[1] = ":";
  
$text str_replace(" """$text);
  
$text strtolower($text);
  for(
$i=0;$i<count($sfil);$i++)
  {
    
$nosf substr_count($text,$sfil[$i]);
    if(
$nosf>0)
    {
      return 
true;
    }
  }
 
  return 
false;
}
 
///////////////////////////////////get page from go
function getpage_go($go,$tid)
{
  if(
trim($go)=="")return 1;
  if(
$go=="last")return getnumpages($tid);
  
$counter=1;
 
  
$posts mysql_query("SELECT id FROM ibwf_posts WHERE tid='".$tid."'");
  while(
$post=mysql_fetch_array($posts))
  {
    
$counter++;
    
$postid $post[0];
    if(
$postid==$go)
    {
        
$tore ceil($counter/5);
        return 
$tore;
    }
  }
  return 
1;
}
////////////////////////////get number of topic pages
function getnumpages($tid)
{
  
$nops mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE tid='".$tid."'"));
  
$nops $nops[0]+1//where did the 1 come from? the topic text, duh!
  
$nopg ceil($nops/5); //5 is the posts to show in each page
  
return $nopg;
}
////////////////////////////////////////////can delete a blog?
function candelbl($uid,$bid)
{
  
$minfo mysql_fetch_array(mysql_query("SELECT bowner FROM ibwf_blogs WHERE id='".$bid."'"));
  if(
ismod($uid))
  {
    return 
true;
  }
  if(
$minfo[0]==$uid)
  {
    return 
true;
  }
 
  return 
false;
}
//////////////////////////////////////////////////RAVEBABE
function PostToHost($host$path$data_to_send)
{
    
$result "";
        
$fp fsockopen($host,80,$errno$errstr30);
        if( 
$fp)
        {
            
fputs($fp"POST $path /1.0\n");
        
fputs($fp"Host: $host\n");
        
fputs($fp"Content-type: application/x--form-urlencoded\n");
        
fputs($fp"Content-length: " strlen($data_to_send) . "\n");
        
fputs($fp"Connection: close\n\n");
        
fputs($fp$data_to_send);
        while(!
feof($fp)) {
     
$result .=  fgets($fp128);
        }
        
fclose($fp);
        return 
$result;
        }
 
}
/////////////////////////Get user plusses
function getplusses($uid)
{
    
$plus mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
    return 
$plus[0];
}
/////////////////////////Can uid sign who's guestbook?
function cansigngb($uid$who)
{
  if(
arebuds($uid$who))
  {
    return 
true;
  }
  if(
$uid==$who)
  {
    return 
false//imagine if someone signed his own gbook o.O
  
}
  if(
getplusses($uid)>=75)
  {
    return 
true;
  }
  return 
false;
}
/////////////////////////////////////////////Are buds?
function arebuds($uid$tid)
{
    
$res mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE ((uid='".$uid."' AND tid='".$tid."') OR (uid='".$tid."' AND tid='".$uid."')) AND agreed='1'"));
    if(
$res[0]>0)
    {
      return 
true;
    }
    return 
false;
}
/////////////////////////////////////////////popups on
function popupson($who)
{
  
$res mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE id='".$who."' AND popmsg='1'"));
    if(
$res[0]>0)
    {
      return 
true;
    }
    return 
false;
}
//////////////////////////////////function get n. of buds
function getnbuds($uid)
{
  
$notb mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE (uid='".$uid."' OR tid='".$uid."') AND agreed='1'"));
  return 
$notb[0];
}
/////////////////////////////get no. of requists
function getnreqs($uid)
{
  
$notb mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE  tid='".$uid."' AND agreed='0'"));
  return 
$notb[0];
}
 
/////////////////////////////get no. of online buds
function getonbuds($uid)
{
  
$counter =0;
    
$buds mysql_query("SELECT uid, tid FROM ibwf_buddies WHERE (uid='".$uid."' OR tid='".$uid."') AND agreed='1'");
    while(
$bud=mysql_fetch_array($buds))
    {
      if(
$bud[0]==$uid)
      {
        
$tid $bud[1];
      }else{
        
$tid $bud[0];
      }
      if(
isonline($tid))
      {
        
$counter++;
      }
    }
    return 
$counter;
}
/////////////////////////////////////////////Function shoutboxpage
function getshoutboxpage($sid)
{
  echo 
"<strong>ShoutBox</strong><br/>";
  echo 
"<p align=\"center\">";
$who $_GET["who"];
    
//////ALL LISTS <<
    
if($page=="" || $page<=0)$page=1;
    if(
$who=="")
    {
    
$noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts"));
    }else{
    
$noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_shouts WHERE shouter='".$who."'"));
    }
    
$num_items $noi[0]; //changable
    
$items_per_page10;
    
$num_pages ceil($num_items/$items_per_page);
    if((
$page>$num_pages)&&$page!=1)$page$num_pages;
    
$limit_start = ($page-1)*$items_per_page;
    
//changable sql
    
if($who =="")
    {
        
$sql "SELECT id, shout, shouter, shtime  FROM ibwf_shouts ORDER BY shtime DESC LIMIT $limit_start$items_per_page";
}else{
    
$sql "SELECT id, shout, shouter, shtime  FROM ibwf_shouts  WHERE shouter='".$who."'ORDER BY shtime DESC LIMIT $limit_start$items_per_page";
}
    
$items mysql_query($sql);
    echo 
mysql_error();
    if(
mysql_num_rows($items)>0)
    {
    while (
$item mysql_fetch_array($items))
    {
        
$shnick getnick_uid($item[2]);
        
$sht parsepm($item[1], $sid);
        
$shdt date("d m y-H:i"$item[3]);
      
$lnk "<a =\" php?action=viewuser&amp;who=$item[2]&amp;sid=$sid\">$shnick</a>: $sht<br/>$shdt";
      if(
ismod(getuid_sid($sid)))
      {
      
$dlsh "<a =\" php?action=delsh&amp;sid=$sid&amp;shid=$item[0]\">[x]</a>";
      }else{
        
$dlsh "";
      }
      echo 
"$lnk $dlsh<br/>";
    }
    }
    if(
$page>1)
    {
      
$ppage $page-1;
      echo 
"<a =\"l php?action=shouts&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«Prev</a> ";
    }
    if(
$page<$num_pages)
    {
      
$npage $page+1;
      echo 
"<a =\"hp?action=shouts&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
    }
    echo 
"<br/>$page/$num_pages<br/>";
    if(
$num_pages>2)
    {
   
$rets "<form action=\"php\" method=\"get\">";
        
$rets .= "<input name=\"page\" format=\"*N\" size=\"3\"/>";
        
$rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\">";
        
$rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\">";
        
$rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\">";
        
$rets .= "<input type=\"Submit\" name=\"Submit\" Value=\"Go To Page\"></form>";
        echo 
$rets;
         }
//  $shbox .= "<a php?action=shouts&amp;sid=$sid\">more</a>, ";
echo "<a php?action=shout&amp;sid=$sid\">shout</a>";
echo 
"</p>";
}
/////////////////////////////////////////////function Shoutbox 1msg
function getshoutbox($sid)
{
   
$shbox .= "<form action=\"php?action=shout&amp;sid=$sid\" method=\"post\"><center>";
  
$shbox .= "<b>ShoutBox</b><br/>";
  
$lshout mysql_fetch_array(mysql_query("SELECT shout, shouter, id  FROM ibwf_shouts ORDER BY shtime DESC LIMIT 1"));
  
$shnick getnick_uid($lshout[1]);
  
$shbox .= "<i><a .php?action=viewuser&amp;sid=$sid&amp;who=$lshout[1]\">".$shnick."</a></i> - ";
  
$text parsepm($lshout[0], $sid);
  
$shbox .= $text;
  
$shbox .= "<br/>";
  
$shbox .= "<a php?action=shouts&amp;sid=$sid\">more</a>";
  if (
ismod(getuid_sid($sid)))
  {
  
$shbox .= " <a php?action=delsh&amp;sid=$sid&amp;shid=$lshout[2]\">delete</a>";
  }
  if(
getplusses(getuid_sid($sid))<75)
  {
  
$shbox .= "<br/>You need at least 75 plusses to shout!";
  }else{
  
$shbox .= "<br/>ShoutBox Message:<br/><input name=\"shtxt\" maxlength=\"100\"/><br/>";
  
$shbox .= "<input type=\"Submit\" name=\"shout\" Value=\"Add Shout\"></center></form>";
  }
  return 
$shbox;
}
/////////////////////////////////////////////function pop up msg
function popup($sid)
{
 
$uid getuid_sid($sid);
          
$unreadpopup=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_popups WHERE unread='1' AND touid='".$uid."'"));
 
 
        if (
$unreadpopup[0]>0)
        {
        
$popsenabled=mysql_fetch_array(mysql_query("SELECT popmsg FROM ibwf_users WHERE id='".$uid."'"));
        if(
$popsenabled[0]==1
           {
        
$pminfo mysql_fetch_array(mysql_query("SELECT id, text, byuid, timesent, touid, reported FROM ibwf_popups WHERE unread='1' AND touid='".$uid."'"));
        
$pmfrm getnick_uid($pminfo[2]);
        
$ncl mysql_query("UPDATE ibwf_popups SET unread='0' WHERE id='".$pminfo[0]."'");
        
$popmsgbox .= "<center><strong>POP-UP Message From $pmfrm</strong>";
        
$popmsgbox .= "<br/>";
        
$tmstamp $pminfo[3];
     
$tmdt date("d m Y - H:i:s"$tmstamp);
        
$popmsgbox .= "Sent At: $tmdt<br/>";
        
$pmtext parsepm($pminfo[1], $sid);
        
$pmtext str_replace("/llfaqs","<a php?action=faqs&amp;sid=$sid\">$sitename F.A.Qs</a>"$pmtext);
        
$pmtext str_replace("/reader",getnick_uid($pminfo[4]), $pmtext);
        
$pmid=$pminfo[0];
        
$popmsgbox .= "Message: $pmtext";
        
$popmsgbox .= "<br/>Send Reply to $pmfrm<br/></center>";
     
$popmsgbox .= "<form action=\"php?action=sendpopup&amp;who=$pminfo[2]&amp;sid=$sid&amp;pmid=$pminfo[0]\" method=\"post\">";
     
$popmsgbox .= "<center><input name=\"pmtext\" maxlength=\"500\"/><br/>";
     
$popmsgbox .= "<input type=\"Submit\" name=\"submit\" Value=\"Send\"></center></form>";
      
// $res = mysql_query("INSERT INTO ibwf_online SET userid='".$uid."', actvtime='".$tm."', place='".$place."', placedet='".$plclink."'");
       
$location mysql_fetch_array(mysql_query("SELECT placedet FROM ibwf_online WHERE userid='".$uid."'"));
       
$popmsgbox .= "<center><a href=\"$location[0]&amp;sid=$sid\">Skip Msg</a><br/>";
       
$popmsgbox .= "<a php?action=rptpop&amp;sid=$sid&amp;pmid=$pminfo[0]\">Report</a></center>";
               }
               }
       return 
$popmsgbox;
}
/////////////////////////////////////////////get tid frm post id
function gettid_pid($pid)
{
  
$tid mysql_fetch_array(mysql_query("SELECT tid FROM ibwf_posts WHERE id='".$pid."'"));
  return 
$tid[0];
}
///////////////////////////////////////////is trashed?
function istrashed($uid)
{
  
$del mysql_query("DELETE FROM ibwf_penalties WHERE timeto<'".time()."'");
  
$not mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='0'"));
  if(
$not[0]>0)
  {
    return 
true;
  }else{
    return 
false;
  }
}
///////////////////////////////////////////is shielded?
function isshield($uid)
{
  
$not mysql_fetch_array(mysql_query("SELECT shield FROM ibwf_users WHERE id='".$uid."'"));
  if(
$not[0]=='1')
  {
    return 
true;
  }else{
    return 
false;
  }
}
///////////////////////////////////////////Get IP
function getip_uid($uid)
{
  
$not mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$uid."'"));
  return 
$not[0];
 
}
///////////////////////////////////////////Get Browser
function getbr_uid($uid)
{
  
$not mysql_fetch_array(mysql_query("SELECT browserm FROM ibwf_users WHERE id='".$uid."'"));
  return 
$not[0];
}
///////////////////////////////////////////is trashed?
function isbanned($uid)
{
  
$del mysql_query("DELETE FROM ibwf_penalties WHERE timeto<'".time()."'");
  
$not mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_penalties WHERE uid='".$uid."' AND (penalty='1' OR penalty='2')"));
 
  if(
$not[0]>0)
  {
    return 
true;
  }else{
    return 
false;
  }
}
 
/////////////////////////////////////////////get tid frm post id
function gettname($tid)
{
  
$tid mysql_fetch_array(mysql_query("SELECT name FROM ibwf_topics WHERE id='".$tid."'"));
  return 
$tid[0];
}
/////////////////////////////////////////////get tid frm post id
function getfid_tid($tid)
{
  
$fid mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
  return 
$fid[0];
}
/////////////////////////////////////////////is ip banned
function isipbanned($ipa$brm)
{
 
  
$pinf mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_penalties WHERE penalty='2' AND ipadd='".$ipa."' AND browserm='".$brm."'"));
  if(
$pinf[0]>0)
  {
  return 
true;
}
return 
false;
}
////////////////get number of pinned topics in forum 
function getpinned($fid)
{
  
$nop mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_topics WHERE fid='".$fid."' AND pinned ='1'"));
  return 
$nop[0];
}
/////////////////////////////////////////////can bud?
function budres($uid$tid)
{
  
//3 = can't bud
  //2 = already buds
  //1 = request pended
  //0 = can bud
  
if($uid==$tid)
  {
    return 
3;
  }
 
  if (
arebuds($uid$tid))
  {
    return 
2;
  }
  
$req mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE ((uid='".$uid."' AND tid='".$tid."') OR (uid='".$tid."' AND tid='".$uid."')) AND agreed='0'"));
  if(
$req[0]>0)
  {
    return 
1;
  }
  
$notb mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE (uid='".$tid."' OR tid='".$tid."') AND agreed='1'"));
  global 
$max_buds;
  if(
$notb[0]>=$max_buds)
  {
 
    return 
3;
  }
  
$notb mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE (uid='".$uid."' OR tid='".$uid."') AND agreed='1'"));
  global 
$max_buds;
  if(
$notb[0]>=$max_buds)
  {
    return 
3;
  }
  return 
0;
}
////////////////////////////////////////////Session expiry time
function getsxtm()
{
   
$getdata mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sesexp'"));
   return 
$getdata[0];
}
////////////////////////////////////////////Get bud msg
function getbudmsg($uid)
{
   
$getdata mysql_fetch_array(mysql_query("SELECT budmsg FROM ibwf_users WHERE id='".$uid."'"));
   return 
$getdata[0];
}
////////////////////////////////////////////Get forum name
function getfname($fid)
{
  
$fname mysql_fetch_array(mysql_query("SELECT name FROM ibwf_forums WHERE id='".$fid."'"));
  return 
$fname[0];
}
////////////////////////////////////////////PM antiflood time
function getpmaf()
{
   
$getdata mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='pmaf'"));
   return 
$getdata[0];
}
////////////////////////////////////////////PM antiflood time
function getfview()
{
   
$getdata mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='fview'"));
   return 
$getdata[0];
}
////////////////////////////////////////////get forum message
function getfmsg()
{
   
$getdata mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='4ummsg'"));
   return 
$getdata[0];
}
//////////////////////////////////////////////is online
function isonline($uid)
{
  
$uon mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online WHERE userid='".$uid."'"));
  if(
$uon[0]>0)
  {
    return 
true;
  }else
  {
    return 
false;
  }
}
///////////////////////////if registration is allowed
function canreg()
{
   
$getreg mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='reg'"));
   if(
$getreg[0]=='1')
   {
     return 
true;
   }else
   {
     return 
false;
   }
}
///////////////////////////if validation is on
function validation()
{
   
$getval mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='vldtn'"));
   if(
$getval[0]=='1')
   {
     return 
true;
   }else
   {
     return 
false;
   }
}
///////////////////////////if accepts auto msgs
function automsgs($uid)
{
   
$getval mysql_fetch_array(mysql_query("SELECT automsgs FROM ibwf_users WHERE id='".$uid."'"));
   if(
$getval[0]=='1')
   {
     return 
true;
   }else
   {
     return 
false;
   }
}
///////////////////////////////////////////Get Forum ID
function getfid($topicid)
{
  
$fid mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$topicid."'"));
  return 
$fid[0];
}
////////////////////////////////////////////Parse PM
////anti spam
function parsepm($text$sid="")
{
  
$text getbbcode($text$sid1);
  
$text findcard($text);
  return 
$text;
}
 
////////////////////////////////////////////Parse other msgs
function parsemsg($text$sid="")
{
  
$text getbbcode($text$sid1);
  
$text findcard($text);
  return 
$text;
}
///////////////////////////////////////////Is site blocked
function isblocked($str,$sender)
{
  if(
ismod($sender))
  {
    return 
false;
  }
  
$str str_replace(" ","",$str);
  
$str strtolower($str);
    
$res mysql_query("SELECT site FROM ibwf_blockedsite");
while (
$row mysql_fetch_array($res)) 
{
   
$sites[] = $row[0];
}
  for(
$i=0;$i<count($sites);$i++)
  {
        
$nosf substr_count($str,$sites[$i]);
    if(
$nosf>0)
    {
      return 
true;
    }
  }
  return 
false;
}
///////////////////////////////////////////Is pm starred
function isstarred($pmid)
{
  
$strd mysql_fetch_array(mysql_query("SELECT starred FROM ibwf_private WHERE id='".$pmid."'"));
  if(
$strd[0]=="1")
  {
    return 
true;
  }else{
    return 
false;
  }
}
////////////////////////////////////////////IS LOGGED?
function islogged($sid)
{
  
//delete old sessions first
  
$deloldses mysql_query("DELETE FROM ibwf_ses WHERE expiretm<'".time()."'");
  
//does sessions exist?
  
$sesx mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_ses WHERE id='".$sid."'"));
  if(
$sesx[0]>0)
  {
    if(!
isuser(getuid_sid($sid)))
{
  return 
false;
}
    
//yip it's logged in
    //first extend its session expirement time
    
$xtm time() + (60*getsxtm());
    
$extxtm mysql_query("UPDATE ibwf_ses SET expiretm='".$xtm."' WHERE id='".$sid."'");
    return 
true;
  }else{
    
//nope its session must be expired or something
    
re

Pagine: [1] 2


Web Design Bolzano Kreatif