Display Number of Attachments in Thread

Started by Benqo, November 24, 2005, 02:50:55 AM

Previous topic - Next topic

Benqo

Link to Mod

Display Number of Attachments is a mod which adds a clip in the indexpage of a forum to each thread containing attachments.

I think this image will explain everything, if something is unclear. :)



The mod uses the characteristic of modern browsers to display the amount of attachments in a thread when the mouse pointer is moved over the image, as you can see.

Version history:
09.02.06 Release: 0.4.1
* solved bug causing SQL error when board has no threads

08.02.06 Release: 0.4
* changed bug for causing an SQL error when board has no threads
+ added support for 1.0.6

16.01.06 Release: 0.3
+ improved the way of querying the database for attachments
* changed filenames for better file handling

11.01.06 Release: 0.2
+ support added for SMF 1.0.5 and 1.1.RC2
+ added routine for guessing if thread has just one or more attachments
+ this version is delivered as .zip and .tar.gz
* changed the term 'Attachment(s)' to localized terms (file/Datei)

23.11.05 Release: 0.1 (works with SMF 1.1RC1)


!Hachi!

thats great one.
          what about 1.0.5?can you make it iff posssible
Happy Ramadan

Benqo

Hi,

well, currently I only have 1.1RC1 installed on my test system and there's no live system for getting it working there. But it's possible. You may have to wait a little or someone else could try to adopt the code for 1.0.5.

Jorin

Great job! No errors listed, but I had to edit the line:

$txt['nbrOfAttachments'] = 'Attachment(s)';

for myself in Modifications.english.php and Modifications.german.php. Maybe you can proof this?

diegolyanky

Very nice and usefull mod ...

But, can you make any modifications for use with Helios_multi theme ?

I love that theme and I love too yor mod. Please, is very usefull for me  ;D

Many thanks in advance  ;)
SMF ... SimpleMachines ... Simple, but complete if you want it ;)

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

diegolyanky

Many thanks JayBachatero for your fast reply ...

I have modified the MessageIndex.template.php of Helios_multi and now is working.

Many thanks again !
SMF ... SimpleMachines ... Simple, but complete if you want it ;)

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

dairin


JayBachatero

There were a lot of template changes from 1.0.5 to 1.1.  You will have to compare the default theme from both versions to find out the changes and so on.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Grudge

Although a nice mod it could really do with some optimisation. At the moment it does a query for every topic in the message index - that doubles the number of queries in the page load. Maybe you should do the query once using

WHERE ID_TOPIC IN (" . implode(',', $topics) . ")
GROUP BY ID_TOPIC


and store all the results in a variable which you then put into context during the while loop?
I'm only a half geek really...

dairin

The problem is im still using 1.0.5 and not intending to switch to 1.1 yet

so any kind soul can help me with the coding for 1.0.5 ??

diegolyanky

SMF ... SimpleMachines ... Simple, but complete if you want it ;)

Benqo

Hi,
sorry that I was that long absent, but I had to look forward for my website.

To answer those questions:
- 1.0.5 support not yet given, as you may have recognized. I had no time to install 1.0.5 in my test environment. And this is not ready yet, Ubuntu on a Laptop can be tricky, too.
- I'll keep the tip with the improvement. I know that the current solution is not the best, but I was looking for a quick solution, that's why.
- Nope, I'm not going to extend it to show the total of space in MB. This would destroy the origin idea of this mod.

I hope that I'll have time to do some improvements soon. Any other comments welcome. :)

Ryan

Great job Benqo!
Have u thought about having this not count images attachments...?

Benqo

You mean leabing out images counted as attachments? Why? They're also attachments like others, so why leave them out?
But I'll take your feedback as it is and maybe I can include it to some improvement...

diegolyanky

No ! ... Don´t leave out the images attached ... All are attachments.

Other thing:

" I wanna a mod with the megabytes uploaded and downloaded by each user. " ... Please please please pleaseeeeeeeee haha

Merry Christmasssssssss for all  ;)
SMF ... SimpleMachines ... Simple, but complete if you want it ;)

d3v


diegolyanky

SMF ... SimpleMachines ... Simple, but complete if you want it ;)

JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Advertisement: