Skip to content
Snippets Groups Projects
Commit 0074a469 authored by deuce's avatar deuce
Browse files

More changes... the first item should now be the internal message base code

Threaded view uses JavaScript and visibility to make dynamic collapsing
threads.

http://nix.synchro.net/blogs/DOVE-GEN/ for an example "blog" highlighting
the thread linking issues on my system...

For a good thread view, see:
http://nix.synchro.net/blogs/DOVE-DEB/Angus%20McLeod/2007/01/10/6872/Quiet___
parent 2f119641
Branches
Tags
No related merge requests found
// User editable settings...
// Internal code of the message base
var msg_code="GENERAL";
// Number of posts to show per page.
var max_posts=16;
// Minimum number of characters in an exerpt
var min_chars=400;
// Number of pixels per level to indent comments
var indent_pixels=20;
//
// Don't change stuff down here.
//
// User name of the blogger
var parameters=http_request.path_info.substr(1).split("/");
var poster=parameters[0];
var year=parseInt(parameters[1],10);
var month=parseInt(parameters[2],10);
var day=parseInt(parameters[3],10);
var msgid=parseInt(parameters[4],10);
var subject=parameters[5];
if(poster.indexOf("/")>=0) {
poster=poster.substr(0,poster.indexOf("/"));
}
var msg_code=parameters[0];
var poster=parameters[1];
var year=parseInt(parameters[2],10);
var month=parseInt(parameters[3],10);
var day=parseInt(parameters[4],10);
var msgid=parseInt(parameters[5],10);
var subject=parameters[6];
//var pnum=system.matchuser(poster);
//if(pnum==0) {
......@@ -41,7 +39,7 @@ if(!isNaN(msgid)) {
if(subject==undefined || subject=="") {
var hdr=msgbase.get_msg_header(parseInt(msgid));
http_reply.status="301 Moved Permanently";
http_reply.header["Location"]="http://"+http_request.host+http_request.virtual_path+poster+"/"+format("%04d",year)+"/"+format("%02d",month)+"/"+format("%02d",day)+"/"+msgid+"/"+clean_subject(hdr.subject);
http_reply.header["Location"]="http://"+http_request.host+http_request.virtual_path+msg_code+"/"+hdr.from+"/"+format("%04d",year)+"/"+format("%02d",month)+"/"+format("%02d",day)+"/"+msgid+"/"+clean_subject(hdr.subject);
exit(0);
}
}
......
<?xjs
load("/synchronet/src/web/root/blogs/blog_config.js");
load(cwd+"/blog_config.js");
?>
<html>
<head>
<title>The Blogifier!</title>
<script>
<!--
function toggle_display(itemID, buttonID)
{
var item = document.getElementById(itemID);
var button = document.getElementById(buttonID);
if (item.style.display != "none") {
item.style.display = "none";
button.src="<?xjs write(http_request.virtual_path)?>plus.gif";
}
else {
item.style.display = "block";
button.src="<?xjs write(http_request.virtual_path)?>minus.gif";
}
}
//-->
</script>
</head>
<body>
......@@ -96,12 +114,13 @@ while(1) {
body=body.split("&#13;&#10;").join("<br>");
?>
<div style="padding-left: <?xjs write(thread_depth*10) ?>px">
<b><?xjs write(hdr.subject); ?></b> (<?xjs write(date); ?>)<br>
By: <?xjs write(hdr.from); ?><br>
<p><?xjs write(body); ?></p>
<div style="padding-left: <?xjs write(thread_depth*indent_pixels) ?>px">
<a onClick="toggle_display('msg-<?xjs write(msgid)?>','button-<?xjs write(msgid) ?>');"><img src="<?xjs write(http_request.virtual_path) ?>plus.gif" id="button-<?xjs write(msgid); ?>"></a> <b><?xjs write(hdr.subject); ?></b> (<?xjs write(date); ?>)<br>
By: <i><?xjs write(hdr.from); ?></i><br>
<div id="msg-<?xjs write(msgid) ?>" style="display: none"><?xjs write(body); ?>
<hr>
</div>
</div>
<?xjs
}
......
<?xjs
load("/synchronet/src/web/root/blogs/blog_config.js");
load("sbbsdefs.js");
load(cwd+"/blog_config.js");
if(!isNaN(msgid)) {
xjs_load("blog_item.xjs");
exit(0);
......@@ -13,14 +14,20 @@ if(!isNaN(msgid)) {
<body>
<p>
Welcome to the <?xjs write(msgbase.cfg.name); ?> Blogifier for <?xjs write(poster); ?>
Welcome to the <?xjs write(msgbase.cfg.name); ?> Blogifier <?xjs if(poster != '') write("for "+poster); ?>
</p>
<?xjs
for(i=msgbase.last_msg; i>=msgbase.first_msg; i--) {
var hdr=msgbase.get_msg_header(i);
if(hdr.from.toUpperCase() != poster.toUpperCase())
if(hdr==null)
continue;
if(hdr.attr & (MSG_PRIVATE|MSG_DELETE))
continue;
if(poster!=undefined && poster!='') {
if(hdr.from.toUpperCase() != poster.toUpperCase())
continue;
}
// if(hdr.from_ext != pnum)
// continue;
if(hdr.thread_back)
......@@ -55,11 +62,11 @@ for(i=msgbase.last_msg; i>=msgbase.first_msg; i--) {
exerpt=exerpt.split("&#13;&#10;").join("<br>");
?>
<b><?xjs write(hdr.subject); ?></b> (<?xjs write(date); ?>)<br>
<b><?xjs write(hdr.subject); ?></b> (<?xjs write(date); ?>) - <i><?xjs write(hdr.from) ?></i><br>
<p><?xjs write(exerpt); if(read_more) write("<b>...</b>"); ?></p>
<p><a href="<?xjs
write("http://"+http_request.host+http_request.virtual_path+poster+"/"+format("%04d",this_year)+"/"+format("%02d",this_month)+"/"+format("%02d",this_day)+"/"+i+"/"+clean_subject(hdr.subject));
write("http://"+http_request.host+http_request.virtual_path+msg_code+"/"+hdr.from+"/"+format("%04d",this_year)+"/"+format("%02d",this_month)+"/"+format("%02d",this_day)+"/"+i+"/"+clean_subject(hdr.subject));
?>">Comments...</a></p>
<?xjs
......
web/root/blogs/minus.gif

85 B

web/root/blogs/plus.gif

88 B

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment