Avatar On @ Off switch

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

    Avatar On @ Off switch

    Ok guys ive being playing around with these codes and stuff but still cant get it to work
    index.php
    Code:
     $showavatar = mysql_fetch_array(mysql_query("SELECT showavatar FROM ibwf_users WHERE id='".$uid."'"));
    Code:
     if($showavatar[0]=="1")
    {
    $avlink = getavatar($item[2]);
    if ($avlink!=""){
    echo "<img src=\"$avlink\" height=\"25\" width=\"25\" alt=\"avatar\"/>";
    }else{
    echo "<img src=\"/images/nopic.jpg\" height=\"25\" width=\"25\" alt=\"avatar\"/>";
    }
    }
    Code:
    echo "<small>Show Avatar online?:</small> <select name=\"showavatar\" value=\"$showavatar[0]\">";
        if($showshout[0]=="1"){
        echo "<option value=\"1\" selected=\"1\">Yes</option>";
        }else{
        echo "<option value=\"1\">Yes</option>";
        }
        if($showavatar[0]=="0"){
        echo "<option value=\"0\" selected=\"0\">No</option>";
        }else{
        echo "<option value=\"0\">No</option>";
        }
        echo "</select><br/><br/>";
    genproc.php

    Code:
       $showavatar = $_POST["showavatar"];
      $res = mysql_query("UPDATE ibwf_users SET showavatar='".$showavatar."' WHERE id='".$uid."'");
    and in sql ive added this
    Code:
    showavatar  int 100 default 1
    what can i do to make this code work
    Last edited by riderz; 09.05.09, 11:43.
    ________________
    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

    #2
    if($showavatar[0]>"1")
    {
    $avlink = getavatar($item[2]);
    if ($avlink!=""){
    echo "<img src=\"$avlink\" height=\"25\" width=\"25\" alt=\"avatar\"/>";
    }else{
    echo "<img src=\"images/nopic.jpg\" height=\"25\" width=\"25\" alt=\"avatar\"/>";
    }
    }

    try that m8

    Comment


      #3
      Sorry guys my code work 100% that ive posted i have just tried it the way ive posted it and it work last time ive tried it was on my localhost then it didnt work
      Last edited by riderz; 09.05.09, 11:56.
      ________________
      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

      Working...
      X