Attachments flag
Posted by bobdobbs
Attachments flag September 29, 2004 04:02PM |
Registered: 19 years ago Posts: 2 |
Re: Attachments flag September 29, 2004 05:37PM |
Registered: 19 years ago Posts: 2 |
Let me explain that a little better...
That is to say before you click on the individual post to read it.
Kind of like how on the forum index there is a "views" column where you can see how many time the post has been read. Is there a way to maybe have another column with the number of attachments?
That is to say before you click on the individual post to read it.
Kind of like how on the forum index there is a "views" column where you can see how many time the post has been read. Is there a way to maybe have another column with the number of attachments?
September 29, 2004 08:52PM |
Admin Registered: 22 years ago Posts: 4,495 |
To get a count, you will have to use some PHP.
<?php if(count($PHORUM["TMP"]["ROWS"]["meta"]["attachments"])){ ?> Do Stuff <?php } ?>
Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: Attachments flag October 15, 2004 07:57PM |
Registered: 19 years ago Posts: 16 |
Re: Attachments flag November 20, 2004 03:14AM |
Registered: 19 years ago Posts: 6 |
From what I understand, the "Attachments" problem is one of the "mysql.php" and "list[_threads].tpl" files.
In the "list[_threads.tpl" template file, you have options on what to display (there's a couple {IF...} statements in there), one being the count.
Unfortunatly, in order to show whether attachments exist or not requires the mysql.php file to run a query that includes the information in the "meta" field of the "[phorumname]_messages" table.
Now, you 'could' run a query against the returned messageid to the "[phorumname]_files" table (a join, basically), but we're talking some work here.
OK, I could be totally full of it, in the wrong 100%, but noone has proven me wrong yet, so I'm gonna stick with these as my issues as to why attachment flags are a pain in the arse.
PS:
using the
In the "list[_threads.tpl" template file, you have options on what to display (there's a couple {IF...} statements in there), one being the count.
Unfortunatly, in order to show whether attachments exist or not requires the mysql.php file to run a query that includes the information in the "meta" field of the "[phorumname]_messages" table.
Now, you 'could' run a query against the returned messageid to the "[phorumname]_files" table (a join, basically), but we're talking some work here.
OK, I could be totally full of it, in the wrong 100%, but noone has proven me wrong yet, so I'm gonna stick with these as my issues as to why attachment flags are a pain in the arse.
PS:
using the
{IF ATTACHMENTS} {IF MESSAGE->attachments} ... {/IF}{/IF}doesn't work. No-sir.
Re: Attachments flag November 20, 2004 04:38AM |
Admin Registered: 21 years ago Posts: 9,240 |
chadedge, no you are wrong, mysql.php doesn't have anything to do with it, no additional query needed.
What brian posted works just fine.
A simple:
shows you if a message has attachments.
Yeah, your other solution with template-tags doesn't work as these are only computed in read.php
Thomas Seifert
Edited 1 time(s). Last edit at 11/20/2004 04:39AM by ts77.
What brian posted works just fine.
A simple:
<?php if(isset($PHORUM["TMP"]["ROWS"]["meta"]["attachments"]) && count($PHORUM["TMP"]["ROWS"]["meta"]["attachments"])){ ?> (attachments) <?php } ?>
shows you if a message has attachments.
Yeah, your other solution with template-tags doesn't work as these are only computed in read.php
Thomas Seifert
Edited 1 time(s). Last edit at 11/20/2004 04:39AM by ts77.
Re: Attachments flag November 21, 2004 02:40AM |
Registered: 19 years ago Posts: 6 |
Re: Attachments flag November 21, 2004 01:56PM |
Registered: 19 years ago Posts: 22 |
In another forum (add-ons), see at the bottom :
[phorum.org]
The code don't work, for me ;)
Edit: removed session-id from link, you don't want others to be you, right? ;)
Edited 1 time(s). Last edit at 11/21/2004 02:01PM by ts77.
[phorum.org]
The code don't work, for me ;)
Edit: removed session-id from link, you don't want others to be you, right? ;)
Edited 1 time(s). Last edit at 11/21/2004 02:01PM by ts77.
Re: Attachments flag November 21, 2004 02:03PM |
Admin Registered: 21 years ago Posts: 9,240 |
Re: Attachments flag November 22, 2004 06:14AM |
Registered: 19 years ago Posts: 22 |
Sorry, only registered users may post in this forum.