SitePoint Sponsor

User Tag List

Page 20 of 31 FirstFirst ... 1016171819202122232430 ... LastLast
Results 476 to 500 of 767
  1. #476
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How to add a watter mark to the uploaded image ?
    will a great feature though
    Never be shy to ask silly Qs
    An answer is always better than none

  2. #477
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    am faceing a problem with delete photo
    it delete the thumb but not the larg image and i get this.

    am testing on localhost IIS
    and i chenged the premission but still same problem ??!!

    help please

    Warning: unlink(photos/20.jpg) [function.unlink]: Permission denied in E:\mysite\script\photoalbum\test\edit_photo.php on line 103
    Process completed!
    Back to Administration Page
    Never be shy to ask silly Qs
    An answer is always better than none

  3. #478
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i have coded a random image display it can be handy for some.
    i know its not the best way but it serves its purpuse.

    you can may be modify it to better.


    PHP Code:
     <?php            
     
    include("config.php");
     
     
    $result1 mysql_query"SELECT category_id FROM gallery_category ORDER BY RAND() LIMIT 1" );
     
    $row mysql_fetch_row$result1 );
     
     
    $cid $row[0];
     
     if (
    $cid){
     
    $result mysql_query"SELECT photo_id, photo_caption, photo_filename FROM gallery_photos WHERE photo_category='".addslashes($cid)."'ORDER BY RAND() LIMIT 3" );

     while( 
    $row mysql_fetch_array$result ) )
     {
     echo 
    "<a href='photoalbum.php?cid=$cid&pid=".$row[0]."'><img src='".$images_dir."/tb_".$row[2]."' border='0' alt='".$row[1]."' /></a>";
     }
     
    mysql_free_result$result );    
     }
     
    ?>
    Never be shy to ask silly Qs
    An answer is always better than none

  4. #479
    SitePoint Member
    Join Date
    Mar 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there any way to set it up so that when you view all the thumbnails and then click on one it opens up in another window!? (which you can then set attributes on - i.e. wiindow size etc) I've had a look through the forum but cant find nothing!

    Cheers

  5. #480
    Obsessive designer Infizi's Avatar
    Join Date
    May 2004
    Location
    North Pole
    Posts
    450
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    New window

    hey,

    its very easy, you need to use java script! Firstly, you need to make these adjustments to your script...
    (1) - Create a new file called 'photo.php'
    (2) - Cut and Paste the PHP from your script that shows the image and its details. You will need to use the variable $imgID as your reference in the script. so when you get the details from the DB make sure you use $imgID!
    (3) - Cut and Paste anything in the head of your gallery script that includes security, admin or any other required includes, and paste it in the head of your new script.
    (4) - In your script, find the thumbnail display script and change the link to href="javascript:displayPhoto('imgID');", replace imgID with the image id from your PHP script.
    (5) - In photo.php, in the head section, add this in.
    Code:
        <script type="Javascript">   
        function displayPhoto(imgID){
        var path_to_photo_script =	"http://www.mysite.com/gallery/photo.php?imgID="+imgID;
        window.open(path_to_photo_script,'Image Display','height='+h+',width='+w+'resizeable=no,toolbar=no,location=no,directories=no,status=no,menubar=no);
        }
        </script>
    customise photo.php until you get the window how you want!
    New Design - PHP Slowly flowing in!

    Infizi Studio's

  6. #481
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey guys,
    I dunno if we've gone over this, buuuuut.... is there a way to have the admin login on a different page than the main index? I can easily see where it would be an advantage to have it there, but for my current project, its an eyesore. Can anyone help?

  7. #482
    SitePoint Member
    Join Date
    Mar 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers Infizi, i'll give it a shot!!

  8. #483
    Obsessive designer Infizi's Avatar
    Join Date
    May 2004
    Location
    North Pole
    Posts
    450
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    admin login

    yeah easy as.

    Just create a new php file, say admin_login.php or something and add in your login script in to that, and simply remove the admin login button from your main.php script.

    Hope that helps - if you dont understand PM me your code and i will try and help you furthur
    New Design - PHP Slowly flowing in!

    Infizi Studio's

  9. #484
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Infizi
    yeah easy as.

    Just create a new php file, say admin_login.php or something and add in your login script in to that, and simply remove the admin login button from your main.php script.

    Hope that helps - if you dont understand PM me your code and i will try and help you furthur
    hi Infizi it look like you are well equipt with PHP
    may be you can help me and SP members on how to integrate a watermark
    for the gallery.

    it will be apriciated from my side

    its just a though, thanks in advince
    Never be shy to ask silly Qs
    An answer is always better than none

  10. #485
    SitePoint Wizard spence_noodle's Avatar
    Join Date
    Jan 2004
    Location
    uk, Leeds (area)
    Posts
    1,264
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by hisham777
    am faceing a problem with delete photo
    it delete the thumb but not the larg image and i get this.

    am testing on localhost IIS
    and i chenged the premission but still same problem ??!!

    help please

    Warning: unlink(photos/20.jpg) [function.unlink]: Permission denied in E:\mysite\script\photoalbum\test\edit_photo.php on line 103
    Process completed!
    Back to Administration Page
    make sure your folder is set to '777'. then try again.
    "Don't you just love it when you solve a programming bug only to create another."

  11. #486
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry i have not mentioned that i solved the problem.

    thanks though for the replay.
    Never be shy to ask silly Qs
    An answer is always better than none

  12. #487
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Infizi, your idea worked (but of course, right? )

    And I have to second hisham's request on doing watermarks... I just read through this entire thread (all 20 pages), since I was sure it must have been covered. Surprisingly, it turns out it wasn't. I know there's an SP article on how to do it in general, I just didn't know if someone had incorporated it yet into this gallery.

  13. #488
    Obsessive designer Infizi's Avatar
    Join Date
    May 2004
    Location
    North Pole
    Posts
    450
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Watermarking

    Hey all - Thanks for the apprecation

    Reason i know so much about this is because i was with a few of the original people who decided to overhaul SP example and add so many new features. Im currently re-writing my old gallery script ot comply with XML and CSS standards - but mainly to make it more user firendly.

    As far as watermarking goes - the script posted on SP does the job perfectly - you will need to add this into your code after the upload script. Look for where GBLib is used in the script to resixe the image. Note that i have edited this script a little to make it compatiable with the gallery script

    PHP Code:
    $my_watermark "watermark.png"// Must be PNG-8 Format
    $margin 5// px margin around watermark
    $my_image $photos_uploaded['name'][$counter].".".$photos_uploaded['type'][$counter];
    $filetype $photos_uploaded['type'][$counter];

    $watermark_image imagecreatefrompng($my_watermark);
    $w[0] = imagesx($watermark_image);
    $w[1] = imagesy($watermark_image);

    $function_suffix $gd_function_suffix[$filetype]; 
    $function_to_read 'ImageCreateFrom' $function_suffix;
    $function_to_write 'Image' $function_suffix;
    $image $function_to_read($my_image);
    $size getimagesize($my_image);
    $dest_x $size[0] - $w[0] - $margin;
    $dest_y $size[1] - $w[1] - $margin;
    imagecopymerge($image$watermark$dest_x$dest_y00$w[0], $w[1], 100);                   
    $function_to_write($image$my_image);
    imagedestroy($image);
    imagedestroy($watermark); 
    This is un tested, but should work. Simply it uses the same code from the gallery script ot make it work with more than just jpegs. In theroy, if you place it after you copy the image from the temp to the desired folder then the thumbnails will also be watermarked. If you place it in the correct place you may also be able to remove these lines:

    $function_suffix = $gd_function_suffix[$filetype];
    $function_to_read = 'ImageCreateFrom' . $function_suffix;
    $function_to_write = 'Image' . $function_suffix;

    because the script has already made them! Hope this helps/works. If you need help implementing it please PM or MSN me
    New Design - PHP Slowly flowing in!

    Infizi Studio's

  14. #489
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cool thanks am trying to implement it with the code now

    thanks
    Never be shy to ask silly Qs
    An answer is always better than none

  15. #490
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no lack thanks though for the code may be i need more trys
    Never be shy to ask silly Qs
    An answer is always better than none

  16. #491
    SitePoint Member
    Join Date
    May 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have been trying to get the photo date to display under each thumbnail but I havenít been successful at it. Does anyone have suggestions on how to do this?

    Iím also a bit stumped on how to list the photos by the date so the newest photos show up before the old ones.

    Any help is appreciated.

  17. #492
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok i think we can do that together
    first you have to make a new colom in the table gallery_photos () called date_added
    make it as DATETIME and the defaut 0000-00-00 00:00:00,
    then in the upload script change the statement this one
    PHP Code:
    mysql_query"INSERT INTO gallery_photos(`photo_filename`, `photo_caption`, `photo_category`) VALUES('0', '".addslashes($photo_caption[$counter])."', '".addslashes($_POST['category'])."')" ); 
    into
    PHP Code:
    mysql_query("INSERT INTO gallery_photos(`photo_filename`, `photo_caption`, `photo_category`, `dateadded` ) 
    VALUES('0', '"
    .addslashes($photo_caption[$counter])."','".addslashes($_POST['category'])."','NOW()')" ); 
    Notes NOW() will add the corrent time and date.

    then in the display you need to add ORDER BY dateadded ASC

    this method should work any problem let me know glad to help

    by the way welcom to site point
    Never be shy to ask silly Qs
    An answer is always better than none

  18. #493
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i have just tested this its working

    in the upload.php

    change the SELECT statement into
    PHP Code:

     mysql_query
    "INSERT INTO gallery_photos(`photo_filename`, `photo_caption`, `photo_category`, `dateadded`) VALUES('0', '".addslashes($photo_caption[$counter])."', '".addslashes($_POST['category'])."', NOW())" ); 

    and in the display.php page change the SELECT Statement into this
    PHP Code:

     $result 
    mysql_query"SELECT photo_id,photo_caption,photo_filename FROM gallery_photos WHERE photo_category='".addslashes($cid)."' GROUP BY dateadded DESC LIMIT $from$max_results"); 
    and make a new colom in the table gallery_photos () called dateadded
    make it as DATETIME and the defaut 0000-00-00 00:00:00


    i have tested it and its working
    Never be shy to ask silly Qs
    An answer is always better than none

  19. #494
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorvin did you make it work ?
    Never be shy to ask silly Qs
    An answer is always better than none

  20. #495
    SitePoint Member
    Join Date
    May 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Hisham, that worked out well. I'm still unable to get the date to display on the thumbnail listing though.

  21. #496
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    am having problem integrating it to the code
    i get thumb and a black image.
    Never be shy to ask silly Qs
    An answer is always better than none

  22. #497
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sorvin
    Thanks Hisham, that worked out well. I'm still unable to get the date to display on the thumbnail listing though.
    you welcome
    Never be shy to ask silly Qs
    An answer is always better than none

  23. #498
    Non-Member bitbytes's Avatar
    Join Date
    May 2006
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    some problem while integrating it .

  24. #499
    Non-Member bitbytes's Avatar
    Join Date
    May 2006
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok ok its been solved. actually problem at my end.

  25. #500
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bitbytes
    ok ok its been solved. actually problem at my end.
    ok would you care to share your solution with me and rest of SP members
    Never be shy to ask silly Qs
    An answer is always better than none


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •