View Full Version : Attachment Viewer
Admin
10-31-2001, 10:00 PM
This is a nice little hack I've been meaning to release for quite some time, but for some reason I waited for v2.2.0. :)
For a demo of this just view an attached image on this forum (I'll attach an image in the next post).
Anyway, this is very easy to install. Only one template to edit and two files to change, it doesn't get any easier!
Just download the installer (attached to this post), upload to your admin folder, and run in your browser.
Again thanks Bane for the installer, and thanks JamesUS for that little copyright notice. :)
Have fun! :china:
Admin
11-01-2001, 06:26 PM
For a demo click below.
very nice firefly, it will be on priority on my intall list!
rockergrrl
11-01-2001, 06:55 PM
Cool Hack! I was hoping you would release this... :D
I'll install this tonight... :)
Thanks! Its a great enhancement!
JJR512
11-01-2001, 09:28 PM
I'd prefer that when I click on an attached image, that the image shows up in the same browser window that the board was in. To get back to the board, just backup. This is the way attached images have worked up until 2.2.0; now, for some reason, they open in a new window. Why? What's wrong with the window you're already in? Opening and closing browser windows quickly hurts many non-NT-kernel versions of Windows, too.
Can anyone tell me how to get 2.2.0 to open attached images (or other files that open in a browser at all) to open in the same window?
eva2000
11-01-2001, 09:37 PM
opening attachments in new window was actually my suggestion :)
to open in same window find the attachment template and change the href target from _blank to _top or remove the target part
|DarkManX|
11-01-2001, 11:12 PM
it didn't create the attachmentview template for me automatically, so could someone please post the code thats in the template that is created during install....thanks
JTMON
11-02-2001, 12:01 AM
Very nice Hack guys! Install was a snap with no problems!
eva2000
11-02-2001, 10:51 PM
bug report in getinfo template
when you click on the Posted by username link on the attachment viewer page, it redirects you to the lost password page instead of users profile to fix
change
Posted by <a href="member.php?s=$session[sessionhash]&userid=$attachuserid">$attachusername</a>
to
Posted by <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$attachuserid">$attachusername</a>
MarkB
11-02-2001, 10:53 PM
Nice :pleased:
JTMON
11-02-2001, 11:31 PM
Where exactly do you make that code change?
eva2000
11-02-2001, 11:47 PM
Originally posted by JTMON
Where exactly do you make that code change? in getinfo template
JTMON
11-03-2001, 12:14 AM
I've searched the getinfo template and cannot find that code anywhere. I even modified it to match my php3 vbulletin but still no luck finding it:(
eva2000
11-03-2001, 12:16 AM
Originally posted by JTMON
I've searched the getinfo template and cannot find that code anywhere. I even modified it to match my php3 vbulletin but still no luck finding it:( the code is from the modified getinfo templates from the first post in this thread
JTMON
11-03-2001, 12:21 AM
I installed using the instructions but it only said to modify the postbit_attachment template. I've looked both places but can't find the code?
JTMON
11-03-2001, 12:23 AM
I did a search for the string using the Admin CP, it shows in the attachmentview template.
JTMON
11-03-2001, 12:29 AM
Yup Yup, I made the changes in the attachmentview template and it works correctly now.:D:D:D:D
eva2000
11-03-2001, 01:18 AM
Originally posted by JTMON
Yup Yup, I made the changes in the attachmentview template and it works correctly now.:D:D:D:D :cool: :D :)
Goldfinger
11-03-2001, 06:46 AM
FireFly always makes the coolest hacks :). Good work bro.
Admin
11-03-2001, 07:19 AM
Thakns everyone! :pleased:
Thanks eva, I fixed the file now. :)
eva2000
11-03-2001, 08:02 PM
no probs :D
|DarkManX|
11-03-2001, 08:52 PM
could someone please post the attachmentview code for me....it didn't work for me for some reason...thanks
|DarkManX|
11-04-2001, 04:24 PM
ok got it!!
thanks
eva2000
11-04-2001, 06:39 PM
Originally posted by |DarkManX|
ok got it!!
thanks :D
Little test
http://www.suprascene.com/temp/error.jpg
squawell
11-12-2001, 11:07 PM
it's a nice hack !!
thanks FireFly~~~
pestilence
11-14-2001, 12:55 AM
superb hack keeps my forum tables looking neat again for some of my users who cant comprehend resize the image first....another cracking hack firefly :)
Horizon
11-27-2001, 03:32 AM
I dont think it worked for me, when I tried to attach something to a post it told me to resize the image, but I did all the changes....is there something I am missing?
DarkReaper
11-28-2001, 01:20 AM
Swank :D
Installed :)
thanx Firefly, this one works like a treat
DarkReaper
11-30-2001, 12:26 AM
Bug:
http://www.unrealtournament.org/forums/attachment.php?s=&postid=46367&fullpage=1
User's name shows up as "Fatal_Exception<LSD>" when it should be "Fatal_Exception<LSD>"
Admin
11-30-2001, 11:25 AM
Ok, try this fix.
In attachment.php, replace this:
$attachusername=$getuser[username];
with this:
$attachusername=unhtmlspecialchars($getuser[username]);
DarkReaper
12-01-2001, 02:49 AM
Worked :)
DarkReaper
12-01-2001, 06:43 PM
You might want to update the zip with that fix.. ;)
Originally posted by JTMON
I installed using the instructions but it only said to modify the postbit_attachment template. I've looked both places but can't find the code?
Me too, I don't know what else should I need to edit or create? How come the install file didn't create it for me? Anyway, the hack didn't work for me, it says:
No attachment specified. If you followed a valid link, please notify the webmaster
Help please?
Sinecure
12-10-2001, 10:47 PM
Just installed it, great hack, no flaws :) I mofied the navbar so that is suited the customizing i have done with mine already and I changed the template around a bit to suit my needs, but other then that it was easier then Pie on a sunday night :)
Thanks Firefly for the hack and Bane for the installer portion :)
Bimma Boy
12-11-2001, 04:45 PM
Wow, what a cool hack, installed in minutes! :)
You guys make wicked hacks - bring them on!
Bimma Boy
VirtueTech
12-14-2001, 04:10 AM
Will this work with 2.0.3?
Admin
12-14-2001, 05:48 AM
I think it was initially written for 2.0.3, but I waited until 2.2.0 was out. So I think it would work, yeah. :)
fixer
12-14-2001, 04:28 PM
Hi
I cant not find
updateuserforum($getforuminfo['forumid']);
in the root/attachment.php for vb2.0.3
help please
VirtueTech
12-14-2001, 10:22 PM
I can't find that in 2.0.3 either.
Any ideas?
nafae
12-14-2001, 11:02 PM
The hack seemed simple enough.. :D but it looks like nothing changed (it just opens attachments like it used to.)
nafae
12-14-2001, 11:04 PM
I got it working, when you said "next" i thought you ment outside of the quotes (for the last step) so i put it right NEXT to the line and it now works like a charm :) thanks firefly!
VirtueTech
12-16-2001, 04:41 AM
a polite bump
Originally posted by fixer
Hi
I cant not find
updateuserforum($getforuminfo['forumid']);
in the root/attachment.php for vb2.0.3
help please
Admin
12-16-2001, 11:30 AM
That line isn't in <2.2.0 versions, so just ignore it and put it in the line above. :)
VirtueTech
12-16-2001, 06:48 PM
The line above? sorry ...I don't mean to be a pest...can you give me an anchor. thanks.
Admin
12-17-2001, 05:30 AM
Of course, what was I thinking. :)
Here:
$idname='attachment';
eval("standarderror(\"".gettemplate('error_invalidid')."\");");
exit;
}
VirtueTech
12-17-2001, 05:39 AM
That code is not in attachment.php
I do see something of that sort in functions.php
Remember I am using 2.0.3 and trying to get through step2 for attachment.php
I don't have this line:
updateuserforum($getforuminfo['forumid']);
Admin
12-17-2001, 06:09 AM
Weird.
Try this one:
if ($noshutdownfunc) {
dotagious
12-22-2001, 09:01 PM
Four things:
1. Great hack
2. Anyway to make it open up in the same window
OR
3. Open up in a seperate window, but then open up the next image in that same new window.
4. Anyway to upgrade this to show a thumbnail image, that when clicked, opened to a full size in the same manner as this hack allows?
OH! and does this work on 2.2.1 ?
Linus
12-27-2001, 05:40 PM
need help ... this din work for me ...
instead it caused the attachment not to appear at all ...
I checked and redid the changes as necessary
using v2.2.1
Lucky
12-31-2001, 02:01 PM
Good hack!
5861king
01-01-2002, 02:15 AM
I have a problem for some reason the varible $newpagelink is not being parsed through onto the postbit_attachment
i have this in my admin/functions.php
$newpagelink='&fullpage=1';
and in my template postbit_attachment i have the following code
<p><normalfont><img src="{imagesfolder}/attach/$post[attachmentextension].gif" width="16" height="16" border="0" alt="">Attachment: <a href="attachment.php?s=$session[sessionhash]&postid=$post[postid]$newpagelink" target="_blank">$post[filename]</a></normalfont><br>
<smallfont>This has been downloaded $post[counter] time(s).</smallfont></p>
so to work around this i have done this in my postbit_attachment
$post[postid]&fullpage=1
which works fine, but want i want to know is why the $newpagelink varible does not work.
Thanks for your help in advance!!!!
Admin
01-01-2002, 12:19 PM
Are you sure you uploaded the new functions.php?
5861king
01-01-2002, 02:28 PM
yep!!, 100% sure, it has been uploaded. :)
Admin
01-01-2002, 02:59 PM
Umm, I really don't know what to tell you.
Are you sure you pasted it in the right place?
E-mail me your functions.php file and I'll take a look.
5861king
01-01-2002, 06:29 PM
o.k. i have sent u part of my functions.php where u describe about puting in the varible in. let me know if u want all of my functions.php and i'll sent it 2 u.
Thanks Firefly for your help!!!! :)
Admin
01-02-2002, 10:51 AM
Sorry pal, I can't find anything wrong with what you sent me. :(
5861king
01-03-2002, 07:16 AM
o.k. No prolem, thanks for your help. At least the attachment viewer works. A excellent hack.
Tahnks for all your help FireFly :D
Scrub
01-07-2002, 08:03 AM
For the people who can't get it working. This is what it should look like in the posbit_attachment template.
<p><normalfont><img src="{imagesfolder}/attach/$post[attachmentextension].gif" width="16" height="16" border="0" alt="">Attachment: <a href="attachment.php?s=$session[sessionhash]&postid=$post[postid]=$newpagelink" target="_blank">$post[filename]</a></normalfont><br>
<smallfont>This has been downloaded $post[counter] time(s).</smallfont></p>
This should help clear up some confusion. Take out the target="_blank" if you want it to open in the same window. :)
WildWayz
01-07-2002, 12:02 PM
Excellent work FireFly!
--James
mSoul01
01-07-2002, 10:02 PM
wow.. another seemless install.. vB2.2.1 and vBP pr8..
much appreciated.. great job..
afterlab
01-12-2002, 04:00 AM
I have had this hack installed awhile back but now whenever someone posts an attachment it gives me a "No Permission" page. And I checked over and over, in PHP files and templates and it has yet to see a problem. Although my first attachment DID work. It somehow worked and all the rest (new ones) don't work.
Any 411?
Linus
01-14-2002, 12:14 PM
hack doesn't seem to work for me ... images still displayed on the post page ... any ideas ?
tweak
01-14-2002, 06:27 PM
Just installed this works GREAT thanx
Erwin
01-14-2002, 11:27 PM
Thanks. Easy. :)
afterlab
01-15-2002, 04:26 AM
Originally posted by afterlab
I have had this hack installed awhile back but now whenever someone posts an attachment it gives me a "No Permission" page. And I checked over and over, in PHP files and templates and it has yet to see a problem. Although my first attachment DID work. It somehow worked and all the rest (new ones) don't work.
Any 411?
Bump.
Linus
01-15-2002, 02:08 PM
Is there no support being offered for this hack ? cos if there isn't I gotta remove what I've done ...
Xelation
01-20-2002, 04:45 PM
Warning: Cannot add header information - headers already sent by (output started at /home/xelation/public_html/forum/admin/functions.php:2233) in /home/xelation/public_html/forum/admin/functions.php on line 1501
Does anyone know what would be the matter? I tried installing it twice now.... :confused: So can anyone tell me please?
Xelation
01-20-2002, 04:54 PM
I dont have that problem anymore... Although now I don't know how to get my images in the viewer.... the images will go into the thread instead of the viewer... does anyone know how to fix this problem?
Admin
01-21-2002, 08:03 AM
Turn off the option to show attachments in posts.
Xelation
01-21-2002, 01:45 PM
nope, nope I was wrong, I still get this message when I go into the thread with the attached file.....
Warning: Cannot add header information - headers already sent by (output started at /home/xelation/public_html/forum/admin/functions.php:2233) in /home/xelation/public_html/forum/admin/functions.php on line 1501
anyone know what the problem is?
Shenlong
01-21-2002, 02:44 PM
another great hack firefly!
Xelation
01-21-2002, 09:12 PM
I'm still having this problem after a whole day of trying to get it fixed.... Can anyone help me please... I can't do anything else until I get this fixed... here is the problem....
Warning: Cannot add header information - headers already sent by (output started at /home/xelation/public_html/forum/admin/functions.php:2233) in /home/xelation/public_html/forum/admin/functions.php on line 1501
So can anyone help me please? Thank you.
Admin
01-22-2002, 08:13 AM
Xelation, make sure you don't have any linefeeds or spaces after ?> at the end of functions.php.
Xelation
01-23-2002, 03:57 PM
Hey chen, I am still having troubles with the attachment viewer... I installed it perfectly and it won't work, there's no errors, and I also turned off the option of viewing images in a thread... After all is said and done... I still just get a plan old white background with an image... do you know what would be the problem?
Xelation
01-23-2002, 05:18 PM
Ah, found out my problem finally!!! Great hack! works awsome!!!
irn-bru
02-12-2002, 11:42 PM
I had some problems with the installer so I hand hacked it myself
I see a few posts that it didnt install the hack or template to anything that was true in my case.
This might help you the hack worked for me when I hand hacked it.
mondaynightmike
02-15-2002, 05:34 PM
wicked hack firefly thanks.
69-FLy-gUy
02-22-2002, 06:54 AM
Mine shows it on the white background. what have i done wrong?
Xelation
02-23-2002, 12:05 AM
On my friends board there is something wrong with the userid or something... I found this problem... when you go to view An attachment, it says..... Posted By: but then some random user name goes here. So does anyone have any clues of whats going on here? here is what the attachmentview template looks like.
<html>
<head>
<title>$bbtitle - Attachment Viewer</title>
$headinclude</head><body>$header<!-- breadcrumb -->
<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextra} align="center">
<tr><td><normalfont><b>$navbar > Attachment Viewer</b>
</normalfont></td></tr></table><!-- /breadcrumb --><br>
<table cellpadding="0" border="0" cellspacing="1" width="{contenttablewidth}" align="center"><tr>
<td nowrap valign="top" align="center"><normalfont>
<img src="attachment.php?s=$session[sessionhash]&attachmentid=$attachmentid">
<br>
<br>Posted by <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$attachuserid">$attachusername</a>
</normalfont><br><smallfont><a href="attachment.php?s=$session[sessionhash]&attachmentid=$attachmentid">
<normalfont>[</normalfont>image alone<normalfont>]</normalfont></a> <a href="$nav_url">
<normalfont>[</normalfont>back<normalfont>
</normalfont></a><br><br><br> <center>
$bbtitle takes no responsibility for the content of messages
<br>and or images linked to or displayed on $bbtitle. All uploaded<br>
material remains the property of the user who uploaded it.
</center></smallfont></td></tr></table>$footer</body></html>
Xelation
02-23-2002, 06:52 PM
can anyone help me with the current problem I stated above?
Thanks Firefly.. another good one.
Working demo at http://www.teenagedweb.com/attachment.php?s=&postid=1266&fullpage=1 (You don't need to be registered to view attachments)
Stylez
03-04-2002, 09:36 PM
this works just fine, thanks :P
Crazy Mofo
05-01-2002, 02:26 AM
i alos have that random name thing happening can some1 help pls? is there a fix?
also for the ppl who are just getting the white nackround Makre sure its the admin/functions you are changing and re-uploading too not root/functions
Crazy Mofo
05-01-2002, 04:25 PM
* Crazy Mofo gives a polite bump :(
David Bott
05-01-2002, 04:44 PM
Question...2.2.5 safe for install using the install script?
Dark Odin
05-01-2002, 07:08 PM
How can I get this to work with attachments in PMs?
FleaBag
05-18-2002, 02:13 PM
Installed on 2.2.5, excellent addition to my forums, a noticeable amount of extra posts have occured!
David Bott
05-18-2002, 03:41 PM
Installed nicely in 2.2.5. Thank you.
Gary King
07-25-2002, 07:06 PM
What exactly does this hack do? (Isn't 2.2.6 like this?)
Just wondering :ermm:
Elmer
10-12-2002, 06:53 PM
grate hack. i'm gonna hit install ;)
Dynamic One
11-20-2002, 01:54 PM
Thanks you very much for this hack.
Bison
11-21-2002, 03:10 AM
Will this work with attachments posted before applying this hack?
Kars10
12-31-2002, 07:16 PM
Thank you. Works like a charm!! ;)
imageconstrux
01-12-2003, 05:16 PM
If you don't allow attachments on your server (members must post them to their own 'free space' accounts), isn't this the default? This is how mine already works for 2.2.9.
Or is there something I'm missing that makes this more useful than the original? (I'm very new to this so that is entirely possible! :) )
Dark Blaze
01-22-2003, 10:43 AM
I think you are correct imageconstrux about your speculation :)
But knowing FireFly and his knowledge of PHP, this is most certainly useful.. Btw, taking under consideration what this hack does, I will tell you this. The hack is made to instead of showing the attachment on the actual thread if it is an image, it provides you a link where you click on it and opens you a page where you can see it in full size :)
Hope this info helps :)
speedway
02-09-2003, 10:43 AM
I have a strange problem under IE only. Randomly when lauching the attachment viewer, any images on the viewer page will be replaced by the attachment. Occiasionally a whole page will be replaced - for example, I sit with 1 browser open with the main site, and the other one with whos online. Randomly the online page will have the attachment displayed while still have the online.php line in the address bar.
I am attaching an image here of the result of the problem.
My users are experiencing this one as well. Mozilla if fine by the way.
Can anyone help?
FleaBag
03-31-2003, 11:48 PM
irn-bru, thanks for the 'hand hack' instructions, made it far easier for me to upgrade to 2.3.0. :D
Synicide
04-24-2003, 04:49 PM
Awesome hack! :D My buddies have been bugging me for this.
Okiewan
04-25-2003, 03:54 PM
Anyone have any idea why the attachment would take so long to load?
Splitfyre
06-22-2003, 07:24 AM
Doesn't want to install for me. I get the following when I run the install php file...
Fatal error: Call to undefined function: cpheader() in install_attachviewer.php on line 5
Looking at Line 5:
cpheader("<title>vBulletin Attachment Viewer Installer / Uninstaller</title>");
How do I get it to install?
Splitfyre
06-22-2003, 07:25 AM
Doesn't want to install for me. I get the following when I run the install php file...
Fatal error: Call to undefined function: cpheader() in install_attachviewer.php on line 5
Looking at Line 5:
cpheader("<title>vBulletin Attachment Viewer Installer / Uninstaller</title>");
How do I get it to install?
Gutty
07-25-2004, 04:36 AM
will this work for 2.3.0 ?
tiger
10-30-2005, 05:21 PM
Any chance some one can get this to work with vb 3.5???
tiger
01-23-2007, 10:23 PM
How about an update for 3.6?
tiger
02-28-2007, 12:01 AM
Will someone please update this hack for 3.6.4
tiger
05-26-2007, 12:25 AM
Come on someone has to have something like this.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.