help

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

    help

    friends, pls tell me.. what should i edit the value to stop users to edit n delet their topics. .. its easy but jst nt getting the right place to edit.. chk this pls..



    //////////////////////////////////////////Post Options



    else if($action=="pstopt")

    {

    $pid = $_GET["pid"];

    $page = $_GET["page"];

    $fid = $_GET["fid"];

    addonline(getuid_sid($sid),"Post Options - xHTML","");

    $pinfo= mysql_fetch_array(mysql_query("SELECT uid,tid, text FROM ibwf_posts WHERE id='".$pid."'"));

    $trid = $pinfo[0];

    $tid = $pinfo[1];

    $ptext = htmlspecialchars($pinfo[2]);

    $pstyle = gettheme($sid);

    echo xhtmlhead("Post Options",$pstyle);

    echo popup($sid);

    echo "<onevent type=\"onenterforward\">";

    echo "<refresh>

    <setvar name=\"ptext\" value=\"$ptext\"/>";

    echo "</refresh></onevent>";

    echo "<p align=\"center\">";

    echo "<b>Post Options</b>";



    echo "</p>";

    echo "<p>";

    $trnick = getnick_uid($trid);

    echo ";<a href=\"121inbox121.php?action=sendpm&amp;sid=$sid& amp;who=$trid\">&#187;Send PM to $trnick</a><br/>";

    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$trid\">&#187;View $trnick's Profile</a><br/>";

    echo "<a href=\"index.php?action=post&amp;sid=$sid&amp;tid= $tid&amp;qut=$pid\">&#187;Quote</a><br/>";

    echo "<a href=\"121genproc121.php?action=rpost&amp;sid=$sid &amp;pid=$pid\">&#187;Report</a><br/>";

    echo "<a href=\"index.php?action=viewtpc&amp;sid=$sid&amp;t id=$tid&amp;page=$page\">&#171;Back to topic</a><br/><br/>";





    if(ismod(getuid_sid($sid)))

    {



    echo "<form method=\"post\" action=\"121mprocpl121.php?action=edtpst&amp;sid=$ sid&amp;pid=$pid\">";

    echo "Text: <input name=\"ptext\" value=\"$ptext\" maxlength=\"500\"/> ";

    echo "<input type=\"submit\" name=\"Submit\" value=\"Edit\"/><br/>";

    echo "</form>";



    echo "<br/><a href=\"121mprocpl121.php?action=delp&amp;sid=$sid& amp;pid=$pid\">&#187;DELETE</a><br/>";

    }

    else if($pinfo[0]==getuid_sid($sid))

    {

    echo "<form method=\"post\" action=\"121usertpc121.php?action=edtpst&amp;sid=$ sid&amp;pid=$pid\">";

    echo "Text: <input name=\"ptext\" value=\"$ptext\" maxlength=\"500\"/> ";

    echo "<input type=\"submit\" name=\"Submit\" value=\"Edit\"/><br/>";

    echo "</form>";

    }



    echo "</p>";

    echo "<p align=\"center\">";

    $thid = mysql_fetch_array(mysql_query("SELECT themeid FROM ibwf_users WHERE id='".$uid."'"));

    $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM ibwf_iconset WHERE id='".$thid[0]."'"));

    echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/themes/$themeimageset[0]/home.gif\" alt=\"*\"/>";

    echo "Home</a>";

    echo "</p>";

    echo xhtmlfoot();

    }



    else if($action=="tpcopt")

    {

    $tid = $_GET["tid"];

    addonline(getuid_sid($sid),"Topic Options - xHTML","");

    $tinfo= mysql_fetch_array(mysql_query("SELECT name,fid, authorid, text, pinned, closed FROM ibwf_topics WHERE id='".$tid."'"));

    $trid = $tinfo[2];

    $ttext = htmlspecialchars($tinfo[3]);

    $tname = htmlspecialchars($tinfo[0]);

    $pstyle = gettheme($sid);

    echo xhtmlhead("Topic Options",$pstyle);

    echo popup($sid);

    echo "<onevent type=\"onenterforward\">";

    echo "<refresh>

    <setvar name=\"ttext\" value=\"$ttext\"/>

    <setvar name=\"tname\" value=\"$tname\"/>";

    echo "</refresh></onevent>";

    echo "<p align=\"center\">";

    echo "<b>Topic Options</b>";



    echo "</p>";

    echo "<p>";

    echo "Topic ID: <b>$tid</b><br/>";

    $trnick = getnick_uid($trid);

    echo "<a href=\"121genproc121.php?action=bkmrk&amp;sid=$sid &amp;tid=$tid\">Bookmark This Topic</a><br/>";

    echo "<a href=\"121inbox121.php?action=sendpm&amp;sid=$sid& amp;who=$trid\">&#187;Send PM to $trnick</a><br/>";

    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$trid\">&#187;View $trnick's Profile</a><br/>";

    echo "<a href=\"index.php?action=post&amp;sid=$sid&amp;tid= $tid&amp;qut=$pid\">&#187;Quote</a><br/>";

    $plid = mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_topics WHERE id='".$tid."'"));

    if($plid[0]==0)

    {

    if(ismod($uid))

    {

    echo "<a href=\"index.php?action=pltpc&amp;sid=$sid&amp;tid =$tid\">&#187;Add Poll</a><br/>";

    }

    }else{

    if(ismod($uid))

    {

    echo "<a href=\"121genproc121.php?action=dltpl&amp;sid=$sid &amp;tid=$tid\">&#187;Delete Poll</a><br/>";

    }

    }

    echo "<a href=\"121genproc121.php?action=rtpc&amp;sid=$sid& amp;tid=$tid\">&#187;Report</a><br/>";

    echo "<a href=\"index.php?action=viewtpc&amp;sid=$sid&amp;t id=$tid&amp;page=1\">&#171;Back to topic</a><br/>";

    if(ismod(getuid_sid($sid)))

    {

    echo "<form method=\"post\" action=\"121mprocpl121.php?action=rentpc&amp;sid=$ sid&amp;tid=$tid\">";

    echo "<br/>Title: <input name=\"tname\" value=\"$tname\" maxlength=\"25\"/>";

    echo "<br/><input type=\"submit\" name=\"Submit\" value=\"Rename\"/><br/>";

    echo "</form>";



    echo "<form method=\"post\" action=\"121mprocpl121.php?action=edttpc&amp;sid=$ sid&amp;tid=$tid\">";

    echo "<br/>Text: <input name=\"ttext\" value=\"$ttext\" maxlength=\"500\"/> ";

    echo "<br/><input type=\"submit\" name=\"Submit\" value=\"Edit\"/><br/>";

    echo "</form>";

    if($trid ==$uid){

    echo "<form action=\"121genproc121.php?action=edtpst&amp;sid=$ sid&amp;pid=$pid\" method=\"post\">";

    echo "User Text: <input name=\"ptext\" value=\"$ptext\" maxlength=\"500\"/> ";

    echo "<input type=\"submit\" name=\"Submit\" value=\"Edit\"/><br/>";

    echo "</form>";

    }

    echo "<a href=\"121mprocpl121.php?action=delt&amp;sid=$sid& amp;tid=$tid\">&#187;DELETE</a><br/>";

    echo "<br/>";

    if($tinfo[5]=='1')

    {

    $ctxt = "Open";

    $cact = "0";

    }else{

    $ctxt = "Close";

    $cact = "1";

    }

    echo "<a href=\"121mprocpl121.php?action=clot&amp;sid=$sid& amp;tid=$tid&amp;tdo=$cact\">&#187;$ctxt</a><br/>";

    if($tinfo[4]=='1')

    {

    $ptxt = "Unpin";

    $pact = "0";

    }else{

    $ptxt = "Pin";

    $pact = "1";

    }

    #2
    This should work:
    if (ismod($uid)) { (place the content for mods }
    mysterio.al - programming is a functional art

    Comment


      #3
      Code:
      else if($pinfo[0]==getuid_sid($sid))
      
      {
      
      echo "<form method=\"post\" action=\"121usertpc121.php?action=edtpst&amp;sid=$ sid&amp;pid=$pid\">";
      
      echo "Text: <input name=\"ptext\" value=\"$ptext\" maxlength=\"500\"/> ";
      
      echo "<input type=\"submit\" name=\"Submit\" value=\"Edit\"/><br/>";
      
      echo "</form>";
      
      }
      just remove this part
      ________________
      Jacques
      jacques@gw-designs.co.za
      http://coding.biz.tm
      Come join and lets make it a place to learn all the noobies how to code
      __________________

      NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

      Comment


        #4
        ok. thnx riders mate..!!

        Comment


          #5
          i did the same.. but it didnt work.. hmm.. i edited the correct thing.. // bro.. do 1 thing, edit it my code. n post.. hope it work next time!!.. user who posted the topic is able to edit n delet his/her own topic. i want to restrict even editing own topic.

          Comment


            #6
            u must remove same in the viewtpc

            all the codes link to usertpc.php u must remove from ur index
            ________________
            Jacques
            jacques@gw-designs.co.za
            http://coding.biz.tm
            Come join and lets make it a place to learn all the noobies how to code
            __________________

            NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

            Comment


              #7
              all the codes. what do you mean by that?

              Comment

              Working...
              X