The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Instant Image Gallery - 5 minute install Details »» | |||||||||||||||||||||||||
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>"> </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>"> </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&page=$pagenumber&userid=$userid"><strong>$vbphrase[hide_thumbnails]</strong></a> <else /> <a href="gallery.php?pp=$perpage&page=$pagenumber&showthumbs=1&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> 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]&stc=1&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"> </td> </if> </tr> 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 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
|
Comments |
#32
|
||||
|
||||
Yes I was watching and refreshing it as you were installing. It seems you do not have thumbnails enabled on your forums. Without thumbnails enabled you'll only get links in the gallery page.
|
#33
|
|||
|
|||
they are (where) enabled already as you can see on http://www.zeewaterforum.org/forums/...3&page=3&pp=20
They are set at 600 px however |
#34
|
||||
|
||||
Dennis, I sent you a PM. Could be a difference between 3.0.0 and 3.0.3. See the PM and we'll figure it out.
|
#35
|
||||
|
||||
Same problem here as Dennis but yeah, getting close. (I am also on vb3.0.3 -- there were some comments in the vbarticles hack some time ago about the change from 3.0.1 to 3.0.3.)
http://www.shinraonline.com/board/ga...hp?userid=1189 |
#36
|
||||
|
||||
Looks to me like this should work on both 3.0.0 and 3.0.3
I've tracked it down to the conditional statement in the gallerybits template. Code:
<if condition="$show['thumbnail']"> <a href="attachment.php?$session[sessionurl]attachmentid=$post[attachmentid]" target="attachment"><img src="attachment.php?$session[sessionurl]attachmentid=$post[attachmentid]&stc=1&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> Thumb off: http://www.shinraonline.com/board/at...chmentid=11789 Thumb on: http://www.shinraonline.com/board/at...=11789&thumb=1 But for some reason you guys aren't satisfying the condition <if condition="$show['thumbnail']"> Ironically all of this code is straight out of the attachment templates on the user control panel. I can see that the "gallery" template is parsing the thumbnail variable correctly because the links are being centered in the table by this conditional: Code:
<if condition="$show['thumbnails']"><col align="center"></col></if> Why does it work on my forums?!?!?! I'm still trying to work it out guys. Thanks for all the beta testing. We really need a hack like this. Bear with me - I'm still a n00b. |
#37
|
||||
|
||||
Hmm... could this be the culprit?
https://vborg.vbsupport.ru/showthrea...threadid=68495 http://www.vbulletin.com/forum/showp...99&postcount=4 |
#38
|
||||
|
||||
OK, I think I figured it out. Instead of passing an array for the conditional in "gallerybits" I changed it to an INT variable.
In the "gallerybits" template on line 4. Replace the conditional: <if condition="$show['thumbnail']"> With: <if condition="$showthumbs"> I've edited the change into the first post. Hope this works so I can get on with the image editing, uploading, etc functions. |
#39
|
||||
|
||||
I used the updated gallerybits template but its still a no go for me. (I didnt re-upload gallery.php though - did I need to?)
|
#40
|
||||
|
||||
Okay, I got it to work (?) by removing this from the gallerybits template. Its a little screwy with first few attachments.
http://www.shinraonline.com/board/ga...humbs=0&page=1 PHP Code:
PHP Code:
|
#41
|
||||
|
||||
The problem is now you are stuck in thumbnail mode and the "Hide" link on the bottom of the table doesn't work correctly.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|