Skip to content
Snippets Groups Projects
Commit 6aa11c93 authored by rswindell's avatar rswindell
Browse files

Use ctrl/modopts.ini to enable/disable optional behavior (e.g. multi-column

external program listing, sorting, emailing of passwords).
parent 752aa3f2
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@
load("sbbsdefs.js");
var email_passwords = true;
options=load("modopts.js","login");
// The following 2 lines are only required for "Re-login" capability
bbs.logout();
......@@ -49,7 +49,7 @@ for(var c=0; c<10; c++) {
bbs.logon();
exit();
}
if(email_passwords) {
if(options && options.email_passwords) {
var usernum = system.matchuser(str);
if(usernum) {
var u = new User(usernum);
......
......@@ -10,8 +10,8 @@ load("sbbsdefs.js");
/* text.dat entries */
load("text.js");
var multicolumn = true;
var sort = false;
if((options=load("modopts.js","xtrn_sec")) == null)
options = {multicolumn: true, sort: false}; // default values
function sort_by_name(a, b)
{
......@@ -50,7 +50,7 @@ while(bbs.online) {
}
else {
if(sort)
if(options.sort)
sec_list.sort(sort_by_name);
for(i in sec_list)
console.uselect(Number(i),"External Program Section"
......@@ -75,23 +75,23 @@ while(bbs.online) {
bbs.menu("xtrn" + (xtrn_area.sec_list[xsec].number+1));
}
else {
if(sort)
if(options.sort)
prog_list.sort(sort_by_name);
printf(bbs.text(XtrnProgLstHdr),xtrn_area.sec_list[xsec].name);
write(bbs.text(XtrnProgLstTitles));
if(multicolumn && prog_list.length >= 10) {
if(options.multicolumn && prog_list.length >= 10) {
write(" ");
write(bbs.text(XtrnProgLstTitles));
}
console.crlf();
write(bbs.text(XtrnProgLstUnderline));
if(multicolumn && prog_list.length >= 10) {
if(options.multicolumn && prog_list.length >= 10) {
write(" ");
write(bbs.text(XtrnProgLstUnderline));
}
console.crlf();
var n;
if(multicolumn && prog_list.length >= 10)
if(options.multicolumn && prog_list.length >= 10)
n=Math.floor(prog_list.length/2)+(prog_list.length&1);
else
n=prog_list.length;
......@@ -101,7 +101,7 @@ while(bbs.online) {
,prog_list[i].name
,prog_list[i].cost);
if(multicolumn
if(options.multicolumn
&& prog_list.length>=10) {
j=Math.floor(prog_list.length/2)+i+(prog_list.length&1);
if(j<prog_list.length) {
......
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