Google
Web alhem.net
Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

ThreadListForm Class Reference

#include <ThreadListForm.h>

Inheritance diagram for ThreadListForm:

Inheritance graph
[legend]
Collaboration diagram for ThreadListForm:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ThreadListForm (Web *)
 ~ThreadListForm ()
void Process ()
void Display (long)
void Select (const std::string &)
void List ()

Detailed Description

File ......... ThreadListForm.h Published .... 2004-07-09 Author ....... grymse@alhem.net

Definition at line 31 of file ThreadListForm.h.


Constructor & Destructor Documentation

ThreadListForm::ThreadListForm Web *  w  ) 
 

File ......... ThreadListForm.cpp Published .... 2004-07-09 Author ....... grymse@alhem.net

Definition at line 31 of file ThreadListForm.cpp.

References ThreadListForm().

Referenced by ThreadListForm().

00031 : BaseForm(w, "ThreadListForm") 00032 { 00033 }

ThreadListForm::~ThreadListForm  ) 
 

Definition at line 36 of file ThreadListForm.cpp.

00037 { 00038 }


Member Function Documentation

void ThreadListForm::Display long   ) 
 

Definition at line 61 of file ThreadListForm.cpp.

References Display().

Referenced by Display(), and IWeb::GenerateDocument().

00062 { 00063 IWeb *pWeb = static_cast<IWeb *>(GetWeb()); 00064 Database& db = pWeb -> GetDatabase(); 00065 Query q(db); 00066 Query q2(db); 00067 char sql[1000]; 00068 00069 // printf("<h3>Thread list</h3>"); 00070 Navigator(pWeb -> GetForum()); 00071 if (pWeb -> GetForum()) 00072 { 00073 printf("</td><td align=center>"); 00074 printf("&nbsp;[&nbsp;<a href=\"%s?page=6\">new topic</a>&nbsp;]",GetCgiName().c_str()); 00075 } 00076 printf("</td><td align=right>"); 00077 // printf("<div align=right>"); 00078 printf("[ <a href=\"%s?page=2\">settings</a> ",GetCgiName().c_str()); 00079 printf("| <a href=\"%s?logout=1\">logout</a> ",GetCgiName().c_str()); 00080 // printf("]</div>"); 00081 printf("]</td></tr></table>"); 00082 printf("</div>"); 00083 00084 sprintf(sql,"select * from thread where forum=%ld and deleted=0 order by updated desc",pWeb -> GetForum()); 00085 q.get_result(sql); 00086 printf("<table cellpadding=\"0\" cellspacing=\"0\" class=threadlist width=\"100%%\">"); 00087 printf("<tr>"); 00088 printf("<th class=threadlist>Image</th>"); 00089 printf("<th class=threadlist>Topic</th>"); 00090 printf("<th class=threadlist>Messages</th>"); 00091 printf("<th class=threadlist>Started</th>"); 00092 // printf("<th class=threadlist>Views</th>"); 00093 printf("<th class=threadlist>Last</th>"); 00094 printf("</tr>"); 00095 while (q.fetch_row()) 00096 { 00097 db::Thread thread(&db, &q); 00098 db::Account account(db, thread.started_by); 00099 printf("<tr class=threadlist>"); 00100 // thumbnail 00101 printf("<td class=threadlist width=\"1%%\">"); 00102 viewtn( thread.image ); 00103 printf("</td>"); 00104 // title 00105 printf("<td class=threadlist>", thread.title.c_str()); 00106 printf("<a href=\"%s?ThreadListForm=view&thread=%ld\">&nbsp;%s&nbsp;</a></td>",GetCgiName().c_str(),thread.num,thread.title.c_str()); 00107 // message count 00108 sprintf(sql,"select count(*) from message where thread=%ld and deleted=0",thread.num); 00109 printf("<td class=threadlist align=right width=\"1%%\">%ld</td>",q2.get_count(sql)); 00110 // started 00111 printf("<td class=threadlist width=\"1%%\">"); 00112 printf("%s<br>",GetAccountName(account).c_str()); 00113 nbprintf("%s</td>", thread.started.c_str()); 00114 // views 00115 // printf("<td class=threadlist width=\"1%%\"></td>"); 00116 // last 00117 { 00118 db::Account account(db, thread.updated_by); 00119 printf("<td class=threadlist width=\"1%%\">"); 00120 printf("%s<br>",GetAccountName(account).c_str()); 00121 nbprintf("%s</td>", thread.updated.c_str()); 00122 } 00123 printf("</tr>"); 00124 } 00125 printf("</table>"); 00126 q.free_result(); 00127 }

void ThreadListForm::List  )  [inline]
 

Definition at line 40 of file ThreadListForm.h.

00040 {}

void ThreadListForm::Process  ) 
 

Definition at line 41 of file ThreadListForm.cpp.

00042 { 00043 IWeb *pWeb = static_cast<IWeb *>(GetWeb()); 00044 // Database& db = pWeb -> GetDatabase(); 00045 char action[200]; 00046 00047 // <input type="submit" name="ThreadListForm" value="action" ... 00048 if (GetForm() -> getvalue( (char *)GetFormName().c_str(), action, 200) && *action) 00049 { 00050 if (!strcmp(action,"view")) 00051 { 00052 std::string thread = GetForm() -> getvalue("thread"); 00053 long num = atol(thread.c_str()); 00054 pWeb -> SetThread( num ); 00055 pWeb -> SetPage( 5 ); 00056 } 00057 } 00058 }

void ThreadListForm::Select const std::string &   )  [inline]
 

Definition at line 39 of file ThreadListForm.h.

References Select().

Referenced by Select().

00039 {}


The documentation for this class was generated from the following files:
Generated on Sat Feb 12 00:14:57 2005 for IBank by doxygen 1.3.7