int i;
p = atoi(BSTR("p")); /* are we looking for a specific post? */
+ WC->bptlid = bp->top_level_id;
if ( ((p == 0) || (p == bp->top_level_id)) && (bp->num_msgs > 0) ) {
/* Show the top level post */
*
*/
void tmplput_blog_permalink(StrBuf *Target, WCTemplputParams *TP) {
- int p = atoi(BSTR("p")); /* are we looking for a specific post? */
char perma[SIZ];
char encoded_perma[SIZ];
strcpy(perma, "/readfwd?gotofirst=");
urlesc(&perma[strlen(perma)], sizeof(perma)-strlen(perma), ChrPtr(WC->CurRoom.name));
-
- if (p != 0) {
- snprintf(&perma[strlen(perma)], sizeof(perma)-strlen(perma), "?p=%d", p);
- }
+ snprintf(&perma[strlen(perma)], sizeof(perma)-strlen(perma), "?p=%d", WC->bptlid);
CtdlEncodeBase64(encoded_perma, perma, strlen(perma), 0);
StrBufAppendPrintf(Target, "/B64%s", encoded_perma);
HashList *ServCfg; /* cache our server config for editing */
HashList *InetCfg; /* Our inet server config for editing */
ExpirePolicy Policy[maxpolicy];
+
+/* used by the blog viewer */
+ int bptlid; /* hash of thread currently being rendered */
};