plainblack.com
Username Password
search
Bookmark and Share

    

CS subscribe.form default OFF

User sandraqu
Date 11/1/2007 12:56 pm
Views 1301
Rating -10    Rate [
|
]
Previous · Next
User Message
sandraqu

 

How do I make the default to OFF of the subscribe.form CS variable??

 lock.form and sticky.form both default to OFF, but their syntax is no different.

 

--sandra 

--- (Edited on 11/1/2007 12:56 pm [GMT-0500] by sandraqu) ---



Back to Top
Rate [
|
]
 
 
colink

How do I make the default to OFF of the subscribe.form CS variable??

The short answer is that this isn't configurable.  It defaults to checking to see if the user is subscribed to the current thread.  If they are subscribed, then it defaults to 0FF.  If they are not subscribed, then it defaults to ON.

Here are your options:

  1. Write some javascript in the template to turn it off.
  2. Change the core code to WebGUI in your install to work just like you'd like. (Given your hosting situation, this may or may not be a valid option)
  3. Submit an RFE to have WebGUI change the way it works by default.
My recommendation would be to write the JS in the template.

--- (Edited on 11/1/2007 2:39 pm [GMT-0500] by colink) ---



Back to Top
Rate [
|
]
 
 
sandraqu

Some help here people - I don't code JS.

function subscribeChk() {
if (document.form.subscribe.value >= 1) {
    document.form.subscribe.value = 0;
    }
}

the form does not have a name, but the radio button does.

do i use this.form instead of document.form?  WebGUI has other un-named forms in the document.

 do i place the JS in the <head> or near the subscribe radio (before or after it) ??

 

--- (Edited on 11/1/2007 3:42 pm [GMT-0500] by sandraqu) ---



Back to Top
Rate [
|
]
 
 
sandraqu

Here's the answer folks:

Edit your "Collaboration System, Post Form Template" template, and add this code after the subscribe call, like this

-------------- 

<tmpl_unless user.isVisitor>
<!--
            <tr>
                <td><tmpl_var subscribe.label></td>
                <td><tmpl_var subscribe.form></td>
            </tr>
-->
</tmpl_unless>

<script language="JavaScript">
<!--
//turn subscription off
function subscribeChk() {
if (document.forms[4].subscribe[0].checked) {
    document.forms[4].subscribe[1].checked = true;
    //alert(document.forms[4].subscribe[0].value);   
    }
}
subscribeChk();
//-->
</script>

--------------

I've chosen to comment out the subscribe code so that the user doesn't see it (or alter it). 

 For me, the form containing the subscribe radio buttion was the 5th un-named form, therefore 'forms[4]' in the JS code. 

If you need to alter an un-named form elsewhere and need to figure out what number it is, I recommend using FireFox with the View Source Chart add-on extension to view the code and count how many <form> tags there are in the HTML code.  After installing and activating the add-on, go to View > View Source Chart.

--- (Edited on 11/5/2007 11:01 am [GMT-0600] by sandraqu) ---

--- (Edited on 11/5/2007 11:02 am [GMT-0600] by sandraqu) ---

--- (Edited on 11/5/2007 11:05 am [GMT-0600] by sandraqu) ---



Back to Top
Rate [
|
]
 
 
    



© 2012 Plain Black Corporation | All Rights Reserved