SitePoint Sponsor

User Tag List

Page 6 of 31 FirstFirst ... 234567891016 ... LastLast
Results 126 to 150 of 767
  1. #126
    SitePoint Evangelist netkid's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    563
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmm can some1 test my gallery at blog.net-kid.net/preupload.pcgi ?

    i think something is wrong,

    btw .pcgi is the xtension for my host so i can use GD or ImageMagick

    Santosh Sankar
    Bullish Bankers

  2. #127
    SitePoint Enthusiast
    Join Date
    Aug 2003
    Location
    Morristown, TN
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by netkid
    hmmm can some1 test my gallery at blog.net-kid.net/preupload.pcgi ?
    I got:
    ----------------------------------------------------------------------
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, webmaster@blog.net-kid.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    ----------------------------------------------------------------------
    also, you might want to put an index.html in your photogallery folder and link to the viewgallery.pcgi. I can see all your files!

    I clicked on the "My First Gallery" link and it never displayed. Something is bad wrong. Does your host not have GD installed? If so, why not use the code I provided a few posts ago?

  3. #128
    SitePoint Addict
    Join Date
    Sep 2002
    Posts
    225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Anonymous
    Nice tutorial, but it is a bit of re-inventing the wheel. Gallery is open source, full featured and supported by a huge community:
    http://gallery.menalto.com/index.php
    It's always good to improve skills, but why not stand on the shoulders of others and make something even better?
    i use this gallery software.. it's really very good stuff.. lots of features etc.. great software.. and they are coming out with a 2.0 soon that's going to be even better.

  4. #129
    SitePoint Member
    Join Date
    Oct 2003
    Location
    York, UK
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice one animal...

    that was just what i was looking for!

    i'll have a go at doing that this afternoon and if it still doesn't work i'll probably be back here!!!

  5. #130
    Fully Sweet Car noddy's Avatar
    Join Date
    Aug 2002
    Location
    Perth, Western Australia
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok I'm working on my back end to this now and I'm trying to delete the photos from the database but when the script uploads the image its setting the owner and user of the file as something different so I dont have permisson to delete or change perms on thoes files.

    Is their a way of including the permissions and user.group perms that the uploaded files should have or should I work out a way on the system to force the perms and uid.gid of the uploaded files???


    Below is my delete function.

    PHP Code:
     // Delete a picture from the database
    if(isset($_REQUEST['delete_photo'])) {
        
    $photo_id $_REQUEST['delete_photo'];
        
    $cid $_REQUEST['cid'];
            if(
    $photo_id != "" && $cid != "") {
                
    delete_photo($photo_id);
                
    $result_final .= "<br/><p style='color: green; font-weight: bold;'>Photo ID: $photo_id has been deleted from the database.</p>";
            } else {
                
    $result_final .= "<br /><p style='color: red; font-weight: bold;'>Their was an error in deleting the requested image please go back and try again.</p>";
            }
     } 
    Thanks for any help

  6. #131
    SitePoint Evangelist
    Join Date
    Nov 2003
    Location
    Brisbane, Australia
    Posts
    408
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Image Management

    Hi

    This is a great tutorial. I have been running an image library with cgi and perl scripts with limited functionality but this one is so much better.

    I have got heaps of it working thanks to the tutorial and the messages left here but I am having troubles with the image maintenance page.

    I want to add a delete an image option and preferably an edit and move image option.

    I'm pretty new at php but am getting to know my way around.

    Has anyone got this working and if so can you PLEASE post your working code.

    Many Thanks

    M Barnes

  7. #132
    Fully Sweet Car noddy's Avatar
    Join Date
    Aug 2002
    Location
    Perth, Western Australia
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    still working on mine having problems with deleting because of the names and the perms it gets given when uploaded

  8. #133
    Anonymous
    SitePoint Community Guest
    Great Article! One problem for me though:
    I really need to be able to use .gif's on upload. My ISP has PHP and GD library set so that it will "read" gif's but not write them. In another php program I'm using they get around the gif issue by having the program "ignore" gif's for the creation of thumbnails (only uses gd to create .jpeg and .png thumbs). Thus the thumbnail file reference for .gif's is set to the same image file name as the full-size image. Even though this is a slightly larger file to work with, it does allow one to use the existing .gif without having to force GD to "write" .gif's to the server (by way of patches or using older versions of the software, etc.).

    Can you possibly suggest a mod to your upload.php script as would allow this same functionality? (making the program "ignore" .gif's for thumbnail creation while using the full file reference for display purposes)?

    Many thanks!
    spin

  9. #134
    Fully Sweet Car noddy's Avatar
    Join Date
    Aug 2002
    Location
    Perth, Western Australia
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try using image magic then

  10. #135
    SitePoint Evangelist netkid's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    563
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My gallery works fine but wen u click on a gallery to see it, it never loads....

    http://www.blog.net-kid.net/photogal...ewgallery.pcgi

    BTW on my server to use GD ur extension is pcgi

    Santosh Sankar
    Bullish Bankers

  11. #136
    SitePoint Addict sleepingdanny's Avatar
    Join Date
    Oct 2002
    Location
    Israel
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It looks like that your gellery is in a constent loop. You might have told the
    script to go to the same page again and again. - Probably using Header(), check again.

    It tries to go to: 66.33.199.37 again and again.

    - Danny

  12. #137
    SitePoint Evangelist netkid's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    563
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so wut do i?

    Santosh Sankar
    Bullish Bankers

  13. #138
    SitePoint Addict sleepingdanny's Avatar
    Join Date
    Oct 2002
    Location
    Israel
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Add the code to your post and I will try to help you.

    - Danny

  14. #139
    SitePoint Evangelist netkid's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    563
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, im at school right now, I'll paste it in from home

    Santosh Sankar
    Bullish Bankers

  15. #140
    SitePoint Evangelist netkid's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    563
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can visit the view page at:
    http://blog.net-kid.net/photogallery/viewgallery.pcgi
    pcgi xtension is due to my server config

    Code:
    PHP Code:

    <?php
        
    include("config.inc.php");

        
    // initialization
        
    $result_array = array();
        
    $counter 0;

        
    $cid = (int)($_GET['cid']);
        
    $pid = (int)($_GET['pid']);

        
    // Category Listing

        
    if( empty($cid) && empty($pid) )
        {
            
    $number_of_categories_in_row 4;

            
    $result mysql_query"SELECT c.category_id,c.category_name,COUNT(photo_id)
                            FROM gallery_category as c
                            LEFT JOIN gallery_photos as p ON p.photo_category = c.category_id
                            GROUP BY c.category_id" 
    );
            while( 
    $row mysql_fetch_array$result ) )
            {
                
    $result_array[] = "<a href='viewgallery.php?cid=".$row[0]."'>".$row[1]."</a> "."(".$row[2].")";
            }
            
    mysql_free_result$result );    

            
    $result_final "<tr>\n";

            foreach(
    $result_array as $category_link)
            {
                if(
    $counter == $number_of_categories_in_row)
                {    
                    
    $counter 1;
                    
    $result_final .= "\n</tr>\n<tr>\n";
                }
                else
                
    $counter++;

                
    $result_final .= "\t<td>".$category_link."</td>\n";
            }

            if(
    $counter)
            {
                if(
    $number_of_categories_in_row-$counter)
                
    $result_final .= "\t<td colspan='".($number_of_categories_in_row-$counter)."'>&nbsp;</td>\n";

                
    $result_final .= "</tr>";
            }
        }


        
    //           Listing

        
    else if( $cid && empty( $pid ) )
        {
            
    $number_of_thumbs_in_row 5;

            
    $result mysql_query"SELECT photo_id,photo_caption,photo_filename FROM gallery_photos WHERE photo_category='".addslashes($cid)."'" );
            
    $nr mysql_num_rows$result );

            if( empty( 
    $nr ) )
            {
                
    $result_final "\t<tr><td>No Category found</td></tr>\n";
            }
            else
            {
                while( 
    $row mysql_fetch_array$result ) )
                {
                    
    $result_array[] = "<a href='viewgallery.php?cid=$cid&pid=".$row[0]."'><img src='".$images_dir."/tb_".$row[2]."' border='0' alt='".$row[1]."' /></a>";
                }
                
    mysql_free_result$result );    

                
    $result_final "<tr>\n";
        
                foreach(
    $result_array as $thumbnail_link)
                {
                    if(
    $counter == $number_of_thumbs_in_row)
                    {    
                        
    $counter 1;
                        
    $result_final .= "\n</tr>\n<tr>\n";
                    }
                    else
                    
    $counter++;

                    
    $result_final .= "\t<td>".$thumbnail_link."</td>\n";
                }
        
                if(
    $counter)
                {
                    if(
    $number_of_photos_in_row-$counter)
                
    $result_final .= "\t<td colspan='".($number_of_photos_in_row-$counter)."'>&nbsp;</td>\n";

                    
    $result_final .= "</tr>";
                }
            }
        }

        
    // Full Size View of Photo
        
    else if( $pid )
        {
            
    $result mysql_query"SELECT photo_caption,photo_filename FROM gallery_photos WHERE photo_id='".addslashes($pid)."'" );
            list(
    $photo_caption$photo_filename) = mysql_fetch_array$result );
            
    $nr mysql_num_rows$result );
            
    mysql_free_result$result );    

            if( empty( 
    $nr ) )
            {
                
    $result_final "\t<tr><td>No Photo found</td></tr>\n";
            }
            else
            {
                
    $result mysql_query"SELECT category_name FROM gallery_category WHERE category_id='".addslashes($cid)."'" );
                list(
    $category_name) = mysql_fetch_array$result );
                
    mysql_free_result$result );    

                
    $result_final .= "<tr>\n\t<td>
                            <a href='viewgallery.php'>Categories</a> &gt; 
                            <a href='viewgallery.php?cid=
    $cid'>$category_name</a></td>\n</tr>\n";

                
    $result_final .= "<tr>\n\t<td align='center'>
                        <br />
                        <img src='"
    .$images_dir."/".$photo_filename."' border='0' alt='".$photo_caption."' />
                        <br />
                        
    $photo_caption
                        </td>
                        </tr>"
    ;
            }
        }

    // Final Output
    echo <<<__HTML_END

    <html>
    <head>
        <title>Gallery View</title>
    </head>
    <body>
    <table width='100%' border='0' align='center' style='width: 100%;'>
    $result_final        
    </table>
    </body>
    </html>

    __HTML_END;
    ?>

    Santosh Sankar
    Bullish Bankers

  16. #141
    SitePoint Evangelist netkid's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    563
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ?

    Santosh Sankar
    Bullish Bankers

  17. #142
    SitePoint Enthusiast
    Join Date
    Aug 2003
    Location
    Morristown, TN
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by netkid
    You can visit the view page at:
    http://blog.net-kid.net/photogallery/viewgallery.pcgi
    pcgi xtension is due to my server config
    It has to be your server config. Your code runs fine on my server here:

    http://www.anglersforchrist.com/gallery/new.php

    I changed the name of the file and the name inside the code. Other than that, this is your code exactly.

    **update **
    I just looked at your site again and I got this to pull up:

    http://blog.net-kid.net/photogallery...ery.pcgi?cid=1

    http://blog.net-kid.net/photogallery...i?cid=1&pid=15

    it is "kinda working". Change the links to viewgallery.php in your code to viewgallery.pcgi and I think that will sovle your problem. You also need to look at how your 404 error document is setup in your htaccess file. That is not working right. Here is mine if it will help:

    ErrorDocument 404 http://www.anglersforchrist.com/404.html

    P.S. I see you take Tae Kwon Do. I have a black belt in TKD (first Dan)

  18. #143
    SitePoint Evangelist netkid's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    563
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok...which code though?

    Yea I just got my black belt in TKD about 3 wks ago

    Santosh Sankar
    Bullish Bankers

  19. #144
    SitePoint Enthusiast
    Join Date
    Aug 2003
    Location
    Morristown, TN
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by netkid
    PHP Code:
    while( $row mysql_fetch_array$result ) )
          {
        
    $result_array[] = "<a href='viewgallery.php?cid=".$row[0]."'>".$row[1]."</a> "."(".$row[2].")";

           }

    mysql_free_result$result ); 
    you posted this code... see the link to viewgallery.php? your file is not named that. change every instance to .php with .pcgi .

  20. #145
    SitePoint Evangelist netkid's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    563
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok thanks

    Santosh Sankar
    Bullish Bankers

  21. #146
    SitePoint Evangelist netkid's Avatar
    Join Date
    Jun 2003
    Location
    USA
    Posts
    563
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a question, how do I get rid of the the Test Gallery and How do I add a new gallery?

    Santosh Sankar
    Bullish Bankers

  22. #147
    Anonymous
    SitePoint Community Guest
    Is there a way to make the photo upload optional? I have good reason for this. I want the upload form with the option to upload and not make it puke if it doesn't have an image

  23. #148
    SitePoint Enthusiast
    Join Date
    Aug 2003
    Location
    Morristown, TN
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Anonymous
    Is there a way to make the photo upload optional? I have good reason for this. I want the upload form with the option to upload and not make it puke if it doesn't have an image
    Why not use javascript for validation on the fields?

    http://javascript.about.com/library/...rmvalidate.htm

  24. #149
    SitePoint Member
    Join Date
    Dec 2003
    Location
    devon UK
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    photo_caption to display with the Thumbnail Listing

    Hi,

    This tutorial is great, easy to follow and i got it working first time. I am a newB to PHP and itís nice to find something that is both well explained and that acutely worked without having to spend hours debugging.

    Q. How can I get the photo_caption to display with the Thumbnail Listing?

    Hope you can help!

  25. #150
    SitePoint Member
    Join Date
    Dec 2003
    Location
    devon UK
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    This tutorial is great, easy to follow and i got it working first time. I am a newB to PHP and itís nice to find something that is both well explained and that acutely worked without having to spend hours debugging.

    Q. How can I get the photo_caption to display with the Thumbnail Listing?

    Hope you can help!


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
  •