[Snippet] 4S Preview before Submit v.0.0.1

Little Mods and Snips 2

[Snippet] 4S Preview before Submit v.0.0.1

Postby Sekuro » 28 Feb 2012, 20:03

4S Preview before Submit
(Force Preview before Submit)

Snippet-Title: 4S Preview before Submit
Snippet-Version: 0.0.1
Snippet-Author: 4seven

Request by: takufner
Request by: Susa

Snippet-Description: This Mod prevents the Posting without Preview

phpBB-Version: phpBB 3.0.x
phpBB-Languages: mutlilingual (because of only 1 edit in language/xx/common.php)
phpBB-Styles: all Styles, that are based on prosilver and subsilver2


Features:
- No posting without preview
- No going around by an empty postfield possible

Planned:
- ACP Entry to switch Mod to Off
- Maybe a Module to prevent 'posting without preview' for chosen groups

Image follows

Image follows

Instruction:

open

posting.php

find

Code: Select all
// Start assigning vars for main posting page ...
$template->assign_vars(array(


before add

Code: Select all
// 4S Preview before Submit / 4seven / 2009 
if(($mode == 'post' ||  $mode == 'reply') && (!$preview && (empty($preview_message)))){
$error[] = $user->lang['USER_MUST_PREVIEW'];
$template->assign_vars(array(
'S_SUBMIT_BUTTON' => false));}
else if (($mode == 'post' ||  $mode == 'reply') && ($preview && (empty($preview_message)))){
$error[] = $user->lang['USER_MUST_PREVIEW'];
$template->assign_vars(array(
'S_SUBMIT_BUTTON' => false));}
else if (($mode == 'post' ||  $mode == 'reply') && ($preview && (!empty($preview_message)))){
$template->assign_vars(array(
'S_SUBMIT_BUTTON' => true));}
// 4S Preview before Submit / 4seven / 2009                 


open

language/xx/common.php

find

Code: Select all
$lang = array_merge($lang, array(


after add

Code: Select all
    'USER_MUST_PREVIEW'    => 'You must click on Preview, before you can Submit',


open

styles/prosilver/template/posting_editor.html

find

Code: Select all
            <input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1" />&nbsp;


replace with

Code: Select all
            <!-- IF S_SUBMIT_BUTTON -->
            <input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1" />&nbsp;
            <!-- ENDIF -->


open

styles/subsilver2/template/posting_body.html

find (2 x)

Code: Select all
            &nbsp; <input class="btnmain" type="submit" accesskey="s" tabindex="11" name="post" value="{L_SUBMIT}" />


replace (2 x) with

Code: Select all
            <!-- IF S_SUBMIT_BUTTON -->
            &nbsp; <input class="btnmain" type="submit" accesskey="s" tabindex="11" name="post" value="{L_SUBMIT}" />
            <!-- ENDIF -->


Clear all Board- and Browser-Caches

Enjoy
Mod-Bot / Service-Team
User avatar
Sekuro

Tiptop

Tiptop
 
Posts: 241
Joined: 11 Feb 2008, 11:49
 
Resolution: 1440x900



Re: [DEV] 4S Preview before Submit v.0.0.1

Postby Sekuro » 31 Aug 2012, 00:43

Mod-Bot / Service-Team
User avatar
Sekuro

Tiptop

Tiptop
 
Posts: 241
Joined: 11 Feb 2008, 11:49
 
Resolution: 1440x900



Return to Snip Cl@ss II

Who is online

Users browsing this forum: No registered users and 1 guest

cron