home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
FAQ
/
cgi-bin
/
discus4_00
/
source
/
em_def.tmpl
< prev
next >
Wrap
Text File
|
2009-11-06
|
6KB
|
204 lines
# FILE: em_def.tmpl
# DESCRIPTION: E-mail notification pop-up for profile defaults
# Copyright (c) 2002, DiscusWare, LLC, all rights reserved
# -------------------------------------------------------------------------------------------
<!--BEGIN-->
<html>
<head>
<title>Select E-mail Notification Defaults</title>
<style>
<!--
body { font-family: verdana,arial,helvetica; font-size: 9pt; }
td.b { font: 8pt $color->{face}; font-weight: bold; }
td.s { font: 8pt $color->{face} }
.bbg { background: #0000ff; }
-->
</style>
<script language="JavaScript">
<!--
function updater () {
var em = document.mainform;
var s = new Array();
var slen = 0;
<#if pro && $GLOBAL_OPTIONS{email_bysubtopic} == 1#>
for (var i = 0; i < em.notify.length; i++) {
if (em.notify[i].checked == true && em.bysub[i].value != "") {
var n = new Array();
s[slen++] = em.bysub[i].value;
} else {
if (em.notify[i].checked == true) {
s[slen++] = em.notify[i].value;
}
}
}
<#else#>
for (var i = 0; i < em.notify.length; i++) {
if (em.notify[i].checked == true) {
s[slen++] = em.notify[i].value;
}
}
<#endif#>
var j = join(s,',');
var f = self.window.opener.document.forms[0];
f.default_notify_string.value = j;
f.submit();
self.close();
}
function init () {
<#mathdefine: $i = sum($#notify_topics,3)#>
var a = new Array($i);
<#foreach $topic (@notify_topics)#>
a[$topic->{_iteration_minus1}] = "$topic->{number}";
<#endloop#>
<#define $i = "$#notify_topics"#>
a[$i] = "0";
<#mathdefine: $i = sum($#notify_topics, 1)#>
a[$i] = "00";
<#mathdefine: $i = sum($#notify_topics, 2)#>
a[$i] = "000";
var f = self.window.opener.document.forms[0];
var sarr = split(f.default_notify_string.value,',');
var q = new Array();
for (var i = 0; i < sarr.length; i++) {
q[sarr[i]] = 1;
}
for (var i = 0; i < a.length; i++) {
if (q[a[i]] == 1) {
document.mainform.notify[i].checked = true;
}
}
}
function split(string,text) {
var splitIndex = 0;
var splitArray = new Array();
var txtLength = text.length;
while (1) {
var i = string.indexOf(text);
var strLength = string.length;
if (i == -1) {
splitArray[splitIndex++] = string;
return splitArray;
}
if (i == 0 && text != string.substring(0, txtLength)) {
return splitArray;
}
splitArray[splitIndex++] = string.substring(0,i);
string = string.substring(i+txtLength, strLength);
}
}
function join(arrayName,text) {
var temp = '';
for (var i=0; i<arrayName.length; i++) {
temp += arrayName[i] + text;
}
if (temp.length == 0) {
return temp;
} else {
return temp.substring(0, temp.length - 1);
}
}
function toggle_checkbox (l) {
var x = document.mainform.notify[l];
if (x.style) {
x.style.backgroundColor = "$color->{bgcolor}";
}
var j = document.mainform.bysub[l];
var i = j.value.indexOf(':');
if (i <= 0) {
j.value = '';
} else {
j.value = j.value.substring(0, i-1);
}
}
// -->
</script>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000" onLoad="init()">
<center><font size=+1><b>Select E-mail Notification Defaults</b></font></center>
<hr>
<p>
Check any of the following boxes to select defaults for e-mail notification:
</p>
<form name="mainform">
<table border=1 cellpadding=5>
<tr align=center>
<td class="b" align=center>$L{EMAIL_NOTIFY_PROFILE_NEW_POST}</td>
<#if pro && $GLOBAL_OPTIONS{email_bysubtopic} == 1#>
<td class="b">$L{EMAIL_NOTIFY_BY_SUBTOPIC}</td>
<#endif#>
<td class="b" align=left>$L{EMAIL_NOTIFY_PROFILE_TOPICS}</td>
</tr>
<#define $subselect = "0"#>
<#foreach $topic (@notify_topics)#>
<tr align=center>
<td class="s"><input type=checkbox name="notify" value="$topic->{number}"\
{#if $topic->{sel}#}{||}checked{#endif#}\
<#if $topic->{bysub} rexp=~ match(^$topic->{number}:.)#>
<#if $browser->{ieX} || $browser->{ns6}#>
{||}class="bbg"\
{#if pro && $GLOBAL_OPTIONS{email_bysubtopic} == 1#}{||}onClick="toggle_checkbox($topic->{_iteration_minus1})"{#endif#}\
></td>
<#else#>
{#if pro && $GLOBAL_OPTIONS{email_bysubtopic} == 1#}{||}onClick="toggle_checkbox($topic->{_iteration_minus1})"{#endif#}\
><font color="#0000ff">*</font></td>
<#endif#>
<#define $subselect = "1"#>
<#else#>
></td>
<#endif#>
<#if pro && $GLOBAL_OPTIONS{email_bysubtopic} == 1#>
<td class="s">
<input type=button value="$L{EMAIL_NOTIFY_PROFILE_GO}" onClick="window.open('$script_url/board-profile.$cgi_extension?action=emsel&topic=$topic->{number}&item=$topic->{_iteration}&username=$general->{username}', 'emwin', 'width=400,height=500,scrollbars=yes,resizable=yes');">
<input type=hidden name="bysub" value="$topic->{bysub}">
</td>
<#endif#>
<td class="s" align=left>$topic->{name}</td>
</tr>
<#endloop#>
<#if $subselect == 1#>
<tr>
<td colspan=3 class="s"><font color="#0000ff">*</font> $L{PRED_FIRSTLEVEL_ON}</td>
</tr>
<#endif#>
</table>
<p>$L{EMAIL_NOTIFY_PROFILE_ADDITIONAL}</p>
<table border=1 width=550>
<tr align=center>
<td class="s" width=50><input type=checkbox name="notify" value="0"{#if $notify->{own_post}#} checked{#endif#}></td>
<td class="s" align=left>$L{PROFEDIT_MYPOSTSBOX}</td>
</tr>
<#if pro#>
<tr align=center>
<td class="s"><input type=checkbox name="notify" value="00"{#if $notify->{reply_post}#} checked{#endif#}></td>
<td class="s" align=left>$L{PRED_REPLIESBOX}</td>
</tr>
<#if $GLOBAL_OPTIONS->{disable_html_mail} == 0#>
<tr align=center>
<td class="s"><input type=checkbox name="notify" value="000"{#if $notify->{format_html}#} checked{#endif#}></td>
<td class="s" align=left>$L{EMAIL_HTML_PREF}</td>
</tr>
<#endif#>
<#endif#>
</table>
<#if pro#>
<input type=hidden name="bysub" value="">
<input type=hidden name="bysub" value="">
<input type=hidden name="bysub" value="">
<#endif#>
<p>
<input type=button value="Save Defaults" onClick="updater()">
<input type=button value="Cancel" onClick="self.close()">
</p>
</form>
</body>
</html>
<!--END-->