Jump to content

Craig Hopson

Members
  • Posts

    212
  • Joined

  • Last visited

Everything posted by Craig Hopson

  1. strange it just started working dont know why....I dislike I.E. Thanks for the reply tho
  2. hi guys i cant see where im going wrong there must be an easier way to get rounded corners in IE any way...trying this https://github.com/malsup/cornerwith this code.. <script type="text/javascript" src="js/jquery.corner.js"></script><script type="text/javascript">$('#header').corner();</script> does this look correct?
  3. hi guys well the question is in the topic i found this http://strd6.com/2011/09/html5-javascript-pasting-image-data-in-chrome/ and this http://www.pasteshack.net/ proving it can be done!! The reason i want this is because i want users of my website to be able to upload photos from there mobiles and file cant be uploaded via http on mobile device (i read somewhere)if there is a better way or and example code for doing this then please help Thanks.
  4. hi guys how do i supply website information?(see pic) i am guessing its done with meta tags hence the topic title but i have googled but with no luck
  5. Craig Hopson

    Encrypting

    hi i have this function to encrypt data in cookies is this the correct way? <?phpdefine('SALT', 'hyDap4XQ6TDu');function encrypt($text){ return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, SALT, $text, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))));}function decrypt($text){ return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, SALT, base64_decode($text), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));}?>
  6. hi i'm stuck again i want a simple image slider but the problem is this var finalslide=''leftrightslide[0]='<img src="dynamicbook1.gif" border=1></a>'leftrightslide[1]='<img src="dynamicbook2.gif" border=1></a>'leftrightslide[2]='<img src="dynamicbook3.gif" border=1></a>'leftrightslide[3]='<img src="dynamicbook4.gif" border=1></a>'leftrightslide[4]='<img src="dynamicbook5.gif" border=1></a>' as you can see i need to tell it what images to display problem is my images come from this $result = mysql_query("SELECT * FROM files ORDER BY RAND() LIMIT 20");while($row = mysql_fetch_array($result)) {$img = 'uploads/'.$row['album'].'/'.$row['filename'];echo '<span style="padding:10px;"><img src="'.$img.'" width="50px" height="50px" style="border:1px solid black;"/></span>';} so how can i integrate them?
  7. i have many pages of scripts across many files all starting <?session_start();include("config.php");
  8. Craig Hopson

    start session

    hi I use sessions now and then i get this error once i get this error the only way to get rid is to delete a cookie called PHPSESSID with value of = 53ff81c3601f65a11a9026a079284d89. what is this error why do i get (not often)?
  9. ok new problem $('#div1, #div2, #div3, #div4, #div5, #div6, #div7').hide('slow'); any think i put in hide like 'slow', 'fast', or 'fade', {}, 1000dont work any idea?
  10. SOLVED like this <script type="text/javascript"> $('#test').addClass('js');$(function() { var timer = setInterval( showDiv, 1000); var counter = 0; function showDiv() { if (counter ==0) { counter++; return; } $('#div1, #div2, #div3, #div4, #div5, #div6, #div7') .stop() .filter( function() { return this.id.match('div' + counter); }) .show('fast'); counter == 10? counter = 0 : counter++; if(counter == 10){ $('#div1, #div2, #div3, #div4, #div5, #div6, #div7').hide('slow'); counter = 0; } }});</script>
  11. hi guys i'm using this <script type="text/javascript"> $('#test').addClass('js');$(function() { var timer = setInterval( showDiv, 2000); var counter = 0; function showDiv() { if (counter ==0) { counter++; return; } $('#div1, #div2, #div3, #div4, #div5, #div6, #div7') .stop() .filter( function() { return this.id.match('div' + counter); }) .show('fast'); counter == 7? counter = 0 : counter++; }});</script> to show #div1, #div2 ect One after another Question:- How do i make it hide them all 20 seconds after the last one shows and restart? Thanks guys
  12. My page is a simple gallery users upload pictures mainly from mobile devices, if user takes photo and phone is sidewise picture is sidewise in gallery so need a option to rotate the image also saving image so next time they look at the gallery it's correct
  13. Thanks for the quick reply how would i do it with AJAX?
  14. hi guys i have a few problems when i use this function to rotate image function rotate($img,$rot){global $id; //get the detail of the image $imageinfo=getimagesize($img); switch($imageinfo['mime']) { //create the image according to the content type case "image/jpg": case "image/jpeg": case "image/pjpeg": //for IE $src_img=imagecreatefromjpeg("$img"); break; case "image/gif": $src_img = imagecreatefromgif("$img"); break; case "image/png": case "image/x-png": //for IE $src_img = imagecreatefrompng("$img"); break; } //rotate the image according to the spcified degree $src_img = imagerotate($src_img, $rot, 0); //output the image to a file imagejpeg ($src_img,$img);}rotate($_GET['img'],$_GET['rot']) PROBLEMS1.......When using browsers cache images so browser needs refreshing after use(I have used httaccess to stop cache'ing)2.......Calling the function. At the moment the function is in a file and i use the GET method from a href (<a href="rotate.php?img='.$Image.'&rot=90">Rotate</a> which flashes a white blank page before coming back to the gallary3.......Could i use jQuery to rotate (It has to save the image after rotation)4.......IS THERE A BETTER WAY TO DO THIS?????? Thanks guys
  15. hi guys i cant get this working am i missing something simple? <script src="js/jquery-1.7.2.min.js"></script><script type="text/javascript">$('.show-element', '.Item').hover(function() { var container = $(this).attr("id").replace('show_', 'info_'); $('#' + container).show();}, function() { var container = $(this).attr("id").replace('show_', 'info_'); $('#' + container).fadeOut(200);});</script><style>.hidden{ display: none;}</style><div class='Item'> <div class='show-element' id='show_1'>Show</div> <div id="info_1" class="hidden">some stuff</div> <div class='show-element' id='show_2'>Show</div> <div id="info_2" class="hidden">some stuff</div></div> (does not show on hover)
  16. PROBLEM SOLVED THANKS BIRBAL YOU REALLY ARE THE MAN
  17. function converttojpg($originalimg){$filetype = @end(explode(".", $originalimg));if (strtolower($filetype) == 'jpg' or strtolower($filetype) == 'jpeg') { $srcImg = imagecreatefromjpeg($originalimg); imagejpeg($srcImg,$originalimg,75); imagedestroy($srcImg); $thumb_img = imagecreatefromjpeg($originalimg); $origw=imagesx($thumb_img);$origh=imagesy($thumb_img);$new_w = 150;$diff=$origw/$new_w;$new_h=$new_w;$dst_img = imagecreate($new_w,$new_h);imagecopyresampled($dst_img,$thumb_img,0,0,0,0,$new_w,$new_h,imagesx($thumb_img),imagesy($thumb_img));$ONLYname = str_replace('uploads/'.$_COOKIE['id'].'/',"",$originalimg);imagejpeg($dst_img, 'uploads/'.$_COOKIE['id'].'/thumbnail/'.$ONLYname,100); } if (strtolower($filetype) == 'png') { $srcImg = imagecreatefrompng($originalimg); imagejpeg($srcImg,$originalimg,100); imagedestroy($srcImg); $NewName = str_replace(".png",".jpg",$originalimg); rename($originalimg,$NewName); $thumb_img = imagecreatefromjpeg($NewName); $origw=imagesx($thumb_img);$origh=imagesy($thumb_img);$new_w = 150;$diff=$origw/$new_w;$new_h=$new_w;$dst_img = imagecreate($new_w,$new_h);imagecopyresampled($dst_img,$thumb_img,0,0,0,0,$new_w,$new_h,imagesx($thumb_img),imagesy($thumb_img));$ONLYname = str_replace('uploads/'.$_COOKIE['id'].'/',"",$NewName);imagejpeg($dst_img, 'uploads/'.$_COOKIE['id'].'/thumbnail/'.$ONLYname,100); } if (strtolower($filetype) == 'gif') { $srcImg = imagecreatefromgif($originalimg); imagejpeg($srcImg,$originalimg,100); imagedestroy($srcImg); $NewName = str_replace(".gif",".jpg",$originalimg); rename($originalimg,$NewName);$thumb_img = imagecreatefromjpeg($NewName); $origw=imagesx($thumb_img);$origh=imagesy($thumb_img);$new_w = 150;$diff=$origw/$new_w;$new_h=$new_w;$dst_img = imagecreate($new_w,$new_h);imagecopyresampled($dst_img,$thumb_img,0,0,0,0,$new_w,$new_h,imagesx($thumb_img),imagesy($thumb_img));$ONLYname = str_replace('uploads/'.$_COOKIE['id'].'/',"",$NewName);imagejpeg($dst_img, 'uploads/'.$_COOKIE['id'].'/thumbnail/'.$ONLYname,100); } } Thanks guys for taking the time to look into this for me
  18. Yes I have sorted that out the only problem is the thumbnail quality
  19. ok this is original imageAnd this is after now this is not a usable thumbnail what am i doing wrong?
  20. i have done this but still the same any other ideas??
  21. Like this imagejpeg($dst_img, 'uploads/'.$_COOKIE['id'].'/thumbnail/'.$ONLYname,100);
  22. This is the quality i'm getting
×
×
  • Create New...