Award system

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

    Award system

    Who can help me to make this one work on lava script
    Code:
    $totaw = wsd_query("* WSIN ".WS_AWARDS." WSIS uid='$proid'","c");
    
    
    ////////////////////////////////
    
    if($wsm=="addaward2"){
    ws_admincheck();
    $color = ws_get_var("color");
    $message   = ws_get_var("message");
    $now   = time();
    $who   = ws_get_var("who");
    $personuid = ws_idfromuser($who);
    
    $a = wsd_query("".WS_AWARDS." (uid,award,note,datestamp) VALUES ('$personuid','$color','$message','$now')","i");
    if($a){
    $message = "Your award has been added!";
    }else{
    $message = "Error: your award has not been added try again!";
    }
    $button = "<a href=\"".$self."".$mode."admin2k\">Admin Zone</a><br/>";
    $what = Array("message","button");
    $with = Array($message,$button);
    ws_temp("ws_msg");
    }
    
    /////////////////////////////////////
    
    
    if($totaw >  0){
    $profileinfo .= "Awards: <a href=\"".$self."".$mode."awards&amp;proid=".$proid."\">".$totaw."</a><br/>";
    }
    ///////////////////////////////////////
    
    if($wsm=="awards"){
    $listname = "Awards";
    $mypage = ws_get_var("page");
    $page = ws_page($mypage);
    $proid = ws_get_var("proid");
    $awards = "";
    $limit = 10;
    $start = ($page - 1) * $limit;
    
    if(empty($proid)){
    $awardsql = wsd_query("* WSIN ".WS_AWARDS." LIMIT $start, $limit","n");
    } else {
    $awardsql = wsd_query("* WSIN ".WS_AWARDS." WSIS uid='$proid' LIMIT $start, $limit","n");
    }
    
    if(empty($proid)){
    $total = wsd_query("* WSIN ".WS_AWARDS."","c");
    } else {
    $total = wsd_query("* WSIN ".WS_AWARDS." WHERE uid='$proid'","c");
    }
    if(!empty($total)){
    while($row = mysql_fetch_array($awardsql)){
    
    if($settvar[0]=="1"){
    $awards .= "</p><p align=\"center\"><img src=\"http://coding-talk.com/images/".$row["award"].".png\" alt=\"".$row["award"]."\"/></p><p>";
    } else {
    $awards .= "<center><img src=\"http://coding-talk.com/images/".$row["award"].".png\" alt=\"".$row["award"]."\"/></center>";
    }
    
    $awards .= ws_prolink($row["uid"],ws_userfromid($row["uid"]))."<br/>";
    $awards .= $row["note"]."<br/>"; 
    $awards .= date("(g:i) D, d  y",$row["datestamp"]);
    $awards .= "<br/><br/>";
    
    
    
    }
    } else {
    
    if(empty($proid)){
    $awards .= "No Awards have been given yet<br/>";
    }else{
    $awards .= "This Member has no awards<br/>";
    }
    }
    
    if(!empty($proid)){
    $mybutton = "<a href=\"".$self."".$mode."profile&amp;proid=".$proid."\">Back to profile</a><br/>";
    }
    $tots = $limit * $page;
    $nav = ws_nav();
    $what = Array("online","nav","mybutton","listname");
    $with = Array($awards,$nav,$mybutton,$listname);
    ws_temp("ws_list"); 
    }
    
    //////////////////////////////////////////////////
    
    $a = wsd_delete("".WS_AWARDS." WSIS uid='$proid'");
    
    /////////////////////////////////////////////////
    
    CREATE TABLE IF NOT EXISTS `wst_awards` (
      `id` int(255) NOT NULL auto_increment,
      `uid` varchar(1000) NOT NULL,
      `award` varchar(1000) NOT NULL,
      `note` varchar(1000) NOT NULL,
      `datestamp` varchar(1000) NOT NULL,
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
    got it out of wapside script
    Last edited by riderz; 12.08.09, 20:47.

    #2
    with all those functions you might aswell start from fresh and code your own :P*
    btw some of that code is missing :P

    Comment


      #3
      Instead of filing up the site with so many addons its better your first correct the addons you already have, coz the day you figure out that everything has become upside down, it will be too much of work..
      As something_else said.. the code is partial
      tinyurl.com/earnbymobile
      Easy earning for Indians
      ---------------------
      Alternative mobile advertising network .. Minimum 100 USD pay / NET15 pay cycle, Good Brand, Best targeting for Android
      goo.gl/6vub3

      Comment


        #4
        It is easier to code your own :d ... What that script should do ?
        whatmp3.name - search mp3 on mobile

        Comment


          #5
          well this code should be able when u have competitions u can award the person with a blue red yellow etc ribbon or anything u want like when the person wrote the best poem or most active user u give them the Award

          Comment


            #6
            just modify avatar script saves messing around (but dont give user option to change)

            Comment

            Working...
            X