View Full Version : Sort attachements by date and display dates
funyoo
02-12-2009, 02:58 PM
Hello,
How can we sort the attachements by date instead of default chronological order and how can we display the dates in the attachements pop-up generated when we click on the attachement icons in the threads list pages.
Exactly like on forexfactory.com :
https://vborg.vbsupport.ru/external/2009/02/25.gif
I would be also interested to know how we can add a hide pictures option.
funyoo
02-17-2009, 12:09 PM
Any help ?
Lynne
02-17-2009, 01:44 PM
That is the pop-up you get when you click on the little paperclip? The date isn't' shown there in default vb, so you modified the code to add it. I suppose you can modify it further by doing an ORDER BY date.
funyoo
02-21-2009, 08:07 AM
That is the pop-up you get when you click on the little paperclip? The date isn't' shown there in default vb, so you modified the code to add it. I suppose you can modify it further by doing an ORDER BY date.
Hi Lynne,
Thanks for your reply, :)
Yes that's correct. The main question is how to write this order by date feature.
Lynne
02-21-2009, 03:32 PM
Well, what is the code you added? What is the name of that variable? Did the modification have to use a plugin to grab the date? Probably the same plugin can be used to do an ORDER BY dateline (or whatever the variable is called).
funyoo
02-22-2009, 03:01 PM
Well, what is the code you added? What is the name of that variable? Did the modification have to use a plugin to grab the date? Probably the same plugin can be used to do an ORDER BY dateline (or whatever the variable is called).
Hi Lynne,
I have added no code as I have not found any code to do that.
Here is the attachment code that should be modified :
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vbphrase[attachments] - $vboptions[bbtitle]</title>
</head>
<body onload="self.focus()" style="margin:0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td class="tcat" colspan="3">
$vbphrase[attachments]
</td>
</tr>
<tr>
<td class="thead">$vbphrase[attachment]</td>
<td class="thead">$vbphrase[size]</td>
<td class="thead">$vbphrase[views]</td>
</tr>
$attachments
<tr>
<td class="tfoot" colspan="3" align="center"><div class="smallfont">
<a href="#" onclick="opener.location=('showthread.php?$session[sessionurl]t=$threadid'); self.close();"><strong>$vbphrase[show_thread_and_close_window]</strong></a>
</div></td>
</tr>
</table>
</body>
</html>
Lynne
02-22-2009, 03:36 PM
That is not the correct template. No where in there does it show the date. If I'm mistaken and that *is* your template, then the date is being added via a plugin.
You need to find the query that grabs all those attachments names/ids/size/etc and add in the ORDER BY statement.
Google "mysql ORDER BY" and you'll get several ORDER BY help pages like this one - http://www.tizag.com/mysqlTutorial/mysqlorderby.php
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.