Jump to content

Zoofu

Members
  • Posts

    80
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Zoofu's Achievements

Member

Member (2/5)

0

Reputation

  1. <?php echo "<table id=\"valign\" width=\"60%\" style=\"border:1px solid #EEE;\">"; echo "<tr><td colspan=\"3\" style=\"border:1px solid #CCC;background-color:#DDD;color:#444;\"><center>Heroes of BuzzWorld<center></td></tr>"; echo "<tr><td style=\"border:1px solid #D5D5D5;background-color:#E5E5E5;color:#555;\"><center>Avatar<center></td><td style=\"border:1px solid #D5D5D5;background-color:#E5E5E5;color:#555;\"><center>Username<center></td><td style=\"border:1px solid #D5D5D5;background-color:#E5E5E5;color:#555;\"><center>Lv.<center></td></tr>"; $sqluy = "SELECT * FROM `users` ORDER BY `pet_level` DESC,`kills` DESC LIMIT 0,15"; $resuy = mysql_query($sqluy) or die(mysql_error()); while($luser = mysql_fetch_assoc($resuy)){ echo "<tr><td style=\"border:1px solid #DDD;background-color:#EEE;color:#666;\"><center><img src=\"./avatar.php?id=".$luser['id']."\"></center></td>"; echo "<td vertical-align=\"middle\" valign=\"middle\" style=\"border:1px solid #DDD;background-color:#EEE;color:#666;\"><center><a valign=\"middle\" href=\"./index.php?page=forum&act=profile&id=".$luser['id']."\">"; echo $luser['username']; echo "</a><br>Kills: ".$luser['kills']."</center></td>"; echo "<td width=\"75\" style=\"border:1px solid #DDD;background-color:#EEE;color:#666;\"><center>".$luser['pet_level']."</center></td>"; echo "</tr>"; } echo "</table>"; ?> For some reason, te cell which has $luser['username'] in, is vertically aligning to the TOP, not the MIDDLE, and I don't have a clue why. (It's only in IE, and for some reason.. After I upload the file and view it it's fine, but when I go to view it a few seconds later, it's broken?) link: http:/www.my-buzz.com/index.php?page=rpg -- The only problem is you need to be logged in.. I'm also using <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
  2. I've been trying to fix this for what? a week? I just figured out that 305 lines above this code snippet, there's an opened if($_SESSION['uid']){ god, Im daft. I put it in my if online section. xD
  3. Im trying to track how many IP's are online. And it's not exactly working. -.- (Not inserting). if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet { $CIP=$_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy { $CIP=$_SERVER['HTTP_X_FORWARDED_FOR']; } else { $CIP=$_SERVER['REMOTE_ADDR']; } $selv300=mysql_query("SELECT * FROM `online` WHERE `ip`='$CIP'") OR die(mysql_error()); $rowv300=mysql_fetch_assoc($selv300); if($rowv300){ }else{ $sql400 = "INSERT INTO `online` (`ip`) VALUES ('".$CIP."')"; $res400 = mysql_query($sql400) or die(mysql_error()); } * - * - Edit! It only works when the user is logged in for some reason, but even if they aren't online, I can still echo out their IP.
  4. <?php include "./globals.php"; if($_GET['id']) { $user = mysql_fetch_object(mysql_query("SELECT * FROM `users` WHERE `id`=". $_GET['id'])); header("Content-type: image/png;"); $col = imagecreate(1,1); $black = imagecolorallocate($col,0,0,0); $back = imagecreatefrompng($user->avatar_background); $base = imagecreatefrompng($user->avatar_base); imagealphablending($base,true); imagecopy($back,$base,0,0,0,0,110,175); imagepng($back); imagedestroy($back); } else die("Error: ID not specified"); ?> I need it to be something like: I used this script structure (sort of) to make customisable avatars... But I dont know how to add Text into it, or position the images in certain places, not just overlapping.
  5. $CIP = $_SERVER['REMOTE_ADDR']; $selv300=mysql_query("SELECT * FROM `online` WHERE `ip`='$CIP'") OR die(mysql_error()); $rowv300=mysql_fetch_assoc($selv300); if($rowv300){ }else{ $sql400 = "INSERT INTO `online` (`ip`) VALUES ('".$CIP."')"; $res400 = mysql_query($sql400) or die(mysql_error()); } It only works when they're logged in. Otherwise it won't recognise them as an IP.
  6. Zoofu

    $_POST?

    if(isset($_POST['Submit']) && !$errors) { echo "<h1>Video uploaded!</h1>"; $sel3=mysql_query("SELECT * FROM `users` WHERE `id`=".$_SESSION['uid']."") OR die(mysql_error()); $rowt3=mysql_fetch_array($sel3); $reply = $_POST['reply']; $sql4 = "INSERT INTO `videos` (`path`,`uid`,`vidname`) VALUES ('videos/".$image_name."','".$row['id']."','".$reply."')"; $res4 = mysql_query($sql4) or die(mysql_error()); } ?> <!--next comes the form, you must set the enctype to "multipart/frm-data" and use an input type "file" --> <form name="newad" method="post" enctype="multipart/form-data" action=""> <table> <tr><td class=\"forum_header\" ><input type="file" name="image"></td></tr> <tr><td class=\"forum_header\" ><input type="text" name=\"reply\"></td></tr> <tr><td class=\"forum_header\" ><input name="Submit" type="submit" value="Upload video"></td></tr> </table> </form> For some reason, it puts the path and uid into the respective fields, bur $reply won't go into vidname?
  7. <?php session_start(); include "./globals.php"; ?> <html> <head> <title>Zoofu | View Item</title> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> <link rel="icon" href="/favicon.ico" type="image/x-icon" /> <link rel="stylesheet" type="text/css" href="./style.css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <center> <?php $id = $_GET['id']; $query = mysql_query("SELECT * FROM videos WHERE `id`=".$id.""); $fetch_array = mysql_fetch_array($query); $id = $fetch_array['id']; $imageurl = $fetch_array['path']; $sel=mysql_query("SELECT * FROM `videos` WHERE `id`=".$id."") OR die(mysql_error()); $row=mysql_fetch_array($sel); echo "<center><table border=\"0\" cellspacing=\"3\" cellpadding=\"3\" width=\"80%\">\n"; echo "<tr><td class=\"forum_header\"><center><br>ItemID: ".$id."</center></td></tr>\n"; echo "<br>\n"; echo "</table></center>\n"; echo '<OBJECT ID="MediaPlayer" WIDTH="192" HEIGHT="190" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject"> <PARAM NAME="FileName" VALUE=".$imageurl."> <PARAM name="autostart" VALUE="false"> <PARAM name="ShowControls" VALUE="true"> <param name="ShowStatusBar" value="false"> <PARAM name="ShowDisplay" VALUE="false"> <EMBED TYPE="application/x-mplayer2" SRC=".$imageurl." NAME="MediaPlayer" WIDTH="600" HEIGHT="450" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0"> </EMBED> </OBJECT>'; ?> </center> </body> </html> echo '<OBJECT ID="MediaPlayer" WIDTH="192" HEIGHT="190" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject"> <PARAM NAME="FileName" VALUE=".$imageurl."> <PARAM name="autostart" VALUE="false"> <PARAM name="ShowControls" VALUE="true"> <param name="ShowStatusBar" value="false"> <PARAM name="ShowDisplay" VALUE="false"> <EMBED TYPE="application/x-mplayer2" SRC=".$imageurl." NAME="MediaPlayer" WIDTH="600" HEIGHT="450" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0"> </EMBED> </OBJECT>'; ^^^^^^ That part, how come.. It won't load, and when I clicked properties it said www.my-buzz.co.cc/.$imageurl. It's supposed to change to the path field right?
  8. Only if the fields `uid` and `path`... If they're the same as something already on there, how do I stop it from inserting? <?php $id = $_GET['id']; $queryl=mysql_query("SELECT * FROM `users` WHERE `id`=".$_SESSION['uid']."") OR die(mysql_error()); $fetcha_array = mysql_fetch_array($queryl); $usernameb = $fetcha_array['username']; $idb = $fetcha_array['id']; $tokensb = $fetcha_array['tokens']; $postsb = $fetcha_array['posts']; $blurbb = $fetcha_array['blurb']; $commentsb = $fetcha_array['comment']; $avatarb = $fetcha_array['avatar']; $usernameb = $fetcha_array['username']; $realnameb = $fetcha_array['name']; $statusb = $fetcha_array['status']; $queryc = mysql_query("SELECT * FROM users WHERE id = '$id'"); $fetch_array = mysql_fetch_array($queryc); $username = $fetch_array['username']; $id = $fetch_array['id']; $tokens = $fetch_array['tokens']; $posts = $fetch_array['posts']; $blurb = $fetch_array['blurb']; $comments = $fetch_array['comment']; $avatar = $fetch_array['avatar']; $realname = $fetch_array['name']; $status = $fetch_array['status']; $sql4 = "INSERT INTO `friends` (`uid`,`path`,`username`,`name`,`avatar`) VALUES ('.$id.','$idb','$usernameb','$realnameb','$avatarb')"; $sql5 = "INSERT INTO `friends` (`uid`,`path`,`username`,`name`,`avatar`) VALUES ('.$idb.','$id','$username','$realname','$avatar')"; $res4 = mysql_query($sql4) or die(mysql_error()); $res5 = mysql_query($sql5) or die(mysql_error()); ?> <html> <head> <title>My-Buzz | Add user</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> </body> </html> <?php header("location: index.php"); ?>
  9. -moz-border-radius: 10px; -webkit-border-radius: 10px; Same principles, is there a way to get border-radius in Internet Explorer?
  10. Also... The file directory it's going into is images which is the same directory as that php file. It's uploading the images, but not setting them as the avatar. And how would I get erm... It to be the path. The avatar field would have to be ./images/THEFILESNAME.png
  11. The screen comes up white, even though I think this is probably the wrong way to go about doing it. <?php //define a maxim size for the uploaded images in Kb define ("MAX_SIZE","100"); //This function reads the extension of the file. It is used to determine if the file is an image by checking the extension. function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } //This variable is used as a flag. The value is initialized with 0 (meaning no error found) and it will be changed to 1 if an errro occures. If the error occures the file will not be uploaded. $errors=0; //checks if the form has been submitted if(isset($_POST['Submit'])) { //reads the name of the file the user submitted for uploading $image=$_FILES['image']['name']; //if it is not empty if ($image) { //get the original name of the file from the clients machine $filename = stripslashes($_FILES['image']['name']); //get the extension of the file in a lower case format $extension = getExtension($filename); $extension = strtolower($extension); //if it is not a known extension, we will suppose it is an error and will not upload the file, otherwize we will do more tests if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) { //print error message echo '<h1>Unknown extension!</h1>'; $errors=1; } else { //get the size of the image in bytes //$_FILES['image']['tmp_name'] is the temporary filename of the file in which the uploaded file was stored on the server $size=filesize($_FILES['image']['tmp_name']); //compare the size with the maxim size we defined and print error if bigger if ($size > MAX_SIZE*1024) { echo '<h1>You have exceeded the size limit!</h1>'; $errors=1; } //we will give an unique name, for example the time in unix time format $image_name=time().'.'.$extension; //the new name will be containing the full path where will be stored (images folder) $newname="images/".$image_name; //we verify if the image has been uploaded, and print error instead $copied = copy($_FILES['image']['tmp_name'], $newname); if (!$copied) { echo '<h1>Copy unsuccessfull!</h1>'; $errors=1; }}}} //If no errors registred, print the success message if(isset($_POST['Submit']) && !$errors) { echo "<h1>File Uploaded Successfully! Try again!</h1>"; $sqlt = "SELECT * FROM `users` WHERE `id`='".$_SESSION['uid']."'"; $rest = mysql_query($sqlt) or die(mysql_error()); $rowt = mysql_fetch_assoc($rest); mysql_query("UPDATE `users` SET avatar='{images/.$_FILES['tmp_name'].}' WHERE `id`=".$_SESSION['uid']."") OR die(mysql_error()); } ?> <!--next comes the form, you must set the enctype to "multipart/frm-data" and use an input type "file" --> <form name="newad" method="post" enctype="multipart/form-data" action=""> <table> <tr><td><input type="file" name="image"></td></tr> <tr><td><input name="Submit" type="submit" value="Upload image"></td></tr> </table> Now I want to know, why doesn't it set that field to what I uploaded? Is there an easier/working/more efficient way to do this?
  12. NULL string(1) "3" Is what appeared. So I take it that it recognises $price, and not tokens?
  13. Yeah, that's what I just realised. Thanks. But the if statements isn't working... the if($row['tokens'] < $price){ part. Dunno why.
  14. Oh I see, it is inserting it into inventory. But only allowing 1 of each item now.
  15. And echoing $sql3 didn't show anything.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.