added: forum
added: mount params can have arguments (in parentheses) added: mount params: withheader, withinfo, restrictcreatethread, only_root_can_remove, can_use_emacs_on(level), can_use_mkdir_on(level), added: table Item has 'subject' column now removed: column 'subject' from table Content git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@505 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -13,24 +13,35 @@
|
||||
#include "../core/data.h"
|
||||
#include "../core/mount.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
bool Content::FunThreadSort(const Thread & t1, const Thread & t2)
|
||||
{
|
||||
Item * pdir1 = data.dirs.GetDir(t1.dir_id);
|
||||
Item * pdir2 = data.dirs.GetDir(t2.dir_id);
|
||||
|
||||
if( !pdir1 || !pdir2 )
|
||||
return false;
|
||||
|
||||
time_t time1 = mktime(&pdir1->date_creation);
|
||||
time_t time2 = mktime(&pdir2->date_creation);
|
||||
|
||||
return time1 > time2;
|
||||
}
|
||||
|
||||
|
||||
void Content::FunThread()
|
||||
{
|
||||
// we're showing the whole directory
|
||||
Item item_ref;
|
||||
|
||||
item_ref.parent_id = request.dir_table.back()->id;
|
||||
|
||||
// !! zrobic inna metode, inny interfejs (jako parametr niech bierze parent_id), i zeby nie odczytywala contentu i subjectu (a moze tylko subject? przyda sie przy ls -l)
|
||||
bool asc = true;
|
||||
|
||||
Mount mount = data.mounts.GetCurrentMountPoint();
|
||||
if( mount.IsParam(Mount::desc) )
|
||||
if( data.mounts.CurrentMountIsParam(Mount::desc) )
|
||||
asc = false;
|
||||
|
||||
db.GetItems(request.item_table, item_ref, asc);
|
||||
db.GetItems(request.item_table, request.dir_table.back()->id, Item::file, true, true, asc);
|
||||
db.GetThreads(request.dir_table.back()->id, request.thread_tab);
|
||||
|
||||
std::sort(request.thread_tab.begin(), request.thread_tab.end(), FunThreadSort);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user