"; echo " "; ?> "; echo "

"; echo "\"*\"/
"; echo "

"; echo ""; echo "
"; exit(); } $brws = explode(" / ",$HTTP_USER_AGENT); $ubr = $brws[0]; $uip = getip(); $action = $_GET["action"]; $page = $_GET["page"]; $who = $_GET["who"]; ////////////////////////////////////////MAIN PAGE if($action=="forum") { addvisitor(); addonline(getuid_sid($sid),"Forum","index.php?action=$action"); //saveuinfo($sid); echo ""; echo "

"; //last post //"SELECT * FROM lib3rtymrc_posts ORDER BY dtpost DESC LIMIT 0 , 1" $lp = mysql_fetch_array(mysql_query("SELECT * FROM lib3rtymrc_posts ORDER BY dtpost DESC LIMIT 0,1")); $tname = gettname($lp[2]); $tname = str_replace("<","",$tname); $tname = str_replace(">","",$tname); $tname = str_replace("/","",$tname); $tname = str_replace("\"","",$tname); $uname = getnick_uid($lp[3]); echo "Pentru a posta trebuie sa va autentificati!
"; echo "\".\"/Ultima postare in $tname de ".getsimbol($lp[3])."$uname
"; // include("lastpost.php"); echo "

"; echo "

"; $fcats = mysql_query("SELECT id, name FROM lib3rtymrc_fcats ORDER BY position, id"); $iml = "\"*\"/"; while($fcat=mysql_fetch_array($fcats)) { $catlink = "$iml [»] $fcat[1]"; echo "
$catlink"; $forums = mysql_query("SELECT id, name FROM lib3rtymrc_forums WHERE cid='".$fcat[0]."' AND clubid='0' ORDER BY position, id, name"); if(getfview()==0) { echo "
"; while($forum=mysql_fetch_array($forums)) { if(canaccess(getuid_sid($sid),$forum[0])) { echo "»$forum[1]
"; } } echo "
"; }else if(getfview()==20) { echo "
Forums: "; echo "[GO]"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } echo "

"; echo "

"; //include("popups.php"); echo ""; echo "-------
"; echo "\"*\"/Meniu Prim
"; echo "

"; echo "

"; echo "
"; } //////////////////////////////////View category else if($action=="viewcat") { $cid = $_GET["cid"]; $cinfo = mysql_fetch_array(mysql_query("SELECT name from lib3rtymrc_fcats WHERE id='".$cid."'")); addonline(getuid_sid($sid),"Vizualizeaza categorie $cinfo[0]",""); echo ""; echo "

"; $forums = mysql_query("SELECT id, name FROM lib3rtymrc_forums WHERE cid='".$cid."' AND clubid='0' ORDER BY position, id, name"); echo ""; while($forum = mysql_fetch_array($forums)) { if(canaccess(getuid_sid($sid), $forum[0])) { $notp = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_topics WHERE fid='".$forum[0]."'")); $nops = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_posts a INNER JOIN lib3rtymrc_topics b ON a.tid = b.id WHERE b.fid='".$forum[0]."'")); $iml = "\"*\"/"; echo "$iml$forum[1] ($notp[0]/$nops[0])
"; $lpt = mysql_fetch_array(mysql_query("SELECT id, name FROM lib3rtymrc_topics WHERE fid='".$forum[0]."' ORDER BY lastpost DESC LIMIT 0,1")); $nops = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_posts WHERE tid='".$lpt[0]."'")); if($nops[0]==0) { $pinfo = mysql_fetch_array(mysql_query("SELECT authorid FROM lib3rtymrc_topics WHERE id='".$lpt[0]."'")); $tluid = $pinfo[0]; }else{ $pinfo = mysql_fetch_array(mysql_query("SELECT uid FROM lib3rtymrc_posts WHERE tid='".$lpt[0]."' ORDER BY dtpost DESC LIMIT 0, 1")); $tluid = $pinfo[0]; } $tlnm = htmlspecialchars($lpt[1]); $tlnick = getnick_uid($tluid); $tpclnk = "$tlnm"; $vulnk = "".getsimbol($tluid)."$tlnick"; echo "Ultima postare: $tpclnk de: $vulnk

"; } } echo "
"; echo "

"; echo "

"; echo "\"*\"/"; echo "Forum
"; echo "\"*\"/"; echo "Prim"; echo "

"; echo "
"; } //////////////////////////////////View Topic else if($action=="viewtpc") { $tinfo = mysql_fetch_array(mysql_query("SELECT name, text, authorid, crdate, views, fid, pollid from lib3rtymrc_topics WHERE id='".$tid."'")); $tnm = htmlspecialchars($tinfo[0]); addonline(getuid_sid($sid),"Vizualizare topic $tnm",""); $tid = $_GET["tid"]; $go = $_GET["go"]; $tfid = mysql_fetch_array(mysql_query("SELECT fid FROM lib3rtymrc_topics WHERE id='".$tid."'")); if(!canaccess(getuid_sid($sid), $tfid[0])) { echo ""; echo "

"; // include("popups.php"); echo "Ne pare rau dar nu ai permisiunea pentru a vedea continutul acestui forum!

"; echo "Prim"; echo "

"; echo "
"; echo ""; exit(); } $tinfo = mysql_fetch_array(mysql_query("SELECT name, text, authorid, crdate, views, fid, pollid from lib3rtymrc_topics WHERE id='".$tid."'")); $tnm = htmlspecialchars($tinfo[0]); echo ""; echo "

"; //include("popups.php"); $num_pages = getnumpages($tid); if($page==""||$page<1)$page=1; if($go!="")$page=getpage_go($go,$tid); $posts_per_page = 5; if($page>$num_pages)$page=$num_pages; $limit_start = $posts_per_page *($page-1); //echo "»Posteaza raspuns«"; $lastlink = "[Ultima pagina]"; $firstlink = "[Prima pagina] "; $golink = ""; if($page>1) { $golink = $firstlink; } if($page<$num_pages) { $golink .= $lastlink; } if($golink !="") { echo "
$golink"; } echo "

"; echo "

"; $vws = $tinfo[4]+1; $rpls = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_posts WHERE tid='".$tid."'")); echo "Raspunsuri: $rpls[0] - Vazut: $vws
"; //$tid = $_GET["tid"]; //echo "Link: [topic=$tid]topic[/topic]
"; ///fm here if($page==1) { $posts_per_page=4; mysql_query("UPDATE lib3rtymrc_topics SET views='".$vws."' WHERE id='".$tid."'"); $ttext = mysql_fetch_array(mysql_query("SELECT authorid, text, crdate, pollid FROM lib3rtymrc_topics WHERE id='".$tid."'")); $unick = getnick_uid($ttext[0]); if(isonline($ttext[0])) { $iml = "\"+\"/"; }else{ $iml = "\"-\"/"; } $usl = "
»$iml".getsimbol($ttext[0])."$unick"; //$topt = "*"; if($go==$tid) { $fli = "\"!\"/"; }else{ $fli =""; } $pst = parsemsg($ttext[1],$sid); echo "$usl: $fli$pst $topt
"; $dtot = date("d-m-y - H:i:s",$ttext[2]); echo "
"; if($ttext[3]>0) { echo "»Chestionar
"; } } if($page>1) { $limit_start--; } $sql = "SELECT id, text, uid, dtpost, quote FROM lib3rtymrc_posts WHERE tid='".$tid."' ORDER BY dtpost LIMIT $limit_start, $posts_per_page"; $posts = mysql_query($sql); while($post = mysql_fetch_array($posts)) { $unick = getnick_uid($post[2]); if(isonline($post[2])) { $iml = "\"+\"/"; }else{ $iml = "\"-\"/"; } $usl = "
»$iml ".getsimbol($post[2])."$unick"; $pst = parsemsg($post[1], $sid); //$topt = "[*]"; if($post[4]>0) { $qtl = "(quote:p=blaze,d=16-04-2006)"; } if($go==$post[0]) { $fli = "\"!\"/"; }else{ $fli =""; } echo "$usl: $fli$pst $topt
"; $dtot = date("d-m-y - H:i:s",$post[3]); // echo $dtot; echo "
"; } ///to here echo "

"; echo "

"; echo "-----
"; echo "

"; echo "

"; if($page>1) { $ppage = $page-1; echo "«pagina anterioara
"; } if($page<$num_pages) { $npage = $page+1; echo "pagina urmatoare»"; } echo "
Pagina $page din $num_pages
"; if($num_pages>2) { $rets = "Dute la pagina"; $rets .= "[Dute]"; $rets .= ""; $rets .= ""; $rets .= ""; $rets .= ""; $rets .= ""; $rets .= ""; echo $rets; } echo "
"; echo "

"; echo "

"; $fid = $tinfo[5]; $fname = getfname($fid); $cid = mysql_fetch_array(mysql_query("SELECT cid FROM lib3rtymrc_forums WHERE id='".$fid."'")); $cinfo = mysql_fetch_array(mysql_query("SELECT name FROM lib3rtymrc_fcats WHERE id='".$cid[0]."'")); $cname = $cinfo[0]; $cid = mysql_fetch_array(mysql_query("SELECT cid FROM lib3rtymrc_forums WHERE id='".$fid."'")); if($cid[0]>0) { $cinfo = mysql_fetch_array(mysql_query("SELECT name FROM lib3rtymrc_fcats WHERE id='".$cid[0]."'")); $cname = htmlspecialchars($cinfo[0]); echo "Forum »|"; echo "$cname
"; }else{ $cid = mysql_fetch_array(mysql_query("SELECT clubid FROM lib3rtymrc_forums WHERE id='".$fid."'")); $cinfo = mysql_fetch_array(mysql_query("SELECT name FROM lib3rtymrc_clubs WHERE id='".$cid[0]."'")); $cname = htmlspecialchars($cinfo[0]); echo ""; echo "$cname Club
"; } $fname = htmlspecialchars($fname); echo "Categorie»$fname » $tnm"; echo "
"; echo "«Prim"; echo "

"; echo "
"; } //////////////////////////////////View Forum else if($action=="viewfrm") { ///// $fid = $_GET["fid"]; $view = $_GET["view"]; if(!canaccess(getuid_sid($sid), $fid)) { addonline(getuid_sid($sid),"Pierdut in forumuri",""); echo ""; echo "

"; //include("popups.php"); echo "Nu ai permisiunea de a vedea continutul acestui forum

"; echo "Prim"; echo "

"; echo "
"; echo ""; exit(); } $finfo = mysql_fetch_array(mysql_query("SELECT name from lib3rtymrc_forums WHERE id='".$fid."'")); $fnm = htmlspecialchars($finfo[0]); addonline(getuid_sid($sid),"Vizualizare forum $fnm",""); echo ""; echo "

"; //include("popups.php"); $norf = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_rss WHERE fid='".$fid."'")); if($norf[0]>0) { echo "\"rss\"/$finfo[0] Extras
"; } echo "Vizualizeaza: "; echo " [Efectueaza]"; echo ""; echo ""; echo ""; echo ""; echo "
"; if($view=="new") { echo "Vizualizeaza topicurile cu postari noi de la ultima vizita"; }else if($view=="myps") { echo "Vizualizeaza topicurile in care ai postat"; }else { echo "Vizualizeaza toate topicurile"; } echo "

"; echo "

"; echo ""; if($page=="" || $page<=0)$page=1; if($page==1) { ///////////pinned topics $topics = mysql_query("SELECT id, name, closed, views, pollid FROM lib3rtymrc_topics WHERE fid='".$fid."' AND pinned='1' ORDER BY lastpost DESC, name, id LIMIT 0,5"); while($topic = mysql_fetch_array($topics)) { $iml = "\"*\"/"; $iml = "*"; $atxt =""; if($topic[2]=='1') { //closed $atxt = "(X)"; } if($topic[4]>0) { $pltx = "(P)"; }else{ $pltx = ""; } $tnm = htmlspecialchars($topic[1]); $nop = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_posts WHERE tid='".$topic[0]."'")); echo "$iml$pltx$tnm($nop[0])$atxt
"; } echo "
"; } $uid = getuid_sid($sid); if($view=="new") { $ulv = mysql_fetch_array(mysql_query("SELECT lastvst FROM lib3rtymrc_users WHERE id='".$uid."'")); $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_topics WHERE fid='".$fid."' AND pinned='0' AND lastpost >='".$ulv[0]."'")); } else if($view=="myps") { $noi = mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT a.id) FROM lib3rtymrc_topics a INNER JOIN lib3rtymrc_posts b ON a.id = b.tid WHERE a.fid='".$fid."' AND a.pinned='0' AND b.uid='".$uid."'")); } else{ $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_topics WHERE fid='".$fid."' AND pinned='0'")); } $num_items = $noi[0]; //changable $items_per_page= 10; $num_pages = ceil($num_items/$items_per_page); if($page>$num_pages)$page= $num_pages; $limit_start = ($page-1)*$items_per_page; if($limit_start<0)$limit_start=0; if($view=="new") { $ulv = mysql_fetch_array(mysql_query("SELECT lastvst FROM lib3rtymrc_users WHERE id='".$uid."'")); $topics = mysql_query("SELECT id, name, closed, views, moved, pollid FROM lib3rtymrc_topics WHERE fid='".$fid."' AND pinned='0' AND lastpost >='".$ulv[0]."' ORDER BY lastpost DESC, name, id LIMIT $limit_start, $items_per_page"); } else if($view=="myps"){ $topics = mysql_query("SELECT a.id, a.name, a.closed, a.views, a.moved, a.pollid FROM lib3rtymrc_topics a INNER JOIN lib3rtymrc_posts b ON a.id = b.tid WHERE a.fid='".$fid."' AND a.pinned='0' AND b.uid='".$uid."' GROUP BY a.id ORDER BY a.lastpost DESC, a.name, a.id LIMIT $limit_start, $items_per_page"); } else{ $topics = mysql_query("SELECT id, name, closed, views, moved, pollid FROM lib3rtymrc_topics WHERE fid='".$fid."' AND pinned='0' ORDER BY lastpost DESC, name, id LIMIT $limit_start, $items_per_page"); } while($topic = mysql_fetch_array($topics)) { $nop = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_posts WHERE tid='".$topic[0]."'")); $iml = "\"*\"/"; if($nop[0]>24) { $iml = "\"*\"/"; } if($topic[4]=='1') { $iml = "\"*\"/"; } if($topic[2]=='1') { $iml = "\"*\"/"; } if($topic[5]>0) { $iml = "\"*\"/"; } $atxt =""; if($topic[2]=='1') { //closed $atxt = "(X)"; } $tnm = htmlspecialchars($topic[1]); echo "$iml$tnm($nop[0])$atxt
"; } echo "
"; echo "

"; echo "

"; if($page>1) { $ppage = $page-1; echo "«Inapoi "; } if($page<$num_pages) { $npage = $page+1; echo "Inainte»"; } echo "
$page/$num_pages
"; if($num_pages>2) { $rets = "Dute la pagina"; $rets .= "[Dute]"; $rets .= ""; $rets .= ""; $rets .= ""; $rets .= ""; $rets .= ""; $rets .= ""; $rets .= ""; echo $rets; } echo "

"; $cid = mysql_fetch_array(mysql_query("SELECT cid FROM lib3rtymrc_forums WHERE id='".$fid."'")); if($cid[0]>0) { $cinfo = mysql_fetch_array(mysql_query("SELECT name FROM lib3rtymrc_fcats WHERE id='".$cid[0]."'")); $cname = htmlspecialchars($cinfo[0]); echo ""; echo "$cname
"; }else{ $cid = mysql_fetch_array(mysql_query("SELECT clubid FROM lib3rtymrc_forums WHERE id='".$fid."'")); $cinfo = mysql_fetch_array(mysql_query("SELECT name FROM lib3rtymrc_clubs WHERE id='".$cid[0]."'")); $cname = htmlspecialchars($cinfo[0]); echo ""; echo "$cname Club
"; } echo "\"*\"/"; echo "Prim"; echo "

"; echo "
"; } /////////////////////////////////////////////////////////////////Chestionare else if($action=="viewtpl") { $who = $_GET["who"]; addonline(getuid_sid($sid),"Vizualizare chestionar",""); echo ""; echo "

"; $uid = getuid_sid($sid); $pollid = mysql_fetch_array(mysql_query("SELECT pollid FROM lib3rtymrc_topics WHERE id='".$who."'")); if($pollid[0]>0) { $polli = mysql_fetch_array(mysql_query("SELECT id, pqst, opt1, opt2, opt3, opt4, opt5, pdt FROM lib3rtymrc_polls WHERE id='".$pollid[0]."'")); if(trim($polli[1])!="") { $qst = parsepm($polli[1], $sid); echo $qst."

"; $vdone = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_presults WHERE uid='".$uid."' AND pid='".$pollid[0]."'")); $nov = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_presults WHERE pid='".$pollid[0]."'")); $nov = $nov[0]; if($vdone[0]>0) { $voted= TRUE; }else{ $voted = FALSE; } $opt1 = $polli[2]; if (trim($opt1)!="") { $opt1 = htmlspecialchars($opt1); $nov1 = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_presults WHERE pid='".$pollid[0]."' AND ans='1'")); $nov1 = $nov1[0]; if($nov>0) { $per = floor(($nov1/$nov)*100); $rests = "Voturi: $nov1($per%)"; }else{ $rests = "Voturi: 0(0%)"; } if($voted) { $lnk = "1.$opt1 $rests
"; }else{ $lnk = "1.$opt1 $rests
"; } echo "$lnk"; } $opt2 = $polli[3]; if (trim($opt2)!="") { $opt2 = htmlspecialchars($opt2); $nov2 = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_presults WHERE pid='".$pollid[0]."' AND ans='2'")); $nov2 = $nov2[0]; if($nov>0) { $per = floor(($nov2/$nov)*100); $rests = "Voturi: $nov2($per%)"; }else{ $rests = "Voturi: 0(0%)"; } if($voted) { $lnk = "2.$opt2 $rests
"; }else{ $lnk = "2.$opt2 $rests
"; } echo "$lnk"; } $opt3 = $polli[4]; if (trim($opt3)!="") { $opt3 = htmlspecialchars($opt3); $nov3 = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_presults WHERE pid='".$pollid[0]."' AND ans='3'")); $nov3 = $nov3[0]; if($nov>0) { $per = floor(($nov3/$nov)*100); $rests = "Voturi: $nov3($per%)"; }else{ $rests = "Voturi: 0(0%)"; } if($voted) { $lnk = "3.$opt3 $rests
"; }else{ $lnk = "3.$opt3 $rests
"; } echo "$lnk"; } $opt4 = $polli[5]; if (trim($opt4)!="") { $opt4 = htmlspecialchars($opt4); $nov4 = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_presults WHERE pid='".$pollid[0]."' AND ans='4'")); $nov4 = $nov4[0]; if($nov>0) { $per = floor(($nov4/$nov)*100); $rests = "Voturi: $nov4($per%)"; }else{ $rests = "Voturi: 0(0%)"; } if($voted) { $lnk = "4.$opt4 $rests
"; }else{ $lnk = "4.$opt4 $rests
"; } echo "$lnk"; } $opt5 = $polli[6]; if (trim($opt5)!="") { $opt5 = htmlspecialchars($opt5); $nov5 = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_presults WHERE pid='".$pollid[0]."' AND ans='5'")); $nov5 = $nov5[0]; if($nov>0) { $per = floor(($nov5/$nov)*100); $rests = "Voturi: $nov5($per%)"; }else{ $rests = "Voturi: 0(0%)"; } if($voted) { $lnk = "5.$opt5 $rests
"; }else{ $lnk = "5.$opt5 $rests
"; } echo "$lnk"; } echo "".date("d m y - H:i",$polli[7]).""; }else{ echo "\"x\"/Acest user nu are chestionar"; } }else{ echo "\"x\"/Acest user nu are chestionar"; } echo "

"; echo "

"; echo "\"*\"/"; echo "Prim"; echo "

"; echo "
"; } /* /////////////////////////Main Page Here echo ""; echo "

"; echo "\"*\"/
"; //echo "welcome: guest

"; echo "Numele:

"; echo "Parola:

"; echo "autentificare"; echo ""; echo ""; echo ""; echo "

"; echo "
"; } */ ?>

XtGem Forum catalog