PDA

View Full Version : Advanced Attachmentbox v1.0


Kars10
03-30-2003, 10:00 PM
Hello Hackers!
This a very small but usefull Hack! :D

What this hack does:
This hack puts your "Attachment-Info" in a Box and displays the filesize of the
attachments next to it (vB3 Style)!

Credits: Pogo from the vbulletin-Germany Team.

Files to edit: 1 (showthread.php)
Templates to edit: 1 (postbit_attachment)
Templates to add: 0

Time to install: 1-2 min

Always backup your Files, and please click, lick or kick install!!

Note: If you have Attachments as Files Hack installed, see this Addon (https://vborg.vbsupport.ru/attachment.php?s=&postid=376212) by Mutt!

Have Fun
Kars

Kars10
03-31-2003, 04:31 PM
Screenshot! :D

Xenon
03-31-2003, 04:32 PM
right, small but really usefull :)

iggy123
03-31-2003, 04:47 PM
nice - have installed

Kars10
03-31-2003, 04:49 PM
Glad you like it iggy123!

Kars :)

Dean C
03-31-2003, 04:56 PM
Nice idea Karsten :)

- miSt

wooolF[RM]
03-31-2003, 07:00 PM
]too bad doesn't work with hack by PPN called Attachments as Files :(
otherwise nice idea! :)

N9ne
03-31-2003, 07:33 PM
I like the file size thing, thanks, saved me time :).

djr
03-31-2003, 07:45 PM
Quick and easy, thanks Kars!

/me picks installed!

Koutaru
03-31-2003, 07:52 PM
neat, I'll check this one out :)

Intex
03-31-2003, 08:12 PM
Nice one Kars10 - I'll install this soon :).

FleaBag
03-31-2003, 08:55 PM
Nice hack, will definitely install once I've finished re-hacking. Regarding the attachments as files hack, it's obselete so there's no real need to worry.

wooolF[RM]
03-31-2003, 09:11 PM
]Yesterday at 11:55 PM GamerForums said this in Post #12 (https://vborg.vbsupport.ru/showthread.php?postid=376113#post376113)
Nice hack, will definitely install once I've finished re-hacking. Regarding the attachments as files hack, it's obselete so there's no real need to worry.

did u mean obsolete? in this case it's not. I know at least 4-5 big boards with over 10000 users that use this hack. It's a very usefull hack (so usefull that its included in vbb 3.x :p)

See you

NuclioN
03-31-2003, 10:35 PM
Nice :) Only the kb stays 0.00 (???)

Mutt
04-01-2003, 03:27 AM
I like this hack and I like the obsolete attachments as files. Here's a slight mod to the directions so it will work.

I also put in optional code so if it was smaller than a meg it listed the size in KB and in MB if larger.

These aren't full directions. just an addon to the existing hack. you'll still need to download the original hack.

Kars10
04-01-2003, 05:51 AM
Thanks Mutt!
Have linked your Attachment in First Post!! :)

Kars

tkeil69575
04-01-2003, 07:57 AM
thanks kars - small is beautifull ;)

Boofo
04-01-2003, 08:25 AM
Another great one, Kars! ;)

Mutt, is there a way to have it show MB for files greater than 1 MB if you don't have the attachments as files hack installed?

+Fares+
04-01-2003, 08:28 AM
Nice :-) Thanks
installed

mossyuk
04-01-2003, 09:25 AM
nice 1, about to install it and thanks to Mutt.

mossyuk
04-01-2003, 09:52 AM
couldnt get the file size function to work (using the files as attachments hack), so I took that bit out.

nice hack anyway, gets the users attention.

Tubbie
04-01-2003, 02:05 PM
nice! i test it!

wooolF[RM]
04-03-2003, 03:31 PM
]04-01-03 at 06:27 AM Mutt said this in Post #15 (https://vborg.vbsupport.ru/showthread.php?postid=376212#post376212)
I like this hack and I like the obsolete attachments as files. Here's a slight mod to the directions so it will work.

I also put in optional code so if it was smaller than a meg it listed the size in KB and in MB if larger.

These aren't full directions. just an addon to the existing hack. you'll still need to download the original hack.

thnx a lot mate :D

tho I get error on line 437 in showthread.php which is $filepath="$attachpath/$post[hash].file";

:(

Mutt
04-03-2003, 10:39 PM
try

$filepath=$attachpath."/".$post[hash].".file";

not sure why you guys would have a problem.

Mr. X
04-04-2003, 05:33 AM
Works great here, just tried it on my localhost test forum, about to apply it to my real forums after I upgrade.

/clicks install

wooolF[RM]
04-04-2003, 01:18 PM
]Parse error: parse error, unexpected T_VARIABLE in /home/www/web1/html/forum/showthread.php on line 437 which is still same problem with $filepath
:( :( :( :( :(

Kars10
04-04-2003, 01:42 PM
wooolF[RM], for me it looks like a error in the attachment-template!

Kars :)

Snapperhaed
04-04-2003, 02:34 PM
Installed but it shows: ( kb, 0 views) Meaning that its not showing the file size. Installed your original hack from 1st post. Am running 2.3.0.

wooolF[RM]
04-04-2003, 03:02 PM
]Today at 04:42 PM Kars10 said this in Post #27 (https://vborg.vbsupport.ru/showthread.php?postid=377505#post377505)
wooolF[RM], for me it looks like a error in the attachment-template!

Kars :)
I'll check it out and report back :) thnx for the tip :)

mmkay, here what I got in my postbit_attachment (part of it)
<img src="https://vborg.vbsupport.ru/images/attach/$post[attachmentextension].gif" width="16" height="16" border="0" alt="">
<smallfont>
<a href="attachment.php?s=$session[sessionhash]&postid=$post[postid]$newpagelink" target="blank">$post[filename]</a>
(<b>$post[attachsize]</b> kb, <b>$post[counter]</b> downloads)
</smallfont>
<smallfont><hr>
<a href="javascript:whodownloaded($post[attachmentid])" class="small">Who Downloaded This?</a>

I can't see what might be wrong with that... Who downloaded hack works perfectly... I can see how many times file have been downloaded... the only problem is displaying the size of the attached file :(

all-the-vb
06-03-2003, 06:26 AM
nice

----
this hack working if u edit 410 line
but tell me what is the benefit of editing 55 line ?

Chris M
06-03-2003, 08:58 AM
V Nice:)

Satan

WEForums
06-03-2003, 09:11 AM
04-01-03 at 06:27 AM Mutt said this in Post #15 (https://vborg.vbsupport.ru/showthread.php?postid=376212#post376212)
I like this hack and I like the obsolete attachments as files. Here's a slight mod to the directions so it will work.

I also put in optional code so if it was smaller than a meg it listed the size in KB and in MB if larger.

These aren't full directions. just an addon to the existing hack. you'll still need to download the original hack. Since the instructions weren't clear, I added the first instruction on both parts of the code. Didn't work (some error), so I did it on the other code. Nothing worked. Same for the second...it has two of the same parts...

What went wrong?

Courage
06-03-2003, 07:21 PM
I run vb 2.3.0 with attachments as files
When I try to apply the hack.. i get a blank page :(

The problem is this:


$post[attachmentid]
$filepath="$attachpath/$post[hash].file";
if ($post[attachmentid] && is_file($filepath)) {
$post[attachsize] = sprintf('%.2f',filesize($filepath)/1024);
} else {
$post[attachsize] = "";
}

pstdgt
06-03-2003, 09:17 PM
Ok, here goes the fix to the fix:

Where the instructions read:

Search for this:
attachment.counter

and replace it with:
attachment.counter,attachment.hash


it actually means:

Search for the second occurance of this:
attachment.counter

and replace it with:
attachment.counter,attachment.hash



And then, where it reads:

scroll down a little bit and right after:

if (!$getperms['cangetattachment']) {
$viewattachedimages=0;
}

add:

$post[attachmentid]
$filepath="$attachpath/$post[hash].file";
if ($post[attachmentid] && is_file($filepath)) {
$post[attachsize] = sprintf('%.2f',filesize($filepath)/1024);
} else {
$post[attachsize] = "";
}


it should read:

scroll down a little bit and right after:

while ($post=$DB_site->fetch_array($posts) and $counter++<$perpage) {

add:

//$post[attachmentid]
$filepath="$attachpath/$post[hash].file";
if ($post[attachmentid] && is_file($filepath)) {
$post[attachsize] = sprintf('%.2f',filesize($filepath)/1024);
} else {
$post[attachsize] = "";
}


notice that the first line of the code to be added is now commented out. it was causing a parse error in the script, thus the blank page experienced by some users which had php error reporting disabled. (there's a setting in php.ini). I really don't know what that line was supposed to do, but the code works fine now, even without it.

that's it. it works fine for me :)