Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Instant Image Gallery - 5 minute install Details »»
Instant Image Gallery - 5 minute install
Version: 1.00, by x3n0 x3n0 is offline
Developer Last Online: Sep 2008 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 08-16-2004 Last Update: 01-25-2005 Installs: 21
 
No support by the author.

A simple user image attachment gallery that requires a single script upload, 2 template creations, and 1 phrase creation.

Live demo:

http://www.zeewaterforum.org/forums/...s=1&userid=359

Step 1: Upload gallery.php to your forum home directory.

Step 2: Create a new global phrase named "gallery" with the text "Click to view {1}'s image gallery" or something similar.

Step 4: Create a template called "gallery" and past the following code into it:

Code:
<form action="gallery.php" method="post">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr>
	<td class="tcat" colspan="4">
		<if condition="$show['attachquota']">
			<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('attachinfo')"><img id="collapseimg_attachinfo" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_attachinfo].gif" alt="$vbphrase[attachment_statistics]" border="0" /></a>
		</if>
		<phrase 1="$username">$vbphrase[attachments_posted_by_x]</phrase>
	</td>
</tr>
</thead>
<if condition="$show['attachquota']">
<tbody id="collapseobj_attachinfo" style="$vbcollapse[collapseobj_attachinfo]">
	<tr>
		<td class="panelsurround" align="center" colspan="4">
		<div class="panel">
			<div style="width:$stylevar[formwidth_usercp]" align="$stylevar[left]">
				<fieldset class="fieldset">
					<legend>$vbphrase[attachment_statistics]</legend>
					<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
					<tr>
						<td><phrase 1="$attachsum" 2="$totalattachments">$vbphrase[currently_using_x_to_store_y_attachments]</phrase></td>
					</tr>
					<if condition="$show['attachlimit']">
					<tr>
						<td>
							<table style="border:2px groove" cellpadding="0" cellspacing="1" border="0" width="100%">
							<tr>
								<if condition="$show['currentattachsize']"><td width="$attachsize" style="background-color:red; font-size:10px" title="<phrase 1="$attachsum">$vbphrase[current_attachment_total_x]</phrase>">&nbsp;</td></if>
								<if condition="$show['totalattachsize']"><td width="$totalsize" style="background-color:green; font-size:10px" title="<phrase 1="$attachlimit">$vbphrase[maximum_attachment_storage_x]</phrase>">&nbsp;</td></if>
							</tr>
							</table>
						</td>
					</tr>
					</if>
					</table>
				</fieldset>
			</div>
		</div>
		</td>
	</tr>
</tbody>
</if>
<tbody>
<tr align="center">
	<td class="thead">$vbphrase[attachment]</td>
	<td class="thead">$vbphrase[title]</td>
	<if condition="$show['deleteoption']">
		<td class="thead">$vbphrase[date]</td>
		<td class="thead" style="padding:0px"><input name="allbox" type="checkbox" value="Check All" title="$vbphrase[check_uncheck_all]" onclick="checkall(this.form);"  /></td>
	<else />
		<td class="thead" colspan="2">$vbphrase[date]</td>
	</if>

</tr>
<if condition="$show['thumbnails']"><col align="center"></col></if>

$template[gallerybits]

<tr>
	<td class="tfoot" colspan="4" align="$stylevar[right]">
		<span class="smallfont" style="float:$stylevar[left]">
			<if condition="$show['thumbnails']">
				<a href="gallery.php?pp=$perpage&amp;page=$pagenumber&amp;userid=$userid"><strong>$vbphrase[hide_thumbnails]</strong></a>
			<else />
				<a href="gallery.php?pp=$perpage&amp;page=$pagenumber&amp;showthumbs=1&amp;userid=$userid"><strong>$vbphrase[show_thumbnails]</strong></a>
			</if>
		</span>
		<if condition="$show['deleteoption']">
			<input type="hidden" name="perpage" value="$perpage" />
			<input type="hidden" name="pagenumber" value="$pagenumber" />
			<input type="hidden" name="showthumbs" value="$showthumbs" />
			<input type="hidden" name="do" value="deleteattachments" />
			<input type="hidden" name="userid" value="$userid" />
			<input type="submit" class="button" value="$vbphrase[delete_selected]" />
		</if>
	</td>
</tr>
</tbody>
</table>

</form>

<if condition="$pagenav">
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-top:3px">
<tr valign="top">
	<td align="$stylevar[right]">$pagenav</td>
</tr>
</table>
</if>
Step 4: Create a new template called "gallerybits" and paste the following code in it:

Code:
<tr>
	<td class="alt2">
		<div>
			<if condition="$showthumbs">
				<a href="attachment.php?$session[sessionurl]attachmentid=$post[attachmentid]" target="attachment"><img src="attachment.php?$session[sessionurl]attachmentid=$post[attachmentid]&amp;stc=1&amp;thumb=1" border="0" /></a>
			<else />
				<img class="inlineimg" src="$stylevar[imgdir_attach]/$post[attachmentextension].gif" alt="$post[attachmentextension]" /> <a href="attachment.php?$session[sessionurl]attachmentid=$post[attachmentid]" target="attachment">$post[filename]</a>
			</if>
		</div>
		<div class="smallfont">$post[size], <phrase 1="$post[counter]">$vbphrase[x_downloads]</phrase></div>
	</td>
	<td class="alt1">
		<div class="smallfont">
			<div><strong>$vbphrase[thread]</strong>: <a href="showthread.php?$session[sessionurl]t=$post[p_threadid]">$post[t_title]</a></div>
			<div><strong>$vbphrase[post]</strong>: <a href="showthread.php?$session[sessionurl]p=$post[postid]#post$post[postid]">$post[p_title]</a></div>
		</div>
	</td>
	<td class="alt2">
		<if condition="$show['inprogress']">
			<em>$vbphrase[in_progress]</em>
		<else />
			<div class="smallfont">$post[postdate] <if condition="!$show['detailedtime']"><span class="time">$post[posttime]</span></if></div>
		</if>
	</td>
	<if condition="$show['deletebox']">
		<td class="alt1" align="center" style="padding:0px"><input type="checkbox" name="deletebox[$post[attachmentid]]" value="yes" /></td>				
	<else />
		<td class="alt1" align="center">&nbsp;</td>
	</if>
</tr>
Step 5: Call the script passing the "userid" variable of the users gallery you wish to view.

Example - I simply added the following code to my postbit template:

Code:
<a href="gallery.php?userid=$post[userid]&pp=10&showthumbs=1" target="new"><img class="inlineimg" src="$stylevar[imgdir_button]/gallery.gif" alt="<phrase 1="$post[username]">$vbphrase[gallery]</phrase>" border="0" /></a>
This allows the user to link to the gallery from anyone's posts. Then I uploaded the image to my button image directory. I've included an image you can use.

This even shows the location in Who's Online with no modifications necessary. Uploading/delete capabilities should be a simple addon, I'm working on it now.

Edit: Completely redone with it's own templates because it didn't like using vB's templates (hard coded URLs).

Edit: Changed template conditional making this 3.0.3 friendly.

Edit: Typo mysteriously appears in source making code fubar. Code revised and reuploaded.

Show Your Support

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

Comments
  #72  
Old 02-18-2005, 07:06 PM
n_i_t_r_o_u_s n_i_t_r_o_u_s is offline
 
Join Date: Feb 2005
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is a great hack, is it possible to port it to 3.0.6?

here's the error i get when calling it up:

Database error in vBulletin 3.0.6:

Code:
Invalid SQL: 
		SELECT thread.forumid, post.postid, post.threadid AS p_threadid, post.title AS p_title, post.dateline AS p_dateline, attachment.attachmentid,
			thread.title AS t_title, attachment.filename, attachment.counter, attachment.filesize AS size, IF(thumbnail = '', 0, 1) AS hasthumbnail,
			user.username, thread.open, attachment.userid
		FROM wwwtoke_attachment AS attachment
		LEFT JOIN wwwtoke_post AS post ON (post.postid = attachment.postid)
		LEFT JOIN wwwtoke_thread AS thread ON (post.threadid = thread.threadid)
		LEFT JOIN wwwtoke_deletionlog AS deletionlog ON(attachment.postid = deletionlog.primaryid AND type = 'post')
		LEFT JOIN wwwtoke_user AS user ON (attachment.userid = user.userid)
		WHERE attachment.userid = 1
			AND ((forumid IN (,3,4,7,11,9,33,5,6,31,8,12,10,32,30,16,18,17,29,1,2,19,20,34,13,14,15,21,22,23,24,25,26,27,28) AND thread.visible = 1 AND post.visible = 1 AND deletionlog.primaryid IS NULL) OR attachment.postid = 0)
		ORDER BY attachment.attachmentid DESC
		LIMIT 0, 10
	
mysql error: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '3,4,7,11,9,33,5,6,31,8,12,10,32,30,16,18,17,29,1,2,19,20,34,13,

mysql error number: 1064
Reply With Quote
  #73  
Old 03-19-2005, 05:13 AM
gldtn gldtn is offline
 
Join Date: Apr 2003
Location: US
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This would be nice if you could get it to work like this: http://www.overgrow.com/edge/gallery.php
Reply With Quote
  #74  
Old 03-27-2005, 11:45 PM
Joe Pimms Joe Pimms is offline
 
Join Date: Jan 2005
Location: Canada
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by n_i_t_r_o_u_s
this is a great hack, is it possible to port it to 3.0.6?

here's the error i get when calling it up:

Database error in vBulletin 3.0.6:

Code:
Invalid SQL: 
		SELECT thread.forumid, post.postid, post.threadid AS p_threadid, post.title AS p_title, post.dateline AS p_dateline, attachment.attachmentid,
			thread.title AS t_title, attachment.filename, attachment.counter, attachment.filesize AS size, IF(thumbnail = '', 0, 1) AS hasthumbnail,
			user.username, thread.open, attachment.userid
		FROM wwwtoke_attachment AS attachment
		LEFT JOIN wwwtoke_post AS post ON (post.postid = attachment.postid)
		LEFT JOIN wwwtoke_thread AS thread ON (post.threadid = thread.threadid)
		LEFT JOIN wwwtoke_deletionlog AS deletionlog ON(attachment.postid = deletionlog.primaryid AND type = 'post')
		LEFT JOIN wwwtoke_user AS user ON (attachment.userid = user.userid)
		WHERE attachment.userid = 1
			AND ((forumid IN (,3,4,7,11,9,33,5,6,31,8,12,10,32,30,16,18,17,29,1,2,19,20,34,13,14,15,21,22,23,24,25,26,27,28) AND thread.visible = 1 AND post.visible = 1 AND deletionlog.primaryid IS NULL) OR attachment.postid = 0)
		ORDER BY attachment.attachmentid DESC
		LIMIT 0, 10
	
mysql error: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '3,4,7,11,9,33,5,6,31,8,12,10,32,30,16,18,17,29,1,2,19,20,34,13,

mysql error number: 1064
i get the same type of error to here is my error :
PHP Code:
Database error in vBulletin 3.0.7:

Invalid SQL
        
SELECT thread.forumidpost.postidpost.threadid AS p_threadidpost.title AS p_titlepost.dateline AS p_datelineattachment.attachmentid,
            
thread.title AS t_titleattachment.filenameattachment.counterattachment.filesize AS size, IF(thumbnail ''01) AS hasthumbnail,
            
user.usernamethread.openattachment.userid
        FROM attachment 
AS attachment
        LEFT JOIN post 
AS post ON (post.postid attachment.postid)
        
LEFT JOIN thread AS thread ON (post.threadid thread.threadid)
        
LEFT JOIN deletionlog AS deletionlog ON(attachment.postid deletionlog.primaryid AND type 'post')
        
LEFT JOIN user AS user ON (attachment.userid user.userid)
        
WHERE attachment.userid 1
            
AND ((forumid IN (,1,2) AND thread.visible AND post.visible AND deletionlog.primaryid IS NULL) OR attachment.postid 0)
        
ORDER BY attachment.attachmentid DESC
        LIMIT 0
10
    
mysql error
You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '1,2) AND thread.visible = 1 AND post.visible = 1 AND deletionlo

mysql error number: 1064 
Reply With Quote
  #75  
Old 03-31-2005, 03:50 PM
lairnoc's Avatar
lairnoc lairnoc is offline
 
Join Date: Oct 2003
Location: The Netherlands
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried to implement it in 3.0.7 on http://www.lairnoc.com but i get this error as well
Code:
Database error in vBulletin 3.0.7:

Invalid SQL: 
		SELECT COUNT(*) AS total,
			SUM(filesize) AS sum
		FROM attachment AS attachment
		LEFT JOIN post AS post ON (post.postid = attachment.postid)
		LEFT JOIN thread AS thread ON (post.threadid = thread.threadid)
		LEFT JOIN deletionlog AS deletionlog ON(attachment.postid = deletionlog.primaryid AND type = 'post')
		WHERE attachment.userid = 11
			AND	((forumid IN (,1,11,10,17,9,8,21,19,20,13) AND thread.visible = 1 AND post.visible = 1 AND deletionlog.primaryid IS NULL) )
	
mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1,11,10,17,9,8,21,19,20,13) AND thread.visible = 1 AND post.visi

mysql error number: 1064

Date: Thursday 31st of March 2005 07:41:40 PM
Script: http://www.lairnoc.com/gallery.php?userid=11&pp=10&showthumbs=1
Referer: http://www.lairnoc.com/showthread.php?t=73
Username: lairnoc
IP Address: 83.118.3.72
If anyone could help me fix it i would love it...
Reply With Quote
  #76  
Old 03-31-2005, 06:21 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To solve this problem, edit your gallery.php.

Find:
PHP Code:
    $attachments $DB_site->query_first(
Add before
PHP Code:
    $forumids substr($forumids1); 
Reply With Quote
  #77  
Old 04-01-2005, 07:10 AM
lairnoc's Avatar
lairnoc lairnoc is offline
 
Join Date: Oct 2003
Location: The Netherlands
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thnx marco
Reply With Quote
  #78  
Old 05-01-2005, 11:31 PM
Allan's Avatar
Allan Allan is offline
 
Join Date: Jun 2003
Location: France
Posts: 1,513
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks w3n0 for this hack, very nice

and thanks MarcoH64, work perfectly with 3.0.7

~~~~~~~~~~~~~~~~~~~
Click install
~~~~~~~~~~~~~~~~~~~
Reply With Quote
  #79  
Old 05-05-2005, 11:01 PM
VanAusdal VanAusdal is offline
 
Join Date: Mar 2005
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I really like the idea of this hack but I have done everything this thread advises but I am still getiint the above mentions sql error. Mine looks like this:

Database error in vBulletin 3.0.7:

Invalid SQL:
SELECT COUNT(*) AS total,
SUM(filesize) AS sum
FROM attachment AS attachment
LEFT JOIN post AS post ON (post.postid = attachment.postid)
LEFT JOIN thread AS thread ON (post.threadid = thread.threadid)
LEFT JOIN deletionlog AS deletionlog ON(attachment.postid = deletionlog.primaryid AND type = 'post')
WHERE attachment.userid = 1585
AND ((forumid IN (,9,31,32,29,10,26,28,11,12,13,14,16,17,18,19,20,2 1,22,1,2,3,4,5,7,8,6,15,23,30,24,25) AND thread.visible = 1 AND post.visible = 1 AND deletionlog.primaryid IS NULL) )

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '9,31,32,29,10,26,28,11,12,13,14,16,17,18,19,20,21 ,22,1,2,3,4,5,

mysql error number: 1064

Date: Thursday 05th of May 2005 11:44:13 PM
Script: http://www.creativexpress.com/commun...0&showthumbs=1
Referer: http://www.creativexpress.com/commun...?threadid=1054
Username: admin
IP Address: 71.36.64.19


Please help!!
Reply With Quote
  #80  
Old 05-06-2005, 05:02 AM
Allan's Avatar
Allan Allan is offline
 
Join Date: Jun 2003
Location: France
Posts: 1,513
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by VanAusdal
I really like the idea of this hack but I have done everything this thread advises but I am still getiint the above mentions sql error. Mine looks like this:

Database error in vBulletin 3.0.7:

Invalid SQL:
SELECT COUNT(*) AS total,
SUM(filesize) AS sum
FROM attachment AS attachment
LEFT JOIN post AS post ON (post.postid = attachment.postid)
LEFT JOIN thread AS thread ON (post.threadid = thread.threadid)
LEFT JOIN deletionlog AS deletionlog ON(attachment.postid = deletionlog.primaryid AND type = 'post')
WHERE attachment.userid = 1585
AND ((forumid IN (,9,31,32,29,10,26,28,11,12,13,14,16,17,18,19,20,2 1,22,1,2,3,4,5,7,8,6,15,23,30,24,25) AND thread.visible = 1 AND post.visible = 1 AND deletionlog.primaryid IS NULL) )

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '9,31,32,29,10,26,28,11,12,13,14,16,17,18,19,20,21 ,22,1,2,3,4,5,

mysql error number: 1064

Date: Thursday 05th of May 2005 11:44:13 PM
Script: http://www.creativexpress.com/commun...0&showthumbs=1
Referer: http://www.creativexpress.com/commun...?threadid=1054
Username: admin
IP Address: 71.36.64.19


Please help!!

https://vborg.vbsupport.ru/showpost....8&postcount=76 , no ?
Reply With Quote
  #81  
Old 05-06-2005, 05:11 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you do like i recommended, it is impossible you still get this error.
Reply With Quote
Reply

Thread Tools

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 11:54 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05238 seconds
  • Memory Usage 2,354KB
  • Queries Executed 27 (?)
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
  • (6)bbcode_code
  • (3)bbcode_php
  • (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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_postinfo_query
  • fetch_postinfo
  • 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
  • postbit_imicons
  • 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