Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 09-27-2000 Last Update: Never Installs: 0
 
No support by the author.

How do all..

I am going to release my image gallery hack (in action http://www.overgrow.com/edge/index.php) without the admin piece.. I am still trying to finish it up without having to re-write all the vB delete routines.. Plus some of you may want to write your own way of administering the images that get uploaded and keeping things clean..

When my admin piece is finished I will post it here as well..

Features: Not too many.. very basic..

-- Only allows gif or jpg files to be uploaded.. I'm sure you can easily modify this for other file types.. PHP really makes things easy..

-- To start a thread in the gallery you must upload an image.. (doesn't apply when replying)

-- You can set a file size limit for upload..

-- Stores information in a new vB table for use later.. (ie; admin stuff. Currently the admin piece is in progress..)

You can download the instructions here - http://www.overgrow.com/tmp/imggalhack.zip

It is a fairly simple hack with a few mods to global.php, newthread.php and newreply.php and a few new templates.. It is not automated, the download is just a text file with the modification intructions..

Please let me know if I made the instructions to confusing and what ya think..

Have Fun..
Herb

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 09-27-2000, 03:04 PM
Guest
 
Posts: n/a
Default

I don't know regular expressions in PHP by the back of my hand but there has got to be a way to replace the following lines with just one line of code:

Code:
       $fileupload_name = str_replace(" ","",$fileupload_name);
       $fileupload_name = str_replace("%","",$fileupload_name);
       $fileupload_name = str_replace("!","",$fileupload_name);
       $fileupload_name = str_replace("@","",$fileupload_name);
       $fileupload_name = str_replace("#","",$fileupload_name);
       $fileupload_name = str_replace("~","",$fileupload_name);
       $fileupload_name = str_replace("^","",$fileupload_name);
       $fileupload_name = str_replace("&","",$fileupload_name);
       $fileupload_name = str_replace("+","",$fileupload_name);
       $fileupload_name = str_replace("=","",$fileupload_name);
Otherwise, nice job Herb
Reply With Quote
  #3  
Old 09-28-2000, 03:23 AM
Guest
 
Posts: n/a
Default

Excellent man I've been waiting a long time for this, Thank you!
Reply With Quote
  #4  
Old 09-28-2000, 06:41 PM
Guest
 
Posts: n/a
Default

upimage should be filename or the other way around. please note this....ROCK on...i love this image hack
Reply With Quote
  #5  
Old 09-28-2000, 08:31 PM
Guest
 
Posts: n/a
Default

Quote:
upimage should be filename or the other way around. please note this....ROCK on...i love this image hack
Not sure what you mean here.. upimage should be upimage.. this is the field name in the table, filled on the insert by the variable TheFileNameIs.. Your welcome to change it to something else though..
Reply With Quote
  #6  
Old 09-28-2000, 09:12 PM
Guest
 
Posts: n/a
Default

i don't know how to explain it really in depth, i have been up to late. but i will just show you what i am talking about, the table created doesn't have a field for upimage. so upimage should be filename.

Code:
CREATE TABLE imagegal (
   imagegalid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
   postid int(10) unsigned DEFAULT '0' NOT NULL,
   filename varchar(100) NOT NULL,
   username varchar(50) NOT NULL,
   userid int(10) unsigned DEFAULT '0' NOT NULL,
   PRIMARY KEY (imagegalid)
);

Code:
      if (isset($fileupload)) {

      $DB_site->query("INSERT INTO imagegal (imagegalid,postid,upimage,username,userid) VALUES ('NULL','$mypostid','$TheFileNameIs','".addslashes($username)."','$userid')");

      }
cause i got this error

Code:
Database error in vBulletin: Invalid SQL: INSERT INTO imagegal (imagegalid,postid,upimage,username,userid) VALUES ('NULL','15','CaddilacEscalade.gif','poil11','1')
mysql error: Unknown column 'upimage' in 'field list'
mysql error number: 1054
Date: Thursday 28th of September 2000 01:57:59 PM
Script: /boards/newthread.php
newthread.php?action=newthread&forumid=24
Reply With Quote
  #7  
Old 09-28-2000, 09:20 PM
Guest
 
Posts: n/a
Default

you are right my man.. My bag.. As soon as my ftp server comes back I will re-upload with the correct field name..

thanks..
Reply With Quote
  #8  
Old 09-29-2000, 02:47 AM
Guest
 
Posts: n/a
Default

Herb could you please let us know once you have uploaded the file?
Reply With Quote
  #9  
Old 09-29-2000, 03:57 AM
Guest
 
Posts: n/a
Default

ok I have changed the imageupload for filename, but how would I go if I did not want the users to HAVE to upload a picture when starting a thread?
How can I remove this option, so users can upload pictures whenever they want?
NOTE: this is prolly very easy to do, I apologize for my ignorance on PHP!

Thanks
Reply With Quote
  #10  
Old 09-29-2000, 01:21 PM
Guest
 
Posts: n/a
Default

conan - I uploaded the new zip with the correct create table fields.. sorry about that..

Quote:
How can I remove this option, so users can upload pictures whenever they want?
Ok in newthread.php find this code that you added for the hack..

Code:
if (isset($fileupload)){
and change it to

Code:
if (isset($fileupload) and $fileupload != "none") {
Then below the above should be

Code:
if ($fileupload == "none") {
       eval("echo standarderror(\$bbtitle,\"".gettemplate("error_filenone")."\");");
       exit();
       }
Remove that check..

Then find

Code:
    // ##### Image Upload Hack (update image table) #####

      if (isset($fileupload)) {

      $DB_site->query("INSERT INTO imagegal (imagegalid,postid,upimage,username,userid) VALUES ('NULL','$mypostid','$TheFileNameIs','".addslashes($username)."','$userid')");

      }

    // ##### Image Upload Hack (update image table) #####
and change it to:

Code:
    // ##### Image Upload Hack (update image table) #####

      if (isset($fileupload) and $fileupload != "none") { {

      $DB_site->query("INSERT INTO imagegal (imagegalid,postid,upimage,username,userid) VALUES ('NULL','$mypostid','$TheFileNameIs','".addslashes($username)."','$userid')");

      }

    // ##### Image Upload Hack (update image table) #####

I think that should do it for ya..

Herb



[Edited by Herb on 09-29-2000 at 10:25 AM]
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:38 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04028 seconds
  • Memory Usage 2,279KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (9)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete