Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 07:39 am EST

Geeklog Forums

Disable/Remove "Preview" - button when posting comments


Status: offline

geirj

Forum User
Junior
Registered: 11/15/03
Posts: 19
I want to remove the Preview button when posting comments.
I have set $_CONF['skip_preview'] = 1 in config.php so that users can post without previewing, but I havent figured out how to remove the Preview button.

I guess it's some code in comment.php or lib-common.php that has to be removed, but I'm not sure wich code..
 Quote

Status: offline

geKow

Forum User
Full Member
Registered: 01/12/03
Posts: 445
try
your_layout/admin/story/storyeditor.thtml

geKow
 Quote

Status: offline

geirj

Forum User
Junior
Registered: 11/15/03
Posts: 19
Thank's for your reply geKow.

I have taken a look at the storyeditor.thtml-file, and the only thing in it about "Previewing" was this line:



I tryed to remove it, but the preview button is still present when posting comments.

Any other ideas?
 Quote

Status: offline

geKow

Forum User
Full Member
Registered: 01/12/03
Posts: 445
Quote by geirj: Thank's for your reply geKow.

I have taken a look at the storyeditor.thtml-file, and the only thing in it about "Previewing" was this line:



I tryed to remove it, but the preview button is still present when posting comments.

Any other ideas?


It's hard to guess wich line you meant
To post code in this forum, you need to use the CODE button above.

Ok I made a mistake you need also to change it in
Text Formatted Code

your_layoutsubmitsubmitstory.thtml

look for

 <input name="mode" type="submit" value="{lang_preview}">

 


I forget that there are two kinds of storyediting, one for admins and one for user. So the first one was the admins one, the second one for usersubmissions.
Sorry

geKow
(who hits the preview button to check his post)
 Quote

Status: offline

geirj

Forum User
Junior
Registered: 11/15/03
Posts: 19
Problem solved.

I think I might have expressed my self unclearly in my previous post's. It was thinking about the preview button in the form when people are posting comments to articles I have written on my main-page (ehrr.. Bad english..) Hope you understand what I mean.

Anyway, I solved the problem by editing the file commentform.thtml in /layout/theme/comment/


Thank's for taking time geKow.
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
I've submitted a full patch for it for Geeklog v1.4:

config.php :
Text Formatted Code
$_CONF['skip_preview']  = 2;
// If = 0, don't allow user to submit comments and stories without previewing
// If = 1, do allow user to submit comments and stories without previewing
// If = 2, do allow user to submit comments and stories without previewing AND disable previewing in general

 

system/lib-comment.php :
Text Formatted Code
            $comment_template->set_var('lang_instr_line5', $LANG03[23]);        

// custom code - start

            if (($_CONF['skip_preview'] > 0) || ($mode == $LANG03[14])) {
                $comment_template->set_var('save_option', '<input type="submit" name="mode" value="' . $LANG03[11] . '">');
            }

            if (($_CONF['skip_preview'] < 2)
                $comment_template->set_var('preview_option', '<input type="submit" name="mode" value="' . $LANG03[14] . '">');

// custom code - end

            $comment_template->set_var('end_block', COM_endBlock());        

 

public_html/layout/professional/comment/commentform_advanced.thtml and commentform.thtml :
Text Formatted Code
                                                            <li>{lang_instr_line5}</li></ul>
<! -- custom code - start -->
                                                            {preview_option}
<! -- custom code - end -->
                                                            {save_option}

 


Same for stories:

public_html/submit.php :
Text Formatted Code
    $storyform->set_var('story_date', $A['unixdate']);

// custom code - start
    if (($_CONF['skip_preview'] > 0) || ($A['mode'] == $LANG12[32])) {
        $storyform->set_var('save_button', '<input name="mode" type="submit" value="' . $LANG12[8] . '">');
    }

            if (($_CONF['skip_preview'] < 2)
        $storyform->set_var('preview_button', '<input name="mode" type="submit" value="' . $LANG12[32] . '">');
// custom code - end

    $storyform->parse('theform', 'storyform');

 

public_html/layout/professional/submit/submitstory_advanced.thtml and submitstory.thtml :
Text Formatted Code
                                            {save_button}
<!-- custom code - start -->
                                            {preview_button}                                        
<!-- custom code - end -->
</td>

 

I hope to see this applied officially!
 Quote

All times are EST. The time is now 07:39 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content