help

Started on the old forum in October 2009 · view the original in the archive · old links redirect here

6 replies · 347 views · started 17 years ago · 2 min read

3 participants
icedroplet1987 Senior · 258 posts #1

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

echo "Post Options";

echo " ";

echo " ";

$trnick = getnick_uid($trid);

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

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

echo "<a href="index.php?action=post&sid=$sid&tid=$tid&qut=$pid">»Quote</a> ";

echo "<a href="121genproc121.php?action=rpost&sid=$sid&pid=$pid">»Report</a> ";

echo "<a href="index.php?action=viewtpc&sid=$sid&tid=$tid&page=$page">«Back to topic</a>

";

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\"/>

";

 echo "</form>";

echo " <a href="121mprocpl121.php?action=delp&sid=$sid&pid=$pid">»DELETE</a> ";

}

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

{

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

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

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

";

 echo "</form>";

 }

echo " ";

echo " ";

$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 " ";

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

echo "Topic Options";

echo " ";

echo " ";

echo "Topic ID: $tid ";

$trnick = getnick_uid($trid);

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

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

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

echo "<a href="index.php?action=post&sid=$sid&tid=$tid&qut=$pid">»Quote</a> ";

$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&sid=$sid&tid=$tid">»Add Poll</a> ";

}

}else{

if(ismod($uid))

{

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

";

}

}

echo "<a href="121genproc121.php?action=rtpc&sid=$sid&tid=$tid">»Report</a> ";

echo "<a href="index.php?action=viewtpc&sid=$sid&tid=$tid&page=1">«Back to topic</a> ";

if(ismod(getuid_sid($sid)))

{

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

echo "

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

echo "

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

echo "</form>";

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

echo "

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

echo "

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

echo "</form>";

if($trid ==$uid){

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

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

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

 echo "</form>";

}

echo "<a href="121mprocpl121.php?action=delt&sid=$sid&tid=$tid">»DELETE</a> ";

echo "

";

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\">»$ctxt</a>

";

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

{

  $ptxt = "Unpin";

  $pact = "0";

}else{

    $ptxt = "Pin";

  $pact = "1";

}
Mysterio Lead · 630 posts #2

This should work: if (ismod($uid)) { (place the content for mods }

mysterio.al - programming is a functional art

riderz Lead · 975 posts #3
else if($pinfo[0]==getuid_sid($sid))

{

echo "<form method=\"post\" action=\"121usertpc121.php?action=edtpst&sid=$ sid&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

icedroplet1987 Senior · 258 posts #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.

riderz Lead · 975 posts #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

Write your reply now; next you create a free account (or sign in) and it is posted right away. 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