Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthornsnipes
    • CommentTimeSep 21st 2006
     
    Let me first start by saying that I love Plogger! That said I am trying to find a solution to allow users to upload their own photos. What I have so far is a file upload form that dumps the file in the /uploads/ directory. I then have to go into the admin panel and 'import' the file (photo). This is fine and actually works very well.

    In addition to that what I want to do is add a comment field to that form that will populate the photo comments. Currently I would have to add any comments during the 'import' session. It would be much easier and more streamlined if the user could enter there on comments in a form field and have that photo comments. Any ideas or suggestions on how I might do this?

    I would greatly appriciate any help on this.

    By the way here is my upload form:
    http://plogger.nathansnipes.com/plupload/plupload.html

    Here is the gallery:
    http://plogger.nathansnipes.com

    Thanks.
    • CommentAuthorsallam
    • CommentTimeSep 28th 2006
     
    thats exactly what I've been looking for. Could you please copy the code of the plupload.php file you're using with your form?

    I also hope someone adds the posibility for users to add their own comments.
    • CommentAuthornsnipes
    • CommentTimeSep 29th 2006
     
    Sallam: There are two files - plupload.html & plupload.php

    plupload.html - just a simple form pointing to the php script

    #############################
    <body>
    <form method="post" enctype="multipart/form-data" action="plupload.php"> Your Image file: <input type="file" name="filename"> <input type="submit"> </form> </body>
    #############################


    plupload.php

    #############################
    <?php
    define ('IMAGES_PATH',"/********/plogger.nathansnipes.com/uploads/"); // make sure that your scripts have write privileges to this path!!!
    $filename = $_FILES['filename']['name'];
    $tmp_filename = $_FILES['filename']['tmp_name'];

    if ($tmp_filename) {

    // test to make sure the file is of the correct file type
    $filename_array = explode(".",$filename);
    $type= $filename_array[1];
    if ($type!="gif" & $type !="jpg" & $type!="png") {
    die ("File type not recognized as a .gif, .jpg, or .png");
    } else {

    $newfile = IMAGES_PATH.$filename; // setup destination filename
    if (!file_exists($newfile)) {
    @$result = move_uploaded_file($tmp_filename,$newfile); // @ used to suppress error messages
    // move_uploaded_file also has a security feature built in to only move files that are HTTP posted uploads.

    if (!$result) {
    die ("Unable to move file.");
    } else {
    echo "Congradulations: Your file was uploaded!";
    } // end if - !$result

    } else {
    die( "Sorry, but that file '$newfile' already exists.");
    } // end if - file_exists
    } // end if - $type

    } else {

    die("No Filename Provided.");
    } // end if - $tmp_filename
    ?>
    #############################


    Does anyone know how I can tap into the comments? I want to be able to have a field that populates the comment for the photo. Anyone?
    • CommentAuthorsallam
    • CommentTimeOct 1st 2006 edited
     
    thanks nsnipes for the code
    as for the comments, I hope someone helps us in here.
    For now, I ask users, in a text I've added above the form, to re-name the pic file, before uploading it, with a descriptive comment of their choosing. This serves 2 ways:
    - for me to get the comment out of the file name
    - it also gives the picture page a friendly URL, instead of the common digits that pic files are often named with:
    http://www.egyptpix.com/upload.html
    • CommentAuthornsnipes
    • CommentTimeOct 2nd 2006
     
    sallam - glad you found a temporary solution.

    my problem is that I want users to be able to add comments that are much longer. Hard to do with a file name. Hopefully someone has some idea of how to do this.

    Any help would be greatly appriciated.
    • CommentAuthornsnipes
    • CommentTimeOct 9th 2006 edited
     
    ...
    • CommentAuthornsnipes
    • CommentTimeNov 6th 2006
     
    bumping this...

    Any thoughts on how to do this? Is a user upload feature in the works for beta 3?