PDA

View Full Version : How would I go about printing the filehash beside attachemnt name?


brfrankl
08-31-2007, 01:02 AM
So as the subject says, I want to display the filehash from the attachment table beside the attachment when you are viewing a post...

So something like this in the attachement section

filename.zip (1.9 KB, 2 views) (MD5: *filehash*)

replacing *filehash with the value from the table...

How would I mod the templates to do that (and which templates)?

brfrankl
09-20-2007, 05:31 PM
anyone? Someone out there has got to have already done this before....

Dismounted
09-21-2007, 02:34 AM
It would require hooking into the attachment upload process and scanning for the MD5 hash using md5file().

brfrankl
09-21-2007, 03:43 AM
the hash is already stored in the attachment database. But I don't know what to edit to get it to show up in the template...

It is in the database at attachment->filehash

So how do I get this value to show beside attachment in the showthread template (I think that is the right template)??

Dismounted
09-21-2007, 05:00 AM
There is an attachment template, you'll have to edit that and add the text you want with the corresponding variable.

brfrankl
09-21-2007, 11:57 AM
ok, but what is the variable I use? That is the part that I am having trouble figuring out...

Dismounted
09-22-2007, 04:54 AM
What are some of the other ones in the template?

Hornstar
09-22-2007, 06:05 AM
If you get this to work, it would be great if you could share it. thanks.

Dismounted
09-22-2007, 06:14 AM
I was bored, so I decided to find out for you guys. :) In the template postbit_attachment, find:
($attachment[filesize]<if condition="$show['views']">, <phrase 1="$attachment[counter]">$vbphrase[x_views]</phrase></if>)
Replace With:
($attachment[filesize]<if condition="$show['views']">, <phrase 1="$attachment[counter]">$vbphrase[x_views]</phrase></if>) (MD5: $attachment[filehash])

brfrankl
09-24-2007, 04:40 PM
Thanks!

Ok, not working. $attachment[filehash] prints nothing. Is there something elsewhere that has to populate the array or something?

Dismounted
09-25-2007, 05:17 AM
The array should be populated.

brfrankl
09-25-2007, 08:55 AM
ok, well nothing printed... any other ideas?

brfrankl
02-09-2008, 09:19 AM
bump... still haven't figured this out. wondering if anyone else has gotten this working...

brfrankl
02-23-2008, 10:26 AM
Ok I guess noone elase has figured out how to make this work or noone else cares... Oh well