How to add an Upload form in the frontpage? How to add an Upload form in the frontpage?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

How to add an Upload form in the frontpage?

Started by avatarz, December 18, 2010, 12:55:08 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

avatarz

Hi,
This is my first post.
I need some help to add in my coppermine powered gallery http://www.msnavatarz.com/ , an upload form in the frontpage. I want that my users can easy upload images directly from the frontpage. Please give me some help..

My website is http://www.msnavatarz.com/

lurkalot

Not sure I fully understand your question.  ???

Your users should, (as long as they have the correct permissions), see a "Upload file" button at the top of every page.
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

avatarz

Quote from: lurkalot on December 18, 2010, 10:13:10 AM
Not sure I fully understand your question.  ???

Your users should, (as long as they have the correct permissions), see a "Upload file" button at the top of every page.

I know that there is a link, but I dont want just e link. I need a form where the users can upload one photo at once.

Here is a screenshot. (https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.pixhostr.com%2Fimage-5C90_4D0CCADA.jpg&hash=d36de54f4c119158103dc247295ddf366aba1773)

avatarz

I can't post photos here?  ??? Here is the link to the photo of the screenshot http://www.pixhostr.com/image-5C90_4D0CCADA.jpg

Αndré

Quote from: avatarz on December 18, 2010, 03:56:06 PM
I can't post photos here?
http://forum.coppermine-gallery.net/index.php/topic,55415.msg270617.html#msg270617


What exactly should happen when they upload a file? If you just have the "select file" form element, you have to hard-code to which album the files should be uploaded. Is this what you want?


Moving to themes board.

avatarz

Quote from: Αndré on December 20, 2010, 10:07:13 AM
http://forum.coppermine-gallery.net/index.php/topic,55415.msg270617.html#msg270617


What exactly should happen when they upload a file? If you just have the "select file" form element, you have to hard-code to which album the files should be uploaded. Is this what you want?


Moving to themes board.

After the upload the user have to be sent to the form where he/she can choose an album from a drop down menu, plus the title, description, keywords fields. This the way how coppermine works, or not? This is the simple one, where can be uploaded one file at time. See the screenshot.

Αndré

Quote from: avatarz on December 22, 2010, 11:13:19 AM
This the way how coppermine works, or not?
No. You have to select an album before you upload.

profili

QuoteNo. You have to select an album before you upload.

What is if we set a choosen album by default. Everthing uploaded from this simple frontpage upload form goes in this default album.
I would like a modification like this. A lot of people could use coppermine as a free image hosting script too.

Αndré

Quote from: profili on February 01, 2011, 01:34:27 AM
What is if we set a choosen album by default. Everthing uploaded from this simple frontpage upload form goes in this default album.
Then it's possible. Please post a link to your gallery and describe exactly where you preferably want the upload field to be displayed. A screenshot could also help.


Quote from: profili on February 01, 2011, 01:34:27 AM
A lot of people could use coppermine as a free image hosting script too.
What's the problem of using the existing upload forms?

profili


QuoteWhat's the problem of using the existing upload forms?

Nothing is wrong. It's fine and ok. But an upload form just in the frontpage is much simpler for the normal user.

Quote from: Αndré on February 01, 2011, 01:47:19 PM
Then it's possible. Please post a link to your gallery and describe exactly where you preferably want the upload field to be displayed. A screenshot could also help.

http://www.galsh.com/

I will put the form just under the header. I can read the code and can work with template.html
If you give me the right code for this I think I can implement it myself.

Thank you.


Αndré

Quote from: profili on February 01, 2011, 03:22:45 PM
I will put the form just under the header
Please create a screenshot and mark where exactly it should be, as I'm currently not sure what contains to the header for you and what not.

profili

As I said I can implement it myself if I have the code for the upload form!
Whatever, here you have a screenshot.

Αndré

list($timestamp, $form_token) = getFormToken();
$template_gallery_admin_menu .= <<< EOT
    <form name="cpgform" id="cpgform" method="post" action="db_input.php" enctype="multipart/form-data" >
    <input type="hidden" name="event" value="picture" />
    <input type="hidden" name="album" value="1" />
    <input type="hidden" name="form_token" value="{$form_token}" />
    <input type="hidden" name="timestamp" value="{$timestamp}" />
    <input type="file" name="userpicture" size="40" class="listbox" />
    <input type="submit" value="Upload" />
EOT;

profili

I tried this using anycontent.php and then using template.html but with the same error:

Error A valid form token could not be found.

profili

I think that anycontent.php is the right direction to go. :) It is ideal for a frontpage upload form.
Cheers

Αndré

Works for me as expected when I add the following code to anycontent.php in my testbed:
list($timestamp, $form_token) = getFormToken();
echo <<< EOT
    <form name="cpgform" id="cpgform" method="post" action="db_input.php" enctype="multipart/form-data" >
        <input type="hidden" name="event" value="picture" />
        <input type="hidden" name="album" value="1" />
        <input type="hidden" name="form_token" value="{$form_token}" />
        <input type="hidden" name="timestamp" value="{$timestamp}" />
        <input type="file" name="userpicture" size="40" class="listbox" />
        <input type="submit" value="Upload" />
    </form>
EOT;