Can access forum

Started on the old forum in February 2011 · view the original in the archive · old links redirect here

10 replies · 657 views · started 15 years ago · 1 min read

5 participants
bigboss Developer · 110 posts #1

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]==458)
  {

    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

nclemale36 Lead · 537 posts #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 ?????

bigboss Developer · 110 posts #3

Ya, i have changed code in core also.

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

jsyguy23 Developer · 134 posts #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

bigboss Developer · 110 posts #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.

bigboss Developer · 110 posts #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 " New PM by : <a href="inbox.php?action=readpm&pmid=$item[1]&sid=$sid">$item[0]</a> ";

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

"; echo "<a href="index.php?action=main&sid=$sid">Main Menu</a>"; boxend(); echo "</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.

"; echo "<a href="index.php?action=main&sid=$sid">Main Menu</a>"; echo "</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 $tnm topic in $fname forum","index.php?action=$action&tid=$tid"); boxstart("$tnm"); $vws = $tinfo[4]+1; $num_pages = getnumpages($tid, $sid); echo "Subject: $tnm Viewed: $vws times Topic # $tid Page # $page of $num_pages Pages:"; $pagewa = 1; while ($pagewa<=$num_pages) { echo "[<a href="index.php?action=viewtpc&page=$pagewa&sid=$sid&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 " "; 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&sid=$sid&who=$ttext[0]">$unick</a>";} else if(isvip($ttext[0])) {$usl = "$iml<a href="index.php?action=viewuser&sid=$sid&who=$ttext[0]">$unick</a>";} else if(ismod($ttext[0])) {$usl = "$iml<a href="index.php?action=viewuser&sid=$sid&who=$ttext[0]">$unick</a>";} else if(ispre($ttext[0])) {$usl = "$iml<a href="index.php?action=viewuser&sid=$sid&who=$ttext[0]">$unick</a>";} else if(isbanned($ttext[0])) {$usl = "$iml<a href="index.php?action=viewuser&sid=$sid&who=$ttext[0]"><strike>$unick</strike></a>";} else {$usl = "$iml<a href="index.php?action=viewuser&sid=$sid&who=$ttext[0]">$unick</a>";} $topt = "<a href="index.php?action=tpcopt&sid=$sid&tid=$tid">*</a>"; $thnk = "<a href="genproc.php?action=thanks&sid=$sid&tid=$tid">[Thnx]</a>";

if($go==$tid) { $fli = "<img src="../images/flag.gif" alt="!"/>"; }else{ $fli =""; } $pst = parsemsg($ttext[1],$sid); echo " $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&sid=$sid&tid=$tid">[Unlike]</a> ";

}else{

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

}

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

";

if($ttext[3]>0){ echo "<a href="index.php?action=viewtpl&sid=$sid&who=$tid">POLL</a> "; } } 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&sid=$sid&who=$post[2]">$unick</a>";} else if(isvip($post[2])) {$usl = "$iml<a href="index.php?action=viewuser&sid=$sid&who=$post[2]">$unick</a>";} else if(ismod($post[2])) {$usl = "$iml<a href="index.php?action=viewuser&sid=$sid&who=$post[2]">$unick</a>";} else if(ispre($post[2])) {$usl = "$iml<a href="index.php?action=viewuser&sid=$sid&who=$post[2]">$unick</a>";} else if(isbanned($post[2])) {$usl = "$iml<a href="index.php?action=viewuser&sid=$sid&who=$post[2])"><strike>$unick</strike></a>";} else {$usl = "$iml<a href="index.php?action=viewuser&sid=$sid&who=$post[2]">$unick</a>";}

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

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

echo " $usl: $topt $quop ";

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

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

if($quo==NULL) {echo "";} else {echo "

"; echo "$quo"; echo "

";} echo " $pst "; } echo " ";

boxend(); echo ""; if($page<$num_pages){ $npage = $page+1; echo "<a href="index.php?action=viewtpc&page=$npage&sid=$sid&tid=$tid">Next»</a> "; } if($page>1){ $ppage = $page-1; echo "<a href="index.php?action=viewtpc&page=$ppage&sid=$sid&tid=$tid">«Previous</a>"; } echo " Add reply:

<form action=\"genproc.php?action=post&amp;sid=$sid\" method=\"post\">"; echo "<textarea id=\"inputText\" name=\"reptxt\"></textarea> ";

echo " <input type="hidden" name="tid" value="$tid"/> <input type="hidden" name="qut" value=""/> <input id="inputButton" type="submit" value="Send"/>

</form>"; echo " Page $page of $num_pages "; $fid = $tinfo[5]; $fname = getfname($fid); echo "<a href=\"index.php?action=viewfrm&amp;sid=$sid&amp;fid=$fid\">Back To $fname Forum</a>

"; getfooter($sid); }

bigboss Developer · 110 posts #9

hidden wrote:

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&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.

bigboss Developer · 110 posts #11

Now problem solved there was blocked some forum in ibwf_ass sql. I removed them.

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close