Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: [MOD] Hidden comment form until clicked for 1.4  (Read 2229 times)

centered

  • Guest
[MOD] Hidden comment form until clicked for 1.4
« on: June 07, 2007, 01:14:09 am »

Original mod by Bakercad in this thread: http://www.solucija.com/forum/viewtopic.php?id=3849

0. Backup

1.  Put this at the end of the languages variables
Code: [Select]
$l['clickcomment'] = 'Click here to show/hide comment form';2. Find the javascript_headers() function and reaplce the following:
Code: [Select]
</script>');With:
Code: [Select]
</script>
<script type="text/javascript">
//<![CDATA[
function toggle(div) {
if (document.getElementById(div).style.display==\'\') {
         document.getElementById(div).style.display = \'none\';
         return
        } document.getElementById(div).style.display = \'\';
};
//]]>
</script>');
3. In the Comment section find:
Code: [Select]
<div class="commentsbox">

<h2><? echo l('addcomment') ?></h2>
and add after it:
Code: [Select]
<p><a title="<? echo l('clickcomment'); ?>" onclick="toggle('sub1')" style="cursor: pointer;"><? echo l('clickcomment'); ?></a></p>
<div id="sub1" style="display: none;">
3a.  Find the form closing at the end of this block and add an extra div.  So your final block will look like:
Code: [Select]
<div class="commentsbox">
<h2><? echo l('addcomment') ?></h2>
<p><a title="<? echo l('clickcomment'); ?>" onclick="toggle('sub1')" style="cursor: pointer;"><? echo l('clickcomment'); ?></a></p>
<div id="sub1" style="display: none;">
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">

 <p><? echo l('comment'); ?></p>

<p><textarea name="text" class="text" rows="5" cols="5"></textarea></p>

<p><? echo l('name'); ?></p>

<p><input name="name" type="text" class="field" id="name" /></p>
<p><? echo l('code_validation'); ?></p>
<p><img width="120" height="30" src="button.php" alt="" /></p>
<p><? echo l('enter_validation_code'); ?></p>
<p><input maxlength="5" size="5" name="userdigit" type="text" class="field" value="" /></p>

<p><input name="category" id="category" type="hidden" value="<? echo get_id('category'); ?>" />

<input name="id" id="id" type="hidden" value="<? echo $articleid; ?>" />

<input name="article" id="article" type="hidden" value="<? echo get_id('article'); ?>" />

 <input name="commentspage" id="commentspage" type="hidden" value="<? echo $back_to_page; ?>" /></p>

<p><input name="comment" type="submit" class="<? echo s('button'); ?>" value="<? echo l('sendcomment'); ?>" /></p>

</form></div>

</div><?
Comment Form Closed


Comment Form Opened
« Last Edit: July 02, 2008, 12:51:15 am by equilni »
Logged