Jump to content

calvin182

Members
  • Posts

    190
  • Joined

  • Last visited

Posts posted by calvin182

  1. I know GD can do all sorts of things with images, but can it do anything with videos? Like lets say I have a video on my server and I want to make a thumbnail of the first frame (or even in the middle of the duration if possible), is there a way to do that?I've seen this on YouTube but I don't know how they do it.I don't need an upload script or anything just something to create a thumbnail from the video and scale it down to lets say no larger than 100x100 (proportional) and save it to a folder if possible.-Calvin

  2. By publishing the HTML template code in Flash, you'll wind up with unvalid and uncompatible code. Try this:

    <object type="application/x-shockwave-flash"data="file.swf"width="720" height="480"><param name="movie"value="file.swf" /></object>

    That should be faily simple to understand, fill in your filename twice and set your dimensions. That will return valid XHTML 1.0 and be compatible in IE, FireFox, Netscape, and Opera (there may be more, these are just the one's I've tested).One problem with that format however. One browser, I do not remember which, will not stream the file. Instead the entire file will download first. Using that format is best for small files but there is a work-around if you have Flash.WORK-AROUND:Lets say all of your flash files have the same dimensions of 720x480. What you would need to do is create a blank .swf to those exact dimensions with the following code in your first frame actionscript:

    loadMovieNum(_root.path,0);

    Then your modifed HTML to embed the Flash would look like this:

    <object type="application/x-shockwave-flash"data="720x480.swf?path=file.swf"width="720" height="480"><param name="movie"value="720x480.swf?path=file.swf" /></object>

    Notice that the only difference is "720x480.swf?path=file.swf". What we did is made a container clip that loads file.swf in the correct proportions.If you have multiple dimmensioned files, you have to either make multiple container clips.--NOTE: You cannot create a small container clip and size it properly with the code, it will not work. You must create the container clip at the proper size.I hope that helps!-Calvin

  3. I've already got a script to upload images, store their values in a flatfile, call that file and display the images 16 to a page and generate pages for the full size image along with a backend of options and other features.Currently, I have to size the thumbnail and image on my system, and upload them to the appropriate folder on my system (they both have the same name but go to different folders).What I want to do is cut out that step and include that in the upload process. In a nutshell, I'd like the image to be resized in proportions not to exceed a maximum width. In the same process, I'd like the same to happen but for a thumbnail. The main image would go into a folder called "images" (where the uploaded image is already going) and the thumbnail to go into a folder called "thumbnails".I don't expect somebody to write me the whole thing but if somebody could help me out with a start or point me in the right direction I'd much appreciate it.Oh and the image formats I'm looking to do this for are .jpg/.jpeg/.png/and maybe .gifI can post the upload code if you'd like to see it.-Calvinhttp://www.oneity-eight.com

  4. I suppose I could do that... although I'm not sure when I'll get it done. If time goes by and I don't PM you, PM me because I probably forgot.Here's the thread where I started the begining stuff if it's any interest to you. Much of that is different now and I've added a backend with plenty of options and I'm currently working on some other stuff I will be sort of piecing it all together eventually.http://w3schools.invisionzone.com/index.ph...opic=2482&st=20I'm using the latest version on my site if you'd like to see where I'm at. Currently I have to manually create the thumbnails and size the main images but everything else is generated and I plan to include automated sizing in the process down the line.http://www.oneity-eight.com

  5. deffinitely! it's part of my gallery script im working on but you're welcome to it, as when it's all finished hackensack reccomended to me that i list it on a open source script site, so im doing just that.next task is resizing to a max size with proportions and then making a thumbnail, then it'll pretty much be all set.

  6. Cool, everything is working now... I do my if() statements differently but I have a few more files with some of the old code and as soon as I changed that if() statement to:

    include('db.php');if (!isset($db)) {$db = array();};

    everything works perfectly!THANKS SO SO MUCH JUSTSOMEGUY!

  7. the mail function should look like this:

    <?php$to = $_POST['email'];$password = $_POST['password'];$login = $_POST['login'];$msg = "Your login and password are as follows:<br/>Login Id: " . $login . "<br/>Password: " . $password;// To send HTML mail, the Content-type header must be set$headers  = 'MIME-Version: 1.0' . "\r\n";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";// Additional headers$headers .= 'To: Mary <mary@example.com>' . "\r\n";$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";if (mail($to, "login information", $msg, $headers)) { echo "Your password was successfully sent to you<br/>";} else { echo "Could not send you an email with your password!";};?>

    obliviously, the addresses in the headers need some adjustment, but that should fix that up. Having that "<br>" in the $from when thats being put into that part of the mail function was no good.also, if you get errors or dont receive the email, the "\r\n" should be changed to "\n", as some servers like that better.

  8. that script look familiar... lolanywho, what seems to be the trouble with it? if nothing is working at all, first check your php version. In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead of $_FILES. Also, make sure that the files have .php extentions. Are you getting any output at all (is the page loading? is the file just not being uploaded?)

  9. correction, the actual code would be <?php include ("navmenu.html"); ?> the .htacess file has nothing to do with this, thats controlls access to bots, folders aswell as numerous other functions.

  10. yes, i found a solution but it's a bit of a pain.to maintain full compatibility between browsers (with streaming play), you have to make a container swf with the exact same size as the file your going to load into it. note that make a smaller container and stretching it to the proper size will not do.example (im going to use container.swf and file.swf), my flashtoon is 720x480. so my container.swf is 720x480 as is my file.swf and I used the following code:

    <object type="application/x-shockwave-flash"data="container.swf?path=http://www.domain.com/flashtoons/file.swf" width="720" height="480"><param name="movie" value="container.swf?path=http://www.domain.com/flashtoons/file.swf" /></object>

    now, if you're a php user and you have a few different sizes, you can write a little script to determine which container to use. if i remember corectly, theres a gd function that checks the size.as far as the name property, validator.w3.org has not retured any errors.

  11. upload.php:

    <strong>Upload an image:</strong><br/><br/><em>Max upload size: 2 megabyte (2,097,152 bytes)</em><!-- The data encoding type, enctype, MUST be specified as below --><form enctype="multipart/form-data" action="upload.php" method="POST">   <!-- MAX_FILE_SIZE must precede the file input field -->   <input type="hidden" name="MAX_FILE_SIZE" value="2097152" />   <!-- Name of input element determines name in $_FILES array -->   <input name="uploaddirectory" type="text" value="/home/DOMAINUSER/public_html/images/" size="50"/>   <input name="userfile" type="file" size="50"/><br/>   <input type="submit" value="Add to gallery" /></form>

    When you have your path figured out, change the type="text" to type="hidden".results.php:

    <?php// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead// of $_FILES.$uploaddir = $_GET['uploaddirectory'];$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {     echo "File was successfully uploaded!"; $backmessage = "Upload another";                                                     } else {  echo "Upload failed!"; $backmessage = "Back to upload";}echo "<br/><a href=\"upload.php\" title=\"$backmessage\">$backmessage</a>";?>

    I hope that helps!

  12. one thing those links dont explain is the proper method of linking that url. personally, i like my code to be valid xhtml 1.0, so when putting the & in the url use & if you are using multiple variables.so an example anchor code would look like this:

    <a  href="http://www.domain.com/index.php?go=media/audio&play=track1">Audio</a>

    and on domain.com/index.php you would have this:

    <?php$go=$_GET['go'];$play=$_GET['play'];//page template stuff and whateversinclude('http://www.domian.com/'.$go.'/index.php?play='.$play); //this would load http://www.domain.com/media/audio/index.php?play=track1

    that right there is a basic way to template your site, there are better methods of course. as far as it saying 'act' or 'go' or whatever, thats totally your choice, thos words are not predefined, so you can make up your own variables if your wish like I just did in the example above.

  13. Two problems...PROBLEM A:Basically, this is the page that my upload form is sent to. What I need it to do is load the array (db.php), upload the image and rename it if needed, add the image to the array, sort the array, and then rebuild the array so it may be saved into a separate file (db.php). It does everything but the last step properly. The problem is it will add the new entry into the array and save it just fine, but if the array contains existing values, it does not add them to the saved version.

    <?phpinclude('db.php');$db = array();$uploaddir = $_POST['uploaddirectory'];$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);$path_parts = pathinfo($uploadfile);$filename = $path_parts['basename'];//$fileext = "." . substr(strrchr($filename, "."), 1);// $filename = basename($uploaddir, $fileext);$today = date("m-d-Y_H-i-s");if (file_exists($uploadfile)) {   $file = $today . $filename;} else {   $file = $filename;};$uploadfile2 = $uploaddir . $file;if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile2)) {     chmod($uploadfile2, 0777);     echo "File was successfully uploaded!"; $backmessage = "Upload another";                                                          $addtodb = "true";  } else {  echo "Upload failed!"; $backmessage = "Back to upload";}echo "<br/><a href=\"add.php\" title=\"$backmessage\">$backmessage</a>";if ($addtodb == "true") {     $newentry = "$db['".$today."'] = \"".$file."\";";} else {exit(0);};krsort($db);$output = "$db = array(); " . $newentry;foreach ($db as $key => $value) {     $output .= " $db['".$key."'] = \"".$value."\";";}$f=fopen("db.php","w");fwrite($f, str_replace("$", "$", "<?php ".$output."?>"));fclose($f);?>

    ----------------------PROBLEM B:This snippet is part of a removal script to delete uploaded images and entries in the database file. My issue with this is the outputted image source is correct but it's not displaying. It just comes up as the alt text. Perhaps its a permissions issue?

    include('db.php');//lots of other codeforeach ($db as $key2 => $value2) {      $imagesource = $images.$value2;     echo "<img src=\"$imagesource\" alt=\"$value2\"/><br/>image: $value2<br/>uploaded: $key2<br/><a href=\"remove.php?key=$key2&value=$value2\" title=\"remove this image\">remove this image</a><br/><br/>";}

    Here are the permissions for the directories and files:PUBLIC_HTML.....folder1 (755)..........folder2 (755)...............admin (777)....................remove.php (777)............... images (777).....................main (777)..........................picture2.jpg (777)could my permissions be the issue? the values returned by the array are correct, but for some reason the only way i can view the image is if i access it directly.---Any help in either of these problems is GREATLY appreciated! I would have posted them in their own topics but it's probably easier to understand if they're both together because they function together.

  14. i have a title tag in my a tag because it will pop up a little tool-tip type thing about the text on mouseover. I also do this with images, because useing just the alt tag does not popup text in firefox, but it does in ie, so i use both. Or, if i dont want my image to show the tooltip in ie, i add a blank title tag so nothing pops up.

  15. You can't process local PHP files in IE. PHP is processed by the server, therefore, IE does not understand it. However if you download EasyPHP, there is a way you can do that, but all of your PHP files must be in a special folder in the program installation.http://www.easyphp.org/

×
×
  • Create New...