• User Attivo

    ...continua
    [php] $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&sid=$sid">more</a>, ";
    echo "<a php?action=shout&sid=$sid">shout</a>";
    echo "</p>";
    }
    /////////////////////////////////////////////function Shoutbox 1msg
    function getshoutbox($sid)
    {
    $shbox .= "<form action="php?action=shout&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&sid=$sid&who=$lshout[1]">".$shnick."</a></i> - ";
    $text = parsepm($lshout[0], $sid);
    $shbox .= $text;
    $shbox .= "<br/>";
    $shbox .= "<a php?action=shouts&sid=$sid">more</a>";
    if (ismod(getuid_sid($sid)))
    {
    $shbox .= " <a php?action=delsh&sid=$sid&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, $sid, 1);
    $text = findcard($text);
    return $text;
    }

    ////////////////////////////////////////////Parse other msgs
    function parsemsg($text, $sid="")
    {
    $text = getbbcode($text, $sid, 1);
    $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*);
    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
    return false;
    }
    }
    ////////////////////////Get user nick from session id
    function getnick_sid($sid)
    {
    $uid = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_ses WHERE id='".$sid."'"));
    $uid = $uid[0];
    return getnick_uid($uid);
    }
    ////////////////////////Get user id from session id
    function getuid_sid($sid)
    {
    $uid = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_ses WHERE id='".$sid."'"));
    $uid = $uid[0];
    return $uid;
    }
    /////////////////////Get total number of pms
    function getpmcount($uid,$view="all")
    {
    if($view=="all"){
    $nopm = mysql_fetch_array(mysql_query("SELECT COUNT() FROM ibwf_private WHERE touid='".$uid."' AND starred='0'"));
    }else if($view =="snt")
    {
    $nopm = mysql_fetch_array(mysql_query("SELECT COUNT(
    ) FROM ibwf_private WHERE byuid='".$uid."'"));
    }else if($view =="str")
    {
    $nopm = mysql_fetch_array(mysql_query("SELECT COUNT() FROM ibwf_private WHERE touid='".$uid."' AND starred='1'"));
    }else if($view =="urd")
    {
    $nopm = mysql_fetch_array(mysql_query("SELECT COUNT(
    ) FROM ibwf_private WHERE touid='".$uid."' AND unread='1'"));
    }
    return $nopm[0];
    }
    function deleteClub($clid)
    {
    $fid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_forums WHERE clubid='".$clid."'"));
    $fid = $fid[0];
    $topics = mysql_query("SELECT id FROM ibwf_topics WHERE fid=".$fid."");
    while($topic = mysql_fetch_array($topics))
    {
    mysql_query("DELETE FROM ibwf_posts WHERE tid='".$topic[0]."'");
    }
    mysql_query("DELETE FROM ibwf_topics WHERE fid='".$fid."'");
    mysql_query("DELETE FROM ibwf_forums WHERE id='".$fid."'");
    mysql_query("DELETE FROM ibwf_rooms WHERE clubid='".$clid."'");
    mysql_query("DELETE FROM ibwf_clubmembers WHERE clid='".$clid."'");
    mysql_query("DELETE FROM ibwf_announcements WHERE clid='".$clid."'");
    mysql_query("DELETE FROM ibwf_clubs WHERE id=".$clid."");
    return true;
    }
    function deleteMClubs($uid)
    {
    $uclubs = mysql_query("SELECT id FROM ibwf_clubs WHERE owner='".$uid."'");
    while($uclub=mysql_fetch_array($uclubs))
    {
    deleteClub($uclub[0]);
    }
    }
    //////////////////////Function add user to online list 😛
    function addonline($uid,$place,$plclink)
    {
    $hidden=mysql_fetch_array(mysql_query("SELECT hidden FROM ibwf_users WHERE id='".$uid."'"));
    if($hidden[0]==0)
    {
    /////delete inactive users
    $tm = time();
    $timeout = $tm - 420; //time out = 5 minutes
    $deloff = mysql_query("DELETE FROM ibwf_online WHERE actvtime <'".$timeout."'");
    ///now try to add user to online list
    $res = mysql_query("UPDATE ibwf_users SET lastact='".time()."' WHERE id='".$uid."'");
    $res = mysql_query("INSERT INTO ibwf_online SET userid='".$uid."', actvtime='".$tm."', place='".$place."', placedet='".$plclink."'");
    if(!$res)
    {
    //most probably userid already in the online list
    //so just update the place and time
    $res = mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$place."', placedet='".$plclink."' WHERE userid='".$uid."'");

    }
    }
    $maxmem=mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE id='2'"));

            $result = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online"));
          if($result[0]>=$maxmem[0])
          {
            $tnow = date("D d M Y - H:i");
            mysql_query("UPDATE ibwf_settings set name='".$tnow."', value='".$result[0]."' WHERE id='2'");
          }
          $maxtoday = mysql_fetch_array(mysql_query("SELECT ppl FROM ibwf_mpot WHERE ddt='".date("d m y")."'"));
          if($maxtoday[0]==0||$maxtoday=="")
          {
            mysql_query("INSERT INTO ibwf_mpot SET ddt='".date("d m y")."', ppl='1', dtm='".date("H:i:s")."'");
            $maxtoday[0]=1;
          }
          if($result[0]>=$maxtoday[0])
          {
            mysql_query("UPDATE ibwf_mpot SET ppl='".$result[0]."', dtm='".date("H:i:s")."' WHERE ddt='".date("d m y")."'");
          }
    

    }
    /////////////////////Get members online
    function getnumonline()
    {
    $nouo = mysql_fetch_array(mysql_query("SELECT COUNT() FROM ibwf_online "));
    return $nouo[0];
    }
    //////////////////////////////////////is ignored
    function isignored($tid, $uid)
    {
    $ign = mysql_fetch_array(mysql_query("SELECT COUNT(
    ) FROM ibwf_ignore WHERE target='".$tid."' AND name='".$uid."'"));
    if($ign[0]>0)
    {
    return true;
    }
    return false;
    }
    ///////////////////////////////////////////GET IP
    function getip()
    {
    if (getenv('HTTP_X_FORWARDED_FOR'))
    {
    $ip=getenv('HTTP_X_FORWARDED_FOR');
    }
    else
    {
    $ip=getenv('REMOTE_ADDR');
    }
    return $ip;
    }
    //////////////////////////////////////////ignore result
    function ignoreres($uid, $tid)
    {
    //0 user can't ignore the target
    //1 yes can ignore
    //2 already ignored
    if($uid==$tid)
    {
    return 0;
    }
    if(ismod($tid))
    {
    //you cant ignore staff members
    return 0;
    }
    /if(arebuds($tid, $uid))
    {
    //why the hell would anyone ignore his bud? o.O
    return 0;
    }
    /
    if(isignored($tid, $uid))
    {
    return 2; // the target is already ignored by the user
    }
    return 1;
    }
    ///////////////////////////////////////////Function getage
    function getage($strdate)
    {
    $dob = explode("-",$strdate);
    if(count($dob)!=3)
    {
    return 0;
    }
    $y = $dob[0];
    $m = $dob[1];
    $d = $dob[2];
    if(strlen($y)!=4)
    {
    return 0;
    }
    if(strlen($m)!=2)
    {
    return 0;
    }
    if(strlen($d)!=2)
    {
    return 0;
    }
    $y += 0;
    $m += 0;
    $d += 0;
    if($y==0) return 0;
    $rage = date("Y") - $y;
    if(date("m")<$m)
    {
    $rage-=1;

    }else{
    if((date("m")==$m)&&(date("d")<$d))
    {
    $rage-=1;
    }
    }
    return $rage;
    }
    /////////////////////////////////////////getavatar
    function getavatar($uid)
    {
    $av = mysql_fetch_array(mysql_query("SELECT avatar FROM ibwf_users WHERE id='".$uid."'"));
    return $av[0];
    }
    /////////////////////////////////////////Can see details?
    function cansee($uid, $tid)
    {
    if($uid==$tid)
    {
    return true;
    }
    if(ismod($uid))
    {
    return true;
    }
    return false;
    }
    //////////////////////////gettimemsg
    function gettimemsg($sec)
    {
    $years=0;
    $months=0;
    $weeks=0;
    $days=0;
    $mins=0;
    $hours=0;
    if ($sec>59)
    {
    $secs=$sec%60;
    $mins=$sec/60;
    $mins=(integer)$mins;
    }
    if ($mins>59)
    {
    $hours=$mins/60;
    $hours=(integer)$hours;
    $mins=$mins%60;
    }
    if ($hours>23)
    {
    $days=$hours/24;
    $days=(integer)$days;
    $hours=$hours%24;
    }
    if ($days>6)
    {
    $weeks=$days/7;
    $weeks=(integer)$weeks;
    $days=$days%7;
    }
    if ($weeks>3)
    {
    $months=$weeks/4;
    $months=(integer)$months;
    $weeks=$weeks%4;
    }
    if ($months>11)
    {
    $years=$months/12;
    $years=(integer)$years;
    $months=$months%12;
    }
    if($years>0)
    {
    if($years==1){$yearmsg="year";}else{$yearmsg="years";}
    if($months==1){$monthsmsg="month";}else{$monthsmsg="months";}
    if($days==1){$daysmsg="day";}else{$daysmsg="days";}
    if($hours==1){$hoursmsg="hour";}else{$hoursmsg="hours";}
    if($mins==1){$minsmsg="minute";}else{$minsmsg="minutes";}
    if($secs==1){$secsmsg="second";}else{$secsmsg="seconds";}
    if($months!=0){$monthscheck="$months $monthsmsg ";}else{$monthscheck="";}
    if(($days!=0)&&($months==0)){$dayscheck="$days $daysmsg ";}else{$dayscheck="";}
    if(($hours!=0)&&($months==0)&&($days==0)){$hourscheck="$hours $hoursmsg ";}else{$hourscheck="";}
    if(($mins!=0)&&($months==0)&&($days==0)&&($hours==0)){$minscheck="$mins $minsmsg ";}else{$minscheck="";}
    if(($secs!=0)&&($months==0)&&($days==0)&&($hours==0)&&($mins==0)){$secscheck="$secs $secsmsg";}else{$secscheck="";}
    return "$years $yearmsg $monthscheck$dayscheck$hourscheck$minscheck$secscheck";
    }
    if(($years<1)&&($months>0))
    {
    if($months==1){$monthsmsg="month";}else{$monthsmsg="months";}
    if($days==1){$daysmsg="day";}else{$daysmsg="days";}
    if($hours==1){$hoursmsg="hour";}else{$hoursmsg="hours";}
    if($mins==1){$minsmsg="minute";}else{$minsmsg="minutes";}
    if($secs==1){$secsmsg="second";}else{$secsmsg="seconds";}
    if($days!=0){$dayscheck="$days $daysmsg ";}else{$dayscheck="";}
    if(($hours!=0)&&($days==0)){$hourscheck="$hours $hoursmsg ";}else{$hourscheck="";}
    if(($mins!=0)&&($days==0)&&($hours==0)){$minscheck="$mins $minsmsg ";}else{$minscheck="";}
    if(($secs!=0)&&($days==0)&&($hours==0)&&($mins==0)){$secscheck="$secs $secsmsg";}else{$secscheck="";}
    return "$months $monthsmsg $dayscheck$hourscheck$minscheck$secscheck";
    }
    if(($months<1)&&($weeks>0))
    {
    if($weeks==1){$weeksmsg="week";}else{$weeksmsg="weeks";}
    if($days==1){$daysmsg="day";}else{$daysmsg="days";}
    if($hours==1){$hoursmsg="hour";}else{$hoursmsg="hours";}
    if($mins==1){$minsmsg="minute";}else{$minsmsg="minutes";}
    if($secs==1){$secsmsg="second";}else{$secsmsg="seconds";}
    if($days!=0){$dayscheck="$days $daysmsg ";}else{$dayscheck="";}
    if(($hours!=0)&&($days==0)){$hourscheck="$hours $hoursmsg ";}else{$hourscheck="";}
    if(($mins!=0)&&($days==0)&&($hours==0)){$minscheck="$mins $minsmsg ";}else{$minscheck="";}
    if(($secs!=0)&&($days==0)&&($hours==0)&&($mins==0)){$secscheck="$secs $secsmsg";}else{$secscheck="";}
    return "$weeks $weeksmsg $dayscheck$hourscheck$minscheck$secscheck";
    }
    if(($weeks<1)&&($days>0))
    {
    if($days==1){$daysmsg="day";}else{$daysmsg="days";}
    if($hours==1){$hoursmsg="hour";}else{$hoursmsg="hours";}
    if($mins==1){$minsmsg="minute";}else{$minsmsg="minutes";}
    if($secs==1){$secsmsg="second";}else{$secsmsg="seconds";}
    if($hours!=0){$hourscheck="$hours $hoursmsg ";}else{$hourscheck="";}
    if(($mins!=0)&&($hours==0)){$minscheck="$mins $minsmsg ";}else{$minscheck="";}
    if(($secs!=0)&&($hours==0)&&($mins==0)){$secscheck="$secs $secsmsg";}else{$secscheck="";}
    return "$days $daysmsg $hourscheck$minscheck$secscheck";
    }
    if(($days<1)&&($hours>0))
    {
    if($hours==1){$hoursmsg="hour";}else{$hoursmsg="hours";}
    if($mins==1){$minsmsg="minute";}else{$minsmsg="minutes";}
    if($secs==1){$secsmsg="second";}else{$secsmsg="seconds";}
    if($mins!=0){$minscheck="$mins $minsmsg ";}else{$minscheck="";}
    if(($secs!=0)&&($mins==0)){$secscheck="$secs $secsmsg";}else{$secscheck="";}
    return "$hours $hoursmsg $minscheck$secscheck";
    }
    if(($hours<1)&&($mins>0))
    {
    if($mins==1){$minsmsg="minute";}else{$minsmsg="minutes";}
    if(($secs==1)&&($mins==0)){$secsmsg="second";}else{$secsmsg="seconds";}
    if($secs!=0){$secscheck="$secs $secsmsg";}else{$secscheck="";}
    return "$mins $minsmsg $secscheck";
    }
    if(($mins<1)&&($sec>0))
    {
    if($sec==1){$secsmsg="second";}else{$secsmsg="seconds";}
    if($sec!=0){$secscheck="$sec $secsmsg";}else{$secscheck="";}
    return "$secscheck";
    }else{
    return "Online!";
    }
    }
    /{
    $yr = floor($sec/60/60/24/365);
    if($yr > 0)
    {
    if($yr == 1)
    {return "$yr year";}
    else
    {return "$yr years";}
    }
    $mnth = floor($sec/60/60/24/7/4);
    if($mnth > 0)
    {
    if($mnth == 1)
    {return "$mnth month";}
    else
    {return "$mnth months";}
    }
    $wks = floor($sec/60/60/24/7);
    if($wks > 0)
    {
    if($wks == 1)
    {return "$wks week";}
    else
    {return "$wks weeks";}
    }
    $ds = floor($sec/60/60/24);
    if($ds > 0)
    {
    if($ds == 1)
    {return "$ds day";}
    else
    {return "$ds days";}
    }
    $hs = floor($sec/60/60);
    if($hs > 0)
    {
    if($hs == 1)
    {return "$hs hour";}
    else
    {return "$hs hours";}
    }
    $ms = floor($sec/60);
    if($ms > 0)
    {
    if($ms == 1)
    {return "$ms minute";}
    else
    {return "$ms minutes";}
    }
    return "$sec Seconds";
    }
    /
    /////////////////////////////////////////get status
    function getstatus($uid)
    {
    $info= mysql_fetch_array(mysql_query("SELECT perm, plusses FROM ibwf_users WHERE id='".$uid."'"));
    if(isbanned($uid))
    {
    return "Banned!";
    }
    if($info[0]=='4')
    {
    return "Site Owner!";
    }else if($info[0]=='3')
    {
    return "Head Administrator!";
    }else if($info[0]=='2')
    {
    return "Administrator!";
    }else if($info[0]=='1')
    {
    return "Moderator!";
    }else{
    if($info[1]<10)
    {
    return "Member";
    }else if($info[1]<25)
    {
    return "Member";
    }else if($info[1]<50)
    {
    return "Member";
    }else if($info[1]<75)
    {
    return "Member";
    }else if($info[1]<250)
    {
    return "Member";
    }else if($info[1]<500)
    {
    return "Member";
    }else if($info[1]<750)
    {
    return "Member";
    }else if($info[1]<1000)
    {
    return "Member";
    }else if($info[1]<1500)
    {
    return "Member";
    }else if($info[1]<2000)
    {
    return "Member";
    }else if($info[1]<2500)
    {
    return "Member";
    }else if($info[1]<3000)
    {
    return "Member";
    }else if($info[1]<4000)
    {
    return "Member";
    }else if($info[1]<5000)
    {
    return "Member";
    }else if($info[1]<10000)
    {
    return "Member";
    }else
    {
    return "Member";
    }
    }
    }
    /////////////////////Get Page Jumber
    function getjumper($action, $sid,$pgurl)
    {
    $rets = "<form action="$php" method="get">";
    $rets .= "<input type="hidden" name="action" value="$action">";
    $rets .= "<input type="hidden" name="sid" value="$sid">";
    $rets .= "<input name="page" format="*N" size="2"/>";
    $rets .= "<input type="Submit" name="Submit" Value="Go To Page"></form>";
    return $rets;
    }
    /////////////////////Get unread number of pms
    function getunreadpm($uid)
    {
    [/php]


  • User Attivo

    ...continua
    [php]$nopm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE touid='".$uid."' AND unread='1'"));
    return $nopm[0];
    }
    //////////////////////GET USER NICK FROM USERID
    function getnick_uid($uid)
    {
    $unick = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id='".$uid."'"));
    return $unick[0];
    }
    ///////////////////////////////////////////////Get the smilies
    function getsmilies()
    {
    $sql = "SELECT * FROM ibwf_smilies";
    $smilies = mysql_query($sql);
    while($smilie=mysql_fetch_array())
    {
    $scode = $smilie[1];
    $spath = $smilie[2];
    $text = str_replace(," ="" alt=""/>",);
    }
    return $text;
    }
    function getgallery($text)
    {
    $sql = "SELECT * FROM ibwf_gallery";
    $smilies = mysql_query($sql);
    while($smilie=mysql_fetch_array($smilies))
    {
    $scode = $gallery[1];
    $spath = $gallery[2];
    $text = str_replace(," ="" alt=""/>",);
    }
    return $text;
    }
    ////////////////////////////////////////////check nicks
    function checknick($aim)
    {
    $chk =0;
    $aim = strtolower($aim);
    $nicks = mysql_query("SELECT id, name, nicklvl FROM ibwf_nicks");
    while($nick=mysql_fetch_array($nicks))
    {
    if($aim==$nick[1])
    {
    $chk = $nick[2];
    }else if(substr($aim,0,strlen($nick[1]))==$nick[1])
    {
    $chk = $nick[2];
    }else{
    $found = strpos($aim, $nick[1]);
    if($found!=0)
    {
    $chk = $nick[2];
    }
    }
    }
    return $chk;
    }
    function autopm($msg, $who)
    {
    mysql_query("INSERT INTO ibwf_private SET text='".$msg."', byuid='1', touid='".$who."', unread='1', timesent='".time()."'");

    }
    function FtpUpload($dest_file, $src_file){
    // set up basic connection
    $server='localhost'; // ftp server
    $connection = ftp_connect($server); // connection
    // login to ftp server
    $user = "linkrx7";
    $pass = "rotary";
    $result = ftp_login($connection, $user, $pass);
    // check connection
    if ((!$connection) || (!$result)) {
    echo "FTP connection has failed!";
    echo "Attempted to connect to $ftp_server for user $ftp_user_name";
    exit;
    }
    // upload the file
    $upload = ftp_put($connection, $dest_file, $src_file, FTP_BINARY);
    // check upload status
    if (!$upload) {
    echo "FTP upload has failed!";
    }
    // close the FTP stream
    ftp_close($connection);
    }
    ////////////////////////////////////////////////////Register
    function register($name,$pass,$usex,$day,$month,$year,$uloc,$email,$info, $ubr)
    {
    $execms = mysql_query("SELECT * FROM ibwf_users WHERE name='".$name."';");

    if (mysql_num_rows($execms)>0){
    return 1;
    }else{
    $pass = md5($pass);
    $validation = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='vldtn'"));
    if($validation[0]==1)
    {
    $validated=0;
    }else{
    $validated=1;
    }
    $reg = mysql_query("INSERT INTO ibwf_users SET name='".$name."', pass='".$pass."', birthday='".$year.$month.$day."', sex='".$usex."', location='".$uloc."', email='".$email."', signature='".$info."', regdate='".time()."', validated='".$validated."', ipadd='".getip()."', browserm='".$ubr."'");

    if ($reg)
    {
    $uid = getuid_nick($name);
      addonline($uid,"Just Registered","");
      $delonline = mysql_query("DELETE FROM ibwf_online WHERE userid='".$uid."'");
      $uid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_users WHERE name='".$name."'"));
      $sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));
      $msg = "Hello /reader =). Greetings from all $sitename[0] staff, we are happy to have you here, welcome to our big happy family!, If You Have any questions or comments about the site feel free to message me or any of the other staff members online. ENJOY!(excited)[br/][small]*p.s: this is an automated pm*[/small]";
      $msg = mysql_escape_string($msg);
      autopm($msg, $uid[0]);
      return 0;
    }else{
      return 2;
    
    }
    

    }

    }
    /////////////////////// GET ibwf_users user id from nickname
    function getuid_nick($nick)
    {
    $uid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_users WHERE name='".$nick."'"));
    return $uid[0];
    }
    /////////////////////////////////////////Is admin?
    function isadmin($uid)
    {
    $admn = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$uid."'"));
    if($admn[0]>=2)
    {
    return true;
    }else{
    return false;
    }
    }
    /////////////////////////////////////////Is admin?
    function isheadadmin($uid)
    {
    $admn = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$uid."'"));
    if($admn[0]==3)
    {
    return true;
    }else{
    return false;
    }
    }
    /////////////////////////////////////////Is owner?
    function isowner($uid)
    {
    $own = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$uid."'"));
    if($own[0]==4)
    {
    return true;
    }else{
    return false;
    }
    }
    ///////////////////////////////////
    function swearing($str)
    {
    $str = str_replace(" ","",$str);
    $sites[0] = "fuck";
    $sites[1] = "shit";
    $sites[2] = "dick";
    $sites[3] = "pussy";
    $sites[4] = "cunt";
    $sites[5] = "cock";
    $sites[6] = "slut";
    $sites[7] = "faggot";
    $sites[8] = "wanker";
    $sites[9] = "prick";
    $sites[10] = "bastard";
    $sites[11] = "bitch";
    for($i=0;$i<count($sites);$i++)
    {
    $str = strtolower($str);
    $nosf = substr_count($str,$sites*);
    if($nosf>0)
    {
    return true;
    }
    }
    return false;
    }
    ///////////////////////////////////parse bbcode
    function getbbcode($text, $sid="", $filtered)
    {
    $text = htmlspecialchars($text);
    $text=preg_replace( );
    $text=preg_replace();
    $text=preg_replace( );
    $text=preg_replace(" );
    $text=preg_replace(" );
    $text = preg_replace();
    $text = preg_replace();
    $text = preg_replace();
    $text = preg_replace(");
    //$text = ereg_replace("[A-Za-z0-9./=?-_]+","<a ="\0">\0</a>", );
    if(substr_count(,"[br/]")<=3){
    $text = str_replace("[br/]","<br/>",);
    }
    $sml = mysql_fetch_array(mysql_query("SELECT hvia FROM ibwf_users WHERE id='".getuid_sid($sid)."'"));
    if ($sml[0]=="1")
    {
    $text = getsmilies($text);
    }
    if($filtered=="1"){
    if(swearing($text))
    {
    $text = strtolower($text);
    $text = str_replace("fuck","fck",$text);
    $text = str_replace("shit","sh
    t",$text);
    $text = str_replace("dick","dck",$text);
    $text = str_replace("pussy","pu**y",$text);
    $text = str_replace("cunt","c
    nt",$text);
    $text = str_replace("cock","cck",$text);
    $text = str_replace("slut","sl
    t",$text);
    $text = str_replace("faggot","fggt",$text);
    $text = str_replace("wanker","wnkr",$text);
    $text = str_replace("prick","prck",$text);
    $text = str_replace("bastard","b
    strd",$text);
    $text = str_replace("bitch","b
    tch",$text);
    }
    }
    return $text;
    }

    //////////////////////////////////////////////////MISC FUNCTIONS
    function spacesin($word)
    {
    $pos = strpos($word," ");
    if($pos === false)
    {
    return false;
    }else
    {
    return true;
    }
    }
    /////////////////////////////////Number of registered members
    function regmemcount()
    {
    $rmc = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users"));
    return $rmc[0];
    }
    ///////
    ///////////////////////////function counter
    function addvisitor()
    {
    $cc = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='Counter'"));
    $cc = $cc[0]+1;
    $res = mysql_query("UPDATE ibwf_settings SET value='".$cc."' WHERE name='Counter'");
    }
    function scharin($word)
    {
    $chars = "abcdefghijklmnopqrstuvwxyz0123456789-_";
    for($i=0;$i<strlen($word);$i++)
    {
    $ch = substr($word,$i,1);
    $nol = substr_count($chars,$ch);
    if($nol==0)
    {
    return true;
    }
    }
    return false;
    }
    function isdigitf($word)
    {
    $chars = "abcdefghijklmnopqrstuvwxyz";
    $ch = substr($word,0,1);
    $sres = ereg("[0-9]",$ch);

    $ch = substr($word,0,1);
    

    $nol = substr_count($chars,$ch);
    if($nol==0)
    {
    return true;
    }

    return false;
    }
    [/php]
    Se potete aiutarmi x favore... Grazie!!!


  • User Attivo

    Probabile che manca la funzione canreg!! ..ma come si mette la funzione canreg? e dove esattamente?


  • Bannato User Attivo

    **nella tabella ibwf_settings setta ****value = 1 dove nome='reg' **


  • User Attivo

    Non lo capito.. puoi essere più preciso?:?


  • Bannato User Attivo

    canreg esiste e controlla se nella tabella ibwf_settings il valore del record con nome 'reg' è uguale a 1, probabilmente nella tua tabella è =0 prova a metterlo = 1:

    ///////////////////////////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;
       }
    }
    ```esegui la query sotto:
    > UPDATE ibwf_settings SET value=1 WHERE name='reg'

  • User Attivo

    A si grazie non l'avevo vista. Alora, nella cartella database c'è
    value text latin1_swedish_ciNo

    cosa dovrei fare? non sono molto pratico 😞 se mi puoi guidare passo dopo passo. Mai ho provato a settare. Da dove devo cominciare?


  • Bannato User Attivo

    più che "non pratico" direi che sei a digiuno 😢
    Non posso aiutarti passo passo, spiacente, sarebbero mille passi ora che arrivi alla soluzione.

    ti dico in due passi cosa fare il resto ci arrivi da te se riesci.

    1. apri phpmyadmin (accedi al tuo database)
    2. lanci l'update che ti ho dato prima

    in bocca al lupo.


  • User Attivo

    lanci... nel senso che me lo dovrei salvare nel mio pc.. e poi importare nel mio database?? Gia' ci sono nel mio database.


  • Moderatore

    lanci significa cliccare sul tastino SQL di phpmyadmin e incollare nel campo di testo

    
     UPDATE ibwf_settings SET value=1 WHERE name='reg'
    
    

    poi invii e se il ragionamento è giusto dovrebbe fungere 🙂


  • User Attivo

    Grazie massi.. funziona:)


  • User Attivo

    Mi sono registrato con successo,, mi sono pure loggato e quando ento mi dice che non sono loggato o la sessione è scaduta.. penso che disogna impostare la cartella del database, come i messaggi precedenti.. metto il codice
    [PHP]////////////////////////////////////////////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
    return false;
    }
    }
    ////////////////////////Get user nick from session id
    function getnick_sid($sid)
    {
    $uid = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_ses WHERE id='".$sid."'"));
    $uid = $uid[0];
    return getnick_uid($uid);
    }
    ////////////////////////Get user id from session id
    function getuid_sid($sid)
    {
    $uid = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_ses WHERE id='".$sid."'"));
    $uid = $uid[0];
    return $uid;
    }
    [/PHP]


  • User Attivo

    Mi sono registrato con successo,, mi sono pure loggato e quando ento mi dice che non sono loggato o la sessione è scaduta.. penso che disogna impostare la cartella del database, come i messaggi precedenti.. metto il codice
    [php]////////////////////////////////////////////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
    return false;
    }
    }
    ////////////////////////Get user nick from session id
    function getnick_sid($sid)
    {
    $uid = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_ses WHERE id='".$sid."'"));
    $uid = $uid[0];
    return getnick_uid($uid);
    }
    ////////////////////////Get user id from session id
    function getuid_sid($sid)
    {
    $uid = mysql_fetch_array(mysql_query("SELECT uid FROM ibwf_ses WHERE id='".$sid."'"));
    $uid = $uid[0];
    return $uid;
    }
    [/php]