Pluses In Every Action

Started on the old forum in January 2008 · view the original in the archive · old links redirect here

19 replies · 1,046 views · started 18 years ago · 1 min read

5 participants
alexism Developer · 136 posts #1

how to make a coding that user can get pluses or credit in every action such as adding polls, blogs, delete pm and others action..how?

WhiteWarrior Principal · 1,419 posts #2

Use somethng like this in every action

$uipa = $uipa+1;
$uip = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
$uip = $uipa + $uip[0];
mysql_query("UPDATE ibwf_users SET plusses='".$uip."' WHERE id='".$uid."'");
alexism Developer · 136 posts #3

where must i put that code?

else if($action=="newtopic") { $fid = $_GET["fid"]; if(!canaccess(getuid_sid($sid), $fid)) <------here? { echo "<card id="main" title="$sitename">"; <------here? echo " "; echo "You Don't Have A Permission To View The Contents Of This Forum

"; echo "<a href="index.php?action=main&sid=$sid">Home</a>"; echo " "; echo "</card>"; echo "</wml>"; exit(); } addonline(getuid_sid($sid),"Creating new topic","index.php?action=online"); echo "<card id="main" title="New Topic">"; echo " "; echo "Title:<input name="ntitle" maxlength="30"/> "; echo "Text:<input name="tpctxt" maxlength="500"/> "; echo "<anchor>Create"; echo " <go href="genproc.php?action=newtopic&sid=$sid" method="post"> <postfield name="fid" value="$fid"/> <postfield name="ntitle" value="$(ntitle)"/> <postfield name="tpctxt" value="$(tpctxt)"/> </go> "; echo "</anchor>"; echo "

<a href="index.php?action=viewfrm&sid=$sid&fid=$fid">"; $fname = getfname($fid); echo "$fname</a> "; echo "<a href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt="*"/>"; echo "Home</a>";

echo "

"; echo "</card>"; }

where?

rukiya Lead · 569 posts #4
addonline(getuid_sid($sid),"Creating new topic","index.php?action=online");
echo "<card id=\"main\" title=\"New Topic\">";
echo "<p align=\"center\">";
if(getplusses(getuid_sid($sid))<20)
{
  echo "
You need at least 20 plusses to create a topic!
";
  }
else{

echo "Title:<input name=\"ntitle\" maxlength=\"30\"/>
";
echo "Text:<input name=\"tpctxt\" maxlength=\"500\"/>
";
echo "<anchor>Create";
echo "
<go href=\"genproc.php?action=newtopic&sid=$sid\" method=\"post\">
<postfield name=\"fid\" value=\"$fid\"/>
<postfield name=\"ntitle\" value=\"$(ntitle)\"/>
<postfield name=\"tpctxt\" value=\"$(tpctxt)\"/>
</go>
";
echo "</anchor>";
}
alexism Developer · 136 posts #5

that help me nothing rukia..ur reply r not related to my post..im asking how to give user pluses in every action..white warrior have give me the code but i dont know where to place the code n i use create new topic action as example..but i want to know where i must put the code that white warrior give to me??

alexism Developer · 136 posts #7

ok this is the sample from my genproc.php.where must i put the code?

else if($action=="post") { $tid = $_POST["tid"]; $tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'")); <------here?------> if(!canaccess(getuid_sid($sid), $tfid[0])) { echo "<head>"; echo "<title>$sitename</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo " "; echo "You Don't Have A Permission To View The Contents Of This Forum

"; echo "0<a accesskey="0" href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; echo " "; echo "</body>"; echo "</html>"; exit(); } <------here?------> $reptxt = $_POST["reptxt"]; $qut = $_POST["qut"]; addonline(getuid_sid($sid),"Posted A reply",""); echo "<head>"; echo "<title>$sitename</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo " "; $crdate = time(); $fid = getfid($tid); //$uid = getuid_sid($sid); $res = false; $closed = mysql_fetch_array(mysql_query("SELECT closed FROM ibwf_topics WHERE id='".$tid."'"));

  if(($closed[0]!='1')||(ismod($uid)))
  {
  
    $lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM ibwf_posts WHERE uid='".$uid."' ORDER BY dtpost DESC LIMIT 1"));
    global $post_af;
    $antiflood = time()-$lpost[0];
    if($antiflood>$post_af)

{ if(trim($reptxt)!="") { if(!isblocked($reptxt,$uid)) { $res = mysql_query("INSERT INTO ibwf_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'"); }else{ $bantime = time() + (302460*60); echo "<img src="../images/notok.gif" alt="X"/>"; echo "Can't Post Reply

"; echo "You just tried posting a reply with a link to one of the crapiest sites on earth The members of these sites spam here a lot, so go to that site and stay there if you don't like it here as a result of your stupid action:

  1. you have lost your sheild
  2. you have lost all your plusses
  3. You are BANNED!"; $user = getnick_sid($sid); mysql_query("INSERT INTO ibwf_mlog SET action='autoban', details='Wap Desire auto banned $user for spamming forums', actdt='".time()."'"); mysql_query("INSERT INTO ibwf_penalties SET uid='".$uid."', penalty='1', exid='2', timeto='".$bantime."', pnreas='Banned: Automatic Ban for spamming for a crap site'"); mysql_query("UPDATE ibwf_users SET plusses='0', shield='0' WHERE id='".$uid."'"); echo "</body>"; echo "</html>"; exit(); } } if($res) { $usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'")); $res2 = mysql_fetch_array(mysql_query("SELECT name, authorid FROM ibwf_topics WHERE id='".$tid."'")); $usr = getnick_uid($uid); $tname = htmlspecialchars($res2[0]); if(($res2[1]!=$uid)&&(automsgs($res2[1]))){ $msg = "Your Topic $tname"." has been Replied to by $usr [br/][small]p.s: this is an automated pm[/small]"; autopm($msg, $res2[1]); } $ups = $usts[0]+1; $upl = $usts[1]+1; mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'"); mysql_query("UPDATE ibwf_topics SET lastpost='".$crdate."' WHERE id='".$tid."'"); echo "<img src="../images/ok.gif" alt="O"/>Message Posted Successfully"; echo "

8<a accesskey="8" href="index.php?action=viewtpc&sid=$sid&tid=$tid&go=last">View Topic</a>"; }else{ echo "<img src="../images/notok.gif" alt="X"/>Error Posting Message"; } }else{ $af = $post_af -$antiflood; echo "<img src="../images/notok.gif" alt="X"/>Antiflood Control: $af"; } }else{ echo "<img src="../images/notok.gif" alt="X"/>Topic is closed for posting"; }

  $fname = getfname($fid);
  echo "

9<a accesskey="9" href="index.php?action=viewfrm&sid=$sid&fid=$fid">$fname</a> "; echo "0<a accesskey="0" href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; echo " "; echo "</body>";

}

where?

rukiya Lead · 569 posts #8

ok this is the sample from my genproc.php.where must i put the code?

else if($action=="post") { $tid = $_POST["tid"]; $tfid = mysql_fetch_array(mysql_query("SELECT fid FROM ibwf_topics WHERE id='".$tid."'")); <------here?------> if(!canaccess(getuid_sid($sid), $tfid[0])) { echo "<head>"; echo "<title>$sitename</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo " "; echo "You Don't Have A Permission To View The Contents Of This Forum

"; echo "0<a accesskey="0" href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; echo " "; echo "</body>"; echo "</html>"; exit(); } <------here?------> $reptxt = $_POST["reptxt"]; $qut = $_POST["qut"]; addonline(getuid_sid($sid),"Posted A reply",""); echo "<head>"; echo "<title>$sitename</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo " "; $crdate = time(); $fid = getfid($tid); //$uid = getuid_sid($sid); $res = false; $closed = mysql_fetch_array(mysql_query("SELECT closed FROM ibwf_topics WHERE id='".$tid."'"));

if(($closed[0]!='1')||(ismod($uid))) {

$lpost = mysql_fetch_array(mysql_query("SELECT dtpost FROM ibwf_posts WHERE uid='".$uid."' ORDER BY dtpost DESC LIMIT 1")); global $post_af; $antiflood = time()-$lpost[0]; if($antiflood>$post_af) { if(trim($reptxt)!="") { if(!isblocked($reptxt,$uid)) { $res = mysql_query("INSERT INTO ibwf_posts SET text='".$reptxt."', tid='".$tid."', uid='".$uid."', dtpost='".$crdate."', quote='".$qut."'"); }else{ $bantime = time() + (302460*60); echo "<img src="../images/notok.gif" alt="X"/>"; echo "Can't Post Reply

"; echo "You just tried posting a reply with a link to one of the crapiest sites on earth The members of these sites spam here a lot, so go to that site and stay there if you don't like it here as a result of your stupid action:

  1. you have lost your sheild
  2. you have lost all your plusses
  3. You are BANNED!"; $user = getnick_sid($sid); mysql_query("INSERT INTO ibwf_mlog SET action='autoban', details='Wap Desire auto banned $user for spamming forums', actdt='".time()."'"); mysql_query("INSERT INTO ibwf_penalties SET uid='".$uid."', penalty='1', exid='2', timeto='".$bantime."', pnreas='Banned: Automatic Ban for spamming for a crap site'"); mysql_query("UPDATE ibwf_users SET plusses='0', shield='0' WHERE id='".$uid."'"); echo "</body>"; echo "</html>"; exit(); } } if($res) { $usts = mysql_fetch_array(mysql_query("SELECT posts, plusses FROM ibwf_users WHERE id='".$uid."'")); $res2 = mysql_fetch_array(mysql_query("SELECT name, authorid FROM ibwf_topics WHERE id='".$tid."'")); $usr = getnick_uid($uid); $tname = htmlspecialchars($res2[0]); if(($res2[1]!=$uid)&&(automsgs($res2[1]))){ $msg = "Your Topic $tname"." has been Replied to by $usr [br/][small]p.s: this is an automated pm[/small]"; autopm($msg, $res2[1]); }
$ups = $usts[0]+1;
$upl = $usts[1]+1;
mysql_query("UPDATE ibwf_users SET posts='".$ups."', plusses='".$upl."' WHERE id='".$uid."'");
mysql_query("UPDATE ibwf_topics SET lastpost='".$crdate."' WHERE id='".$tid."'");

echo "<img src="../images/ok.gif" alt="O"/>Message Posted Successfully"; echo "

8<a accesskey="8" href="index.php?action=viewtpc&sid=$sid&tid=$tid&go=last">View Topic</a>"; }else{ echo "<img src="../images/notok.gif" alt="X"/>Error Posting Message"; } }else{ $af = $post_af -$antiflood; echo "<img src="../images/notok.gif" alt="X"/>Antiflood Control: $af"; } }else{ echo "<img src="../images/notok.gif" alt="X"/>Topic is closed for posting"; }

$fname = getfname($fid); echo "

9<a accesskey="9" href="index.php?action=viewfrm&sid=$sid&fid=$fid">$fname</a> "; echo "0<a accesskey="0" href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; echo " "; echo "</body>";

}

mcKeny Developer · 130 posts #9

you already get pluses whenever you post ... if you want to give pluses for creating a topic just add that code WHERE you see topic successfully created.... if you want to add it on other actions just look in genproc.php and add it at the success areas..

R.M.C

PHP Adovocate B)

alexism Developer · 136 posts #10

ok i give a new example of sign guestbook coding..where must i put that code??

else if($action=="signgb") { $who = $_POST["who"];

if(!cansigngb(getuid_sid($sid), $who)) { echo "<head>"; echo "<title>$sitename</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo " "; echo "You cant Sign this user guestbook

"; echo "0<a accesskey="0" href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; echo " "; echo "</body>"; echo "</html>"; exit(); } $msgtxt = $_POST["msgtxt"]; //$qut = $_POST["qut"]; addonline(getuid_sid($sid),"Signing a guestbook",""); echo "<head>"; echo "<title>$sitename</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo " "; $crdate = time(); //$uid = getuid_sid($sid); $res = false;

  if(trim($msgtxt)!="")
  {
    
  $res = mysql_query("INSERT INTO ibwf_gbook SET gbowner='".$who."', gbsigner='".$uid."', dtime='".$crdate."', gbmsg='".$msgtxt."'");
  }
  if($res)
  {
    echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Message Posted Successfully";
  }else{
    echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error Posting Message";
  }
  
  echo "

"; echo "0<a accesskey="0" href="index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; echo " "; echo "</body>";

}

where?

mcKeny Developer · 130 posts #11

if you read what i said you wouldn't ask such question...i said you should add that code in genproc.php WHERE ever the result is success eg that code you got there you would add it WHERE it says if($res) {

HERE<< echo "message post successful"; }

R.M.C

PHP Adovocate B)

WhiteWarrior Principal · 1,419 posts #12
else if($action=="signgb")
{
$who = $_POST["who"];

if(!cansigngb(getuid_sid($sid), $who))
{
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
echo "You cant Sign this user guestbook

";
echo "[b]0 [/b]<a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p>";
echo "</body>";
echo "</html>";
exit();
}
$msgtxt = $_POST["msgtxt"];
//$qut = $_POST["qut"];
addonline(getuid_sid($sid),"Signing a guestbook","");
echo "<head>";
echo "<title>$sitename</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
$crdate = time();
//$uid = getuid_sid($sid);
$res = false;

if(trim($msgtxt)!="")
{

$res = mysql_query("INSERT INTO ibwf_gbook SET gbowner='".$who."', gbsigner='".$uid."', dtime='".$crdate."', gbmsg='".$msgtxt."'");
}
if($res)
{
$uipa = $uipa+1;
$uip = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
$uip = $uipa + $uip[0];
mysql_query("UPDATE ibwf_users SET plusses='".$uip."' WHERE id='".$uid."'");
echo "<img src=\"../images/ok.gif\" alt=\"O\"/>Message Posted Successfully";
}else{
echo "<img src=\"../images/notok.gif\" alt=\"X\"/>Error Posting Message";
}

echo "

";
echo "[b]0 [/b]<a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p>";
echo "</body>";

}

where you see the

if($res) { $uipa = $uipa+1; $uip = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'")); $uip = $uipa + $uip[0]; mysql_query("UPDATE ibwf_users SET plusses='".$uip."' WHERE id='".$uid."'"); echo "<img src="../images/ok.gif" alt="O"/>Message Posted Successfully"; }

add the code under that and it will update plusses on Success of posting new roply if you know what i mean?

alexism Developer · 136 posts #13

owh..i got it..!! thanks white warrior n mckeny..

cortez Junior · 27 posts #14

and i want to add plussses in chatroom i mean 5 chat msg get 1 plusses so how?

mcKeny Developer · 130 posts #15

try this

$uid = getuid_sid($sid);

$info = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chat WHERE uid='".$uid."'"));
if($info[0]>5)
{

$uipa = $uipa+1; 
$uip = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'")); 
$uip = $uipa +  $uip[0]; 
mysql_query("UPDATE ibwf_users SET plusses='".$uip."' WHERE id='".$uid."'"); 
}

R.M.C

PHP Adovocate B)

WhiteWarrior Principal · 1,419 posts #16
$uid = getuid_sid($sid);

$info = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chat WHERE uid='".$uid."'"));
if($info[0]>5)
{

$uipa = $uipa+1;
$uip = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
$uip = $uipa +  $uip[0];
mysql_query("UPDATE ibwf_users SET plusses='".$uip."' WHERE id='".$uid."'");
}

that will work but only give 1 plusses change it to this

$uid = getuid_sid($sid);

$info = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chat WHERE uid='".$uid."'"));
if($info[0]>5)
{

$uipa = $uipa+5;
$uip = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
$uip = $uipa +  $uip[0];
mysql_query("UPDATE ibwf_users SET plusses='".$uip."' WHERE id='".$uid."'");
}
Guest #20

no prob B)

hi guys can u help how to convert chat post and bps to pluses?? post the code how?? pls thanks 😢

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