Jump to content
Sign in to follow this  
Paws

Gallery?!?!

Recommended Posts

I think we should have the Gallery working on the swz.net homepage smile.gif not that one for all the players that used to be on subspace.net but one for just swz. Just a thought.

 

.p

Share this post


Link to post
Share on other sites

This is an idea being worked on. It's hampered by my inability TO program IN anything but HTML (I am a struggler)... We have a PHP script that would make things very easy, but miew has been gone AND SOME things have TO be done TO allow people TO post pics. I thought OF how cool this feature would be too, I'll work on it.

Share this post


Link to post
Share on other sites

Uh, there's a lot OF free scripts out there. Nothing has TO be coded FROM scratch.

 

Edit: http://www.scriptarchive.com/ssi_image.html USING this PHP upload script that I peiced together:

 

<?php 



// Create the main upload function 

function do_upload() { 

    

   // Create an array containing all valid upload file types for this script 

   $allowed_types = array( 

       "image/gif" => "gif", 

       "image/pjpeg" => "jpg",

"image/png" => "png", 

       // Add more types here if you like 

   ); 

    

   // Check to see if the file type is in the allowed types array 

   if(!array_key_exists($_FILES['userfile']['type'], $allowed_types)) { 

       die("Invalid file type. Read the instructions, numbnuts."); 

   } 

    

   // Set the maximum uploadable file size => 51200 = 50kb 

   $maxfilesize = 51200; 

    

   // Is the file larger than it is allowed to be? 

   if($_FILES['userfile']['size'] > $maxfilesize) { 

       die("This file is too large. Did you see those directions? Perhaps you should read them."); 

   } 

    

   // Where will the file be uploaded to? 

   $uploaddir = $_SERVER['DOCUMENT_ROOT'] . "/uploads/"; 

    

   // What is the files temporary name? 

   $file = $_FILES['userfile']['tmp_name']; 

    

   // What is the files actual name? 

   $filename = $_FILES['userfile']['name']; 

        

   // Does this file already exist on the server? 

   if(file_exists($uploaddir . $filename)) { 

       die("A file with that name already exists on this server. Please rename your file and try again."); 

   } else { 

       // This file does not already exist, so copy it. 

       copy($file, $uploaddir.$filename) or die("This file could not be copied. Please try again."); 

   } 

    

   // All done! :-) 

   echo "File uploaded successfully. Isn't life grand?"; 

} 



?> 

<html> 

   <head> 

       <title>Upload Your Image</title> 

   </head> 

   <body>

<p align="left"><font face="Verdana" size="2">Please use this form to upload your image submission to the database. Click the Browse button and select a file from your local drive. Images can be either jpeg's, png's, or gif's, and may be no larger than 50KB (51200 bytes). If it breaks, please don't yell at me, I'm just a lowly peon; grist of the SWZ mill. Or something.</font></p>

       <form method="post" enctype="multipart/form-data"> 

           <input type="hidden" name="action" value="do_upload"> 

           <input type="file" name="userfile"><br /> 

           <input type="submit" name="submit" value="Upload Image"> 

       </form> 

   </body> 

</html> 

<?php 

// If the form has been completed, execute the upload function (above). 

if($_POST['action'] == "do_upload") { 

   do_upload(); 

} 

?> 

Share this post


Link to post
Share on other sites

I talked to sanka and he agrees with me that we should handle this in house. We have the resources and the ability, and it will be fairly easy without all the hastle of integrating with the forum.

Share this post


Link to post
Share on other sites

QUOTE
I talked to sanka and he agrees with me that we should handle this in house. We have the resources and the ability, and it will be fairly easy without all the hastle of integrating with the forum.

 

I think its a good idea to have a gallery compatible with the forum, since it would mean one less login for our users to remember...basically a script that just shares phpbb's USER db AND doesnt require ANY modification OF the forum.

Share this post


Link to post
Share on other sites

The system we're talking about here won't really require a login that I can see. However, due to the LESS THAN PERFECT ftpd this host uses, I can't upload anything without errors. So I'm still working on it.

 

Additionally, that type of system requires that certain PHP modules be installed on the server, and that a seperate SQL database be established. While all that is fine and dandy, the system I'm attempting TO develop IS far simpler; it will allow users TO upload a file, THEN a gallery script will allow them TO manage the file they upload. It can be included ON ANY page via a simple php includes. Thumbnails will be generated FROM basic HTML, without the need FOR server modification.

 

That being said, TO mod this forum IS TO FIRST upgrade it TO a CURRENT version. So one thing AT a TIME, please. :smt120

Share this post


Link to post
Share on other sites

4 images has mods already made for integration.

 

its all a matter of installing.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...