Jump to content

jaymc

Members
  • Posts

    1,521
  • Joined

  • Last visited

    Never

Everything posted by jaymc

  1. I have made a script to manipulate an image The last stage of my script is to overlay a solid blue color over the entire image and then change the transparency of the blue to something like 30% Basically, giving the total image a complete blue tint What function does this and can you give me an example? Thanks!
  2. Ok, take a look at this image [img]http://img369.imageshack.us/img369/5788/image1uw4.jpg[/img] Basically, when someone selects 'Ashanti' from that drop down menu, I want the value oh the text field to change to Ashanti What is the code for that?
  3. Does anyone know of such a program that I could install on the backend of a CENTOS 4.3
  4. I have a database which contains my members table and a few other things. The members table is heavily accessed.. I am going to make 2 more tables which will be heavily used My question is, will it slow things down if I put the 2 new tables in the same database as the members database Would it be better making a new database for the 2 new tables? Or doesnt it matter? Thanks
  5. Is their any PHP functions / scripts / way to convert mp3 audio to another format such as WMA I know its a bit far fetched...
  6. Ok, I am making a music website. Each song info will be stored in a database, I am thinking of using the following fields for the songs table [b][ID] [GENRE] [ARTIST FULL NAME] [ALBUM NAME] [SONG NAME] [ALBUM ID] [VIEWS][/b] Now their is going to be about 300 albums, so if their are 15 songs per album then thats 4500 rows in the table The query will be pretty straiight forward when someone wants to listen to a song, it will be selected by ID which will be unique Anyway, Im just wondering, is this the best way to go about it. Chuck every song in the same table?
  7. So the only real feasable approach is probably to explode by lines and use strstr()
  8. Can you give me an example of how to use regular expressions with what I need
  9. Right, I'll drop you straight in it. I have about 2000 .txt files that look like the below code [code]<? $music = $_GET['send']; if (strpos($music, "2diealbum1"))  { $song = "2diealbum/songs/2diealbum/2diealbum1.wma"; $songdisplay = "2die4 - Paranoid Entity"; } else if (strpos($music, "2diealbum2"))  { $song = "2diealbum/songs/2diealbum/2diealbum2.wma"; $songdisplay = "2die4 - Hell On Earth"; } else if (strpos($music, "2diealbum3"))  { $song = "2diealbum/songs/2diealbum/2diealbum3.wma"; $songdisplay = "2die4 - Im Ok"; } else if (strpos($music, "2diealbum4"))  { $song = "2diealbum/songs/2diealbum/2diealbum4.wma"; $songdisplay = "2die4 - Reminissin"; } else if (strpos($music, "2diealbum5"))  { $song = "2diealbum/songs/2diealbum/2diealbum5.wma"; $songdisplay = "2die4 - Listen To Your Heart"; } else if (strpos($music, "2diealbum6"))  { $song = "2diealbum/songs/2diealbum/2diealbum6.wma"; $songdisplay = "2die4 - Take It Slow"; } else if (strpos($music, "2diealbum7"))  { $song = "2diealbum/songs/2diealbum/2diealbum7.wma"; $songdisplay = "2die4 - Do Ya Like That"; } else if (strpos($music, "2diealbum8"))  { $song = "2diealbum/songs/2diealbum/2diealbum8.wma"; $songdisplay = "2die4 - Just The Begining"; } else if (strpos($music, "2diealbum9"))  { $song = "2diealbum/songs/2diealbum/2diealbum9.wma"; $songdisplay = "2die4 - Put Em Down"; } else if (strpos($music, "2diealbuma"))  { $song = "2diealbum/songs/2diealbum/2diealbuma.wma"; $songdisplay = "2die4 - Earths Condition"; } else if (strpos($music, "2diealbumb"))  { $song = "2diealbum/songs/2diealbum/2diealbumb.wma"; $songdisplay = "2die4 - By My Side"; } else if (strpos($music, "2diealbumc"))  { $song = "2diealbum/songs/2diealbum/2diealbumc.wma"; $songdisplay = "2die4 - I Needed You"; } else if (strpos($music, "2diealbumd"))  { $song = "2diealbum/songs/2diealbum/2diealbumd.wma"; $songdisplay = "2die4 - Its Ok To Cry"; } else if (strpos($music, "2diealbume"))  { $song = "2diealbum/songs/2diealbum/2diealbume.wma"; $songdisplay = "2die4 - Easy Lover"; } else if (strpos($music, "2diealbumf"))  { $song = "2diealbum/songs/2diealbum/2diealbumf.wma"; $songdisplay = "2die4 - Throw It Up"; } else if (strpos($music, "2diealbumg"))  { $song = "2diealbum/songs/2diealbum/2diealbumg.wma"; $songdisplay = "2die4 - Me In General"; } else if (strpos($music, "2diealbumh"))  { $song = "2diealbum/songs/2diealbum/2diealbumh.wma"; $songdisplay = "2die4 - Catch A Breath"; } else if (strpos($music, "2diealbumi"))  { $song = "2diealbum/songs/2diealbum/2diealbumi.wma"; $songdisplay = "2die4 - It Aint Easy"; } else  if (strpos($music, "2diealbumplay")) { $song = "2diealbum/songs/2diealbum/2diealbumplay.wax"; $songdisplay = "2die4 - Complete Album"; }  ?>[/code] I am going to create a script that will loop and read in the entire contents of each .txt file Then, I need to dig out the following information from each else if. Ive put the information I need in BOLD else if (strpos($music, "[b]2diealbumi[/b]"))  { $song = "[b]2diealbum/songs/2diealbum/2diealbumi.wma[/b]"; $songdisplay = "[b]2die4 - It Aint Easy[/b]"; } What is the best way to do this. Its a bit messy but how would you do it? P.S, its not the loop on stuck with, its the handling of the data
  10. This script is supposed to read a directory full of images, manipulate them and then save them into another DIR It is working, but, for some reason its only working for the last image of the Loop Here is the code, see if you can see the problem [code]<? $opendir = opendir("pics"); $c=1; while ($readdir = readdir($opendir)){ // Get new sizes list($newwidth, $newheight) = getimagesize($readdir); // Load $source = imagecreatefromjpeg($readdir); $max_width = 500; $max_height = 700; $origwidth = imagesx($source);         $origheight = imagesy($source); /* if (imagesx($source) > $max_width || imagesy($source) > $max_height) {       if ($max_height / $origheight < $max_width / $origwidth) { $scale = $max_height / $origheight; }       if ($max_width / $origwidth < $max_height / $origheight) { $scale = $max_width / $origwidth; }         $height = $scale * $origheight;         $width = $scale * $origwidth; } else { */ $width = $origwidth; $height = $origheight; $thumb = imagecreatetruecolor($width, $height); // Resize imagecopyresampled ($thumb, $source, 0, 0, 0, 0, $width, $height, $origwidth, $origheight); // Output imagejpeg($thumb,"userimages/$readdir"); echo "$c - $readdir<BR>"; $c++; } ?>[/code]
  11. I want to use PHP's image functions to manipulate an image, put text on it for example then save that image on the server How do you save?
  12. Yeh thats what I mean.. Images dont really need extensions. If you rename bozo.gif to bozo.jpg the image will still work I just dont get why it doesnt work with the php image stuff In my script when someone uploads an image it automatically gets renamed image.jpg regardless of the real file type Any way around it?
  13. Ok Ive got a new problem The script works fine, but, if the file is a gif it doesnt work Note, when I say gif, its actually named file.jpg but the image is still a gif Any way around it?
  14. Sorry, I see what you mean, just didnt want to have it as 2 different pages But yeh, its working fine :) Thanks
  15. How would that work? See the ECHO at the bottom. It doesnt work... [code]<? // File and new size $filename = 'JMC.jpg'; //$percent = 0.5; // Content type header('Content-type: image/jpeg'); // Get new sizes //list($width, $height) = getimagesize($filename); $newwidth = 76; $newheight = 62; // Load $thumb = imagecreatetruecolor($newwidth, $newheight); $source = imagecreatefromjpeg($filename); // Resize imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // Output imagejpeg($thumb, null, 100); echo "<img src=image.php>"; ?> [/code]
  16. Ok, Im just making a script that will make resized thumbnails to save on bandwidth.. Ive mastered the image creation, however, I need the image displayed with some HTML theirfor I cant use the 'setting headers' approach [code]<? // File and new size $filename = 'JMC.jpg'; // Content type header('Content-type: image/jpeg'); // Get new sizes // list($width, $height) = getimagesize($filename); $newwidth = 76; $newheight = 62; // Load $thumb = imagecreatetruecolor($newwidth, $newheight); $source = imagecreatefromjpeg($filename); // Resize imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // Output imagejpeg($thumb, null, 100); ?> [/code] I basically need to do something like this [b]<img src="$thumb">[/b] But obviously it doesnt work like that. Any help? Thanks
  17. Cheers ! That worked a treat
  18. Here is the query im running to select 100 mobile numbers from a database [b]$query = "SELECT * FROM `ibf_members` WHERE `mobilenum` !=NULL LIMIT 0,100";[/b] However, I want to to select 100 at random, not the first 100 in the table How can I achieve that?
  19. Well ive never ever tried addverts from it. Its just been a free service that ran riot for a year and ended up with one hell of a busy website Its only now That im looking to earn cash from it. The CPM stuff is pretty low rate and its not worth it seeing as you have to bomb your viewers with popups to earn a small amount
  20. I bet this all got your attention, unfortunetly Im here for advice, not to give it !! I have a very busy website, it has 100,000 members and usually has 1000 people online at any one time I think its time now to start making money from it ! The obvious approach is advertisements, but thats where Im stuck at Ive tried all the pay per click companys, google add words, clicksor etc. Not enough people bother clicking them... as you can imagine. I want a more solid way. I am looking into popups but some company quoted $0.003 per popup viewed. [b]What are your experiences? Any tips? Any publisher companys you reccomend?[/b] Thanks !
  21. Good reply, lol ! Ok, I want to develop a system to cater for PAY PER CLICK adds You are not allowed to 'ask' people to click on them, so obviously having next to the advert 'Please click this' wont wash with the add company But, what they dont know want hurt them! So i want to put the add in an iframe and have the 'Please click this' text next to it. To the add company it will just appear as they have clicked from within the page the adds are located. But I think they may be able to detect if its in an iframe and reveal the page of which the iframe is sittin in, thus being able to see my 'Please click here' text... thats why Im asking...
  22. Im just wonderin if its possible to retrieve the URL oh the parent page a frame is placed in PARENT WEBPAGE (www.site.com) | | | Within that page is an iframe displaying a website from (www.webby.com) Would it be possible to place some code in (www.webby.com) so that it could retrieve the parent and in turn output www.site.com I'll tell you why I want to know this if you can give me the answer Regards.
×
×
  • 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.