Working Share Plusses Script

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

    Working Share Plusses Script

    I only modified this script from Give Game Plusses script of my site.It is full working in lavalair wml version but in html the system said that Plusses Successfully updated but the when you view ya profile your plusses wasnt deducted also it wont added the user plusses you shared.In short,it wont updated at all in html version.So someone just fix it..or just try it first.

    #2
    Working Share Plusses

    Add this to genproc.php in wml version..

    //////////////////////////////////////////Give Plusses
    else if($action=="givepl")
    {
    addonline(getuid_sid($sid),"Giving Plusses","");
    $who = $_GET["who"];
    $ptg = $_POST["ptg"];
    echo "<card id=\"main\" title=\"Give Kamote\">";
    echo "<p align=\"center\">";
    //$uid = getuid_sid($sid);
    $gpsf = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
    $gpst = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'"));
    if($gpsf[0]>=$ptg){
    $gpsf = $gpsf[0]-$ptg;
    $gpst = $gpst[0]+$ptg;
    $res = mysql_query("UPDATE ibwf_users SET plusses='".$gpst."' WHERE id='".$who."'");
    if($res)
    {
    $res = mysql_query("UPDATE ibwf_users SET plusses='".$gpsf."' WHERE id='".$uid."'");
    echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Kamote Updated Successfully.!<br/>";
    $msg = "Hi! /reader,[br/] You had given $ptg Plusses successfully. :-) [br/]Huwag ng mgreply at ng walang gulo lol[br/]P.S: this is an automated pm";
    autopm($msg, $who);
    }else{
    echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!<br/>";
    }
    }else{
    echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You don't have enough plusses to give<br/>Pasaway Ka..<br/>";
    }

    echo "<br/>";

    echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
    echo "</p>";
    echo "</card>";
    }

    And add this to index.php wml version..

    //////////////////////////////////////////Give Plusses



    else if($action=="givepl")

    {

    $who = $_GET["who"];

    addonline(getuid_sid($sid),"Giving Plusses","");

    echo "<card id=\"main\" title=\"Share Kamote\">";

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

    echo "<refresh>

    <setvar name=\"tfgp\" value=\"0\"/>";

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

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

    echo "<b>Give Plusses To ".getnick_uid($who)."</b><br/><br/>";

    $nopl = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".getuid_sid($sid)."'"));

    echo "You have $nopl[0] plusses<br/><br/>";

    echo "Plusses To Give:<br/>";

    echo "<input name=\"tfgp\" format=\"*N\" maxlength=\"5\"/>";

    echo "<br/><anchor>Give";

    echo "<go href=\"genproc.php?action=givepl&amp;sid=$sid&amp; who=$who\" method=\"post\">";

    echo "<postfield name=\"ptg\" value=\"$(tfgp)\"/>";

    echo "</go></anchor>";

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

    echo "Home</a>";

    echo "</p>";

    echo "</card>";

    }

    Usage for this code is:

    if($uid !=$who)
    {
    echo "<a href=\"index.php?action=givepl&amp;sid=$sid&amp;wh o=$who\">Share Plusses</a>";
    }
    Last edited by l0rdrayven; 18.07.09, 08:23.

    Comment


      #3
      Add this to core.php html version.
      //////////////////////////////////////////Give GPs

      else if($action=="givepl")

      {

      addonline(getuid_sid($sid),"Giving Plusses","");

      $who = $_GET["who"];

      $ptg = $_POST["ptg"];

      echo "<head>";

      echo "<title>Give Kamote</title>";

      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";

      echo "</head>";

      echo "<body>";

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

      //$uid = getuid_sid($sid);

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

      $gpst = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'"));

      if($gpsf[0]>=$ptg){

      $gpsf = $gpsf[0]-$ptg;

      $gpst = $gpst[0]+$ptg;

      $res = mysql_query("UPDATE ibwf_users SET plusses='".$gpst."' WHERE id='".$who."'");

      if($res)

      {

      $res = mysql_query("UPDATE ibwf_users SET plusses='".$gpsf."' WHERE id='".$uid."'");

      echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Kamote Updated Successfully<br/>";
      $msg = "Hi! /reader,[br/] you had given $ptg plusses successfully. :-) [br/]Huwag ng mgreply at ng walang gulo lol[br/]P.S: this is an automated pm";
      autopm($msg, $who);

      }else{

      echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!<br/>";

      }

      }else{

      echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You don't have enough plusses to give<br/>Pasaway ka<br/>";

      }



      echo "<br/>";



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

      echo "</p>";

      echo "</body>";

      }
      Add this to index.php html version.
      //////////////////////////////////////////Give Plusses

      else if($action=="givepl")
      {
      $who = $_GET["who"];
      $mmsg = htmlspecialchars(getsetmood(getuid_sid($sid)));
      addonline(getuid_sid($sid),"Giving Plusses ($mmsg)","");
      echo "<head>";
      echo "<title>Give Kamote</title>";
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
      echo "</head>";
      echo "<body>";
      echo "<p align=\"center\">";
      echo "<b>Give Plusses To ".getnick_uid($who)."</b><br/><br/>";
      $nopl = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".getuid_sid($sid)."'"));
      echo "You have $nopl[0] plusses<br/><br/>";
      echo "Plusses To Give:<br/>";
      echo "<form action=\"genproc.php?action=givepl&amp;sid=$sid&am p;who=$who\" method=\"post\">";
      echo "<input name=\"tfgp\" style=\"-wap-input-format: '*N'\" maxlength=\"5\">";
      echo "<br/><input type=\"Submit\" Value=\"Give\" name=\"Give\"></form>";
      echo "<br/><br/><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo "</p>";
      echo "</body>";
      }
      The same usage code...

      Comment


        #4
        TAKE NOTE:
        Im just a noob and really trying hard to learn..The script is the same,wml and html but why plusses are not updated perfectly in html version unlike in wml that works perfectly.
        I forgot someone help to fix the part of Autopm message the username of the plusses giver doesnt appear in the message inbox tnt.

        Comment


          #5
          share pluses
          Code:
          //////////////////////////////////////////Share Plusses
          
          else if($action=="sharepl")
          {
            $who = $_GET["who"];
            addonline(getuid_sid($sid),"giving coins","");
            addlast(getuid_sid($sid),"giving coins","");
              echo "<card id=\"main\" title=\"Giving coins\">";
              echo "<onevent type=\"onenterforward\">";
              echo "<refresh>
                  <setvar name=\"tfgp\" value=\"0\"/>";
              echo "</refresh></onevent>";
            echo "<p align=\"center\">";
          echo "";
          echo "<br/>";
            echo "<b>Give Plusses To ".getnick_uid($who)."</b><br/><br/>";
            $kazz = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".getuid_sid($sid)."'"));
            echo "You have $kazz[0] Coins<br/><br/>";
            echo "Plusses to give<br/>";
            echo "<input name=\"tfgp\" format=\"*N\" maxlength=\"2\"/>";
            echo "<br/><anchor>Give";
            echo "<go href=\"genproc.php?action=sharepl&amp;sid=$sid&amp;who=$who\" method=\"post\">";
            echo "<postfield name=\"ptg\" value=\"$(tfgp)\"/>";
            echo "</go></anchor>";
            echo "<br/><br/><a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Home</a>";
            echo "</p>";
            echo "</card>";
          }
          in genproc add it
          Code:
          //////////////////////////////////////////Share plusses
          else if($action=="sharepl")
          {
              addonline(getuid_sid($sid),"Giving  Plusses","");
              $who = $_GET["who"];
              $ptg = $_POST["ptg"];
              $pres = trim($_POST["pres"]);
              echo "<card id=\"main\" title=\"Giving plusses\">";
            echo "<p align=\"center\">";
            //$uid = getuid_sid($sid);
            $psf = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$uid."'"));
            $pst = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$who."'"));
            if($psf[0]>=$ptg){
              $psf = $psf[0]-$ptg;
              $pst = $pst[0]+$ptg;
              $res = mysql_query("UPDATE ibwf_users SET plusses='".$pst."' WHERE id='".$who."'");
            if($res)
                  {
                    $res = mysql_query("UPDATE ibwf_users SET plusses='".$psf."' WHERE id='".$uid."'");
           mysql_query("INSERT INTO ibwf_mlog SET action='shareplusses', details='<b>".getnick_uid(getuid_sid($sid))."</b> send plusses to<b> ".$unick."</b> the amount of: ".$ptg."', actdt='".time()."'");
                     mysql_query("UPDATE ibwf_users SET plussess=plusses-3 WHERE id='".$uid."'");
                     echo "Plusses Shared Successfully to $unick<br/>";
                    $msg = "".getnick_uid(getuid_sid($sid))." had shared $ptg plusses to you. LIVE MSG: $pres"."[br/][small]Note: This is an automatic PM[/small]";
          			autopm($msg, $who);
                  }else{
                    echo "Database Error!<br/>";
                  }
                }else{
                   $nopl = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".getuid_sid($sid)."'"));
                  echo "Yebba! not enough plusses!<br/>";
                  }
                echo "<br/>";
            
               echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo "Home</a>";
          echo "</p>";
            echo "</card>";
          }
          this will work for share plusses :P

          Comment


            #6
            yah it is w0rking but i w0nder why the html version d0nt w0rk even though i created a the same script.

            Comment


              #7
              convert it to html mine is work

              Comment

              Working...
              X