Began working on a permalink system WARNING NOT WORKING YET
authorArt Cancro <ajc@citadel.org>
Mon, 22 Nov 2010 04:27:11 +0000 (23:27 -0500)
committerArt Cancro <ajc@citadel.org>
Mon, 22 Nov 2010 04:27:11 +0000 (23:27 -0500)
webcit/blogview_renderer.c
webcit/static/styles/webcit.css
webcit/static/t/view_blog_post.html

index 949fd179a3a90ea4b29061adebb4c5e28b34b523..164c7539563fb542bded28a0e1a2254708786346 100644 (file)
@@ -237,6 +237,28 @@ int blogview_Cleanup(void **ViewSpecific)
        return 0;
 }
 
+/*
+ * Generate a permalink for a post
+ *
+ * FIXME THIS IS WRONG, FIND THE FOO
+ *
+ */
+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);
+       }
+
+       CtdlEncodeBase64(encoded_perma, perma, strlen(perma), 0);
+       StrBufAppendPrintf(Target, "/B64%s", encoded_perma);
+}
+
 
 void 
 InitModule_BLOGVIEWRENDERERS
@@ -251,4 +273,5 @@ InitModule_BLOGVIEWRENDERERS
                blogview_render,
                blogview_Cleanup
        );
+       RegisterNamespace("BLOG:PERMALINK", 0, 0, tmplput_blog_permalink, NULL, CTX_NONE);
 }
index 5589f67daa36214408b3e58e9efa7880fedc078f..94a100b2dc53657d4ec140115a3c18b9d52f3504 100644 (file)
@@ -1227,6 +1227,15 @@ a.event_title:hover span.bttbottom, a.event_unread:hover span.bttbottom, a.event
        font-style: bold;
 }
 
+.blog_post_title a:link, .blog_post_title a:visited, .blog_post_title a:active {
+       color: #000000;
+}
+
+.blog_post_title a:hover {
+       color: #0000FF;
+}
+
+
 .blog_post_header {
        font-size: 100%;
        font-style: italic;
index 7a01f009aa68c57419890aa02536947f40ba5b61..c16398b913d2c40ecf487651e79d7bdf320f0a06 100644 (file)
@@ -1,6 +1,6 @@
 <div class="blog_post">
 <div class="blog_post_title">
-<?!("COND:MAIL:SUBJ", 7)><?MAIL:SUMM:SUBJECT("X")><??("X", 7)>
+<?!("COND:MAIL:SUBJ", 7)><a href="<?BLOG:PERMALINK>"><?MAIL:SUMM:SUBJECT("X")></a><??("X", 7)>
 </div>
 <div class="blog_post_header">
 <span>