9#if __DCL_HAVE_THIS_FILE__
18 const String& strThis,
19 const String& strLinkEnc
24 const wchar_t* aNames[] = { L
"FIRST", L
"PREV", L
"GOTO", L
"NEXT", L
"LAST"};
26 for(
int i = 0; i < 5; i++) {
29 p->assign(L
"THIS", strThis);
30 p->assign(L
"_LIST", strLinkEnc);
36static String __PART(
int n)
40 s = L
"&part=" + String::valueOf(n);
56 int nStartPart = nCurrentPart - ((nCurrentPart - 1) % nGotoPart);
57 int nEndPart = nStartPart + nGotoPart - 1;
58 if (nEndPart > nTotalPart)
59 nEndPart = nTotalPart;
61 if (nStartPart <= nGotoPart) {
68 FIRST.assign(L
"PART", __PART(1));
72 PREV.assign(L
"PART", __PART(nStartPart - 1));
76 if ((nStartPart + nGotoPart) > nTotalPart) {
81 int nNext = nCurrentPart + nGotoPart - ((nCurrentPart - 1) % nGotoPart);
84 NEXT.assign(L
"PART", __PART(nNext));
88 LAST.assign(L
"PART", __PART(nTotalPart));
96 for(
int n = nStartPart; n <= nEndPart; n++) {
97 if (n == nCurrentPart) {
98 CURRENT.assign(L
"NO", String::valueOf(n));
102 GOTO.assign(L
"NO", String::valueOf(n));
103 GOTO.assign(L
"PART", __PART(n));
113 const String& strDetailPage,
114 const String& strListEnc
124 __pPREV = &(*__pSource)[L
"_PREV"];
125 __pNEXT = &(*__pSource)[L
"_NEXT"];
127 __pNPREV = &(*__pSource)[L
"N_PREV"];
128 __pNNEXT = &(*__pSource)[L
"N_NEXT"];
130 __pPREV->assign(L
"DETAIL", strDetailPage);
131 __pPREV->assign(L
"_LIST", strListEnc);
132 __pNEXT->assign(L
"DETAIL", strDetailPage);
133 __pNEXT->assign(L
"_LIST", strListEnc);
143 int nPREV_ID = fields.byName(L
"PREV_ID").asInteger();
144 int nNEXT_ID = fields.byName(L
"NEXT_ID").asInteger();
147 __pPREV->assign(L
"PREV_ID", String::valueOf(nPREV_ID));
148 pDest->assign(L
"_PREV", *
__pPREV);
154 __pNEXT->assign(L
"NEXT_ID", String::valueOf(nNEXT_ID));
155 pDest->assign(L
"_NEXT", *
__pNEXT);
165 const String& strListEnc
169 __pPREV->assign(L
"_LIST", strListEnc);
170 __pNEXT->assign(L
"_LIST", strListEnc);
178 const String& strDetailPage,
179 const String& strToEdit,
180 const String& strThisEnc,
181 const String& strListEnc
203 __pNADD = &(*__pSource)[L
"N_ADD"];
204 __pADD->assign(L
"DETAIL", strDetailPage);
205 __pADD->assign(L
"EDIT", strToEdit);
206 __pADD->assign(L
"_THIS", strThisEnc);
207 __pADD->assign(L
"_LIST", strListEnc);
212 __pREPLY->assign(L
"DETAIL", strDetailPage);
213 __pREPLY->assign(L
"EDIT", strToEdit);
214 __pREPLY->assign(L
"_THIS", strThisEnc);
215 __pREPLY->assign(L
"_LIST", strListEnc);
220 __pAGREE->assign(L
"EDIT", strToEdit);
221 __pAGREE->assign(L
"_THIS", strThisEnc);
222 __pAGREE->assign(L
"_LIST", strListEnc);
234 __pMODIFY->assign(L
"DETAIL", strDetailPage);
253 const String& strMessageID,
254 const String& strToList,
265 pDest->assign(L
"_ADD", *
__pNADD);
295 __pADD->assign(L
"PARENT_ID", fields.byName(L
"PARENT_ID").asString());
296 pDest->assign(L
"_ADD", *
__pADD);
301 int nChild = fields.byName(L
"NCHILD").asInteger();
302 if (nChild == mt.
width()) {
311 __pREPLY->assign(L
"MESSAGE_ID", strMessageID);
312 pDest->assign(L
"_REPLY", *
__pREPLY);
316 int nUserID = fields.byName(L
"USER_ID").asInteger();
332 SQLField& VOTE_END = fields.byName(L
"VOTE_END");
333 if (!VOTE_END.isNull() &&
349 __pAGREE->assign(L
"MESSAGE_ID", strMessageID);
350 pDest->assign(L
"_AGREE", *
__pAGREE);
361 __pMODIFY->assign(L
"MESSAGE_ID", strMessageID);
372 __pDELETE->assign(L
"MESSAGE_ID", strMessageID);
390 time_t tNow = time(
NULL);
391 tNow -= nRecentHour * 60 * 60;
395 __pNew = pSource->atP(L
"_NEW");
396 __pOld = pSource->atP(L
"_OLD");
407 pDest->assign(L
"_RECENT", *
__pNew);
411 pDest->assign(L
"_RECENT", *
__pOld);
424 __pOdd = pSource->atP(L
"ODD");
425 __pEven = pSource->atP(L
"EVEN");
433 int n = ((nRow - 1) /
__nGroup) % 2;
437 pDest->assign(L
"_GROUP", *
__pEven);
441 pDest->assign(L
"_GROUP", *
__pOdd);
#define __DCL_ASSERT(expr)
static DateTime getCurrentLocalTime()
PartLink(TextTemplate *pSource, const String &strThis, const String &strLinkEnc)
void assign(TextTemplate *pDest, int nTotalPart, int nCurrentPart, int nNumberPart)
void assign(TextTemplate *pDest, DateTime dt)
RecentIcon(TextTemplate *pSource, int nRecentHour)
void assign(TextTemplate *pDest, int nRow)
RowGroup(TextTemplate *pSource, int nGroup)
void assign(TextTemplate *pDest, _CONST SQLFields &fields)
SiblingLink(TextTemplate *pSource, const String &strDetailPage, const String &strListEnc)
TextTemplate * __pDISAGREE
UpdateLink(TextTemplate *pSource, const String &strDetailPage, const String &strToEdit, const String &strThisEnc, const String &strListEnc)
TextTemplate * __pNDISAGREE
void assign(TextTemplate *pDest, _CONST SQLFields &fields, const Session &session, const String &strMessageID, const String &strToList, const MessageTree &mt, const MessageTree::Position &pos)
TextTemplate * __pNMODIFY
TextTemplate * __pNDELETE