removed some thread and ticket information from request

they are in FunThread and FunTicket classes now
added funtion FunUptime (I forgot about it)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@631 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-08-10 20:43:38 +00:00
parent 76897b8a83
commit 9901c63ede
79 changed files with 1219 additions and 993 deletions

View File

@@ -9,8 +9,9 @@
#include "templates.h"
#include "misc.h"
#include "../core/request.h"
#include "../core/misc.h"
#include "core/request.h"
#include "core/misc.h"
#include "functions/functions.h"
@@ -19,11 +20,14 @@ namespace TemplatesFunctions
void thread_is(Info & i)
{
i.res = request->is_thread;
i.res = functions->fun_thread.is_thread;
}
static size_t thread_tab_index;
@@ -32,15 +36,15 @@ void thread_tab(Info & i)
{
thread_tab_index = i.iter;
i.res = thread_tab_index < request->thread_tab.size();
i.res = thread_tab_index < functions->fun_thread.thread_tab.size();
}
void thread_tab_url(Info & i)
{
if( thread_tab_index < request->thread_tab.size() )
if( thread_tab_index < functions->fun_thread.thread_tab.size() )
{
Item * dir = system->dirs.GetDir( request->thread_tab[thread_tab_index].dir_id );
Item * dir = system->dirs.GetDir( functions->fun_thread.thread_tab[thread_tab_index].dir_id );
if( dir )
{
@@ -56,9 +60,9 @@ void thread_tab_url(Info & i)
void thread_tab_subject(Info & i)
{
if( thread_tab_index < request->thread_tab.size() )
if( thread_tab_index < functions->fun_thread.thread_tab.size() )
{
Item * dir = system->dirs.GetDir( request->thread_tab[thread_tab_index].dir_id );
Item * dir = system->dirs.GetDir( functions->fun_thread.thread_tab[thread_tab_index].dir_id );
if( dir )
{
@@ -77,9 +81,9 @@ void thread_tab_subject(Info & i)
void thread_tab_answers(Info & i)
{
if( thread_tab_index < request->thread_tab.size() )
if( thread_tab_index < functions->fun_thread.thread_tab.size() )
{
long a = request->thread_tab[thread_tab_index].items;
long a = functions->fun_thread.thread_tab[thread_tab_index].items;
// the first is created by the author
// we count only the rest
@@ -96,9 +100,9 @@ void thread_tab_author(Info & i)
bool unknown = true;
if( thread_tab_index < request->thread_tab.size() )
if( thread_tab_index < functions->fun_thread.thread_tab.size() )
{
Item * dir = system->dirs.GetDir( request->thread_tab[thread_tab_index].dir_id );
Item * dir = system->dirs.GetDir( functions->fun_thread.thread_tab[thread_tab_index].dir_id );
if( dir )
{
@@ -129,27 +133,27 @@ bool unknown = true;
void thread_tab_last_item_date_modification(Info & i)
{
if( thread_tab_index < request->thread_tab.size() )
if( request->thread_tab[thread_tab_index].last_item.id != -1 )
i.out << DateToStr( &request->thread_tab[thread_tab_index].last_item.date_modification );
if( thread_tab_index < functions->fun_thread.thread_tab.size() )
if( functions->fun_thread.thread_tab[thread_tab_index].last_item.id != -1 )
i.out << DateToStr( &functions->fun_thread.thread_tab[thread_tab_index].last_item.date_modification );
}
void thread_tab_last_item_date_modification_nice(Info & i)
{
if( thread_tab_index < request->thread_tab.size() )
if( request->thread_tab[thread_tab_index].last_item.id != -1 )
print_date_nice(i, &request->thread_tab[thread_tab_index].last_item.date_modification);
if( thread_tab_index < functions->fun_thread.thread_tab.size() )
if( functions->fun_thread.thread_tab[thread_tab_index].last_item.id != -1 )
print_date_nice(i, &functions->fun_thread.thread_tab[thread_tab_index].last_item.date_modification);
}
void thread_tab_last_item_user(Info & i)
{
if( thread_tab_index < request->thread_tab.size() )
if( thread_tab_index < functions->fun_thread.thread_tab.size() )
{
if( request->thread_tab[thread_tab_index].last_item.id != -1 )
if( functions->fun_thread.thread_tab[thread_tab_index].last_item.id != -1 )
{
User * puser = system->users.GetUser( request->thread_tab[thread_tab_index].last_item.user_id );
User * puser = system->users.GetUser( functions->fun_thread.thread_tab[thread_tab_index].last_item.user_id );
if( puser )
HtmlEscape(i.out, puser->name);
@@ -157,8 +161,8 @@ void thread_tab_last_item_user(Info & i)
{
i.out << "~";
if( !request->thread_tab[thread_tab_index].last_item.guest_name.empty() )
HtmlEscape(i.out, request->thread_tab[thread_tab_index].last_item.guest_name);
if( !functions->fun_thread.thread_tab[thread_tab_index].last_item.guest_name.empty() )
HtmlEscape(i.out, functions->fun_thread.thread_tab[thread_tab_index].last_item.guest_name);
else
i.out << "guest"; // !! dodac do konfiga
}