Jump to content

Mancent

Members
  • Posts

    147
  • Joined

  • Last visited

Everything posted by Mancent

  1. sure.. We are in flash application and as you the user move your mouse on a x y axis you are updating using php server side script to insert as a update where user id x mouse movement and user y mouse movement so if user "A" is in some user zone as user"B" show both or many MMORPG simple script like.. Its a Movement script updating mysql table users_float table user_id, user_x, user_y and then if the users are in the same zone the users see ne and other. its a simple idea. and I have it working but its choppy so I'm looking to see whats the best way to do it using PHP if PHP can do it. I might need to add c++ to the project. I do not know if this is a bad idea becasue it would always be updating none stop when the users is login.. See the idea is when a user clicks on a friends picture that user sends a message to the friend asking if they can come in. then the friend says yes or no and if yes they are both at that users zone where they both can chat private to one and other or have a party in thier personal zone space. and while the user is in that zone with that user they both see each others movement...
  2. This way seems not good. <?php $username ="MANCENT"; $user_input_x = _xmouse.movement ;//FLASH $user_input_y = _ymouse.movement ;//FLASH while(true) { $updatepos = mysql_query("UPDATE users_float SET user_input_x = '$user_input_x' , user_input_y = '$user_input_y' WHERE username = '$username'"); } This way works but whats a better way? ?>
  3. here is mine i use. rezise.php <?php class SimpleImage { var $image; var $image_type; function load($filename) { $image_info = getimagesize($filename); $this->image_type = $image_info[2]; if( $this->image_type == IMAGETYPE_JPEG ) { $this->image = imagecreatefromjpeg($filename); } elseif( $this->image_type == IMAGETYPE_GIF ) { $this->image = imagecreatefromgif($filename); } elseif( $this->image_type == IMAGETYPE_PNG ) { $this->image = imagecreatefrompng($filename); } } function save($filename, $image_type=IMAGETYPE_JPEG, $compression=75, $permissions=null) { if( $image_type == IMAGETYPE_JPEG ) { imagejpeg($this->image,$filename,$compression); } elseif( $image_type == IMAGETYPE_GIF ) { imagegif($this->image,$filename); } elseif( $image_type == IMAGETYPE_PNG ) { imagepng($this->image,$filename); } if( $permissions != null) { chmod($filename,$permissions); } } function output($image_type=IMAGETYPE_JPEG) { if( $image_type == IMAGETYPE_JPEG ) { imagejpeg($this->image); } elseif( $image_type == IMAGETYPE_GIF ) { imagegif($this->image); } elseif( $image_type == IMAGETYPE_PNG ) { imagepng($this->image); } } function getWidth() { return imagesx($this->image); } function getHeight() { return imagesy($this->image); } function resizeToHeight($height) { $ratio = $height / $this->getHeight(); $width = $this->getWidth() * $ratio; $this->resize($width,$height); } function resizeToWidth($width) { $ratio = $width / $this->getWidth(); $height = $this->getheight() * $ratio; $this->resize($width,$height); } function scale($scale) { $width = $this->getWidth() * $scale/100; $height = $this->getheight() * $scale/100; $this->resize($width,$height); } function resize($width,$height) { $new_image = imagecreatetruecolor($width, $height); imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight()); $this->image = $new_image; } } ?> then you just place this code on the uploader <?php $image=new SimpleImage(); $image->load($filetempname); $image->resize(1900,1200); //<<----- THIS IS THE WIDTH AND HEIGHT $image->save($filepath.$filename); ?>
  4. This is how it should look. basic xml file http://wiistream.net/php/user/pictures/gallery.xml but this is how it looks. http://wiistream.net/php/user/pictures/gallery.php?username=Mancent&user_folder=Mancent_Pictures mysql php xml file with category's. This is whats making it so hard the category's Im using 3 tables one table is for my friends and one table is the category folder name and the other table is the picture holder with the category folder name so I thought i could do a if statement if user_folder = user_folder from the two tables it would keep the correct images in the correct category. But 3 weeks later still no luck. Heres what I got so far. <?php //lets get the mysql connection information. include "../../connect.php"; //we need this because the flash stores the xml file in temp internet history. Header('Cache-Control: no-cache'); Header('Pragma: no-cache'); //ok flash sent out the username $username = mysql_real_escape_string($_GET['username']); //ok flash sent out the folder name $user_folder = mysql_real_escape_string($_GET['user_folder']); $user_folder = (isset($_GET['friend'])) ? ' AND b.user_folder = \'' . mysql_real_escape_string($_GET['user_folder']) . '\' ' : NULL; //this part will be used becasue we need to see if friendship has ben made. $friend = (isset($_GET['friend'])) ? ' AND b.friend = \'' . mysql_real_escape_string($_GET['friend']) . '\' ' : NULL; //Ok lets select the username from the accounts table to see if they are a user.. $get_username = "SELECT * FROM accounts WHERE username = '$username'"; $username_results = mysql_query($get_username) or die("Data not found."); //Get the number of results from the query. $check_username_mysql_rows = mysql_num_rows($username_results); //If there is a match for the username, echo the the users xml data. if($check_username_mysql_rows == 1) { $sql1 = "SELECT a.username,a.user_folder,b.username FROM user_image_folders as a JOIN `user_friends_list` as b ON (b.friend = a.username)WHERE (b.username = '$username' $user_folder $friend AND b.status = 1)"; $result1 = mysql_query($sql1); //TODO MAKE THE FRIENDSHIP WORK WITH THIS $sql = "SELECT a.username,a.user_folder,a.user_folder,a.large_pic,a.small_pic,a.pic_title,a.pic_discription,b.username FROM user_photo_gallery as a JOIN `user_friends_list` as b ON (b.friend = a.username)WHERE (b.username = '$username' $user_folder $friend AND b.status = 1)"; $result2 = mysql_query($sql); $user_xml = "<?xml version=\"1.0\"?>\n"; $user_xml .= "<settings>\n"; $user_xml .= "<sceneHeight>600</sceneHeight>\n"; $user_xml .= "<sceneWidth>1000</sceneWidth>\n"; $user_xml .= "<titleColor>#000000</titleColor>\n"; $user_xml .= "<descriptionBgAlpha>70</descriptionBgAlpha>\n"; $user_xml .= "<showFullscreenBtn>no</showFullscreenBtn>\n"; $user_xml .= "<waterMark useImage=\"no\"><![CDATA[THIS]]></waterMark>\n"; $user_xml .= "</settings>\n"; $user_xml .="<galleries>\n"; //{ while ($i_get_myfriends = mysql_fetch_assoc($result1)) { $user_xml .="<gallery theName=\"". $i_get_myfriends['user_folder'] ."\" itemsPerRow=\"3\" autoStart=\"no\" playTime=\"5\" autoResize=\"yes\" xOffset=\"5\" yOffset=\"10\" showTitleOnThumbs=\"yes\" allowDownload=\"yes\">\n"; while ($i_get_myfriends2 = mysql_fetch_assoc($result2)) { //if($i_get_myfriends['user_folder'] ==$i_get_myfriends2['user_folder']) //{ $user_xml .="<picture largePicture=\"". $i_get_myfriends2['large_pic'] ."\" smallPicture=\"". $i_get_myfriends2['small_pic'] ."\" theTitle=\"". $i_get_myfriends2['pic_title'] ."\"><![CDATA[". $i_get_myfriends2['pic_discription'] ."]]>\n"; $user_xml .="</picture>\n"; //} } $user_xml .="</gallery>\n"; } $user_xml .="</galleries>\n"; echo $user_xml; } else { echo "Wiistream Eorror!\n"; } ?> See all the images are going into one folder.. and they are sopost to go into the friends folder it they are the friends pictures. but they are all in my folder..
  5. here is a quick example how they did it. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <script language="javascript" type="text/javascript"> <!-- /**************************************************** Author: Eric King Url: http://redrival.com/eak/index.shtml This script is free to use as long as this info is left in Featured on Dynamic Drive script library (http://www.dynamicdrive.com) ****************************************************/ var win=null; function NewWindow(mypage,myname,w,h,scroll,pos){ if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;} if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;} else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20} settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'; win=window.open(mypage,myname,settings);} // --> </script> </head> <body> <a href="http://stream.wadiomedia.org/flash/clean/player.swf?infoXML=http://stream.wadiomedia.org/api_public.php&streamURL=http://listen.wadiomedia.org/stream_128.php" onclick="NewWindow(this.href,'mywin','500','500','no','center');return false" onfocus="this.blur()"><img src="http://t2.gstatic.com/images?q=tbn:ANd9GcTyVLPW9ZSEYYu-uzHpwGCh-iEjzHxSv4GK3q30GmE-1t_cdj-hDg" width="25" height="25" border="0" /></a> </body> </html>
  6. Bump ya you got the basic codes you just need to get a popup window code and you can use java for that. google search dhtml popup window <script language="javascript" type="text/javascript"> <!-- /**************************************************** Author: Eric King Url: http://redrival.com/eak/index.shtml This script is free to use as long as this info is left in Featured on Dynamic Drive script library (http://www.dynamicdrive.com) ****************************************************/ var win=null; function NewWindow(mypage,myname,w,h,scroll,pos){ if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;} if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;} else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20} settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no'; win=window.open(mypage,myname,settings);} // --> </script> and use this for your image for the button. <a href="http://www.yoursite.com/where your mp3 player flash name is" //this window size is 500 height 500 width onclick="NewWindow(this.href,'mywin','500','500','no','center');return false" onfocus="this.blur()">YourLinkText</a>
  7. Ok i created two tables and did it this way so far.. But to get the idea you can test the links to see the different category's and images in that category. heres the script so far. I need help joining the friends table where friendship is made. and if friendship is made then this script needs to echo the xml data where all friends images are and folders. http://wiistream.net/php/user/pictures/gallery.php?username=Demo&user_folder=Category1 http://wiistream.net/php/user/pictures/gallery.php?username=Demo&user_folder=Category2 <?php //lets get the mysql connection information. include "../../connect.php"; //we need this because the flash stores the xml file in temp internet history. Header('Cache-Control: no-cache'); Header('Pragma: no-cache'); //ok flash sent out the username $username = mysql_real_escape_string($_GET['username']); //ok flash sent out the folder name $user_folder = mysql_real_escape_string($_GET['user_folder']); //this part will be used becasue we need to see if friendship has ben made. $friend = (isset($_GET['friend'])) ? ' AND b.friend = \'' . mysql_real_escape_string($_GET['friend']) . '\' ' : NULL; //Ok lets select the username from the accounts table to see if they are a user.. $get_username = "SELECT * FROM accounts WHERE username = '$username'"; $username_results = mysql_query($get_username) or die("Data not found."); //Get the number of results from the query. $check_username_mysql_rows = mysql_num_rows($username_results); //If there is a match for the username, echo the the users xml data. if($check_username_mysql_rows == 1) { $lets_get_this_users_photos = "SELECT * FROM user_photo_gallery WHERE username = '$username'AND user_folder ='$user_folder'"; $lets_get_this_users_photos_results = mysql_query($lets_get_this_users_photos) or die("Data not found."); $lets_get_this_users_folders = "SELECT * FROM user_image_folders WHERE username = '$username'AND user_folder ='$user_folder'"; $lets_get_this_users_folders_results = mysql_query($lets_get_this_users_folders) or die("Data not found."); //TODO MAKE THE FRIENDSHIP WORK WITH THIS //$sql = "SELECT a.username,a.user_folder,a.large_pic,a.small_pic,a.pic_title,a.pic_discription,b.username FROM (user_photo_gallery as a )JOIN `user_friends_list` as b ON (b.friend = a.username)WHERE (b.username = '$username' $friend AND b.status = 1) ORDER BY a.user_folder DESC"; //$result2 = mysql_query($sql); $user_xml = "<?xml version=\"1.0\"?>\n"; $user_xml .= "<settings>\n"; $user_xml .= "<sceneHeight>600</sceneHeight>\n"; $user_xml .= "<sceneWidth>1000</sceneWidth>\n"; $user_xml .= "<titleColor>#000000</titleColor>\n"; $user_xml .= "<descriptionBgAlpha>70</descriptionBgAlpha>\n"; $user_xml .= "<showFullscreenBtn>no</showFullscreenBtn>\n"; $user_xml .= "<waterMark useImage=\"no\"><![CDATA[THIS]]></waterMark>\n"; $user_xml .= "</settings>\n"; $user_xml .="<galleries>\n"; while ($i_get_this_users_mysql_folder_name = mysql_fetch_assoc($lets_get_this_users_folders_results)) { $user_xml .="<gallery theName=\"". $i_get_this_users_mysql_folder_name['user_folder'] ."\" itemsPerRow=\"3\" autoStart=\"no\" playTime=\"5\" autoResize=\"yes\" xOffset=\"5\" yOffset=\"10\" showTitleOnThumbs=\"yes\" allowDownload=\"yes\">\n"; while ($i_get_this_users_photo_folder_names = mysql_fetch_assoc($lets_get_this_users_photos_results)) { if($i_get_this_users_mysql_folder_name['user_folder']/*AND IT EQULES AS THE SAME AS*/==$i_get_this_users_photo_folder_names['user_folder']) { $user_xml .="<picture largePicture=\"". $i_get_this_users_photo_folder_names['large_pic'] ."\" smallPicture=\"". $i_get_this_users_photo_folder_names['small_pic'] ."\" theTitle=\"". $i_get_this_users_photo_folder_names['pic_title'] ."\"><![CDATA[". $i_get_this_users_photo_folder_names['pic_discription'] ."]]>\n"; $user_xml .="</picture>\n"; } } $user_xml .="</gallery>\n"; } $user_xml .="</galleries>\n"; echo $user_xml; } else { echo "Wiistream Eorror!\n"; } ?>
  8. say i have a mysql table with the following fileds user_id picture_category picture_title picture_description picture_thumb //small image size picture_normal //large image size. ok what I'm trying to do is this. if( user_id && picture_category == the same name show all the pictures in that category as one section) //show this category and all the images from this user_id and picture_category so if this user_id has a new category name and new images uploaded it would show the images in the right category. my php xml script is in the works and is looking like this so far. <?php include "../../connect.php"; Header('Cache-Control: no-cache'); Header('Pragma: no-cache'); $username = mysql_real_escape_string($_GET['username']); $user_folder = mysql_real_escape_string($_GET['user_folder']); //$password = mysql_real_escape_string($_GET['password']); $friend = (isset($_GET['friend'])) ? ' AND b.friend = \'' . mysql_real_escape_string($_GET['friend']) . '\' ' : NULL; $query = "SELECT * FROM accounts WHERE username = '$username'"; $results = mysql_query($query) or die("Data not found."); //Get the number of results from the query. $rows = mysql_num_rows($results); //If their is a match for the username, echo the the users xml data. if($rows == 1) { $query1 = "SELECT * FROM user_photo_gallery WHERE username = '$username'"; $query2 = "SELECT * FROM user_photo_gallery WHERE username = '$username' AND user_folder = '$user_folder'"; $results1 = mysql_query($query1) or die("Data not found."); $results2 = mysql_query($query2) or die("Data not found."); //$row = mysql_fetch_assoc($results1); $user_xml = "<?xml version=\"1.0\"?>\n"; $user_xml .= "<settings>\n"; $user_xml .= "<sceneHeight>600</sceneHeight>\n"; $user_xml .= "<sceneWidth>1000</sceneWidth>\n"; $user_xml .= "<titleColor>#000000</titleColor>\n"; $user_xml .= "<descriptionBgAlpha>70</descriptionBgAlpha>\n"; $user_xml .= "<showFullscreenBtn>no</showFullscreenBtn>\n"; $user_xml .= "<waterMark useImage=\"no\"><![CDATA[THIS]]></waterMark>\n"; $user_xml .= "</settings>\n"; $user_xml .="<galleries>\n"; //$sql = "SELECT a.username,a.user_folder,a.large_pic,a.small_pic,a.pic_title,a.pic_discription,b.username FROM (user_photo_gallery as a )JOIN `user_friends_list` as b ON (b.friend = a.username)WHERE (b.username = '$username' $friend AND b.status = 1) ORDER BY a.user_folder DESC"; //$result2 = mysql_query($sql); //if(mysql_num_rows($result2) > 0) //{ while ($row = mysql_fetch_assoc($results1)) { $user_xml .="<gallery theName=\"". $row['user_folder'] ."\" itemsPerRow=\"3\" autoStart=\"no\" playTime=\"5\" autoResize=\"yes\" xOffset=\"5\" yOffset=\"10\" showTitleOnThumbs=\"yes\" allowDownload=\"yes\">\n"; if($row['user_folder'] =="Demo_Photos") { //select all pictures where this folder name and username maybe? while ($row1 = mysql_fetch_assoc($results2)) { $user_xml .="<picture largePicture=\"". $row1['large_pic'] ."\" smallPicture=\"". $row1['small_pic'] ."\" theTitle=\"". $row1['pic_title'] ."\"><![CDATA[". $row1['pic_discription'] ."]]>\n"; $user_xml .="</picture>\n"; } } else { } $user_xml .="</gallery>\n"; } //} //else //{ //echo "Wiistream Eorror!\n"; //}; $user_xml .="</galleries>\n"; echo $user_xml; } else { echo "Wiistream Eorror!\n"; } ?> the real xml file should look like this. <?xml version="1.0" encoding="utf-8"?> <settings> <sceneHeight>600</sceneHeight> <sceneWidth>1000</sceneWidth> <titleColor>#000000</titleColor> <descriptionBgAlpha>70</descriptionBgAlpha> <showFullscreenBtn>no</showFullscreenBtn> <waterMark useImage="yes"><![CDATA[<font size="20">Copyright (c) 2010</font> <font color="#000000"><Strong>WiiStream</Strong></font>]]></waterMark> </settings> <galleries> <gallery theName="USERS PERSONAL GALLERY TITLE" itemsPerRow="3" autoStart="no" playTime="5" autoResize="yes" xOffset="5" yOffset="10" showTitleOnThumbs="yes" allowDownload="yes"> <picture largePicture="http://acadianfury.files.wordpress.com/2007/01/mazda.jpeg" smallPicture="http://acadianfury.files.wordpress.com/2007/01/mazda.jpeg" theTitle="USERS TITLE OF PICTURE"><![CDATA[uSERS DISCRIPTION OF PICTURE CAN USE TAGS]]></picture> </gallery> <gallery theName="USERS PERSONAL GALLERY TITLE1" itemsPerRow="3" autoStart="no" playTime="5" autoResize="yes" xOffset="5" yOffset="10" showTitleOnThumbs="yes" allowDownload="yes"> <picture largePicture="http://acadianfury.files.wordpress.com/2007/01/mazda.jpeg" smallPicture="http://acadianfury.files.wordpress.com/2007/01/mazda.jpeg" theTitle="USERS TITLE OF PICTURE"><![CDATA[uSERS DISCRIPTION OF PICTURE CAN USE TAGS]]></picture> <picture largePicture="http://acadianfury.files.wordpress.com/2007/01/mazda.jpeg" smallPicture="http://acadianfury.files.wordpress.com/2007/01/mazda.jpeg" theTitle="USERS TITLE OF PICTURE"><![CDATA[uSERS DISCRIPTION OF PICTURE CAN USE TAGS]]></picture> </gallery> <gallery theName="USERS PERSONAL GALLERY TITLE2" itemsPerRow="3" autoStart="no" playTime="5" autoResize="yes" xOffset="5" yOffset="10" showTitleOnThumbs="yes" allowDownload="yes"> <picture largePicture="http://acadianfury.files.wordpress.com/2007/01/mazda.jpeg" smallPicture="http://acadianfury.files.wordpress.com/2007/01/mazda.jpeg" theTitle="USERS TITLE OF PICTURE"><![CDATA[uSERS DISCRIPTION OF PICTURE CAN USE TAGS]]></picture> <picture largePicture="http://acadianfury.files.wordpress.com/2007/01/mazda.jpeg" smallPicture="http://acadianfury.files.wordpress.com/2007/01/mazda.jpeg" theTitle="USERS TITLE OF PICTURE"><![CDATA[uSERS DISCRIPTION OF PICTURE CAN USE TAGS]]></picture> <picture largePicture="http://acadianfury.files.wordpress.com/2007/01/mazda.jpeg" smallPicture="http://acadianfury.files.wordpress.com/2007/01/mazda.jpeg" theTitle="USERS TITLE OF PICTURE"><![CDATA[uSERS DISCRIPTION OF PICTURE CAN USE TAGS]]></picture> <picture largePicture="http://acadianfury.files.wordpress.com/2007/01/mazda.jpeg" smallPicture="http://acadianfury.files.wordpress.com/2007/01/mazda.jpeg" theTitle="USERS TITLE OF PICTURE"><![CDATA[uSERS DISCRIPTION OF PICTURE CAN USE TAGS]]></picture> </gallery> </galleries> but using it with mysql it only gets the user_id and the picture_category for this user and pulls back that users data only. I also have a join table included to join if this user has friendship with that user. and then you would see all your pictures upload and category's. and all your friends pictures and category's.
  9. your working on the same thing I'm working on. I created a flash uploader and used php to upload the files to the host server. and it inserts into the database I then crated a mp3 player using xml to read the data from the mysql database using xml converted into php my only problem I'm having is uploading script I can upload any mp3 file but it always over writes the old mp3 file. I tried using md5 to upload random strings for the mp3 and it did work the files was all getting uploaded and they are all random names 487dfds8f89638989df9s8d8938f but when they would get injected into the database they always had one string name and it was never matching the file md5 string name.. I haven't found a solution for this yet.
  10. Ok the code above is working, but it dose a strange thing. the md5 code post 2 different codes in mysql it post d41d8cd98f00b204e9800998ecf8427e and the file where it was uploaded to the folder it post da75bf56aba6127e87731c45b40aa21b How can this get fixed? I know i can write some string and this would be solved $insert ="usersphoto.jpg"; this would solve the problem but I want to be able to upload many images and they are all different names so md5 seemed good.
  11. ok i redid the whole thing. but now I am having a problem with update mysql <?php include "../php/connect.php"; include('Resize.php'); //What user is online using this? $username=$_POST['username']; $username=stripslashes($username); $username=mysql_real_escape_string($username); //Ok get the user folder location $filepath=getcwd()."/".$_GET['dir']."/"; $filetempname=$_FILES['Filedata']['tmp_name']; $filename=$_FILES['Filedata']['name']; $insert =(md5($filename)); //Ok let resize thie image to be small $image=new SimpleImage(); $image->load($filetempname); $image->resize(300,300); $image->save($filepath . $insert); //lets update the database where this users photo is $setavatar=mysql_query("UPDATE accounts SET avatar = 'http://wiistream.net/users/$username/images/$insert' WHERE username = '$username'"); ?> the database updates all the information but one. http://wiistream.net/users/Mancent/images/ the $insert is not working for the mysql but the $insert is needed to clean up spaces in images names. so this should be http://wiistream.net/users/Mancent/images/some md5 code But it is adding every thing to the correct folder and naming it right for any user its just not injecting into the Database correctly
  12. sorry i didn't read yout topic right my bad you just want to use this on your website? here <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" name="main" width="220" height="207" align="middle" id="main"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="false" /> <param name="movie" value="http://stream.wadiomedia.org/flash/clean/player.swf?infoXML=http://stream.wadiomedia.org/api_public.php&streamURL=http://listen.wadiomedia.org/stream_128.php" /> <param name="quality" value="high" /> <embed src="http://stream.wadiomedia.org/flash/clean/player.swf?infoXML=http://stream.wadiomedia.org/api_public.php&streamURL=http://listen.wadiomedia.org/stream_128.php" quality="high" width="220" height="207" name="main" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>
  13. ya I read them and tried many but nothing was working it still uploaded and no errors but it never resized. Thats why I thought I would has here to see if some one could solve my problem.
  14. Ok this script works but it needs to do more. I need to resize the images that get uploaded to 300px to 300px because the images are way to big and then i need to add a if statement to send back to flash if the file is to small to upload so it will look best. so no file that is less then 300px by 300px can be uploaded. this script is doing two things One it uploads the picture to some username folder Two it inserts into the database where username. <?php include "../php/connect.php"; $username = $_POST['username']; $username = stripslashes($username); $username = mysql_real_escape_string($username); if(@!empty($_FILES)) { $_FILES['Filedata']['name'] = Relocate(utf8_decode($_FILES['Filedata']['name']),$username); $filepath = getcwd()."/".$_GET['dir']."/"; if(!file_exists($filepath)) mkdir($filepath,0777); chmod($filepath,0777); if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $filepath . $_FILES['Filedata']['name'])) chmod($filepath.$_FILES['Filedata']['name'], 0777); } function Relocate($str,$username) { $filename = "UserPhoto.jpg";//md5($str); $setavatar = mysql_query("UPDATE accounts SET avatar = 'http://wiistream.net/users/$username/images/$filename' WHERE username = '$username'"); echo '&msgText=' . $username . ''; return $filename; } Relocate($str,$username); ?>
  15. Its a flash app use php with xml? is the flash using xml to read the song title artist name ect. post your xml file and will convert it to php.. for a example: this is a xml file <files mainWidth="700" nRows="3" thumbHeight="80" thumbWidth="80" imageWidth="120" imageHeight="120" searchDetails="1" > <file thumbnail="thumbs/xmrv2.jpg" image="images/xmrv2.jpg" headline="XML based Image Rotator V2" downloadURL="http://flashden.net/item/xml-based-image-rotator-v2/36855"> <details> <![CDATA[ <p>This is the Version 2 of our <a href="/item/xml-based-image-rotator/25516"> XML based Image Rotator</a></p> <p><strong>Features:</strong> Fully XML Customizable Image Rotator.</p> <ul> <li>Add as many as images as you want. </li> <li> Supported files <strong> JPG , GIF, PNG & SWF </strong>. </li> <li>You can place <strong> HTML </strong> / <strong> CSS </strong> formatted image specific description.</li> <li><strong>Next</strong> & <strong>Previous</strong> Buttons on mouse over.</li> <li>Nice bouncing effect for description</li> <li>Image preloader for each image.</li> <li>You can change image dimensions , fade speed, image duration, description coming speed & description text background transparency lavel from”config.xml” file.</li> <li> Commented code.</li> <li> Help file included.</li> <li>Two XML files are included. for image data & for image rotator configuration.</li> </ul> <p><strong>Keyword:</strong> XML Based Image rotator, Image Gallary, Banner Rotation, Slide Show, Image Rotator</p> ]]> </details> </file> </files> this is the same file in php <?php include "../connect.php"; $username = mysql_real_escape_string($_GET['username']); $sql = "SELECT * FROM accounts"; $result = mysql_query($sql); $query = "SELECT username FROM accounts WHERE username = '$username'"; $results = mysql_query($query) or die("Data not found."); $new_xml = "<?xml version=\"1.0\"?>\n"; $new_xml .= "<files>\n"; if(mysql_num_rows($results) > 0) { while ($row = mysql_fetch_assoc($result)) { $new_xml .= "<file thumbnail=\"". $row['avatar'] ."\" image=\"". $row['avatar'] ."\" headline=\"". $row['username'] ."\" downloadURL=\"". $row['username'] ."\">\n"; $new_xml .= "<details>\n"; $new_xml .= "<![CDATA[". $row['bio'] ."]]>\n"; $new_xml .= "</details>\n"; $new_xml .= "</file>\n"; } $new_xml .= "</files>\n"; echo $new_xml; } else { echo "WiiStream Error!\n" ; } ?>
  16. thank you make scene. Hey would you check this out its what i was working on the friend system http://wiistream.net/WiiStream.swf
  17. I got it. <?php //include the connect script include "../../connect.php"; //Post variables from flash $username = $_POST['username']; $friend= $_POST['friend']; $username = stripslashes($username); $friend = stripslashes($friend); $username = mysql_real_escape_string($username); $friend = mysql_real_escape_string($friend); $sql = mysql_query("SELECT * FROM user_friends_list WHERE username = '$username'"); $rows = mysql_num_rows($sql); if($rows > 0) { if($username == $friend || $friend == $username) { echo "&msgTextfriendship= SELFADD REJECTED!" ; return; } $newsql = mysql_query("SELECT * FROM user_friends_list WHERE username = '$username' and friend = '$friend'"); $newrows = mysql_num_rows($newsql); if(mysql_num_rows($newsql) > 0) { while ($newrows = mysql_fetch_assoc($newsql)) { if($newrows['username'] && $newrows['friend'] && $newrows['status'] == "0") { echo "&msgTextfriendship= PENDING STATUS!"; return; } if($newrows['username'] && $newrows['friend'] && $newrows['status'] == "1") { echo "&msgTextfriendship= FRIENDS!"; return; } if($newrows['username'] && $newrows['friend'] && $newrows['status'] == "2") { echo "&msgTextfriendship= WAITING!"; return; } } } echo "&msgTextfriendship= REQUESTED NEW FRIEND SUCCESSFULLY!"; $insertnewfriend = mysql_query("INSERT INTO user_friends_list (username,friend,status) VALUES ('$friend','$username','0')") or die(mysql_error()); $pendingnewfriend = mysql_query("INSERT INTO user_friends_list (username,friend,status) VALUES ('$username','$friend','2')") or die(mysql_error()); return; } else { echo "WiiStream Error!"; return; } ?>
  18. well how about this? <?php //include the connect script include "../../connect.php"; //Post variables from flash $username = $_POST['username']; $friend= $_POST['friend']; $username = stripslashes($username); $friend = stripslashes($friend); $username = mysql_real_escape_string($username); $friend = mysql_real_escape_string($friend); $sql = mysql_query("SELECT * FROM user_friends_list WHERE username = '$username'"); $rows = mysql_num_rows($sql); if($rows > 0) { if($username == $friend || $friend == $username) { echo "&msgTextfriendship= SELFADD REJECTED!" ; return; } if(mysql_num_rows($sql) > 0) { while ($rows = mysql_fetch_assoc($sql)) { if($rows['username'] && $rows['friend'] && $rows['status'] == "0") { echo "&msgTextfriendship= PENDING STATUS!"; return; } if($rows['username'] && $rows['friend'] && $rows['status'] == "1") { echo "&msgTextfriendship= FRIENDS!"; return; } } } echo "&msgTextfriendship= REQUESTED NEW FRIEND SUCCESSFULLY!"; $insertnewfriend = mysql_query("INSERT INTO user_friends_list (username,friend,status) VALUES ('$friend','$username','0')") or die(mysql_error()); return; } else { echo "WiiStream Error!"; return; } ?>
  19. ok I'm just going to do it the only way i can think of. i hope you guys can help me with a better system. because this is going to be strange. I added a simple if statement code to say hey if I'm the user and I want to invite my self don't do it. it this line if($username == $friend) { //BLA BLA DONT DO IT return; } because when your register you have to be your self as a friend to see your commits you post. if not then you cant see your commits. I don't know why I did it that way, but thats just the way I had to do it. now I think I'm going to do a check system with a simple true statement $check = true; if($check==ture) { //Here is where I'm going to do a search using xml to get all my friends in a list and if i already invited a friend or the friend is pending then it will return the value back to flash. if its all clear move on and insert new friend. Its corning I know but I don't know any way else I can do it. return; } Well thats the idea. CORNY CORNIE <?php //include the connect script include "../../connect.php"; //Post variables from flash $username = $_POST['username']; $friend= $_POST['friend']; $username = stripslashes($username); $friend = stripslashes($friend); $username = mysql_real_escape_string($username); $friend = mysql_real_escape_string($friend); $sql = mysql_query("SELECT * FROM user_friends_list WHERE username = '$username'"); $rows = mysql_num_rows($sql); if($rows > 0) { //lets give it a checksystem $check=true; if($username == $friend || $friend == $username) { echo "&msgTextfriendship= IF IM ADDING MY SELF DO NOT DO IT!" ; return; } if($check==true) { // I COULD DO A XML SECTION HERE TO PRINT OUT ALL MY FRIENDS AND USE WHILE THEN CONTINUE WITH THE IF STATMENTS echo "&msgTextfriendship= IF I ALREADY INVITED THIS PERSON TO BE MY FRIEND DO NOT DO IT!" ; return; } else { echo "&msgTextfriendship= REQUESTED NEW FRIEND SUCCESSFULLY!"; $insertnewfriend = mysql_query("INSERT INTO user_friends_list (username,friend,status) VALUES ('$friend','$username','0')") or die(mysql_error()); //$updateuserfriend = mysql_query("UPDATE user_friends_list SET status = '1' WHERE username = '$username' and friend = '$friend' and status ='0'"); return; } return; } else { echo "WiiStream Error!"; return; } ?>
  20. ya I'm not getting it. I understand what it needs to do but I'm having a brain fart. ok it leaves from a flash file into the php file my username = $username post ok it leaves from a flash file into the php file my friend selection = $friend post now my php file has the two vars it needs ti insert into the mysql database. I need to do a check so i would select from friends list table where username = mancent if username = mancent and friends name = friends name send a response back to flash error already friends or pending.. But i don't know yet. <?php //include the connect script include "../../connect.php"; //Post variables from flash $username = $_POST['username']; $friend= $_POST['friend']; $status = $_POST['status']; $username = stripslashes($username); $status = stripslashes($status); $friend = stripslashes($friend); $username = mysql_real_escape_string($username); $status = mysql_real_escape_string($status); $friend = mysql_real_escape_string($friend); $sql = mysql_query("SELECT * FROM user_friends_list WHERE username = '$username'"); $rows = mysql_num_rows($sql); $your_username=$rows['username']; if($rows > 0) { $sql1 = mysql_query("SELECT * FROM user_friends_list WHERE username = '$username' and friend = '$friend' and status ='$status'"); $rows1 = mysql_num_rows($sql1); if($username && $friend && $status == "0" || $username && $friend && $status == "1") { echo "&msgTextfriendship= REQUESTED REJECTED ALREADY FRIENDS OR STATUS IS PENDING!"; return; } else { echo "&msgTextfriendship= REQUESTED NEW FRIEND SUCCESSFULLY!"; $insertnewfriend = mysql_query("INSERT INTO user_friends_list (username,friend,status) VALUES ('$friend','$username','0')") or die(mysql_error()); //$updateuserfriend = mysql_query("UPDATE user_friends_list SET status = '1' WHERE username = '$username' and friend = '$friend' and status ='0'"); return; } return; } else { echo "WiiStream Error!"; return; } ?> Would this have to post and get data so the var sent from flash is my username and my firend selection $friend= $_POST['friend']; $username = $_POST['username']; how can i use them vars and convert them over to get can i do this $getusername = $username; $getusername = $_GET['username']; would that still be mancent?
  21. nope not working yet: my output says this ::TESTING THIS OUT FOR SEARCHING AND ADDING A FRIEND IF:: REQUESTED NEW FRIEND SUCCESSFULLY! And i tried to add myself as a friend and i'm already my friend so it should have said this ::TESTING THIS OUT FOR SEARCHING AND ADDING A FRIEND IF:: REQUESTED REJECTED ALREADY FRIENDS OR STATUS IS PENDING!
  22. <?php //include the connect script include "../../connect.php"; //Post variables from flash $username = $_POST['username']; $friend= $_POST['friend']; $status = $_POST['status']; $username = stripslashes($username); $status = stripslashes($status); $friend = stripslashes($friend); $username = mysql_real_escape_string($username); $status = mysql_real_escape_string($status); $friend = mysql_real_escape_string($friend); $sql = mysql_query("SELECT * FROM user_friends_list WHERE username = '$username'"); $rows = mysql_num_rows($sql); $your_username=$rows['username']; if($rows > 0) { $sql1 = mysql_query("SELECT * FROM user_friends_list WHERE username = '$username' and friend = '$friend' and status ='$status'"); $rows = mysql_num_rows($sql1); if($username && $friend && $status == "0" || $username && $friend && $status == "1") { echo "&msgTextfriendship= REQUESTED REJECTED ALREADY FRIENDS OR STATUS IS PENDING!"; return; } else { echo "&msgTextfriendship= REQUESTED NEW FRIEND SUCCESSFULLY!"; $insertnewfriend = mysql_query("INSERT INTO user_friends_list (username,friend,status) VALUES ('$friend','$username','0')") or die(mysql_error()); //$updateuserfriend = mysql_query("UPDATE user_friends_list SET status = '1' WHERE username = '$username' and friend = '$friend' and status ='0'"); return; } return; } else { echo "WiiStream Error!"; return; } ?> This right here I haven't tested it yet but I wanted to ask if this would work.. $sql1 = mysql_query("SELECT * FROM user_friends_list WHERE username = '$username' and friend = '$friend' and status ='$status'"); $rows = mysql_num_rows($sql1); if($username && $friend && $status == "0" || $username && $friend && $status == "1") { echo "&msgTextfriendship= REQUESTED REJECTED ALREADY FRIENDS OR STATUS IS PENDING!"; return; }
  23. ya like encrypted passwords md5? But if I had to check the username to match exactly as it is set in mysql Dragon123 Fatbuss123 if I had to do this how whould I do it?
×
×
  • 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.