Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

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
  #62  
Old 10-31-2004, 12:33 AM
Lord Brar's Avatar
Lord Brar Lord Brar is offline
 
Join Date: Jul 2004
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

:P So, I should be waiting for it BTW will it be a paid add-on or would you be generous enough to release it free???
Reply With Quote
  #63  
Old 10-31-2004, 07:58 PM
ambrosious ambrosious is offline
 
Join Date: Jun 2004
Posts: 206
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Where in postbit do I add that bit of code?
Reply With Quote
  #64  
Old 11-14-2004, 12:22 PM
x3n0's Avatar
x3n0 x3n0 is offline
 
Join Date: Sep 2002
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I will not support this hack if it's being used to conceal weapons of mass destruction or for bombing the crade of civilization.

We haven't decided if well be charging for the Gallery Hack or not. We will probably offer several different versions of the hack, a free version without support or installer software and a low priced (about $30 version with additional features, support, and a few different CSS styles thrown in for good measure. That's about all I can say about contract software here so as not to be a rule breaker. Try CalSat.net if you need solutions we can't discuss in a public forum.
Reply With Quote
  #65  
Old 12-16-2004, 07:09 PM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lo m8 is there anyway to OMIT certain types of attachements from this.Not everyone uploads pics all the time and when testing it - rars which im using to test show up as red x`s so would like it if rars and zips etc where ommited from the gallery

is this possible ?? would be neat if could

or is their a solution to stop zips and rars from showing up as red x`s

or an even better one - let this just show attachments from certain sections

Lot of or`s aint there
but i got loads of red x`s so any help would be helpful
Reply With Quote
  #66  
Old 12-17-2004, 08:23 AM
leeman's Avatar
leeman leeman is offline
 
Join Date: Nov 2004
Location: Sweden
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I only get red X's ....

Links and all works but the thuimbs only show red X ...
Reply With Quote
  #67  
Old 12-17-2004, 12:31 PM
lasto lasto is offline
 
Join Date: Jan 2002
Posts: 1,514
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

run attachments updater m8 in the admin cp maybe thats it - hacks works fine for me - i get red x`s if people have posted zips or rars in ttheir post so does anyone know how to fix this ?
Reply With Quote
  #68  
Old 01-25-2005, 06:10 PM
ryancooper ryancooper is offline
 
Join Date: Jul 2002
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I get the following error???

Database error in vBulletin 3.0.0 Release Candidate 3:

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 = 2
AND ((forumid IN(0Array,1,101,100,2,3,4,15,16,22,29,23,6,24,30,3 1,32,33,35,34,39,41,40,42,43,4 4,36,37,38,45,46,47,54,55,56,48,49,50,51,52,53,57, 58,59,60,61,62,63,64,65,66,67, 68,69,70,71,72,73,74,75,76,77,78,79,80,85,86,87,81 ,82,83,95,96,97,88,89,90,91,92 ,93,94,5,13,7,8,9,14,21,10,11,98,99) AND thread.visible = 1 AND post.visible = 1 AND deletionlog.primaryid IS NULL) OR attachment.postid = 0)

mysql error: Unknown column '0Array' in 'where clause'

mysql error number: 1054
Reply With Quote
  #69  
Old 01-25-2005, 10:19 PM
x3n0's Avatar
x3n0 x3n0 is offline
 
Join Date: Sep 2002
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I highlighted the error.

Quote:
Originally Posted by ryancooper
I get the following error???

Database error in vBulletin 3.0.0 Release Candidate 3:

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 = 2
AND ((forumid IN(0Array,1,101,100,2,3,4,15,16,22,29,23,6,24,30,31,32,33,3 5,34,39,41,40,42,43,44,36,37,38,45,46,47,54,55,56, 48,49,50,51,52,53,57,58,59,60,61,62,63,64,65,66,67 ,68,69,70,71,72,73,74,75,76,77,78,79,80,85,86,87,8 1,82,83,95,96,97,88,89,90,91,92,93,94,5,13,7,8,9,1 4,21,10,11,98,99) AND thread.visible = 1 AND post.visible = 1 AND deletionlog.primaryid IS NULL) OR attachment.postid = 0)

mysql error: Unknown column '0Array' in 'where clause'

mysql error number: 1054
Reply With Quote
  #70  
Old 01-25-2005, 11:51 PM
ryancooper ryancooper is offline
 
Join Date: Jul 2002
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by x3n0
I highlighted the error.
Thanks. I am just a beginner so can you tell me how to fix it?
Reply With Quote
  #71  
Old 01-26-2005, 02:04 AM
x3n0's Avatar
x3n0 x3n0 is offline
 
Join Date: Sep 2002
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank's for catching that! A simple typo. My copy doesn't have it and it's from the same archive. Odd... Must have snuck in there somehow! I've highlighted in this snippet of offending code:

Code:
	$attachments = $DB_site->query_first("
		SELECT COUNT(*) AS total,
			SUM(filesize) AS sum
		FROM " . TABLE_PREFIX . "attachment AS attachment
		LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = attachment.postid)
		LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (post.threadid = thread.threadid)
		LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(attachment.postid = deletionlog.primaryid AND type = 'post')
		WHERE attachment.userid = $userid
			AND	((forumid IN(0$forumids) AND thread.visible = 1 AND post.visible = 1 AND deletionlog.primaryid IS NULL) " . iif($userid==$bbuserinfo['userid'], "OR attachment.postid = 0") . ")
	");
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 09:05 PM.


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.08105 seconds
  • Memory Usage 2,329KB
  • Queries Executed 25 (?)
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
  • (4)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
  • (4)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_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