Skip to content
Snippets Groups Projects
Commit 177fb317 authored by runemaster's avatar runemaster
Browse files

Updates for new features.

(Profiles, update posts/e-mails, and future expandability.)
parent 884ded23
No related branches found
No related tags found
No related merge requests found
Showing
with 296 additions and 111 deletions
/* $Id$ */
/* $Id: */
load("../web/lib/template.ssjs");
......@@ -8,11 +8,14 @@ http_reply.header.pragma='no-cache';
http_reply.header.expires='0';
http_reply.header['cache-control']='must-revalidate';
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
load("../web/lib/leftnav_html.ssjs");
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
/* Main Page Stats */
/* Main Page Stats - might move to global_defs.ssjs */
total=time()-system.uptime;
days = Math.floor(total/(24*60*60));
......@@ -44,31 +47,6 @@ load("../web/lib/leftnav_html.ssjs");
var port = host.indexOf(':');
if(port>=0)
host=host.slice(0,port);
if(telnet_port=="23")
telnet_port="";
else
telnet_port = ":" + telnet_port;
if(rlogin_port=="513")
rlogin_port="";
else
rlogin_port = ":" + rlogin_port;
if(ftp_port=="21")
ftp_port="";
else
ftp_port = ":" + ftp_port;
if(irc_port=="6667")
irc_port="";
else
irc_port = ":" + irc_port;
if(nntp_port=="119")
nntp_port="";
else
nntp_port = ":" + nntp_port;
if(gopher_port=="70")
gopher_port='';
else
gopher_port = ":" + gopher_port;
template.additional_services ='[' + ("java telnet".link("telnet/")) + '] ';
template.additional_services+='[' + ("telnet".link("telnet://"+host +telnet_port)) + '] ';
......@@ -78,8 +56,11 @@ load("../web/lib/leftnav_html.ssjs");
template.additional_services+='[' + ("news".link("news://"+host +nntp_port)) + '] ';
template.additional_services+='[' + ("gopher".link("gopher://"+host +gopher_port)) + '] ';
if(do_rightnav)
write_template("rightnav.inc");
write_template("main.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
function addcommas(num)
{
......
......@@ -76,40 +76,44 @@ template.profile = new Array;
template.profile.push({html: '<h1>Edit Profile</h1>' });
template.profile.push({html: '<p>Personal Information</p>' });
template.profile.push({html: '<form action="/members/updateprofile.ssjs?edituser=' + user.number + '" method="post">' });
template.profile.push({html: '<table class="userstats" cellpadding="0" cellspacing="2">' });
template.profile.push({html: '<table class="userstats2" cellpadding="2" cellspacing="1">' });
if(system.newuser_questions & UQ_REALNAME)
template.profile.push({html: '<tr><td class="userstats" align="right">Real Name: </td><td class="userstats" align="left"><input type="text" name="name" size="25" maxlength="25" value="' + usr.name + '" ' + disabled + ' /></td></tr>' });
if(system.newuser_questions & UQ_ALIASES)
template.profile.push({html: '<tr><td class="userstats" align="right">Alias: </td><td class="userstats" align="left"><input type="text" name="alias" size="25" maxlength="25" value="' + usr.alias + '" ' + disabled + ' /></td></tr>' });
template.profile.push({html: '<tr><td class="userstatsright" align="right">Alias: </td><td class="userstats" align="left"><input type="text" name="alias" size="25" maxlength="25" value="' + usr.alias + '" ' + disabled + ' /></td></tr>' });
if(system.newuser_questions & UQ_HANDLE)
template.profile.push({html: '<tr><td class="userstats" align="right">Chat Handle: </td><td class="userstats" align="left"><input type="text" name="handle" size="8" maxlength="8" value="' + usr.handle + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstats" align="right">E-Mail Address: </td><td class="userstats" align="left"><input type="text" name="email" size="50" maxlength="60" value="' + usr.netmail + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstatsright" align="right">Chat Handle: </td><td class="userstats" align="left"><input type="text" name="handle" size="8" maxlength="8" value="' + usr.handle + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstatsright" align="right">E-Mail Address: </td><td class="userstats" align="left"><input type="text" name="email" size="50" maxlength="60" value="' + usr.netmail + '" /></td></tr>' });
if(system.newuser_questions & UQ_ADDRESS)
template.profile.push({html: '<tr><td class="userstats" align="right">Address: </td><td class="userstats" align="left"><input type="text" name="address" size="50" maxlength="50" value="' + usr.address + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstatsright" align="right">Address: </td><td class="userstats" align="left"><input type="text" name="address" size="50" maxlength="50" value="' + usr.address + '" /></td></tr>' });
if(system.newuser_questions & UQ_LOCATION)
template.profile.push({html: '<tr><td class="userstats" align="right">City, State/Prov: </td><td class="userstats" align="left"><input type="text" name="location" size="50" maxlength="50" value="' + usr.location + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstatsright" align="right">City, State/Prov: </td><td class="userstats" align="left"><input type="text" name="location" size="50" maxlength="50" value="' + usr.location + '" /></td></tr>' });
if(system.newuser_questions & UQ_ADDRESS)
template.profile.push({html: '<tr><td class="userstats" align="right">Zip/Postal Code: </td><td class="userstats" align="left"><input type="text" name="zipcode" size="50" maxlength="50" value="' + usr.zipcode + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstatsright" align="right">Zip/Postal Code: </td><td class="userstats" align="left"><input type="text" name="zipcode" size="50" maxlength="50" value="' + usr.zipcode + '" /></td></tr>' });
if(system.newuser_questions & UQ_PHONE)
template.profile.push({html: '<tr><td class="userstats" align="right">Phone: </td><td class="userstats" align="left"><input type="text" name="phone" size="50" maxlength="50" value="' + usr.phone + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstatsright" align="right">Phone: </td><td class="userstats" align="left"><input type="text" name="phone" size="50" maxlength="50" value="' + usr.phone + '" /></td></tr>' });
template.profile.push({html: '</table>' });
template.profile.push({html: '<h3>Web Profile</h3>'});
template.profile.push({html: '<p>Changes here are only visible in the Web Interface.</p>' });
template.profile.push({html: '<table class="userstats" cellpadding="0" cellspacing="2">' });
template.profile.push({html: '<tr><td class="userstats" align="right">ICQ: </td><td class="userstats" align="left"><input type="text" name="icq" size="10" maxlength="10" value="' + usr.icq + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstats" align="right">MSN: </td><td class="userstats" align="left"><input type="text" name="msn" size="50" maxlength="50" value="' + usr.msn + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstats" align="right">Yahoo: </td><td class="userstats" align="left"><input type="text" name="yahoo" size="50" maxlength="50" value="' + usr.yahoo + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstats" align="right">AIM: </td><td class="userstats" align="left"><input type="text" name="aim" size="50" maxlength="50" value="' + usr.aim + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstats" align="right">Homepage: </td><td class="userstats" align="left"><input type="text" name="homepage" size="50" maxlength="50" value="' + usr.homepage + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstats" align="right">Hobbies: </td><td class="userstats" align="left"><input type="textarea" size="50" name="hobbies" value="' + usr.hobbies + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstats" align="right">Picture (Link): </td><td class="userstats" align="left"><input type="textarea" size="50" name="picture" value="' + usr.picture + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstats" align="right">Avatar (Link): </td><td class="userstats" align="left"><input type="textarea" size="50" name="avatar" value="' + usr.avatar + '" /></td></tr>' });
template.profile.push({html: '<p>Changes here are only visible in the Web Interface.<br /><br /></p>' });
template.profile.push({html: '<table class="userstats2" cellpadding="2" cellspacing="1">' });
template.profile.push({html: '<tr><td class="userstatsright" align="right">ICQ: </td><td class="userstats" align="left"><input type="text" name="icq" size="10" maxlength="10" value="' + usr.icq + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstatsright" align="right">MSN: </td><td class="userstats" align="left"><input type="text" name="msn" size="50" maxlength="50" value="' + usr.msn + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstatsright" align="right">Yahoo: </td><td class="userstats" align="left"><input type="text" name="yahoo" size="50" maxlength="50" value="' + usr.yahoo + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstatsright" align="right">AIM: </td><td class="userstats" align="left"><input type="text" name="aim" size="50" maxlength="50" value="' + usr.aim + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstatsright" align="right">Homepage: </td><td class="userstats" align="left"><input type="text" name="homepage" size="50" maxlength="50" value="' + usr.homepage + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstatsright" align="right">Hobbies: </td><td class="userstats" align="left"><input type="textarea" size="50" name="hobbies" value="' + usr.hobbies + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstatsright" align="right">Picture (Link): </td><td class="userstats" align="left"><input type="textarea" size="50" name="picture" value="' + usr.picture + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstatsright" align="right">Avatar (Link): </td><td class="userstats" align="left"><input type="textarea" size="50" name="avatar" value="' + usr.avatar + '" /></td></tr>' });
template.profile.push({html: '<tr><td class="userstats">&nbsp;</td><td class="userstats"><br /><input type="submit" value="Update Profile" /></td></tr></table></form><br />' });
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
write_template("profile.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
/* $Id$ */
load("../web/lib/template.ssjs");
var sub="";
template.title=system.name+ " Information Menu";
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
template.user_num=user.number;
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
write_template("infomenu.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
......@@ -4,6 +4,9 @@ load("../web/lib/template.ssjs");
var sub="";
if(CurrTheme=="NightShade")
do_rightnav=false;
if(user.number!=0) {
var file = new File(system.data_dir + "logon.lst");
if(file.open("r")) {
......@@ -14,8 +17,14 @@ if(user.number!=0) {
template.lastcallers=html_encode(template.lastcallers.join("\r\n"),true,false,true,true);
}
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
write_template("lastcallers.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
......@@ -11,8 +11,15 @@ template.title = "Change User Password";
if(user.security.password_date!=0)
template.pwchangedate=strftime("%A, %B %d, %Y." ,user.security.password_date);
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
write_template("newpw.inc");
write_template("footer.inc");
\ No newline at end of file
if(do_footer)
write_template("footer.inc");
......@@ -30,8 +30,14 @@ if(prefsfile.open("w+",false)) {
load('../web/lib/template.ssjs');
template.theme=Themes[CurrTheme];
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
load("../web/lib/leftnav_html.ssjs");
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
write_template("picktheme.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
/* $Id$ */
load("../web/lib/template.ssjs");
var sub="";
template.title= system.name+ " - System Information";
if(CurrTheme=="NightShade")
do_rightnav = false;
template.sysinfo="";
f=new File(system.text_dir+"system.msg");
if(f.open("rb",true)) {
......@@ -106,8 +111,14 @@ for(addr in system.fido_addr_list) {
template.fidoaddrs[addr].address=system.fido_addr_list[addr];
}
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
write_template("sysinfo.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
/* $Id$ */
load("../web/lib/template.ssjs");
var sub='';
......@@ -10,8 +12,15 @@ for(tname in Themes) {
template.theme_list+='>'+html_encode(Themes[tname].desc,true,true,false,false)+'</option>';
}
template.theme_list+='</select>';
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
load("../web/lib/leftnav_html.ssjs");
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
write_template("themes.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
......@@ -90,10 +90,15 @@ template.backurl='<a href="/members/userlist.ssjs">Back to Userlist</a>';
template.update_message="Profile has been Updated."
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
write_template("updateprofile.inc");
if(do_footer)
write_template("footer.inc");
write_template("footer.inc");
\ No newline at end of file
......@@ -40,11 +40,17 @@ for(i=1;i<=lastuser;i++) {
if(http_request.query["sort"]!=undefined)
template.users.sort(alphasort);
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
write_template("userlist.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
function alphasort (a,b)
{
......
......@@ -22,11 +22,17 @@ else
i=i ? 100/i : user.stats.total_posts > user.stats.total_logons ? 100 : 0;
template.pinfo=parseInt(i);
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
write_template("userstats.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
function addcommas(num)
{
......
......@@ -151,10 +151,15 @@ if(is_sysop) {
template.profile.push({html: '</table><br />' });
}
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(CurrTheme=="NewLayout")
if(do_rightnav)
write_template("rightnav.inc");
write_template("profile.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
/* $Id$ */
/*
* Attachment FS emulator
* Request attachments in the form:
......
......@@ -3,11 +3,20 @@
load("../web/lib/msgslib.ssjs");
template.title="Message Groups on " +system.name;
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
template.groups=msg_area.grp_list;
write_template("msgs/choosegroup.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
msgs_done();
......@@ -4,6 +4,7 @@ load("../web/lib/msgslib.ssjs");
template.title="Choosing Message Subs in Group: "+msg_area.grp[grp].description;
if(do_header)
write_template("header.inc");
template.group=msg_area.grp[grp];
......@@ -36,9 +37,14 @@ for(s in msg_area.grp[grp].sub_list) {
template.subs.push(thissub);
}
load("../web/lib/topnav_html.ssjs");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
write_template("msgs/choosesubs.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
msgs_done();
/* $Id$ */
load("../web/lib/msgslib.ssjs");
template.title="Message Groups on " +system.name;
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
template.groups=msg_area.grp_list;
write_template("msgs/groups.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
msgs_done();
/* $Id$ */
/*
* Inline attachment FS emulator
* Request attachments in the form:
......
/* $Id$ */
load("../web/lib/template.ssjs");
load("../web/lib/msgslib.ssjs");
......@@ -58,10 +60,17 @@ if(http_request.query.Action=="Delete") {
}
template.sub_code=sub;
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
write_template("msgs/management.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
msgs_done();
......@@ -5,17 +5,59 @@ load("../web/lib/mime_decode.ssjs");
template.txtbodybgwht=0;
template.author_avatar = '';
/* If you want to disable display of certain .inc files */
/* for a specific theme declare it like this in the .ssjs */
/* file corresponding to the page you want to overide the */
/* default display type for the theme */
if(CurrTheme=="NightShade") {
do_leftnav=false;
do_rightnav=false;
}
if(msgbase.open!=undefined && msgbase.open()==false) {
error(msgbase.last_error);
}
/* Check author info if message base is local and display it */
/* on the new expanded message read page for new theme */
var hdr=msgbase.get_msg_header(false,m);
if(hdr.from_ext!=undefined) {
template.u_num = hdr.from_ext;
usr = new User(template.u_num);
template.author_firston = strftime("%m/%d/%y",usr.stats.firston_date);
template.author_posts = usr.stats.total_posts;
if((user.compare_ars(msg_area.sub[sub].operator_ars) && msg_area.sub[sub].operator_ars != '' || user.number==1) && show_ip==true) {
template.author_ip='IP: ' + usr.note + '<br /><br />';
}
template.author_ismod = '<br />Member<br /><br />';
if(usr.compare_ars(msg_area.sub[sub].operator_ars) && msg_area.sub[sub].operator_ars != '' || usr.number==1)
template.author_ismod = '<br />Moderator<br /><br />';
if(file_exists(prefs_dir + format("%04d.html_prefs",usr.number))); {
prefsfile=new File(prefs_dir + format("%04d.html_prefs",usr.number));
if(prefsfile.open("r",false)) {
if(prefsfile.iniGetValue('Profile', 'Avatar', '')!='') {
template.author_avatar=prefsfile.iniGetValue('Profile', 'Avatar', '');
var display_info=true;
} else
template.author_avatar = template.image_dir + "/nothumbnail.jpg";
prefsfile.close();
}
}
}
template.can_delete=can_delete(m);
if(sub=='mail') {
template.group=new Object;
template.group.name="E-Mail";
}
else {
} else {
template.group=msg_area.grp[msg_area.sub[sub].grp_name];
}
......@@ -125,10 +167,16 @@ if(tmp!=undefined)
else
template.nextlink=no_next_msg_html;
write_template("header.inc");
load("../web/lib/topnav_html.ssjs");
load("../web/lib/leftnav_html.ssjs");
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
write_template("msgs/msg.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
msgs_done();
......@@ -221,7 +221,6 @@ if(sub!='mail') {
}
}
write_template("header.inc");
last_offset=msgarray.length-1-offset;
first_offset = offset;
max_first_offset= offset+msgarray.length-1-offset;
......@@ -245,6 +244,9 @@ if(DateDescending) {
if(hdr==null)
continue;
template.messages[displayed.toString()]=hdr;
template.messages[displayed.toString()].to=template.messages[displayed.toString()].to.substr(0,15);
template.messages[displayed.toString()].from=template.messages[displayed.toString()].from.substr(0,15);
template.messages[displayed.toString()].subject=template.messages[displayed.toString()].subject.substr(0,20);
template.messages[displayed.toString()].attachments=count_attachments(hdr,msgbase.get_msg_body(true,msgarray[last_offset].offset));
template.messages[displayed.toString()].offset=msgarray[last_offset].offset;
displayed++;
......@@ -255,8 +257,11 @@ if(DateDescending) {
var hdr=clean_msg_headers(msgbase.get_msg_header(true,msgarray[first_offset].offset),0);
if(hdr==null)
continue;
template.messages[displayed.toString()]=hdr;
template.messages[displayed.toString()].attachments=count_attachments(hdr,msgbase.get_msg_body(true,msgarray[first_offset].offset));
template.messages[displayed.toString()]=hdr;
template.messages[displayed.toString()].to=template.messages[displayed.toString()].to.substr(0,15);
template.messages[displayed.toString()].from=template.messages[displayed.toString()].from.substr(0,15);
template.messages[displayed.toString()].subject=template.messages[displayed.toString()].subject.substr(0,20);
template.messages[displayed.toString()].attachments=count_attachments(hdr,msgbase.get_msg_body(true,msgarray[first_offset].offset));
template.messages[displayed.toString()].offset=msgarray[first_offset].offset;
displayed++;
}
......@@ -270,8 +275,40 @@ if(sub=='mail') {
template.post_button_image="new_message.gif";
}
load("../web/lib/topnav_html.ssjs");
load("../web/lib/leftnav_html.ssjs");
if(http_request.query["sort"]!=undefined)
template.messages.sort(alphasort);
if(do_header)
write_template("header.inc");
if(do_topnav)
load("../web/lib/topnav_html.ssjs");
if(do_leftnav)
load("../web/lib/leftnav_html.ssjs");
if(do_rightnav)
write_template("rightnav.inc");
write_template("msgs/msgs.inc");
write_template("footer.inc");
if(do_footer)
write_template("footer.inc");
msgs_done();
function alphasort (a,b)
{
if(http_request.query["sort"]==undefined)
return(0);
var sortby=http_request.query["sort"]
var au;
var bu;
if(a[sortby].toUpperCase!=undefined)
au=a[sortby].toUpperCase();
else
au=a[sortby];
if(b[sortby].toUpperCase!=undefined)
bu=b[sortby].toUpperCase();
else
bu=b[sortby];
if(au<bu)
return -1;
if(bu>au)
return 1;
return 0;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment