home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / FAQ / discus_admin_1357211388 / template / admin / em_def.tmpl < prev    next >
Text File  |  2009-11-06  |  6KB  |  204 lines

  1. # FILE: em_def.tmpl
  2. # DESCRIPTION: E-mail notification pop-up for profile defaults
  3. # Copyright (c) 2002, DiscusWare, LLC, all rights reserved
  4. # -------------------------------------------------------------------------------------------
  5.  
  6. <!--BEGIN-->
  7.  
  8. <html>
  9. <head>
  10. <title>Select E-mail Notification Defaults</title>
  11.  
  12. <style>
  13. <!--
  14.     body { font-family: verdana,arial,helvetica; font-size: 9pt; }
  15.     td.b { font: 8pt $color->{face}; font-weight: bold; }
  16.     td.s { font: 8pt $color->{face} }
  17.     .bbg { background: #0000ff; }
  18. -->
  19. </style>
  20.  
  21. <script language="JavaScript">
  22. <!--
  23.     function updater () {
  24.         var em = document.mainform;
  25.         var s = new Array();
  26.         var slen = 0;
  27.         <#if pro && $GLOBAL_OPTIONS{email_bysubtopic} == 1#>
  28.                 for (var i = 0; i < em.notify.length; i++) {
  29.                     if (em.notify[i].checked == true && em.bysub[i].value != "") {
  30.                         var n = new Array();
  31.                         s[slen++] = em.bysub[i].value;
  32.                     } else {
  33.                         if (em.notify[i].checked == true) {
  34.                             s[slen++] = em.notify[i].value;
  35.                         }
  36.                     }
  37.                 }
  38.         <#else#>
  39.                 for (var i = 0; i < em.notify.length; i++) {
  40.                     if (em.notify[i].checked == true) {
  41.                         s[slen++] = em.notify[i].value;
  42.                     }
  43.                 }
  44.         <#endif#>
  45.         var j = join(s,',');
  46.         var f = self.window.opener.document.forms[0];
  47.         f.default_notify_string.value = j;
  48.         f.submit();
  49.         self.close();
  50.     }
  51.     function init () {
  52.         <#mathdefine: $i = sum($#notify_topics,3)#>
  53.         var a = new Array($i);
  54.         <#foreach $topic (@notify_topics)#>
  55.             a[$topic->{_iteration_minus1}] = "$topic->{number}";
  56.         <#endloop#>
  57.         <#define $i = "$#notify_topics"#>
  58.         a[$i] = "0";
  59.         <#mathdefine: $i = sum($#notify_topics, 1)#>
  60.         a[$i] = "00";
  61.         <#mathdefine: $i = sum($#notify_topics, 2)#>
  62.         a[$i] = "000";
  63.         var f = self.window.opener.document.forms[0];
  64.         var sarr = split(f.default_notify_string.value,',');
  65.         var q = new Array();
  66.         for (var i = 0; i < sarr.length; i++) {
  67.             q[sarr[i]] = 1;
  68.         }
  69.         for (var i = 0; i < a.length; i++) {
  70.             if (q[a[i]] == 1) {
  71.                 document.mainform.notify[i].checked = true;
  72.             }
  73.         }
  74.     }
  75.     function split(string,text) {
  76.         var splitIndex = 0;
  77.         var splitArray = new Array();
  78.         var txtLength = text.length;
  79.         while (1) {
  80.             var i = string.indexOf(text);
  81.             var strLength = string.length;
  82.             if (i == -1) {
  83.                 splitArray[splitIndex++] = string;
  84.                 return splitArray;
  85.             }
  86.             if (i == 0 && text != string.substring(0, txtLength)) {
  87.                 return splitArray;
  88.             }
  89.             splitArray[splitIndex++] = string.substring(0,i);
  90.             string = string.substring(i+txtLength, strLength);
  91.         }
  92.     }
  93.     function join(arrayName,text) {
  94.         var temp = '';
  95.         for (var i=0; i<arrayName.length; i++) {
  96.             temp += arrayName[i] + text;
  97.         }
  98.         if (temp.length == 0) {
  99.             return temp;
  100.         } else {
  101.             return temp.substring(0, temp.length - 1);
  102.         }
  103.     }
  104.     function toggle_checkbox (l) {
  105.         var x = document.mainform.notify[l];
  106.         if (x.style) {
  107.             x.style.backgroundColor = "$color->{bgcolor}";
  108.         }
  109.         var j = document.mainform.bysub[l];
  110.         var i = j.value.indexOf(':');
  111.         if (i <= 0) {
  112.             j.value = '';
  113.         } else {
  114.             j.value = j.value.substring(0, i-1);
  115.         }
  116.     }
  117. // -->
  118. </script>
  119. </head>
  120.  
  121. <body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000" onLoad="init()">
  122.  
  123. <center><font size=+1><b>Select E-mail Notification Defaults</b></font></center>
  124. <hr>
  125. <p>
  126. Check any of the following boxes to select defaults for e-mail notification:
  127. </p>
  128.  
  129. <form name="mainform">
  130.     <table border=1 cellpadding=5>
  131.     <tr align=center>
  132.     <td class="b" align=center>$L{EMAIL_NOTIFY_PROFILE_NEW_POST}</td>
  133.     <#if pro && $GLOBAL_OPTIONS{email_bysubtopic} == 1#>
  134.         <td class="b">$L{EMAIL_NOTIFY_BY_SUBTOPIC}</td>
  135.     <#endif#>
  136.     <td class="b" align=left>$L{EMAIL_NOTIFY_PROFILE_TOPICS}</td>
  137.     </tr>
  138.     <#define $subselect = "0"#>
  139.     <#foreach $topic (@notify_topics)#>
  140.         <tr align=center>
  141.         <td class="s"><input type=checkbox name="notify" value="$topic->{number}"\
  142.             {#if $topic->{sel}#}{||}checked{#endif#}\
  143.             <#if $topic->{bysub} rexp=~ match(^$topic->{number}:.)#>
  144.                 <#if $browser->{ieX} || $browser->{ns6}#>
  145.                     {||}class="bbg"\
  146.                     {#if pro && $GLOBAL_OPTIONS{email_bysubtopic} == 1#}{||}onClick="toggle_checkbox($topic->{_iteration_minus1})"{#endif#}\
  147.                     ></td>
  148.                 <#else#>
  149.                     {#if pro && $GLOBAL_OPTIONS{email_bysubtopic} == 1#}{||}onClick="toggle_checkbox($topic->{_iteration_minus1})"{#endif#}\
  150.                     ><font color="#0000ff">*</font></td>
  151.                 <#endif#>
  152.                 <#define $subselect = "1"#>
  153.             <#else#>
  154.                 ></td>
  155.             <#endif#>
  156.             <#if pro && $GLOBAL_OPTIONS{email_bysubtopic} == 1#>
  157.                 <td class="s">
  158.                 <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');">
  159.                 <input type=hidden name="bysub" value="$topic->{bysub}">
  160.                 </td>
  161.             <#endif#>
  162.         <td class="s" align=left>$topic->{name}</td>
  163.         </tr>
  164.     <#endloop#>
  165.     <#if $subselect == 1#>
  166.         <tr>
  167.         <td colspan=3 class="s"><font color="#0000ff">*</font> $L{PRED_FIRSTLEVEL_ON}</td>
  168.         </tr>
  169.     <#endif#>
  170.     </table>
  171.     <p>$L{EMAIL_NOTIFY_PROFILE_ADDITIONAL}</p>
  172.     <table border=1 width=550>
  173.     <tr align=center>
  174.     <td class="s" width=50><input type=checkbox name="notify" value="0"{#if $notify->{own_post}#} checked{#endif#}></td>
  175.     <td class="s" align=left>$L{PROFEDIT_MYPOSTSBOX}</td>
  176.     </tr>
  177.     <#if pro#>
  178.         <tr align=center>
  179.         <td class="s"><input type=checkbox name="notify" value="00"{#if $notify->{reply_post}#} checked{#endif#}></td>
  180.         <td class="s" align=left>$L{PRED_REPLIESBOX}</td>
  181.         </tr>
  182.         <#if $GLOBAL_OPTIONS->{disable_html_mail} == 0#>
  183.             <tr align=center>
  184.             <td class="s"><input type=checkbox name="notify" value="000"{#if $notify->{format_html}#} checked{#endif#}></td>
  185.             <td class="s" align=left>$L{EMAIL_HTML_PREF}</td>
  186.             </tr>
  187.         <#endif#>
  188.     <#endif#>
  189.     </table>
  190.     <#if pro#>
  191.         <input type=hidden name="bysub" value="">
  192.         <input type=hidden name="bysub" value="">
  193.         <input type=hidden name="bysub" value="">
  194.     <#endif#>
  195. <p>
  196. <input type=button value="Save Defaults" onClick="updater()">
  197. <input type=button value="Cancel" onClick="self.close()">
  198. </p>
  199.  
  200. </form>
  201. </body>
  202. </html>
  203. <!--END-->
  204.