Can access forum

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can access forum

    plz help me coder i have changed perm in my site but i m facing error in access forum. staff and club owner also cant open topic in club and newbie forum. this function is in my core.php
    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;
    }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]==456)
    {

    if(isowner($uid))
    {
    return true;
    }else{
    return false;
    }
    }

    if($ginfo[2]==457)
    {

    if(isheadadmin($uid))
    {
    return true;
    }else{
    return false;
    }
    }

    if($ginfo[2]==45
    {

    if(isadmin($uid))
    {
    return true;
    }else{
    return false;
    }
    }

    if($ginfo[2]==459)
    {

    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;
    }



    i have changed perm in my site like owner=456
    head admin=457
    admin=458
    mod=459

    plz what is mistake in my code??????? plz help me thanx in advance
    LoveForum.BiZ

    #2
    perm dosnt have to in any order . as long as the host knows what each number gives to what status it makes no difference.

    have you changed the isowner=4 isheadadmin=3 etc etc code in your core also ?????
    Wapchat4u


    Topsites4u

    Comment


      #3
      Ya, i have changed code in core also.

      Now perm are descending still staff cant view topic in club and newbie forum.
      LoveForum.BiZ

      Comment


        #4
        $uperms = mysql_fetch_array(mysql_query("SELECT birthday, perm, posts, plusses FROM ibwf_users WHERE id='".$uid."'")); try this line i can still see perm lol

        Comment


          #5
          Go and check ismod function, change it from 1 to ur new no. Note default ismod==1 and default ismod2>0. So check and change ismod==459
          have connected with http://adexchat.com ?
          Fun up with
          http://forum.adexchat.com

          Comment


            #6
            I already changed perm for ismod=456 though staff cant see club topic.

            Added after 2 minutes:

            Plz something else or subzro add this function canaccess for my perms. Mod=456, admin=457, headadmin=458, owner=459.
            Last edited by bigboss; 02.02.11, 12:57.
            LoveForum.BiZ

            Comment


              #7
              Then that mean ur error not from core. Then post ur action topic here. I and the part where staff and clubowner can not view.
              have connected with http://adexchat.com ?
              Fun up with
              http://forum.adexchat.com

              Comment


                #8
                //////////////////////////////////View Topic///////////////////
                else if($action=="viewtpc"){

                gettimebar();
                $umsg = getunreadpm(getuid_sid($sid));
                $item = mysql_fetch_array(mysql_query("SELECT
                a.name, b.id FROM ibwf_users a
                INNER JOIN ibwf_private b ON a.id = b.byuid
                WHERE b.touid='".$uid."' AND b.unread='1'
                ORDER BY b.timesent DESC
                LIMIT 1"));

                if($umsg>0)
                {

                echo "<br/><b>New PM by : <a href=\"inbox.php?action=readpm&amp;pmid=$item[1]&amp;sid=$sid\">$item[0]</a></b><br/>";

                }
                getalert($sid);
                $tid = $_GET["tid"];
                $go = $_GET["go"];
                $seer = getuid_sid($sid);

                $tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'"));
                $fname = getfname($tfid[0]);


                if (isforumblocked($uid)){
                boxstart("Error!");
                echo "<img src=\"notok.gif\"/>";
                echo "Your forum access has been blocked by a moderator!!!<br/><br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\">Main Menu</a>";
                boxend();
                echo "</font></body></html>";
                exit();
                }
                if(!canaccess($uid, $tfid[0])){
                boxstart("Error!");
                echo "<img src=\"notok.gif\"/>";
                echo "This post belongs to $fname forum which is not available to you presently. To read this post, join $fname club.<br/><br/>";
                echo "<a href=\"index.php?action=main&amp;sid=$sid\">Main Menu</a>";
                echo "</font></body></html>";
                exit();
                }

                if($go!="") {
                $page=getpage_go($go,$tid,$sid);
                }

                $tinfo = mysql_fetch_array(mysql_query("SELECT name, text, authorid, crdate, views, fid, pollid from ibwf_topics WHERE id='".$tid."'"));
                $tnm = htmlspecialchars($tinfo[0]);
                $namewa = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_forums WHERE id = $tinfo[5]"));
                $namewa1 = htmlspecialchars($namewa[0]);
                $indiatime = time() + (addhours());
                addonline($uid,"Viewing <i>$tnm</i> topic in $fname forum","index.php?action=$action&amp;tid=$tid");
                boxstart("$tnm");
                $vws = $tinfo[4]+1;
                $num_pages = getnumpages($tid, $sid);
                echo "Subject: $tnm<br/>Viewed: $vws times<br/>Topic # $tid<br/>Page # $page of $num_pages<br/>Pages:";
                $pagewa = 1;
                while ($pagewa<=$num_pages)
                {
                echo "[<a href=\"index.php?action=viewtpc&amp;page=$pagewa&a mp;sid=$sid&amp;tid=$tid\">$pagewa</a>]";
                $pagewa = $pagewa+1;
                };
                if($page==""||$page<1) {
                $page=1;
                }
                $posts_per_page = getppp($uid);
                if($page>$num_pages) {
                $page=$num_pages;
                }
                $limit_start = $posts_per_page *($page-1);
                $rpls = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE tid='".$tid."'"));
                ///fm here
                if($page==1){
                mysql_query("UPDATE ibwf_topics SET views='".$vws."' WHERE id='".$tid."'");
                $ttext = mysql_fetch_array(mysql_query("SELECT authorid, text, crdate, pollid FROM ibwf_topics WHERE id='".$tid."'"));
                $unick = getnick_uid($ttext[0]);




                echo "<p align=\"left\">";
                if(isonline($ttext[0])){
                $iml = "<img src=\"../images/onl.gif\" alt=\"+\"/>";
                }else{
                $iml = "<img src=\"../images/ofl.gif\" alt=\"-\"/>";
                }
                if(isowner($ttext[0]))
                {$usl = "$iml<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$ttext[0]\"><b><font color='red'>$unick</font></b></a>";}
                else if(isvip($ttext[0]))
                {$usl = "$iml<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$ttext[0]\"><b><font color='lightgreen'>$unick</font></b></a>";}
                else if(ismod($ttext[0]))
                {$usl = "$iml<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$ttext[0]\"><b><font color='green'>$unick</font></b></a>";}
                else if(ispre($ttext[0]))
                {$usl = "$iml<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$ttext[0]\"><b><font color='lime'>$unick</font></b></a>";}
                else if(isbanned($ttext[0]))
                {$usl = "$iml<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$ttext[0]\"><strike>$unick</strike></a>";}
                else
                {$usl = "$iml<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$ttext[0]\">$unick</a>";}
                $topt = "<a href=\"index.php?action=tpcopt&amp;sid=$sid&amp;ti d=$tid\">*</a>";
                $thnk = "<a href=\"genproc.php?action=thanks&amp;sid=$sid&amp; tid=$tid\">[Thnx]</a>";

                if($go==$tid)
                {
                $fli = "<img src=\"../images/flag.gif\" alt=\"!\"/>";
                }else{
                $fli ="";
                }
                $pst = parsemsg($ttext[1],$sid);
                echo "<br/>$usl: $topt $thnk";
                $vp = mysql_fetch_array(mysql_query("SELECT tid FROM fun_favtopic WHERE uid='".$uid."'"));



                if($tid==$vp[0])



                {



                echo "<a href=\"genproc.php?action=delfav&amp;sid=$sid&amp; tid=$tid\">[Unlike]</a><br/>";



                }else{



                echo "<a href=\"genproc.php?action=makefav&amp;sid=$sid&amp ;tid=$tid\">[Like]</a><br/>";



                }


                $indiatime = $ttext[2] + (addhours());
                $dtot = date("d/m/Y h:i:s A",$indiatime);
                echo $dtot."<br/>";
                echo "<br/>$pst<br/><br/>";

                if($ttext[3]>0){
                echo "<a href=\"index.php?action=viewtpl&amp;sid=$sid&amp;w ho=$tid\">POLL</a><br/>";
                }
                }
                if($page>1){
                $limit_start--;
                }
                $sql = "SELECT id, text, uid, dtpost FROM ibwf_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 = "<img src=\"../images/onl.gif\" alt=\"+\"/>";
                }else{
                $iml = "<img src=\"../images/ofl.gif\" alt=\"-\"/>";
                }
                if(isowner($post[2]))
                {$usl = "$iml<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$post[2]\"><b><font color='red'>$unick</font></b></a>";}
                else if(isvip($post[2]))
                {$usl = "$iml<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$post[2]\"><b><font color='lightgreen'>$unick</font></b></a>";}
                else if(ismod($post[2]))
                {$usl = "$iml<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$post[2]\"><b><font color='green'>$unick</font></b></a>";}
                else if(ispre($post[2]))
                {$usl = "$iml<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$post[2]\"><b><font color='lime'>$unick</font></b></a>";}
                else if(isbanned($post[2]))
                {$usl = "$iml<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$post[2])\"><strike>$unick</strike></a>";}
                else
                {$usl = "$iml<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$post[2]\">$unick</a>";}

                $pst = parsemsg($post[1], $sid);
                $quo = parsemsg($post[4], $sid);

                $topt = "<a href=\"index.php?action=pstopt&amp;sid=$sid&amp;pi d=$post[0]&amp;page=$page&amp;fid=$tinfo[5]\">*</a>";
                $quop = "<a href=\"index.php?action=quote&amp;sid=$sid&amp;pid =$post[0]&amp;tid=$tid\">[Q]</a>";
                if($go==$tid)
                {
                $fli = "<img src=\"../images/flag.gif\" alt=\"!\"/>";
                }else{
                $fli ="";
                }


                echo "<br/>$usl: $topt $quop<br/>";

                $indiantime = $post[3] + (addhours());

                $dtot = date("d/m/Y h:i:s A",$indiantime);
                echo $dtot."<br/>";


                if($quo==NULL)
                {echo "";}
                else
                {echo "<br/>----<br/>";
                echo "$quo";
                echo "<br/>----<br/>";}
                echo "<br/>$pst<br/>";
                }
                echo "</p>";

                boxend();
                echo "<center>";
                if($page<$num_pages){
                $npage = $page+1;
                echo "<a href=\"index.php?action=viewtpc&amp;page=$npage&am p;sid=$sid&amp;tid=$tid\">Next&#187;</a><br/>";
                }
                if($page>1){
                $ppage = $page-1;
                echo "<a href=\"index.php?action=viewtpc&amp;page=$ppage&am p;sid=$sid&amp;tid=$tid\">&#171;Previous</a>";
                }
                echo "<br/>Add reply:<br/><form action=\"genproc.php?action=post&amp;sid=$sid\" method=\"post\">";
                echo "<textarea id=\"inputText\" name=\"reptxt\"></textarea><br/>";

                echo "
                <input type=\"hidden\" name=\"tid\" value=\"$tid\"/>
                <input type=\"hidden\" name=\"qut\" value=\"\"/>
                <input id=\"inputButton\" type=\"submit\" value=\"Send\"/>
                </form></center>";
                echo "<p align=\"center\">Page $page of $num_pages<br/>";
                $fid = $tinfo[5];
                $fname = getfname($fid);
                echo "<a href=\"index.php?action=viewfrm&amp;sid=$sid&amp;f id=$fid\">Back To $fname Forum</a><br/><br/></p>";
                getfooter($sid);
                }
                LoveForum.BiZ

                Comment


                  #9
                  Originally posted by hidden
                  Code:
                  if(!canaccess(getuid_sid($sid), $tfid[0])){
                  boxstart("Error!");
                  echo "<img src=\"notok.gif\"/>";
                  echo "This post belongs to $fname forum which is not available to you presently. To read this post, join $fname club.<br/><br/>";
                  echo "<a href=\"index.php?action=main&amp;sid=$sid\">Main Menu</a>";
                  echo "</font></body></html>";
                  exit();
                  }
                  Now copy paste it

                  Thanx a lot Bro. Now staff can see topic of users club but still have problem in newbie forum staff and members cant see topics of Newbie forum so plz help me again abt this problem.
                  LoveForum.BiZ

                  Comment


                    #10
                    look at
                    PHP Code:
                    ismod function 
                    com site: http://vampist.net
                    download site: http://wapdloads.net
                    fb: http://www.facebook.com/pmplx

                    Comment


                      #11
                      Now problem solved there was blocked some forum in ibwf_ass sql. I removed them.
                      LoveForum.BiZ

                      Comment

                      Working...
                      X