phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

VCNP in SQR

Goto page 1, 2  Next
 
Search this topic... | Search General Support... | Search Box
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Author Message
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Tue Dec 30, 2008 8:01 pm 
Post subject: VCNP in SQR

Hy!

I am using Visual Confirmation on New Posters and also Super Quick Reply. But the confirmation code do not show up in the quick reply form, only when you click "post reply". icon_rolleyes.gif How to put the confirmation code also in the quick reply form?

This is VCNP:
Code:
##############################################################
## MOD Title: Visual Confirmation on New Posters
## MOD Author: Thoul < thoul@phpbbsmith.com > (Jeremy Rogers) http://www.phpbbsmith.com
## MOD Description:
##      Adds visual confirmation to the posting form for new posters.
## MOD Version: 3.0.1
##
## Installation Level: Easy
## Installation Time: 10 Minutes
## Files To Edit:
##      admin/admin_board.php,
##      posting.php,
##      templates/subSilver/posting_body.tpl,
##      templates/subSilver/admin/board_config_body.tpl
## Included Files:
##      install.php,
##      vc.php,
##      language/lang_english/lang_vc_newposts.php,
##      mods/vc_newposts/config.php,
##      mods/vc_newposts/constants.php,
##      mods/vc_newposts/vc_newposts.php,
##      templates/subSilver/admin/vc_newposts.tpl,
##      templates/subSilver/vc_newposts/standard.tpl,
##      templates/subSilver/vc_newposts/photo.tpl
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## This modification adds a visual confirmation image to the posting page.
##
## After installing, go the Admin Panel > General > Configuration page.  At
## the bottom of this page, you'll find new settings related to this
## modification.  You should adjust these as you desire.
##
## If you want to use this modification with a type of Visual Confirmation
## other than the standard phpBB visual confirmation image, you will need to
## install another modification for that type of confirmation first.  This
## modification currently supports the following:
##   -Default phpBB 2.0.21 visual confirmation,
##   -Advanced Visual Confirmation 1.1.1,
##   -Better Captcha 1.0.1,
##   -FreeCap Visual Confirmation 0.0.3,
##   -Photo Visual Confirmation 1.0.0 - 1.0.1a,
##  -Visual confirmation 1.0.0 by Ptirhiik.
## Options for some of these will not appear in the Admin Panel until they are
## installed and functioning, to prevent you from setting up the board
## incorrectly.  To use Advanced Visual Confirmation or Ptirhiik's modification,
## selected the "phpBB standard or compatible" configuration option after
## installing the modification you want to use.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ COPY ]--------------------------------------
#

copy root/*.* to *.*

#
#-----[ DIY INSTRUCTIONS ]------------------------------------------
#

Run install.php by visiting it in your web browser, for example
http://www.yoursite.com/phpBB2/install.php
Choose the "Install" option.
This will install the database portions of the hack. If you prefer to run the
queries manually, check contrib/install.sql.

#
#-----[ OPEN ]--------------------------------------
#
admin/admin_board.php

#
#-----[ FIND ]--------------------------------------
#

<?php

#
#-----[ AFTER, ADD ]--------------------------------------
#

// This file modified for Visual Confirmation on New Posters

#
#-----[ FIND ]--------------------------------------
#

$template->pparse("body");

#
#-----[ BEFORE, ADD ]--------------------------------------
#

//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
require_once($phpbb_root_path . 'mods/vc_newposts/config.' . $phpEx);
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------


#
#-----[ OPEN ]--------------------------------------
#
posting.php

#
#-----[ FIND ]--------------------------------------
#

<?php

#
#-----[ AFTER, ADD ]--------------------------------------
#

// This file modified for Visual Confirmation on New Posters

#
#-----[ FIND ]--------------------------------------
#

//
// End session management
//

#
#-----[ AFTER, ADD ]--------------------------------------
#

//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
require_once($phpbb_root_path . 'mods/vc_newposts/vc_newposts.' . $phpEx);
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

#
#-----[ FIND ]--------------------------------------
#

         prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length);

#
#-----[ AFTER, ADD ]--------------------------------------
#

//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
         $vc_newposts->check_fields();
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

#
#-----[ FIND ]--------------------------------------
#

//
// Topic review
//

#
#-----[ BEFORE, ADD ]--------------------------------------
#

//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
$vc_newposts->show_field();
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------


#
#-----[ OPEN ]--------------------------------------
#
templates/subSilver/posting_body.tpl

#
#-----[ FIND ]--------------------------------------
#
# Just needs to be the first line in the file. Might be a different line for
# some templates.
#

<script language="JavaScript" type="text/javascript">

#
#-----[ BEFORE, ADD ]--------------------------------------
#

<!-- This file modified for Visual Confirmation on New Posters -->

#
#-----[ FIND ]--------------------------------------
#

   {POLLBOX}

#
#-----[ AFTER, ADD ]--------------------------------------
#

<!-- Visual Confirmation on New Posters - Begin Code Alteration -->
{VC_NEWPOSTS}
<!-- Visual Confirmation on New Posters - End Code Alteration -->


#
#-----[ OPEN ]--------------------------------------
#
templates/subSilver/admin/board_config_body.tpl

#
#-----[ FIND ]--------------------------------------
#
# Just needs to be the first line in the file. Might be a different line for
# some templates.
#

<h1>{L_CONFIGURATION_TITLE}</h1>

#
#-----[ BEFORE, ADD ]--------------------------------------
#

<!-- This file modified for Visual Confirmation on New Posters -->

#
#-----[ FIND ]--------------------------------------
#

   <tr>
      <td class="row1">{L_SMTP_PASSWORD}<br /><span class="gensmall">{L_SMTP_PASSWORD_EXPLAIN}</span></td>
      <td class="row2"><input class="post" type="password" name="smtp_password" value="{SMTP_PASSWORD}" size="25" maxlength="255" /></td>
   </tr>

#
#-----[ AFTER, ADD ]--------------------------------------
#

<!-- Visual Confirmation on New Posters - Begin Code Alteration -->
{VC_NEWPOSTS}
<!-- Visual Confirmation on New Posters - End Code Alteration -->

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

And this is SQR:
Code:
##############################################################
## MOD Title: Super Quick Reply
## MOD Author: hayk < hayk@mail.ru > (Hayk Chamyan) http://www.a13n.org
## MOD Description: This MOD adds "quick" reply form to View Topic page.
##                  It can be configured both for a specific user and for the entire board.
##
## MOD Version: 1.3.5
##
## Installation Level: Intermediate
## Installation Time: 20-25 Minutes
## Files To Edit: admin/admin_board.php,
##                admin/admin_users.php,
##                includes/functions_selects.php,
##                includes/usercp_avatar.php,
##                includes/usercp_register.php,
##                language/lang_english/lang_admin.php,
##                language/lang_english/lang_main.php,
##                templates/subSilver/admin/board_config_body.tpl,
##                templates/subSilver/admin/user_edit_body.tpl,
##                templates/subSilver/profile_add_body.tpl,
##                templates/subSilver/viewtopic_body.tpl,
##                templates/subSilver/subSilver.cfg,
##                viewtopic.php
##
## Included Files: viewtopic_quickreply.php,
##                 viewtopic_quickreply.tpl,
##                 quickreply.gif
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## Personally, I did not like any of the modes I've come across so far, so I decided to make my own.
##
## MOD support topic at phpbb.com: http://www.phpbb.com/phpBB/viewtopic.php?t=230887
##
## Features:
##      - SQR panel in board config:
##        - enable/disable SQR
##        - SQR options for anonymous users
##      - SQR panel in user profile:
##        - SQR form view mode: basic/advanced
##        - SQR form display type: show/hide/at the last page
##        - Open SQR form automatically
##
## This MOD phpBB 2.0.22 compatible.
##
## This MOD will install using EasyMOD.
##
## This MOD not compliant with MODs (for more info see contrib folder):
##  - Username Color ( http://www.phpbb.com/phpBB/viewtopic.php?t=187354 )
##  - Link Poster's Name To Profile ( http://www.phpbb.com/phpBB/viewtopic.php?t=210954 )
##  - Mini Profile ( http://www.phpbb.com/phpBB/viewtopic.php?t=110870 )
##  - Author Hyperlink ( http://www.phpbb.com/phpBB/viewtopic.php?t=135776 )
##  - Online/Offline/Hidden ( http://www.phpbb.com/phpBB/viewtopic.php?t=228106 )
##
## For mode addons see contrib folder.
##
## This MOD is released under the GPL License.
##############################################################
## MOD History:
##
##   2007-02-19 - Version 1.3.5
##      - make the necessary changes to correct the denied MOD
##      - SQR 1.3.2 to SQR 1.3.5 Code Changes added
##
##   2007-02-05 - Version 1.3.4
##      - make MOD phpBB 2.0.22 compatible
##
##   2005-07-09 - Version 1.3.2
##      - fixed javascript error on paste name
##      - fixed Russian language translation
##      - added code for joint installation with Multiple BBCode MOD
##      - smiles improoved
##      - added code for joint installation with Categories Hierarchy MOD
##      - changes to install SQR on Categories Hierarchy MODedd boards
##
##   2005-06-29 - Version 1.3.1
##      - "Open SQR form" option has been added
##      - logic has been changed
##      - bug at registration process has been fixed
##      - bug at user editing has been fixed
##      - SQR 1.3.0 to SQR 1.3.1 Code Changes added
##
##   2005-03-14 - Version 1.3.0
##      - Show/Hide SQR button added
##      - fixed Author's Notes
##      - notes about Online/Offline/Hidden added
##      - SQR 1.2.2 to SQR 1.3.0 Code Changes added
##
##   2005-03-11 - Version 1.2.2
##      - added code for joint installation with File Attachment MOD
##      - fixed bug with SQR form view mode
##      - re-wrote Author's Notes
##
##   2005-03-10 - Version 1.2.1
##      - make the necessary changes to correct the denied MOD
##
##   2005-03-09 - Version 1.2.0
##      - Anonymous settings are added in forum config in administration panel
##      - fixed bug: moderators did not see SQR form in locked topics and forums
##      - fixed bug at registration process
##      - added code for joint installation with Lock/Unlock in Posting Body MOD
##      - added code for joint installation with Save posts as drafts MOD
##      - added code for joint installation with Topic Search MOD
##      - added code for joint installation with User Profile Link MOD
##      - make more EMC (I hope)
##      - added Russian language translation
##      - added SQR 1.1.1 to SQR 1.2.0 Code Changes
##
##   2004-12-03 - Version 1.1.1
##      - make the necessary changes to correct the denied MOD
##
##   2004-12-01 - Version 1.1.0
##      - added SQR mode: basic/advanced
##      - added SQR display type: show/hide/last page
##
##   2004-10-08 - Version 1.0.2
##      - make the necessary changes to correct the denied MOD
##
##   2004-09-07 - Version 1.0.1
##      - make the necessary changes to correct the denied MOD
##
##   2004-04-13 - Version 1.0.0
##      - initial public version
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ COPY ]------------------------------------------
#
copy viewtopic_quickreply.php to includes/viewtopic_quickreply.php
copy viewtopic_quickreply.tpl to templates/subSilver/viewtopic_quickreply.tpl
copy quickreply.gif to templates/subSilver/images/lang_english/quickreply.gif

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php

#
#-----[ FIND ]------------------------------------------
#
$avatars_local_yes = ( $new['allow_avatar_local'] ) ? "checked=\"checked\"" : "";

#
#-----[ BEFORE, ADD ]--------------------------------------
#
$quickreply_yes = ( $new['allow_quickreply'] ) ? "checked=\"checked\"" : "";
$quickreply_no = ( !$new['allow_quickreply'] ) ? "checked=\"checked\"" : "";

$anonymous_sqr_mode_basic = ( $new['anonymous_sqr_mode']==0 ) ? 'checked="checked"' : '';
$anonymous_sqr_mode_advanced = ( $new['anonymous_sqr_mode']!=0 ) ? 'checked="checked"' : '';

$anonymous_sqr_select = quick_reply_select($new['anonymous_show_sqr'], 'anonymous_show_sqr');

$anonymous_open_sqr_yes = ( $new['anonymous_open_sqr'] ) ? "checked=\"checked\"" : "";
$anonymous_open_sqr_no = ( !$new['anonymous_open_sqr'] ) ? "checked=\"checked\"" : "";


#
#-----[ FIND ]------------------------------------------
#
"L_ALLOW_NAME_CHANGE" => $lang['Allow_name_change'],

#
#-----[ AFTER, ADD ]--------------------------------------
#

   "L_SQR_SETTINGS" => $lang['SQR_settings'],
   "L_ALLOW_QUICK_REPLY" => $lang['Allow_quick_reply'],
   "L_ANONYMOUS_SHOW_SQR" => $lang['Anonymous_show_SQR'],
   "L_ANONYMOUS_SQR_MODE" => $lang['Anonymous_SQR_mode'],
   "L_ANONYMOUS_SQR_MODE_BASIC" => $lang['Quick_reply_mode_basic'],
   "L_ANONYMOUS_SQR_MODE_ADVANCED" => $lang['Quick_reply_mode_advanced'],
   "L_ANONYMOUS_OPEN_SQR" => $lang['Anonymous_open_SQR'],

#
#-----[ FIND ]------------------------------------------
#
"NAMECHANGE_NO" => $namechange_no,

#
#-----[ AFTER, ADD ]--------------------------------------
#
   "ANONYMOUS_SQR_SELECT" => $anonymous_sqr_select,
   "QUICKREPLY_YES" => $quickreply_yes,
   "QUICKREPLY_NO" => $quickreply_no,
   "ANONYMOUS_SQR_MODE_BASIC" => $anonymous_sqr_mode_basic,
   "ANONYMOUS_SQR_MODE_ADVANCED" => $anonymous_sqr_mode_advanced,
   "ANONYMOUS_OPEN_SQR_YES" => $anonymous_open_sqr_yes,
   "ANONYMOUS_OPEN_SQR_NO" => $anonymous_open_sqr_no,

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php

#
#-----[ FIND ]------------------------------------------
#
$user_dateformat = ( $HTTP_POST_VARS['dateformat'] ) ? trim( $HTTP_POST_VARS['dateformat'] ) : $board_config['default_dateformat'];

#
#-----[ AFTER, ADD ]--------------------------------------
#
      $user_show_quickreply = ( isset( $HTTP_POST_VARS['show_quickreply'] ) ) ? intval( $HTTP_POST_VARS['show_quickreply'] ) : 1;
      $user_quickreply_mode = ( isset( $HTTP_POST_VARS['quickreply_mode'] ) ) ? ( ( $HTTP_POST_VARS['quickreply_mode'] ) ? TRUE : 0 ) : TRUE;
      $user_open_quickreply = ( isset( $HTTP_POST_VARS['open_quickreply'] ) ) ? ( ( $HTTP_POST_VARS['open_quickreply'] ) ? TRUE : 0 ) : TRUE;

#
#-----[ FIND ]------------------------------------------
#
# NOTE - the origial text is:
#   SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", $aim) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_sig_bbcode_uid = '$signature_bbcode_uid', user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_active = $user_status, user_rank = $user_rank" . $avatar_sql . "
SET " . $username_sql . $passwd_sql

#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_active = $user_status,

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
user_show_quickreply = $user_show_quickreply, user_quickreply_mode = $user_quickreply_mode, user_open_quickreply = $user_open_quickreply,

#
#-----[ FIND ]------------------------------------------
#
$user_dateformat = htmlspecialchars($this_userdata['user_dateformat']);

#
#-----[ AFTER, ADD ]--------------------------------------
#
      $user_show_quickreply = $this_userdata['user_show_quickreply'];
      $user_quickreply_mode = $this_userdata['user_quickreply_mode'];
      $user_open_quickreply = $this_userdata['user_open_quickreply'];

#
#-----[ FIND ]------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="dateformat" value="' . str_replace("\"", "&quot;", $user_dateformat) . '" />';

#
#-----[ AFTER, ADD ]--------------------------------------
#
         $s_hidden_fields .= '<input type="hidden" name="show_quickreply" value="' . $user_show_quickreply . '" />';
         $s_hidden_fields .= '<input type="hidden" name="quickreply_mode" value="' . $user_quickreply_mode . '" />';
         $s_hidden_fields .= '<input type="hidden" name="open_quickreply" value="' . $user_quickreply_mode . '" />';

#
#-----[ FIND ]------------------------------------------
#
'DATE_FORMAT' => $user_dateformat,

#
#-----[ AFTER, ADD ]--------------------------------------
#
         'QUICK_REPLY_SELECT' => quick_reply_select($user_show_quickreply, 'show_quickreply'),
         'QUICK_REPLY_MODE_BASIC' => ( $user_quickreply_mode==0 ) ? 'checked="checked"' : '',
         'QUICK_REPLY_MODE_ADVANCED' => ( $user_quickreply_mode!=0 ) ? 'checked="checked"' : '',
         'OPEN_QUICK_REPLY_YES' => ( $user_open_quickreply ) ? 'checked="checked"' : '',
         'OPEN_QUICK_REPLY_NO' => ( !$user_open_quickreply ) ? 'checked="checked"' : '',

#
#-----[ FIND ]------------------------------------------
#
'L_DATE_FORMAT_EXPLAIN' => $lang['Date_format_explain'],

#
#-----[ AFTER, ADD ]--------------------------------------
#
         'L_QUICK_REPLY_PANEL' => $lang['Quick_reply_panel'],
         'L_SHOW_QUICK_REPLY' => $lang['Show_quick_reply'],
         'L_QUICK_REPLY_MODE' => $lang['Quick_reply_mode'],
         'L_QUICK_REPLY_MODE_BASIC' => $lang['Quick_reply_mode_basic'],
         'L_QUICK_REPLY_MODE_ADVANCED' => $lang['Quick_reply_mode_advanced'],
         'L_OPEN_QUICK_REPLY' => $lang['Open_quick_reply'],

#
#-----[ OPEN ]------------------------------------------
#
includes/functions_selects.php

#
#-----[ FIND ]------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]--------------------------------------
#
function quick_reply_select($default, $select_name = "show_quickreply")
{
   global $lang;

   $sqr_select = '<select name="' . $select_name . '">';

   while( list($value, $mode) = @each($lang['sqr']) )
   {
      $selected = ( $value == $default ) ? ' selected="selected"' : '';
      $sqr_select .= '<option value="' . $value . '"' . $selected . '>' . $mode . '</option>';
   }

   $sqr_select .= '</select>';

   return $sqr_select;

}


#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_avatar.php

#
#-----[ FIND ]------------------------------------------
#
# NOTE - the origial text is:
# function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current_email, &$coppa, &$username, &$email, &$new_password, &$cur_password, &$password_confirm, &$icq, &$aim, &$msn, &$yim, &$website, &$location, &$occupation, &$interests, &$signature, &$viewemail, &$notifypm, &$popup_pm, &$notifyreply, &$attachsig, &$allowhtml, &$allowbbcode, &$allowsmilies, &$hideonline, &$style, &$language, &$timezone, &$dateformat, &$session_id)
function display_avatar_gallery

#
#-----[ IN-LINE FIND ]------------------------------------------
#
, &$session_id

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
, &$show_quickreply, &$quickreply_mode, &$user_open_quickreply

#
#-----[ FIND ]------------------------------------------
#
# NOTE - the origial text is:
# $params = array('coppa', 'user_id', 'username', 'email', 'current_email', 'cur_password', 'new_password', 'password_confirm', 'icq', 'aim', 'msn', 'yim', 'website', 'location', 'occupation', 'interests', 'signature', 'viewemail', 'notifypm', 'popup_pm', 'notifyreply', 'attachsig', 'allowhtml', 'allowbbcode', 'allowsmilies', 'hideonline', 'style', 'language', 'timezone', 'dateformat');
$params = array

#
#-----[ IN-LINE FIND ]------------------------------------------
#
);

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
, 'show_quickreply', 'quickreply_mode', 'user_open_quickreply'

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------
#
$user_dateformat = ( !empty($HTTP_POST_VARS['dateformat']) ) ? trim(htmlspecialchars($HTTP_POST_VARS['dateformat'])) : $board_config['default_dateformat'];

#
#-----[ AFTER, ADD ]--------------------------------------
#
   $user_show_quickreply = ( isset( $HTTP_POST_VARS['show_quickreply'] ) ) ? intval( $HTTP_POST_VARS['show_quickreply'] ) : 1;
   $user_quickreply_mode = ( isset( $HTTP_POST_VARS['quickreply_mode'] ) ) ? ( ( $HTTP_POST_VARS['quickreply_mode'] ) ? TRUE : 0 ) : TRUE;
   $user_open_quickreply = ( isset( $HTTP_POST_VARS['open_quickreply'] ) ) ? ( ( $HTTP_POST_VARS['open_quickreply'] ) ? TRUE : 0 ) : TRUE;

#
#-----[ FIND ]------------------------------------------
#
# NOTE - the origial text is:
# SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popup_pm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . "
SET " . $username_sql . $passwd_sql . "user_email =

#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_lang = '" . str_replace("\'", "''", $user_lang)

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
user_show_quickreply = $user_show_quickreply, user_quickreply_mode = $user_quickreply_mode, user_open_quickreply = $user_open_quickreply,

#
#-----[ FIND ]------------------------------------------
#
# NOTE - the origial text is:
# $sql = "INSERT INTO " . USERS_TABLE . "   (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
$sql = "INSERT INTO " . USERS_TABLE .

#
#-----[ IN-LINE FIND ]------------------------------------------
#
user_lang,

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
user_show_quickreply, user_quickreply_mode, user_open_quickreply,

#
#-----[ FIND ]------------------------------------------
#
# NOTE - the origial text is:
# VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, ";
VALUES ($user_id, '" . str_replace("\'", "''", $username)

#
#-----[ IN-LINE FIND ]------------------------------------------
#
'" . str_replace("\'", "''", $user_lang)

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
$user_show_quickreply, $user_quickreply_mode, $user_open_quickreply,

#
#-----[ FIND ]------------------------------------------
#
$user_dateformat = $userdata['user_dateformat'];

#
#-----[ AFTER, ADD ]--------------------------------------
#
   $user_show_quickreply = $userdata['user_show_quickreply'];
   $user_quickreply_mode = $userdata['user_quickreply_mode'];
   $user_open_quickreply = $userdata['user_open_quickreply'];

#
#-----[ FIND ]------------------------------------------
#
# NOTE - the origial text is:
# display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, &$new_password, &$cur_password, $password_confirm, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popup_pm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat, $userdata['session_id']);
display_avatar_gallery($mode,

#
#-----[ IN-LINE FIND ]------------------------------------------
#
, $userdata['session_id']

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
, $user_show_quickreply, $user_quickreply_mode, $user_open_quickreply

#
#-----[ FIND ]------------------------------------------
#
'DATE_FORMAT' => $user_dateformat,

#
#-----[ AFTER, ADD ]--------------------------------------
#
      'QUICK_REPLY_SELECT' => quick_reply_select($user_show_quickreply, 'show_quickreply'),
      'QUICK_REPLY_MODE_BASIC' => ( $user_quickreply_mode==0 ) ? 'checked="checked"' : '',
      'QUICK_REPLY_MODE_ADVANCED' => ( $user_quickreply_mode!=0 ) ? 'checked="checked"' : '',
      'OPEN_QUICK_REPLY_YES' => ( $user_open_quickreply ) ? 'checked="checked"' : '',
      'OPEN_QUICK_REPLY_NO' => ( !$user_open_quickreply ) ? 'checked="checked"' : '',

#
#-----[ FIND ]------------------------------------------
#
'L_DATE_FORMAT_EXPLAIN' => $lang['Date_format_explain'],

#
#-----[ AFTER, ADD ]--------------------------------------
#
      'L_QUICK_REPLY_PANEL' => $lang['Quick_reply_panel'],
      'L_SHOW_QUICK_REPLY' => $lang['Show_quick_reply'],
      'L_QUICK_REPLY_MODE' => $lang['Quick_reply_mode'],
      'L_QUICK_REPLY_MODE_BASIC' => $lang['Quick_reply_mode_basic'],
      'L_QUICK_REPLY_MODE_ADVANCED' => $lang['Quick_reply_mode_advanced'],
      'L_OPEN_QUICK_REPLY' => $lang['Open_quick_reply'],

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php

#
#-----[ FIND ]------------------------------------------
#
$lang['Version_information']

#
#-----[ AFTER, ADD ]--------------------------------------
#

//
// SQR
//
$lang['SQR_settings'] = 'SQR Settings';
$lang['Allow_quick_reply'] = 'Allow Quick Reply';
$lang['Anonymous_show_SQR'] = 'Show Quick Reply Form to Anonymous Users';
$lang['Anonymous_SQR_mode'] = 'Anonymous Users Quick Reply Mode';
$lang['Anonymous_open_SQR'] = 'Open Quick Reply Form for Anonymous Users automatically';

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
$lang['A_critical_error']

#
#-----[ AFTER, ADD ]--------------------------------------
#

//
// SQR
//
$lang['Quick_reply_panel'] = 'Super Quick Reply MOD';
$lang['Quick_Reply'] = 'Quick Reply';
$lang['Show_quick_reply'] = 'Show Quick Reply Form';
$lang['sqr']['0'] = 'No';
$lang['sqr']['1'] = 'Yes';
$lang['sqr']['2'] = 'On last page only';
$lang['Quick_reply_mode'] = 'Quick Reply Mode';
$lang['Quick_reply_mode_basic'] = 'Basic';
$lang['Quick_reply_mode_advanced'] = 'Advanced';
$lang['Show_hide_quick_reply_form'] = 'Show/hide quick reply form';
$lang['Open_quick_reply'] = 'Open Quick Reply Form automatically';

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl

#
#-----[ FIND ]------------------------------------------
#
<tr>
<th class="thHead" colspan="2">{L_AVATAR_SETTINGS}</th>

#
#-----[ BEFORE, ADD ]--------------------------------------
#
   <tr>
     <th class="thHead" colspan="2">{L_SQR_SETTINGS}</th>
   </tr>
   <tr>
      <td class="row1">{L_ALLOW_QUICK_REPLY}</td>
      <td class="row2"><input type="radio" name="allow_quickreply" value="1" {QUICKREPLY_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="allow_quickreply" value="0" {QUICKREPLY_NO} /> {L_NO}</td>
   </tr>
   <tr>
     <td class="row1">{L_ANONYMOUS_SHOW_SQR}</td>
     <td class="row2">{ANONYMOUS_SQR_SELECT}</td>
   </tr>
   <tr>
     <td class="row1">{L_ANONYMOUS_SQR_MODE}</td>
     <td class="row2"><input type="radio" name="anonymous_sqr_mode" value="0" {ANONYMOUS_SQR_MODE_BASIC} />{L_ANONYMOUS_SQR_MODE_BASIC}&nbsp;&nbsp;<input type="radio" name="anonymous_sqr_mode" value="1" {ANONYMOUS_SQR_MODE_ADVANCED} />{L_ANONYMOUS_SQR_MODE_ADVANCED}</td>
   </tr>
   <tr>
     <td class="row1">{L_ANONYMOUS_OPEN_SQR}</td>
     <td class="row2"><input type="radio" name="anonymous_open_sqr" value="1" {ANONYMOUS_OPEN_SQR_YES} />{L_YES}&nbsp;&nbsp;<input type="radio" name="anonymous_open_sqr" value="0" {ANONYMOUS_OPEN_SQR_NO} />{L_NO}</td>
   </tr>

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/user_edit_body.tpl

#
#-----[ FIND ]------------------------------------------
#
<tr>
<th class="thSides" colspan="2" height="12" valign="middle">{L_AVATAR_PANEL}</th>

#
#-----[ BEFORE, ADD ]--------------------------------------
#
   <tr>
     <th class="thSides" colspan="2" height="12" valign="middle">{L_QUICK_REPLY_PANEL}</th>
   </tr>
   <tr>
     <td class="row1"><span class="gen">{L_SHOW_QUICK_REPLY}:</span></td>
     <td class="row2">{QUICK_REPLY_SELECT}</td>
   </tr>
   <tr>
     <td class="row1"><span class="gen">{L_QUICK_REPLY_MODE}:</span></td>
     <td class="row2">
      <input type="radio" name="quickreply_mode" value="0" {QUICK_REPLY_MODE_BASIC} />
      <span class="gen">{L_QUICK_REPLY_MODE_BASIC}</span>&nbsp;&nbsp;
      <input type="radio" name="quickreply_mode" value="1" {QUICK_REPLY_MODE_ADVANCED} />
      <span class="gen">{L_QUICK_REPLY_MODE_ADVANCED}</span></td>
   </tr>
   <tr>
     <td class="row1"><span class="gen">{L_OPEN_QUICK_REPLY}:</span></td>
     <td class="row2">
      <input type="radio" name="open_quickreply" value="1" {OPEN_QUICK_REPLY_YES} />
      <span class="gen">{L_YES}</span>&nbsp;&nbsp;
      <input type="radio" name="open_quickreply" value="0" {OPEN_QUICK_REPLY_NO} />
      <span class="gen">{L_NO}</span></td>
   </tr>
   <tr>
     <td class="catSides" colspan="2"><span class="cattitle">&nbsp;</span></td>
   </tr>

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN switch_avatar_block -->

#
#-----[ BEFORE, ADD ]--------------------------------------
#
   <tr>
     <td class="catSides" colspan="2"><span class="cattitle">&nbsp;</span></td>
   </tr>
   <tr>
     <th class="thSides" colspan="2" height="12" valign="middle">{L_QUICK_REPLY_PANEL}</th>
   </tr>
   <tr>
     <td class="row1"><span class="gen">{L_SHOW_QUICK_REPLY}:</span></td>
     <td class="row2">{QUICK_REPLY_SELECT}</td>
   </tr>
   <tr>
     <td class="row1"><span class="gen">{L_QUICK_REPLY_MODE}:</span></td>
     <td class="row2">
      <input type="radio" name="quickreply_mode" value="0" {QUICK_REPLY_MODE_BASIC} />
      <span class="gen">{L_QUICK_REPLY_MODE_BASIC}</span>&nbsp;&nbsp;
      <input type="radio" name="quickreply_mode" value="1" {QUICK_REPLY_MODE_ADVANCED} />
      <span class="gen">{L_QUICK_REPLY_MODE_ADVANCED}</span></td>
   </tr>
   <tr>
     <td class="row1"><span class="gen">{L_OPEN_QUICK_REPLY}:</span></td>
     <td class="row2">
      <input type="radio" name="open_quickreply" value="1" {OPEN_QUICK_REPLY_YES} />
      <span class="gen">{L_YES}</span>&nbsp;&nbsp;
      <input type="radio" name="open_quickreply" value="0" {OPEN_QUICK_REPLY_NO} />
      <span class="gen">{L_NO}</span></td>
   </tr>

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------
#
# NOTE - the origial text is:
# <td align="left" valign="middle" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a>&nbsp;&nbsp;&nbsp;<a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td>
<a href="{U_POST_NEW_TOPIC}">

#
#-----[ IN-LINE FIND ]------------------------------------------
#
U_POST_NEW_TOPIC

#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
U_POST_NEW_TOPIC

#
#-----[ FIND ]------------------------------------------
#
# NOTE - the origial text is:
# <td align="left" valign="middle" nowrap="nowrap"><span class="nav"><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" border="0" alt="{L_POST_NEW_TOPIC}" align="middle" /></a>&nbsp;&nbsp;&nbsp;<a href="{U_POST_REPLY_TOPIC}"><img src="{REPLY_IMG}" border="0" alt="{L_POST_REPLY_TOPIC}" align="middle" /></a></span></td>
<a href="{U_POST_NEW_TOPIC}">

#
#-----[ IN-LINE FIND ]------------------------------------------
#
</a></span></td>

#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
</a>

#
#-----[ AFTER, ADD ]--------------------------------------
#
<!-- BEGIN switch_quick_reply -->
&nbsp;&nbsp;&nbsp;<a href="{U_POST_SQR_TOPIC}"><img src="{SQR_IMG}" border="0" alt="{L_POST_SQR_TOPIC}" align="middle" /></a>
<!-- END switch_quick_reply -->
</span></td>

#
#-----[ FIND ]------------------------------------------
#
<table width="100%" cellspacing="2" border="0" align="center">

#
#-----[ BEFORE, ADD ]--------------------------------------
#
<!-- BEGIN switch_quick_reply -->
   {QRBODY}
<!-- END switch_quick_reply -->


#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/subSilver.cfg

#
#-----[ FIND ]------------------------------------------
#
# NOTE - the origial text is:
# $images['reply_locked'] = "$current_template_images/{LANG}/reply-locked.gif";
$images['reply_locked'] =

#
#-----[ AFTER, ADD ]--------------------------------------
#
$images['quickreply'] = "$current_template_images/{LANG}/quickreply.gif";

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);

#
#-----[ AFTER, ADD ]--------------------------------------
#
include($phpbb_root_path . 'includes/functions_post.'.$phpEx);

#
#-----[ FIND ]------------------------------------------
#
'body' => 'viewtopic_body.tpl')

#
#-----[ BEFORE, ADD ]------------------------------------------
#
   'qrbody' => 'viewtopic_quickreply.tpl',

#
#-----[ FIND ]------------------------------------------
#
# NOTE - the origial text is:
# //
# // Okay, let's do the loop, yeah come on baby let's do the loop
# // and it goes like this ...
# //
# for($i = 0; $i < $total_posts; $i++)
//
//
//
//
for($i = 0; $i < $total_posts; $i++)

#
#-----[ BEFORE, ADD ]--------------------------------------
#
//
// SQR
//
$sqr_last_page = ((floor( $start / intval($board_config['posts_per_page']) ) + 1 ) == ceil( $total_replies / intval($board_config['posts_per_page'])));
if ( $userdata['user_id'] != ANONYMOUS )
{
   $sqr_user_display = (bool)( ($userdata['user_show_quickreply']==2) ? $sqr_last_page : $userdata['user_show_quickreply'] );
}
else
{
   $sqr_user_display = (bool)( ($board_config['anonymous_show_sqr']==2) ? $sqr_last_page : $board_config['anonymous_show_sqr'] );
}
if ( ($board_config['allow_quickreply'] != 0) && $is_auth['auth_reply'] && $sqr_user_display )
{
   $show_qr_form =   true;
}
else
{
   $show_qr_form =   false;
}


#
#-----[ FIND ]------------------------------------------
#
# NOTE - the origial text is:
# $template->assign_block_vars('postrow', array(
$template->assign_block_vars('postrow'

#
#-----[ BEFORE, ADD ]--------------------------------------
#
   //
   // SQR
   // If you have installed "User Profile MOD" - do not add this lines or remove "User Profile MOD"
   //
   if ( $show_qr_form )
   {
      $poster = '<a href="javascript:pn(\''.$poster.'\');">'.$poster.'</a>';
   }


#
#-----[ FIND ]------------------------------------------
#
$template->pparse('body');

#
#-----[ BEFORE, ADD ]--------------------------------------
#
if ( $show_qr_form )
{
   $template->assign_block_vars('switch_quick_reply', array());
   include($phpbb_root_path . 'includes/viewtopic_quickreply.'.$phpEx);
}


#
#-----[ SQL ]------------------------------------------
#
ALTER TABLE phpbb_users ADD user_show_quickreply TINYINT(1) DEFAULT '1' NOT NULL;
ALTER TABLE phpbb_users ADD user_quickreply_mode TINYINT(1) DEFAULT '1' NOT NULL;
ALTER TABLE phpbb_users ADD user_open_quickreply TINYINT(1) DEFAULT '1' NOT NULL;
UPDATE phpbb_users SET user_show_quickreply=0 WHERE user_id=-1;
UPDATE phpbb_users SET user_quickreply_mode=0 WHERE user_id=-1;
UPDATE phpbb_users SET user_open_quickreply=0 WHERE user_id=-1;
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_quickreply', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('anonymous_show_sqr', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('anonymous_sqr_mode', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('anonymous_open_sqr', '0');

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

Thanks!

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
roadhog
Board Member



Joined: 19 Nov 2008

Posts: 95
Location: Central Texas


flag
PostPosted: Wed Dec 31, 2008 2:36 am 
Post subject: Re: VCNP in SQR

This topic should probably be under Mod Requests, and I am definitely not a mod writer, but I "think" that this all you need to do to get the VCNP into your SQR code. Try this:


Code:
#
#-----[ OPEN ]--------------------------------------
#

viewtopic_quickreply.tpl

#
#-----[ FIND ]--------------------------------------
#
# Just needs to be the first line in the file. Might be a different line for
# some templates.
#

<script language="JavaScript" type="text/javascript">

#
#-----[ BEFORE, ADD ]--------------------------------------
#

<!-- This file modified for Visual Confirmation on New Posters -->

#
#-----[ FIND ]--------------------------------------
#

   <tr>
     <td class="catBottom" colspan="2" align="center" height="28"> {S_HIDDEN_FORM_FIELDS}<input type="submit" tabindex="5" name="preview" class="mainoption" value="{L_PREVIEW}" />&nbsp;<input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="{L_SUBMIT}" /></td>
   </tr>

#
#-----[ BEFORE, ADD ]--------------------------------------
#

<!-- Visual Confirmation on New Posters - Begin Code Alteration -->
{VC_NEWPOSTS}
<!-- Visual Confirmation on New Posters - End Code Alteration -->



If that doesn't work, maybe someone who actually knows what he's doing can help you out.
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Wed Dec 31, 2008 11:47 pm 
Post subject: Re: VCNP in SQR

Thanks for the reply! I just tryed your solution but it doesn't work. icon_sad.gif
This is my viewtopic_quickreply.tpl file:
Code:
<script language="JavaScript" type="text/javascript">
<!--
// bbCode control by
// subBlue design
// www.subBlue.com

// Startup variables
var imageTag = false;
var theSelection = false;

// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
                && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
                && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
var is_moz = 0;

var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
var is_mac = (clientPC.indexOf("mac")!=-1);

<!-- BEGIN switch_advanced_qr -->
// Helpline messages
b_help = "{L_BBCODE_B_HELP}";
i_help = "{L_BBCODE_I_HELP}";
u_help = "{L_BBCODE_U_HELP}";
q_help = "{L_BBCODE_Q_HELP}";
c_help = "{L_BBCODE_C_HELP}";
l_help = "{L_BBCODE_L_HELP}";
o_help = "{L_BBCODE_O_HELP}";
p_help = "{L_BBCODE_P_HELP}";
w_help = "{L_BBCODE_W_HELP}";
a_help = "{L_BBCODE_A_HELP}";
s_help = "{L_BBCODE_S_HELP}";
f_help = "{L_BBCODE_F_HELP}";


// Shows the help messages in the helpline window
function helpline(help) {
   document.post.helpbox.value = eval(help + "_help");
}


function emoticon(text) {
   var txtarea = document.post.message;
   text = ' ' + text + ' ';
   if (txtarea.createTextRange && txtarea.caretPos) {
      var caretPos = txtarea.caretPos;
      caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
      txtarea.focus();
   } else {
      txtarea.value  += text;
      txtarea.focus();
   }
}


function bbfontstyle(bbopen, bbclose) {
   var txtarea = document.post.message;

   if ((clientVer >= 4) && is_ie && is_win) {
      theSelection = document.selection.createRange().text;
      if (!theSelection) {
         txtarea.value += bbopen + bbclose;
         txtarea.focus();
         return;
      }
      document.selection.createRange().text = bbopen + theSelection + bbclose;
      txtarea.focus();
      return;
   }
   else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
   {
      mozWrap(txtarea, bbopen, bbclose);
      return;
   }
   else
   {
      txtarea.value += bbopen + bbclose;
      txtarea.focus();
   }
   storeCaret(txtarea);
}


<!-- END switch_advanced_qr -->


// Define the bbCode tags
bbcode = new Array();
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');
imageTag = false;


// Replacement for arrayname.length property
function getarraysize(thearray) {
   for (i = 0; i < thearray.length; i++) {
      if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
         return i;
      }
   return thearray.length;
}

// Replacement for arrayname.push(value) not implemented in IE until version 5.5
// Appends element to the array
function arraypush(thearray,value) {
   thearray[ getarraysize(thearray) ] = value;
}

// Replacement for arrayname.pop() not implemented in IE until version 5.5
// Removes and returns the last element of an array
function arraypop(thearray) {
   thearraysize = getarraysize(thearray);
   retval = thearray[thearraysize - 1];
   delete thearray[thearraysize - 1];
   return retval;
}


function checkForm() {

   formErrors = false;

   if (document.post.message.value.length < 2) {
      formErrors = "{L_EMPTY_MESSAGE}";
   }

   if (formErrors) {
      alert(formErrors);
      return false;
   } else {
      bbstyle(-1);
      //formObj.preview.disabled = true;
      //formObj.submit.disabled = true;
      return true;
   }
}


function bbstyle(bbnumber) {
   var txtarea = document.post.message;

   txtarea.focus();
   donotinsert = false;
   theSelection = false;
   bblast = 0;

   if (bbnumber == -1) { // Close all open tags & default button names
      while (bbcode[0]) {
         butnumber = arraypop(bbcode) - 1;
         txtarea.value += bbtags[butnumber + 1];
         buttext = eval('document.post.addbbcode' + butnumber + '.value');
         eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
      }
      imageTag = false; // All tags are closed including image tags :D
      txtarea.focus();
      return;
   }

   if ((clientVer >= 4) && is_ie && is_win)
   {
      theSelection = document.selection.createRange().text; // Get text selection
      if (theSelection) {
         // Add tags around selection
         document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
         txtarea.focus();
         theSelection = '';
         return;
      }
   }
   else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
   {
      mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]);
      return;
   }

   // Find last occurance of an open tag the same as the one just clicked
   for (i = 0; i < bbcode.length; i++) {
      if (bbcode[i] == bbnumber+1) {
         bblast = i;
         donotinsert = true;
      }
   }

   if (donotinsert) {      // Close all open tags up to the one just clicked & default button names
      while (bbcode[bblast]) {
            butnumber = arraypop(bbcode) - 1;
            txtarea.value += bbtags[butnumber + 1];
            buttext = eval('document.post.addbbcode' + butnumber + '.value');
            eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
            imageTag = false;
         }
         txtarea.focus();
         return;
   } else { // Open tags

      if (imageTag && (bbnumber != 14)) {      // Close image tag before adding another
         txtarea.value += bbtags[15];
         lastValue = arraypop(bbcode) - 1;   // Remove the close image tag from the list
         document.post.addbbcode14.value = "Img";   // Return button back to normal state
         imageTag = false;
      }

      // Open tag
      txtarea.value += bbtags[bbnumber];
      if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
      arraypush(bbcode,bbnumber+1);
      eval('document.post.addbbcode'+bbnumber+'.value += "*"');
      txtarea.focus();
      return;
   }
   storeCaret(txtarea);
}

// From http://www.massless.org/mozedit/
function mozWrap(txtarea, open, close)
{
   var selLength = txtarea.textLength;
   var selStart = txtarea.selectionStart;
   var selEnd = txtarea.selectionEnd;
   if (selEnd == 1 || selEnd == 2)
      selEnd = selLength;

   var s1 = (txtarea.value).substring(0,selStart);
   var s2 = (txtarea.value).substring(selStart, selEnd)
   var s3 = (txtarea.value).substring(selEnd, selLength);
   txtarea.value = s1 + open + s2 + close + s3;
   return;
}

// Insert at Claret position. Code from
// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
function storeCaret(textEl) {
   if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

function pn(name)
{
   sqr_show();
   var txtarea = document.post.message;
   text = '[b]' + name + '[/b]' + '\r\n';
   if (txtarea.createTextRange && txtarea.caretPos)
   {
      var caretPos = txtarea.caretPos;
      caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
      txtarea.focus();
   }
   else
   {
      txtarea.value  += text;
      txtarea.focus();
   }

}

function sqr_show_hide()
{
   var id = 'sqr';
   var item = null;

   if (document.getElementById)
   {
      item = document.getElementById(id);
   }
   else if (document.all)
   {
      item = document.all[id];
   }
   else if (document.layers)
   {
      item = document.layers[id];
   }

   if (item && item.style)
   {
      if (item.style.display == "none")
      {
         item.style.display = "";
      }
      else
      {
         item.style.display = "none";
      }
   }
   else if (item)
   {
      item.visibility = "show";
   }
}

function sqr_show()
{
   var id = 'sqr';
   var item = null;

   if (document.getElementById)
   {
      item = document.getElementById(id);
   }
   else if (document.all)
   {
      item = document.all[id];
   }
   else if (document.layers)
   {
      item = document.layers[id];
   }

   if (item && item.style)
   {
      if (item.style.display == "none")
      {
         item.style.display = "";
      }
   }
   else if (item)
   {
      item.visibility = "show";
   }
}

//-->
</script>

<!-- BEGIN switch_open_qr_yes -->
<div id="sqr" style="display: show; position: relative; ">
<!-- END switch_open_qr_yes -->
<!-- BEGIN switch_open_qr_no -->
<div id="sqr" style="display: none; position: relative; ">
<!-- END switch_open_qr_no -->
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)">

<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
   <tr>
      <th class="thHead" colspan="2" height="25"><b>{L_QUICK_REPLY}</b></th>
   </tr>
   <!-- BEGIN switch_username_select -->
   <tr>
      <td class="row1"><span class="gen"><b>{L_USERNAME}</b></span></td>
      <td class="row2"><span class="genmed"><input type="text" class="post" tabindex="1" name="username" size="25" maxlength="25" value="{USERNAME}" /></span></td>
   </tr>
   <!-- END switch_username_select -->
   <tr>
     <td class="row1" width="22%"><span class="gen"><b>{L_SUBJECT}</b></span></td>
     <td class="row2" width="78%"> <span class="gen">
      <input type="text" name="subject" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{SUBJECT}" />
      </span> </td>
   </tr>
   <tr>
     <td class="row1" valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr>
         <td><span class="gen"><b>{L_MESSAGE_BODY}</b></span> </td>
        </tr>
        <!-- BEGIN switch_advanced_qr -->
        <tr>
         <td valign="middle" align="center"> <br />
           <table width="100" border="0" cellspacing="0" cellpadding="5">
            <tr align="center">
              <td colspan="{S_SMILIES_COLSPAN}" class="gensmall"><b>{L_EMOTICONS}</b></td>
            </tr>
        <!-- END switch_advanced_qr -->
            <!-- BEGIN smilies_row -->
            <tr align="center" valign="middle">
              <!-- BEGIN smilies_col -->
              <td><img src="{smilies_row.smilies_col.SMILEY_IMG}" border="0" onmouseover="this.style.cursor='hand';" onclick="emoticon('{smilies_row.smilies_col.SMILEY_CODE}');" alt="{smilies_row.smilies_col.SMILEY_DESC}" title="{smilies_row.smilies_col.SMILEY_DESC}" /></td>
              <!-- END smilies_col -->
            </tr>
            <!-- END smilies_row -->
            <!-- BEGIN switch_smilies_extra -->
            <tr align="center">
              <td colspan="{S_SMILIES_COLSPAN}"><span  class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></span></td>
            </tr>
            <!-- END switch_smilies_extra -->
        <!-- BEGIN switch_advanced_qr -->
           </table>
         </td>
        </tr>
        <!-- END switch_advanced_qr -->
      </table>
     </td>
     <td class="row2" valign="top"><span class="gen"> <span class="genmed"> </span>
      <table width="450" border="0" cellspacing="0" cellpadding="2">
        <!-- BEGIN switch_advanced_qr -->
        <tr align="center" valign="middle">
         <td><span class="genmed">
           <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onClick="bbstyle(2)" onMouseOver="helpline('i')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onClick="bbstyle(6)" onMouseOver="helpline('q')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onClick="bbstyle(8)" onMouseOver="helpline('c')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onClick="bbstyle(10)" onMouseOver="helpline('l')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onClick="bbstyle(12)" onMouseOver="helpline('o')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px"  onClick="bbstyle(14)" onMouseOver="helpline('p')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
           </span></td>
        </tr>
        <tr>
         <td colspan="9">
           <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><span class="genmed"> &nbsp;{L_FONT_COLOR}:
               <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver="helpline('s')">
                 <option style="color:black; background-color: {T_TD_COLOR1}" value="{T_FONTCOLOR1}" class="genmed">{L_COLOR_DEFAULT}</option>
                 <option style="color:darkred; background-color: {T_TD_COLOR1}" value="darkred" class="genmed">{L_COLOR_DARK_RED}</option>
                 <option style="color:red; background-color: {T_TD_COLOR1}" value="red" class="genmed">{L_COLOR_RED}</option>
                 <option style="color:orange; background-color: {T_TD_COLOR1}" value="orange" class="genmed">{L_COLOR_ORANGE}</option>
                 <option style="color:brown; background-color: {T_TD_COLOR1}" value="brown" class="genmed">{L_COLOR_BROWN}</option>
                 <option style="color:yellow; background-color: {T_TD_COLOR1}" value="yellow" class="genmed">{L_COLOR_YELLOW}</option>
                 <option style="color:green; background-color: {T_TD_COLOR1}" value="green" class="genmed">{L_COLOR_GREEN}</option>
                 <option style="color:olive; background-color: {T_TD_COLOR1}" value="olive" class="genmed">{L_COLOR_OLIVE}</option>
                 <option style="color:cyan; background-color: {T_TD_COLOR1}" value="cyan" class="genmed">{L_COLOR_CYAN}</option>
                 <option style="color:blue; background-color: {T_TD_COLOR1}" value="blue" class="genmed">{L_COLOR_BLUE}</option>
                 <option style="color:darkblue; background-color: {T_TD_COLOR1}" value="darkblue" class="genmed">{L_COLOR_DARK_BLUE}</option>
                 <option style="color:indigo; background-color: {T_TD_COLOR1}" value="indigo" class="genmed">{L_COLOR_INDIGO}</option>
                 <option style="color:violet; background-color: {T_TD_COLOR1}" value="violet" class="genmed">{L_COLOR_VIOLET}</option>
                 <option style="color:white; background-color: {T_TD_COLOR1}" value="white" class="genmed">{L_COLOR_WHITE}</option>
                 <option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option>
               </select> &nbsp;{L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;" onMouseOver="helpline('f')">
                 <option value="0" class="genmed">{L_FONT_SIZE}</option>
                 <option value="7" class="genmed">{L_FONT_TINY}</option>
                 <option value="9" class="genmed">{L_FONT_SMALL}</option>
                 <option value="12" selected class="genmed">{L_FONT_NORMAL}</option>
                 <option value="18" class="genmed">{L_FONT_LARGE}</option>
                 <option  value="24" class="genmed">{L_FONT_HUGE}</option>
               </select>
               </span></td>
              <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td>
            </tr>
           </table>
         </td>
        </tr>
        <tr>
         <td colspan="9"> <span class="gensmall">
           <input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" />
           </span></td>
        </tr>
        <!-- END switch_advanced_qr -->
        <tr>
         <td colspan="9"><span class="gen">
           <textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);"></textarea>
           </span></td>
        </tr>
      </table>
      </span></td>
   </tr>
   <!-- BEGIN switch_advanced_qr -->
   <tr>
     <td class="row1" valign="top"><span class="gen"><b>{L_OPTIONS}</b></span><br /><span class="gensmall">{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td>
     <td class="row2"><span class="gen"> </span>
      <table cellspacing="0" cellpadding="1" border="0">
        <!-- BEGIN switch_html_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="disable_html" {S_HTML_CHECKED} />
         </td>
         <td><span class="gen">{L_DISABLE_HTML}</span></td>
        </tr>
        <!-- END switch_html_checkbox -->
        <!-- BEGIN switch_bbcode_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="disable_bbcode" {S_BBCODE_CHECKED} />
         </td>
         <td><span class="gen">{L_DISABLE_BBCODE}</span></td>
        </tr>
        <!-- END switch_bbcode_checkbox -->
        <!-- BEGIN switch_smilies_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="disable_smilies" {S_SMILIES_CHECKED} />
         </td>
         <td><span class="gen">{L_DISABLE_SMILIES}</span></td>
        </tr>
        <!-- END switch_smilies_checkbox -->
        <!-- BEGIN switch_signature_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="attach_sig" {S_SIGNATURE_CHECKED} />
         </td>
         <td><span class="gen">{L_ATTACH_SIGNATURE}</span></td>
        </tr>
        <!-- END switch_signature_checkbox -->
        <!-- BEGIN switch_notify_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="notify" {S_NOTIFY_CHECKED} />
         </td>
         <td><span class="gen">{L_NOTIFY_ON_REPLY}</span></td>
        </tr>
        <!-- END switch_notify_checkbox -->
        <!-- BEGIN switch_delete_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="delete" />
         </td>
         <td><span class="gen">{L_DELETE_POST}</span></td>
        </tr>
        <!-- END switch_delete_checkbox -->
      </table>
     </td>
   </tr>
   <!-- END switch_advanced_qr -->
   <tr>
     <td class="catBottom" colspan="2" align="center" height="28"> {S_HIDDEN_FORM_FIELDS}<input type="submit" tabindex="5" name="preview" class="mainoption" value="{L_PREVIEW}" />&nbsp;<input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="{L_SUBMIT}" /></td>
   </tr>
  </table>

</form>

</div>

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
roadhog
Board Member



Joined: 19 Nov 2008

Posts: 95
Location: Central Texas


flag
PostPosted: Thu Jan 01, 2009 6:28 pm 
Post subject: Re: VCNP in SQR

Is this what you tried?

Code:
<script language="JavaScript" type="text/javascript">
<!--
// bbCode control by
// subBlue design
// www.subBlue.com

// Startup variables
var imageTag = false;
var theSelection = false;

// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
                && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
                && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
var is_moz = 0;

var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
var is_mac = (clientPC.indexOf("mac")!=-1);

<!-- BEGIN switch_advanced_qr -->
// Helpline messages
b_help = "{L_BBCODE_B_HELP}";
i_help = "{L_BBCODE_I_HELP}";
u_help = "{L_BBCODE_U_HELP}";
q_help = "{L_BBCODE_Q_HELP}";
c_help = "{L_BBCODE_C_HELP}";
l_help = "{L_BBCODE_L_HELP}";
o_help = "{L_BBCODE_O_HELP}";
p_help = "{L_BBCODE_P_HELP}";
w_help = "{L_BBCODE_W_HELP}";
a_help = "{L_BBCODE_A_HELP}";
s_help = "{L_BBCODE_S_HELP}";
f_help = "{L_BBCODE_F_HELP}";


// Shows the help messages in the helpline window
function helpline(help) {
   document.post.helpbox.value = eval(help + "_help");
}


function emoticon(text) {
   var txtarea = document.post.message;
   text = ' ' + text + ' ';
   if (txtarea.createTextRange && txtarea.caretPos) {
      var caretPos = txtarea.caretPos;
      caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
      txtarea.focus();
   } else {
      txtarea.value  += text;
      txtarea.focus();
   }
}


function bbfontstyle(bbopen, bbclose) {
   var txtarea = document.post.message;

   if ((clientVer >= 4) && is_ie && is_win) {
      theSelection = document.selection.createRange().text;
      if (!theSelection) {
         txtarea.value += bbopen + bbclose;
         txtarea.focus();
         return;
      }
      document.selection.createRange().text = bbopen + theSelection + bbclose;
      txtarea.focus();
      return;
   }
   else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
   {
      mozWrap(txtarea, bbopen, bbclose);
      return;
   }
   else
   {
      txtarea.value += bbopen + bbclose;
      txtarea.focus();
   }
   storeCaret(txtarea);
}


<!-- END switch_advanced_qr -->


// Define the bbCode tags
bbcode = new Array();
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');
imageTag = false;


// Replacement for arrayname.length property
function getarraysize(thearray) {
   for (i = 0; i < thearray.length; i++) {
      if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
         return i;
      }
   return thearray.length;
}

// Replacement for arrayname.push(value) not implemented in IE until version 5.5
// Appends element to the array
function arraypush(thearray,value) {
   thearray[ getarraysize(thearray) ] = value;
}

// Replacement for arrayname.pop() not implemented in IE until version 5.5
// Removes and returns the last element of an array
function arraypop(thearray) {
   thearraysize = getarraysize(thearray);
   retval = thearray[thearraysize - 1];
   delete thearray[thearraysize - 1];
   return retval;
}


function checkForm() {

   formErrors = false;

   if (document.post.message.value.length < 2) {
      formErrors = "{L_EMPTY_MESSAGE}";
   }

   if (formErrors) {
      alert(formErrors);
      return false;
   } else {
      bbstyle(-1);
      //formObj.preview.disabled = true;
      //formObj.submit.disabled = true;
      return true;
   }
}


function bbstyle(bbnumber) {
   var txtarea = document.post.message;

   txtarea.focus();
   donotinsert = false;
   theSelection = false;
   bblast = 0;

   if (bbnumber == -1) { // Close all open tags & default button names
      while (bbcode[0]) {
         butnumber = arraypop(bbcode) - 1;
         txtarea.value += bbtags[butnumber + 1];
         buttext = eval('document.post.addbbcode' + butnumber + '.value');
         eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
      }
      imageTag = false; // All tags are closed including image tags :D
      txtarea.focus();
      return;
   }

   if ((clientVer >= 4) && is_ie && is_win)
   {
      theSelection = document.selection.createRange().text; // Get text selection
      if (theSelection) {
         // Add tags around selection
         document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
         txtarea.focus();
         theSelection = '';
         return;
      }
   }
   else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
   {
      mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]);
      return;
   }

   // Find last occurance of an open tag the same as the one just clicked
   for (i = 0; i < bbcode.length; i++) {
      if (bbcode[i] == bbnumber+1) {
         bblast = i;
         donotinsert = true;
      }
   }

   if (donotinsert) {      // Close all open tags up to the one just clicked & default button names
      while (bbcode[bblast]) {
            butnumber = arraypop(bbcode) - 1;
            txtarea.value += bbtags[butnumber + 1];
            buttext = eval('document.post.addbbcode' + butnumber + '.value');
            eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
            imageTag = false;
         }
         txtarea.focus();
         return;
   } else { // Open tags

      if (imageTag && (bbnumber != 14)) {      // Close image tag before adding another
         txtarea.value += bbtags[15];
         lastValue = arraypop(bbcode) - 1;   // Remove the close image tag from the list
         document.post.addbbcode14.value = "Img";   // Return button back to normal state
         imageTag = false;
      }

      // Open tag
      txtarea.value += bbtags[bbnumber];
      if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
      arraypush(bbcode,bbnumber+1);
      eval('document.post.addbbcode'+bbnumber+'.value += "*"');
      txtarea.focus();
      return;
   }
   storeCaret(txtarea);
}

// From http://www.massless.org/mozedit/
function mozWrap(txtarea, open, close)
{
   var selLength = txtarea.textLength;
   var selStart = txtarea.selectionStart;
   var selEnd = txtarea.selectionEnd;
   if (selEnd == 1 || selEnd == 2)
      selEnd = selLength;

   var s1 = (txtarea.value).substring(0,selStart);
   var s2 = (txtarea.value).substring(selStart, selEnd)
   var s3 = (txtarea.value).substring(selEnd, selLength);
   txtarea.value = s1 + open + s2 + close + s3;
   return;
}

// Insert at Claret position. Code from
// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
function storeCaret(textEl) {
   if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

function pn(name)
{
   sqr_show();
   var txtarea = document.post.message;
   text = '[b]' + name + '[/b]' + '\r\n';
   if (txtarea.createTextRange && txtarea.caretPos)
   {
      var caretPos = txtarea.caretPos;
      caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
      txtarea.focus();
   }
   else
   {
      txtarea.value  += text;
      txtarea.focus();
   }

}

function sqr_show_hide()
{
   var id = 'sqr';
   var item = null;

   if (document.getElementById)
   {
      item = document.getElementById(id);
   }
   else if (document.all)
   {
      item = document.all[id];
   }
   else if (document.layers)
   {
      item = document.layers[id];
   }

   if (item && item.style)
   {
      if (item.style.display == "none")
      {
         item.style.display = "";
      }
      else
      {
         item.style.display = "none";
      }
   }
   else if (item)
   {
      item.visibility = "show";
   }
}

function sqr_show()
{
   var id = 'sqr';
   var item = null;

   if (document.getElementById)
   {
      item = document.getElementById(id);
   }
   else if (document.all)
   {
      item = document.all[id];
   }
   else if (document.layers)
   {
      item = document.layers[id];
   }

   if (item && item.style)
   {
      if (item.style.display == "none")
      {
         item.style.display = "";
      }
   }
   else if (item)
   {
      item.visibility = "show";
   }
}

//-->
</script>

<!-- BEGIN switch_open_qr_yes -->
<div id="sqr" style="display: show; position: relative; ">
<!-- END switch_open_qr_yes -->
<!-- BEGIN switch_open_qr_no -->
<div id="sqr" style="display: none; position: relative; ">
<!-- END switch_open_qr_no -->
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)">

<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
   <tr>
      <th class="thHead" colspan="2" height="25"><b>{L_QUICK_REPLY}</b></th>
   </tr>
   <!-- BEGIN switch_username_select -->
   <tr>
      <td class="row1"><span class="gen"><b>{L_USERNAME}</b></span></td>
      <td class="row2"><span class="genmed"><input type="text" class="post" tabindex="1" name="username" size="25" maxlength="25" value="{USERNAME}" /></span></td>
   </tr>
   <!-- END switch_username_select -->
   <tr>
     <td class="row1" width="22%"><span class="gen"><b>{L_SUBJECT}</b></span></td>
     <td class="row2" width="78%"> <span class="gen">
      <input type="text" name="subject" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{SUBJECT}" />
      </span> </td>
   </tr>
   <tr>
     <td class="row1" valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr>
         <td><span class="gen"><b>{L_MESSAGE_BODY}</b></span> </td>
        </tr>
        <!-- BEGIN switch_advanced_qr -->
        <tr>
         <td valign="middle" align="center"> <br />
           <table width="100" border="0" cellspacing="0" cellpadding="5">
            <tr align="center">
              <td colspan="{S_SMILIES_COLSPAN}" class="gensmall"><b>{L_EMOTICONS}</b></td>
            </tr>
        <!-- END switch_advanced_qr -->
            <!-- BEGIN smilies_row -->
            <tr align="center" valign="middle">
              <!-- BEGIN smilies_col -->
              <td><img src="{smilies_row.smilies_col.SMILEY_IMG}" border="0" onmouseover="this.style.cursor='hand';" onclick="emoticon('{smilies_row.smilies_col.SMILEY_CODE}');" alt="{smilies_row.smilies_col.SMILEY_DESC}" title="{smilies_row.smilies_col.SMILEY_DESC}" /></td>
              <!-- END smilies_col -->
            </tr>
            <!-- END smilies_row -->
            <!-- BEGIN switch_smilies_extra -->
            <tr align="center">
              <td colspan="{S_SMILIES_COLSPAN}"><span  class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></span></td>
            </tr>
            <!-- END switch_smilies_extra -->
        <!-- BEGIN switch_advanced_qr -->
           </table>
         </td>
        </tr>
        <!-- END switch_advanced_qr -->
      </table>
     </td>
     <td class="row2" valign="top"><span class="gen"> <span class="genmed"> </span>
      <table width="450" border="0" cellspacing="0" cellpadding="2">
        <!-- BEGIN switch_advanced_qr -->
        <tr align="center" valign="middle">
         <td><span class="genmed">
           <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onClick="bbstyle(2)" onMouseOver="helpline('i')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onClick="bbstyle(6)" onMouseOver="helpline('q')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onClick="bbstyle(8)" onMouseOver="helpline('c')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onClick="bbstyle(10)" onMouseOver="helpline('l')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onClick="bbstyle(12)" onMouseOver="helpline('o')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px"  onClick="bbstyle(14)" onMouseOver="helpline('p')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
           </span></td>
        </tr>
        <tr>
         <td colspan="9">
           <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><span class="genmed"> &nbsp;{L_FONT_COLOR}:
               <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver="helpline('s')">
                 <option style="color:black; background-color: {T_TD_COLOR1}" value="{T_FONTCOLOR1}" class="genmed">{L_COLOR_DEFAULT}</option>
                 <option style="color:darkred; background-color: {T_TD_COLOR1}" value="darkred" class="genmed">{L_COLOR_DARK_RED}</option>
                 <option style="color:red; background-color: {T_TD_COLOR1}" value="red" class="genmed">{L_COLOR_RED}</option>
                 <option style="color:orange; background-color: {T_TD_COLOR1}" value="orange" class="genmed">{L_COLOR_ORANGE}</option>
                 <option style="color:brown; background-color: {T_TD_COLOR1}" value="brown" class="genmed">{L_COLOR_BROWN}</option>
                 <option style="color:yellow; background-color: {T_TD_COLOR1}" value="yellow" class="genmed">{L_COLOR_YELLOW}</option>
                 <option style="color:green; background-color: {T_TD_COLOR1}" value="green" class="genmed">{L_COLOR_GREEN}</option>
                 <option style="color:olive; background-color: {T_TD_COLOR1}" value="olive" class="genmed">{L_COLOR_OLIVE}</option>
                 <option style="color:cyan; background-color: {T_TD_COLOR1}" value="cyan" class="genmed">{L_COLOR_CYAN}</option>
                 <option style="color:blue; background-color: {T_TD_COLOR1}" value="blue" class="genmed">{L_COLOR_BLUE}</option>
                 <option style="color:darkblue; background-color: {T_TD_COLOR1}" value="darkblue" class="genmed">{L_COLOR_DARK_BLUE}</option>
                 <option style="color:indigo; background-color: {T_TD_COLOR1}" value="indigo" class="genmed">{L_COLOR_INDIGO}</option>
                 <option style="color:violet; background-color: {T_TD_COLOR1}" value="violet" class="genmed">{L_COLOR_VIOLET}</option>
                 <option style="color:white; background-color: {T_TD_COLOR1}" value="white" class="genmed">{L_COLOR_WHITE}</option>
                 <option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option>
               </select> &nbsp;{L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;" onMouseOver="helpline('f')">
                 <option value="0" class="genmed">{L_FONT_SIZE}</option>
                 <option value="7" class="genmed">{L_FONT_TINY}</option>
                 <option value="9" class="genmed">{L_FONT_SMALL}</option>
                 <option value="12" selected class="genmed">{L_FONT_NORMAL}</option>
                 <option value="18" class="genmed">{L_FONT_LARGE}</option>
                 <option  value="24" class="genmed">{L_FONT_HUGE}</option>
               </select>
               </span></td>
              <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td>
            </tr>
           </table>
         </td>
        </tr>
        <tr>
         <td colspan="9"> <span class="gensmall">
           <input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" />
           </span></td>
        </tr>
        <!-- END switch_advanced_qr -->
        <tr>
         <td colspan="9"><span class="gen">
           <textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);"></textarea>
           </span></td>
        </tr>
      </table>
      </span></td>
   </tr>
   <!-- BEGIN switch_advanced_qr -->
   <tr>
     <td class="row1" valign="top"><span class="gen"><b>{L_OPTIONS}</b></span><br /><span class="gensmall">{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td>
     <td class="row2"><span class="gen"> </span>
      <table cellspacing="0" cellpadding="1" border="0">
        <!-- BEGIN switch_html_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="disable_html" {S_HTML_CHECKED} />
         </td>
         <td><span class="gen">{L_DISABLE_HTML}</span></td>
        </tr>
        <!-- END switch_html_checkbox -->
        <!-- BEGIN switch_bbcode_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="disable_bbcode" {S_BBCODE_CHECKED} />
         </td>
         <td><span class="gen">{L_DISABLE_BBCODE}</span></td>
        </tr>
        <!-- END switch_bbcode_checkbox -->
        <!-- BEGIN switch_smilies_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="disable_smilies" {S_SMILIES_CHECKED} />
         </td>
         <td><span class="gen">{L_DISABLE_SMILIES}</span></td>
        </tr>
        <!-- END switch_smilies_checkbox -->
        <!-- BEGIN switch_signature_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="attach_sig" {S_SIGNATURE_CHECKED} />
         </td>
         <td><span class="gen">{L_ATTACH_SIGNATURE}</span></td>
        </tr>
        <!-- END switch_signature_checkbox -->
        <!-- BEGIN switch_notify_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="notify" {S_NOTIFY_CHECKED} />
         </td>
         <td><span class="gen">{L_NOTIFY_ON_REPLY}</span></td>
        </tr>
        <!-- END switch_notify_checkbox -->
        <!-- BEGIN switch_delete_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="delete" />
         </td>
         <td><span class="gen">{L_DELETE_POST}</span></td>
        </tr>
        <!-- END switch_delete_checkbox -->
      </table>
     </td>
   </tr>
   <!-- END switch_advanced_qr -->
<!-- Visual Confirmation on New Posters - Begin Code Alteration -->
{VC_NEWPOSTS}
<!-- Visual Confirmation on New Posters - End Code Alteration -->
   <tr>
     <td class="catBottom" colspan="2" align="center" height="28"> {S_HIDDEN_FORM_FIELDS}<input type="submit" tabindex="5" name="preview" class="mainoption" value="{L_PREVIEW}" />&nbsp;<input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="{L_SUBMIT}" /></td>
   </tr>
  </table>

</form>

</div>
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Thu Jan 01, 2009 9:04 pm 
Post subject: Re: VCNP in SQR

Yes. That is exactly what I've tryed and it just doesn't work. icon_sad.gif
_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
roadhog
Board Member



Joined: 19 Nov 2008

Posts: 95
Location: Central Texas


flag
PostPosted: Fri Jan 02, 2009 1:26 am 
Post subject: Re: VCNP in SQR

Ok, try this. I just moved it up one line. If this doesn't work, I don't see any other place to put it.

Code:
<script language="JavaScript" type="text/javascript">
<!--
// bbCode control by
// subBlue design
// www.subBlue.com

// Startup variables
var imageTag = false;
var theSelection = false;

// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
                && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
                && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
var is_moz = 0;

var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
var is_mac = (clientPC.indexOf("mac")!=-1);

<!-- BEGIN switch_advanced_qr -->
// Helpline messages
b_help = "{L_BBCODE_B_HELP}";
i_help = "{L_BBCODE_I_HELP}";
u_help = "{L_BBCODE_U_HELP}";
q_help = "{L_BBCODE_Q_HELP}";
c_help = "{L_BBCODE_C_HELP}";
l_help = "{L_BBCODE_L_HELP}";
o_help = "{L_BBCODE_O_HELP}";
p_help = "{L_BBCODE_P_HELP}";
w_help = "{L_BBCODE_W_HELP}";
a_help = "{L_BBCODE_A_HELP}";
s_help = "{L_BBCODE_S_HELP}";
f_help = "{L_BBCODE_F_HELP}";


// Shows the help messages in the helpline window
function helpline(help) {
   document.post.helpbox.value = eval(help + "_help");
}


function emoticon(text) {
   var txtarea = document.post.message;
   text = ' ' + text + ' ';
   if (txtarea.createTextRange && txtarea.caretPos) {
      var caretPos = txtarea.caretPos;
      caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
      txtarea.focus();
   } else {
      txtarea.value  += text;
      txtarea.focus();
   }
}


function bbfontstyle(bbopen, bbclose) {
   var txtarea = document.post.message;

   if ((clientVer >= 4) && is_ie && is_win) {
      theSelection = document.selection.createRange().text;
      if (!theSelection) {
         txtarea.value += bbopen + bbclose;
         txtarea.focus();
         return;
      }
      document.selection.createRange().text = bbopen + theSelection + bbclose;
      txtarea.focus();
      return;
   }
   else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
   {
      mozWrap(txtarea, bbopen, bbclose);
      return;
   }
   else
   {
      txtarea.value += bbopen + bbclose;
      txtarea.focus();
   }
   storeCaret(txtarea);
}


<!-- END switch_advanced_qr -->


// Define the bbCode tags
bbcode = new Array();
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');
imageTag = false;


// Replacement for arrayname.length property
function getarraysize(thearray) {
   for (i = 0; i < thearray.length; i++) {
      if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
         return i;
      }
   return thearray.length;
}

// Replacement for arrayname.push(value) not implemented in IE until version 5.5
// Appends element to the array
function arraypush(thearray,value) {
   thearray[ getarraysize(thearray) ] = value;
}

// Replacement for arrayname.pop() not implemented in IE until version 5.5
// Removes and returns the last element of an array
function arraypop(thearray) {
   thearraysize = getarraysize(thearray);
   retval = thearray[thearraysize - 1];
   delete thearray[thearraysize - 1];
   return retval;
}


function checkForm() {

   formErrors = false;

   if (document.post.message.value.length < 2) {
      formErrors = "{L_EMPTY_MESSAGE}";
   }

   if (formErrors) {
      alert(formErrors);
      return false;
   } else {
      bbstyle(-1);
      //formObj.preview.disabled = true;
      //formObj.submit.disabled = true;
      return true;
   }
}


function bbstyle(bbnumber) {
   var txtarea = document.post.message;

   txtarea.focus();
   donotinsert = false;
   theSelection = false;
   bblast = 0;

   if (bbnumber == -1) { // Close all open tags & default button names
      while (bbcode[0]) {
         butnumber = arraypop(bbcode) - 1;
         txtarea.value += bbtags[butnumber + 1];
         buttext = eval('document.post.addbbcode' + butnumber + '.value');
         eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
      }
      imageTag = false; // All tags are closed including image tags :D
      txtarea.focus();
      return;
   }

   if ((clientVer >= 4) && is_ie && is_win)
   {
      theSelection = document.selection.createRange().text; // Get text selection
      if (theSelection) {
         // Add tags around selection
         document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
         txtarea.focus();
         theSelection = '';
         return;
      }
   }
   else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
   {
      mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]);
      return;
   }

   // Find last occurance of an open tag the same as the one just clicked
   for (i = 0; i < bbcode.length; i++) {
      if (bbcode[i] == bbnumber+1) {
         bblast = i;
         donotinsert = true;
      }
   }

   if (donotinsert) {      // Close all open tags up to the one just clicked & default button names
      while (bbcode[bblast]) {
            butnumber = arraypop(bbcode) - 1;
            txtarea.value += bbtags[butnumber + 1];
            buttext = eval('document.post.addbbcode' + butnumber + '.value');
            eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
            imageTag = false;
         }
         txtarea.focus();
         return;
   } else { // Open tags

      if (imageTag && (bbnumber != 14)) {      // Close image tag before adding another
         txtarea.value += bbtags[15];
         lastValue = arraypop(bbcode) - 1;   // Remove the close image tag from the list
         document.post.addbbcode14.value = "Img";   // Return button back to normal state
         imageTag = false;
      }

      // Open tag
      txtarea.value += bbtags[bbnumber];
      if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
      arraypush(bbcode,bbnumber+1);
      eval('document.post.addbbcode'+bbnumber+'.value += "*"');
      txtarea.focus();
      return;
   }
   storeCaret(txtarea);
}

// From http://www.massless.org/mozedit/
function mozWrap(txtarea, open, close)
{
   var selLength = txtarea.textLength;
   var selStart = txtarea.selectionStart;
   var selEnd = txtarea.selectionEnd;
   if (selEnd == 1 || selEnd == 2)
      selEnd = selLength;

   var s1 = (txtarea.value).substring(0,selStart);
   var s2 = (txtarea.value).substring(selStart, selEnd)
   var s3 = (txtarea.value).substring(selEnd, selLength);
   txtarea.value = s1 + open + s2 + close + s3;
   return;
}

// Insert at Claret position. Code from
// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
function storeCaret(textEl) {
   if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

function pn(name)
{
   sqr_show();
   var txtarea = document.post.message;
   text = '[b]' + name + '[/b]' + '\r\n';
   if (txtarea.createTextRange && txtarea.caretPos)
   {
      var caretPos = txtarea.caretPos;
      caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
      txtarea.focus();
   }
   else
   {
      txtarea.value  += text;
      txtarea.focus();
   }

}

function sqr_show_hide()
{
   var id = 'sqr';
   var item = null;

   if (document.getElementById)
   {
      item = document.getElementById(id);
   }
   else if (document.all)
   {
      item = document.all[id];
   }
   else if (document.layers)
   {
      item = document.layers[id];
   }

   if (item && item.style)
   {
      if (item.style.display == "none")
      {
         item.style.display = "";
      }
      else
      {
         item.style.display = "none";
      }
   }
   else if (item)
   {
      item.visibility = "show";
   }
}

function sqr_show()
{
   var id = 'sqr';
   var item = null;

   if (document.getElementById)
   {
      item = document.getElementById(id);
   }
   else if (document.all)
   {
      item = document.all[id];
   }
   else if (document.layers)
   {
      item = document.layers[id];
   }

   if (item && item.style)
   {
      if (item.style.display == "none")
      {
         item.style.display = "";
      }
   }
   else if (item)
   {
      item.visibility = "show";
   }
}

//-->
</script>

<!-- BEGIN switch_open_qr_yes -->
<div id="sqr" style="display: show; position: relative; ">
<!-- END switch_open_qr_yes -->
<!-- BEGIN switch_open_qr_no -->
<div id="sqr" style="display: none; position: relative; ">
<!-- END switch_open_qr_no -->
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)">

<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
   <tr>
      <th class="thHead" colspan="2" height="25"><b>{L_QUICK_REPLY}</b></th>
   </tr>
   <!-- BEGIN switch_username_select -->
   <tr>
      <td class="row1"><span class="gen"><b>{L_USERNAME}</b></span></td>
      <td class="row2"><span class="genmed"><input type="text" class="post" tabindex="1" name="username" size="25" maxlength="25" value="{USERNAME}" /></span></td>
   </tr>
   <!-- END switch_username_select -->
   <tr>
     <td class="row1" width="22%"><span class="gen"><b>{L_SUBJECT}</b></span></td>
     <td class="row2" width="78%"> <span class="gen">
      <input type="text" name="subject" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{SUBJECT}" />
      </span> </td>
   </tr>
   <tr>
     <td class="row1" valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr>
         <td><span class="gen"><b>{L_MESSAGE_BODY}</b></span> </td>
        </tr>
        <!-- BEGIN switch_advanced_qr -->
        <tr>
         <td valign="middle" align="center"> <br />
           <table width="100" border="0" cellspacing="0" cellpadding="5">
            <tr align="center">
              <td colspan="{S_SMILIES_COLSPAN}" class="gensmall"><b>{L_EMOTICONS}</b></td>
            </tr>
        <!-- END switch_advanced_qr -->
            <!-- BEGIN smilies_row -->
            <tr align="center" valign="middle">
              <!-- BEGIN smilies_col -->
              <td><img src="{smilies_row.smilies_col.SMILEY_IMG}" border="0" onmouseover="this.style.cursor='hand';" onclick="emoticon('{smilies_row.smilies_col.SMILEY_CODE}');" alt="{smilies_row.smilies_col.SMILEY_DESC}" title="{smilies_row.smilies_col.SMILEY_DESC}" /></td>
              <!-- END smilies_col -->
            </tr>
            <!-- END smilies_row -->
            <!-- BEGIN switch_smilies_extra -->
            <tr align="center">
              <td colspan="{S_SMILIES_COLSPAN}"><span  class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></span></td>
            </tr>
            <!-- END switch_smilies_extra -->
        <!-- BEGIN switch_advanced_qr -->
           </table>
         </td>
        </tr>
        <!-- END switch_advanced_qr -->
      </table>
     </td>
     <td class="row2" valign="top"><span class="gen"> <span class="genmed"> </span>
      <table width="450" border="0" cellspacing="0" cellpadding="2">
        <!-- BEGIN switch_advanced_qr -->
        <tr align="center" valign="middle">
         <td><span class="genmed">
           <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onClick="bbstyle(2)" onMouseOver="helpline('i')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onClick="bbstyle(6)" onMouseOver="helpline('q')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onClick="bbstyle(8)" onMouseOver="helpline('c')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onClick="bbstyle(10)" onMouseOver="helpline('l')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onClick="bbstyle(12)" onMouseOver="helpline('o')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px"  onClick="bbstyle(14)" onMouseOver="helpline('p')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
           </span></td>
        </tr>
        <tr>
         <td colspan="9">
           <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><span class="genmed"> &nbsp;{L_FONT_COLOR}:
               <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver="helpline('s')">
                 <option style="color:black; background-color: {T_TD_COLOR1}" value="{T_FONTCOLOR1}" class="genmed">{L_COLOR_DEFAULT}</option>
                 <option style="color:darkred; background-color: {T_TD_COLOR1}" value="darkred" class="genmed">{L_COLOR_DARK_RED}</option>
                 <option style="color:red; background-color: {T_TD_COLOR1}" value="red" class="genmed">{L_COLOR_RED}</option>
                 <option style="color:orange; background-color: {T_TD_COLOR1}" value="orange" class="genmed">{L_COLOR_ORANGE}</option>
                 <option style="color:brown; background-color: {T_TD_COLOR1}" value="brown" class="genmed">{L_COLOR_BROWN}</option>
                 <option style="color:yellow; background-color: {T_TD_COLOR1}" value="yellow" class="genmed">{L_COLOR_YELLOW}</option>
                 <option style="color:green; background-color: {T_TD_COLOR1}" value="green" class="genmed">{L_COLOR_GREEN}</option>
                 <option style="color:olive; background-color: {T_TD_COLOR1}" value="olive" class="genmed">{L_COLOR_OLIVE}</option>
                 <option style="color:cyan; background-color: {T_TD_COLOR1}" value="cyan" class="genmed">{L_COLOR_CYAN}</option>
                 <option style="color:blue; background-color: {T_TD_COLOR1}" value="blue" class="genmed">{L_COLOR_BLUE}</option>
                 <option style="color:darkblue; background-color: {T_TD_COLOR1}" value="darkblue" class="genmed">{L_COLOR_DARK_BLUE}</option>
                 <option style="color:indigo; background-color: {T_TD_COLOR1}" value="indigo" class="genmed">{L_COLOR_INDIGO}</option>
                 <option style="color:violet; background-color: {T_TD_COLOR1}" value="violet" class="genmed">{L_COLOR_VIOLET}</option>
                 <option style="color:white; background-color: {T_TD_COLOR1}" value="white" class="genmed">{L_COLOR_WHITE}</option>
                 <option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option>
               </select> &nbsp;{L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;" onMouseOver="helpline('f')">
                 <option value="0" class="genmed">{L_FONT_SIZE}</option>
                 <option value="7" class="genmed">{L_FONT_TINY}</option>
                 <option value="9" class="genmed">{L_FONT_SMALL}</option>
                 <option value="12" selected class="genmed">{L_FONT_NORMAL}</option>
                 <option value="18" class="genmed">{L_FONT_LARGE}</option>
                 <option  value="24" class="genmed">{L_FONT_HUGE}</option>
               </select>
               </span></td>
              <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td>
            </tr>
           </table>
         </td>
        </tr>
        <tr>
         <td colspan="9"> <span class="gensmall">
           <input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" />
           </span></td>
        </tr>
        <!-- END switch_advanced_qr -->
        <tr>
         <td colspan="9"><span class="gen">
           <textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);"></textarea>
           </span></td>
        </tr>
      </table>
      </span></td>
   </tr>
   <!-- BEGIN switch_advanced_qr -->
   <tr>
     <td class="row1" valign="top"><span class="gen"><b>{L_OPTIONS}</b></span><br /><span class="gensmall">{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td>
     <td class="row2"><span class="gen"> </span>
      <table cellspacing="0" cellpadding="1" border="0">
        <!-- BEGIN switch_html_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="disable_html" {S_HTML_CHECKED} />
         </td>
         <td><span class="gen">{L_DISABLE_HTML}</span></td>
        </tr>
        <!-- END switch_html_checkbox -->
        <!-- BEGIN switch_bbcode_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="disable_bbcode" {S_BBCODE_CHECKED} />
         </td>
         <td><span class="gen">{L_DISABLE_BBCODE}</span></td>
        </tr>
        <!-- END switch_bbcode_checkbox -->
        <!-- BEGIN switch_smilies_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="disable_smilies" {S_SMILIES_CHECKED} />
         </td>
         <td><span class="gen">{L_DISABLE_SMILIES}</span></td>
        </tr>
        <!-- END switch_smilies_checkbox -->
        <!-- BEGIN switch_signature_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="attach_sig" {S_SIGNATURE_CHECKED} />
         </td>
         <td><span class="gen">{L_ATTACH_SIGNATURE}</span></td>
        </tr>
        <!-- END switch_signature_checkbox -->
        <!-- BEGIN switch_notify_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="notify" {S_NOTIFY_CHECKED} />
         </td>
         <td><span class="gen">{L_NOTIFY_ON_REPLY}</span></td>
        </tr>
        <!-- END switch_notify_checkbox -->
        <!-- BEGIN switch_delete_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="delete" />
         </td>
         <td><span class="gen">{L_DELETE_POST}</span></td>
        </tr>
        <!-- END switch_delete_checkbox -->
      </table>
     </td>
   </tr>
<!-- Visual Confirmation on New Posters - Begin Code Alteration -->
{VC_NEWPOSTS}
<!-- Visual Confirmation on New Posters - End Code Alteration -->
   <!-- END switch_advanced_qr -->
   <tr>
     <td class="catBottom" colspan="2" align="center" height="28"> {S_HIDDEN_FORM_FIELDS}<input type="submit" tabindex="5" name="preview" class="mainoption" value="{L_PREVIEW}" />&nbsp;<input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="{L_SUBMIT}" /></td>
   </tr>
  </table>

</form>

</div>
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Fri Jan 02, 2009 12:07 pm 
Post subject: Re: VCNP in SQR

It doesn't work. I also tryed to put it at the bottom, after </form>, but also not working. I've tryed like 4-5 places, but still no result. icon_sad.gif I don't know where it should be put, I think a good programmer could manage this. icon_confused.gif

LATER EDIT: I've asked help on the support board of the creator of this MOD, but no answear so far...

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
RMcGirr83
Board Member



Joined: 02 Dec 2008

Posts: 53
Location: East Lyme, CT


flag
PostPosted: Fri Jan 02, 2009 5:25 pm 
Post subject: Re: VCNP in SQR

There is code that would need to be placed into

Code:

viewtopic_quickreply.php


to check the field upon submit. (Hint, look at how posting.php is edited).

_________________
Rich McGirr
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Fri Jan 02, 2009 7:55 pm 
Post subject: Re: VCNP in SQR

Either they are written in a complettly different maner or they don't have anything in commun. I can't find absolutly nothing similar between viewtopic_quickreply.tpl and posting.php.

This is the changes required for posting.php:
Code:
#-----[ OPEN ]--------------------------------------
#
posting.php

#
#-----[ FIND ]--------------------------------------
#

<?php

#
#-----[ AFTER, ADD ]--------------------------------------
#

// This file modified for Visual Confirmation on New Posters

#
#-----[ FIND ]--------------------------------------
#

//
// End session management
//

#
#-----[ AFTER, ADD ]--------------------------------------
#

//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
require_once($phpbb_root_path . 'mods/vc_newposts/vc_newposts.' . $phpEx);
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

#
#-----[ FIND ]--------------------------------------
#

         prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length);

#
#-----[ AFTER, ADD ]--------------------------------------
#

//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
         $vc_newposts->check_fields();
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

#
#-----[ FIND ]--------------------------------------
#

//
// Topic review
//

#
#-----[ BEFORE, ADD ]--------------------------------------
#

//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
$vc_newposts->show_field();
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------


And this is viewtopic_quickreply.php:
Code:
<script language="JavaScript" type="text/javascript">
<!--
// bbCode control by
// subBlue design
// www.subBlue.com

// Startup variables
var imageTag = false;
var theSelection = false;

// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
                && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
                && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
var is_moz = 0;

var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
var is_mac = (clientPC.indexOf("mac")!=-1);

<!-- BEGIN switch_advanced_qr -->
// Helpline messages
b_help = "{L_BBCODE_B_HELP}";
i_help = "{L_BBCODE_I_HELP}";
u_help = "{L_BBCODE_U_HELP}";
q_help = "{L_BBCODE_Q_HELP}";
c_help = "{L_BBCODE_C_HELP}";
l_help = "{L_BBCODE_L_HELP}";
o_help = "{L_BBCODE_O_HELP}";
p_help = "{L_BBCODE_P_HELP}";
w_help = "{L_BBCODE_W_HELP}";
a_help = "{L_BBCODE_A_HELP}";
s_help = "{L_BBCODE_S_HELP}";
f_help = "{L_BBCODE_F_HELP}";


// Shows the help messages in the helpline window
function helpline(help) {
   document.post.helpbox.value = eval(help + "_help");
}


function emoticon(text) {
   var txtarea = document.post.message;
   text = ' ' + text + ' ';
   if (txtarea.createTextRange && txtarea.caretPos) {
      var caretPos = txtarea.caretPos;
      caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
      txtarea.focus();
   } else {
      txtarea.value  += text;
      txtarea.focus();
   }
}


function bbfontstyle(bbopen, bbclose) {
   var txtarea = document.post.message;

   if ((clientVer >= 4) && is_ie && is_win) {
      theSelection = document.selection.createRange().text;
      if (!theSelection) {
         txtarea.value += bbopen + bbclose;
         txtarea.focus();
         return;
      }
      document.selection.createRange().text = bbopen + theSelection + bbclose;
      txtarea.focus();
      return;
   }
   else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
   {
      mozWrap(txtarea, bbopen, bbclose);
      return;
   }
   else
   {
      txtarea.value += bbopen + bbclose;
      txtarea.focus();
   }
   storeCaret(txtarea);
}


<!-- END switch_advanced_qr -->


// Define the bbCode tags
bbcode = new Array();
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');
imageTag = false;


// Replacement for arrayname.length property
function getarraysize(thearray) {
   for (i = 0; i < thearray.length; i++) {
      if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
         return i;
      }
   return thearray.length;
}

// Replacement for arrayname.push(value) not implemented in IE until version 5.5
// Appends element to the array
function arraypush(thearray,value) {
   thearray[ getarraysize(thearray) ] = value;
}

// Replacement for arrayname.pop() not implemented in IE until version 5.5
// Removes and returns the last element of an array
function arraypop(thearray) {
   thearraysize = getarraysize(thearray);
   retval = thearray[thearraysize - 1];
   delete thearray[thearraysize - 1];
   return retval;
}


function checkForm() {

   formErrors = false;

   if (document.post.message.value.length < 2) {
      formErrors = "{L_EMPTY_MESSAGE}";
   }

   if (formErrors) {
      alert(formErrors);
      return false;
   } else {
      bbstyle(-1);
      //formObj.preview.disabled = true;
      //formObj.submit.disabled = true;
      return true;
   }
}


function bbstyle(bbnumber) {
   var txtarea = document.post.message;

   txtarea.focus();
   donotinsert = false;
   theSelection = false;
   bblast = 0;

   if (bbnumber == -1) { // Close all open tags & default button names
      while (bbcode[0]) {
         butnumber = arraypop(bbcode) - 1;
         txtarea.value += bbtags[butnumber + 1];
         buttext = eval('document.post.addbbcode' + butnumber + '.value');
         eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
      }
      imageTag = false; // All tags are closed including image tags :D
      txtarea.focus();
      return;
   }

   if ((clientVer >= 4) && is_ie && is_win)
   {
      theSelection = document.selection.createRange().text; // Get text selection
      if (theSelection) {
         // Add tags around selection
         document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
         txtarea.focus();
         theSelection = '';
         return;
      }
   }
   else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
   {
      mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]);
      return;
   }

   // Find last occurance of an open tag the same as the one just clicked
   for (i = 0; i < bbcode.length; i++) {
      if (bbcode[i] == bbnumber+1) {
         bblast = i;
         donotinsert = true;
      }
   }

   if (donotinsert) {      // Close all open tags up to the one just clicked & default button names
      while (bbcode[bblast]) {
            butnumber = arraypop(bbcode) - 1;
            txtarea.value += bbtags[butnumber + 1];
            buttext = eval('document.post.addbbcode' + butnumber + '.value');
            eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
            imageTag = false;
         }
         txtarea.focus();
         return;
   } else { // Open tags

      if (imageTag && (bbnumber != 14)) {      // Close image tag before adding another
         txtarea.value += bbtags[15];
         lastValue = arraypop(bbcode) - 1;   // Remove the close image tag from the list
         document.post.addbbcode14.value = "Img";   // Return button back to normal state
         imageTag = false;
      }

      // Open tag
      txtarea.value += bbtags[bbnumber];
      if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
      arraypush(bbcode,bbnumber+1);
      eval('document.post.addbbcode'+bbnumber+'.value += "*"');
      txtarea.focus();
      return;
   }
   storeCaret(txtarea);
}

// From http://www.massless.org/mozedit/
function mozWrap(txtarea, open, close)
{
   var selLength = txtarea.textLength;
   var selStart = txtarea.selectionStart;
   var selEnd = txtarea.selectionEnd;
   if (selEnd == 1 || selEnd == 2)
      selEnd = selLength;

   var s1 = (txtarea.value).substring(0,selStart);
   var s2 = (txtarea.value).substring(selStart, selEnd)
   var s3 = (txtarea.value).substring(selEnd, selLength);
   txtarea.value = s1 + open + s2 + close + s3;
   return;
}

// Insert at Claret position. Code from
// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
function storeCaret(textEl) {
   if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

function pn(name)
{
   sqr_show();
   var txtarea = document.post.message;
   text = '[b]' + name + '[/b]' + '\r\n';
   if (txtarea.createTextRange && txtarea.caretPos)
   {
      var caretPos = txtarea.caretPos;
      caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
      txtarea.focus();
   }
   else
   {
      txtarea.value  += text;
      txtarea.focus();
   }

}

function sqr_show_hide()
{
   var id = 'sqr';
   var item = null;

   if (document.getElementById)
   {
      item = document.getElementById(id);
   }
   else if (document.all)
   {
      item = document.all[id];
   }
   else if (document.layers)
   {
      item = document.layers[id];
   }

   if (item && item.style)
   {
      if (item.style.display == "none")
      {
         item.style.display = "";
      }
      else
      {
         item.style.display = "none";
      }
   }
   else if (item)
   {
      item.visibility = "show";
   }
}

function sqr_show()
{
   var id = 'sqr';
   var item = null;

   if (document.getElementById)
   {
      item = document.getElementById(id);
   }
   else if (document.all)
   {
      item = document.all[id];
   }
   else if (document.layers)
   {
      item = document.layers[id];
   }

   if (item && item.style)
   {
      if (item.style.display == "none")
      {
         item.style.display = "";
      }
   }
   else if (item)
   {
      item.visibility = "show";
   }
}

//-->
</script>

<!-- BEGIN switch_open_qr_yes -->
<div id="sqr" style="display: show; position: relative; ">
<!-- END switch_open_qr_yes -->
<!-- BEGIN switch_open_qr_no -->
<div id="sqr" style="display: none; position: relative; ">
<!-- END switch_open_qr_no -->
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)">

<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
   <tr>
      <th class="thHead" colspan="2" height="25"><b>{L_QUICK_REPLY}</b></th>
   </tr>
   <!-- BEGIN switch_username_select -->
   <tr>
      <td class="row1"><span class="gen"><b>{L_USERNAME}</b></span></td>
      <td class="row2"><span class="genmed"><input type="text" class="post" tabindex="1" name="username" size="25" maxlength="25" value="{USERNAME}" /></span></td>
   </tr>
   <!-- END switch_username_select -->
   <tr>
     <td class="row1" width="22%"><span class="gen"><b>{L_SUBJECT}</b></span></td>
     <td class="row2" width="78%"> <span class="gen">
      <input type="text" name="subject" size="45" maxlength="60" style="width:450px" tabindex="2" class="post" value="{SUBJECT}" />
      </span> </td>
   </tr>
   <tr>
     <td class="row1" valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr>
         <td><span class="gen"><b>{L_MESSAGE_BODY}</b></span> </td>
        </tr>
        <!-- BEGIN switch_advanced_qr -->
        <tr>
         <td valign="middle" align="center"> <br />
           <table width="100" border="0" cellspacing="0" cellpadding="5">
            <tr align="center">
              <td colspan="{S_SMILIES_COLSPAN}" class="gensmall"><b>{L_EMOTICONS}</b></td>
            </tr>
        <!-- END switch_advanced_qr -->
            <!-- BEGIN smilies_row -->
            <tr align="center" valign="middle">
              <!-- BEGIN smilies_col -->
              <td><img src="{smilies_row.smilies_col.SMILEY_IMG}" border="0" onmouseover="this.style.cursor='hand';" onclick="emoticon('{smilies_row.smilies_col.SMILEY_CODE}');" alt="{smilies_row.smilies_col.SMILEY_DESC}" title="{smilies_row.smilies_col.SMILEY_DESC}" /></td>
              <!-- END smilies_col -->
            </tr>
            <!-- END smilies_row -->
            <!-- BEGIN switch_smilies_extra -->
            <tr align="center">
              <td colspan="{S_SMILIES_COLSPAN}"><span  class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></span></td>
            </tr>
            <!-- END switch_smilies_extra -->
        <!-- BEGIN switch_advanced_qr -->
           </table>
         </td>
        </tr>
        <!-- END switch_advanced_qr -->
      </table>
     </td>
     <td class="row2" valign="top"><span class="gen"> <span class="genmed"> </span>
      <table width="450" border="0" cellspacing="0" cellpadding="2">
        <!-- BEGIN switch_advanced_qr -->
        <tr align="center" valign="middle">
         <td><span class="genmed">
           <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onClick="bbstyle(2)" onMouseOver="helpline('i')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onClick="bbstyle(6)" onMouseOver="helpline('q')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onClick="bbstyle(8)" onMouseOver="helpline('c')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onClick="bbstyle(10)" onMouseOver="helpline('l')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onClick="bbstyle(12)" onMouseOver="helpline('o')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px"  onClick="bbstyle(14)" onMouseOver="helpline('p')" />
           </span></td>
         <td><span class="genmed">
           <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
           </span></td>
        </tr>
        <tr>
         <td colspan="9">
           <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><span class="genmed"> &nbsp;{L_FONT_COLOR}:
               <select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onMouseOver="helpline('s')">
                 <option style="color:black; background-color: {T_TD_COLOR1}" value="{T_FONTCOLOR1}" class="genmed">{L_COLOR_DEFAULT}</option>
                 <option style="color:darkred; background-color: {T_TD_COLOR1}" value="darkred" class="genmed">{L_COLOR_DARK_RED}</option>
                 <option style="color:red; background-color: {T_TD_COLOR1}" value="red" class="genmed">{L_COLOR_RED}</option>
                 <option style="color:orange; background-color: {T_TD_COLOR1}" value="orange" class="genmed">{L_COLOR_ORANGE}</option>
                 <option style="color:brown; background-color: {T_TD_COLOR1}" value="brown" class="genmed">{L_COLOR_BROWN}</option>
                 <option style="color:yellow; background-color: {T_TD_COLOR1}" value="yellow" class="genmed">{L_COLOR_YELLOW}</option>
                 <option style="color:green; background-color: {T_TD_COLOR1}" value="green" class="genmed">{L_COLOR_GREEN}</option>
                 <option style="color:olive; background-color: {T_TD_COLOR1}" value="olive" class="genmed">{L_COLOR_OLIVE}</option>
                 <option style="color:cyan; background-color: {T_TD_COLOR1}" value="cyan" class="genmed">{L_COLOR_CYAN}</option>
                 <option style="color:blue; background-color: {T_TD_COLOR1}" value="blue" class="genmed">{L_COLOR_BLUE}</option>
                 <option style="color:darkblue; background-color: {T_TD_COLOR1}" value="darkblue" class="genmed">{L_COLOR_DARK_BLUE}</option>
                 <option style="color:indigo; background-color: {T_TD_COLOR1}" value="indigo" class="genmed">{L_COLOR_INDIGO}</option>
                 <option style="color:violet; background-color: {T_TD_COLOR1}" value="violet" class="genmed">{L_COLOR_VIOLET}</option>
                 <option style="color:white; background-color: {T_TD_COLOR1}" value="white" class="genmed">{L_COLOR_WHITE}</option>
                 <option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option>
               </select> &nbsp;{L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;" onMouseOver="helpline('f')">
                 <option value="0" class="genmed">{L_FONT_SIZE}</option>
                 <option value="7" class="genmed">{L_FONT_TINY}</option>
                 <option value="9" class="genmed">{L_FONT_SMALL}</option>
                 <option value="12" selected class="genmed">{L_FONT_NORMAL}</option>
                 <option value="18" class="genmed">{L_FONT_LARGE}</option>
                 <option  value="24" class="genmed">{L_FONT_HUGE}</option>
               </select>
               </span></td>
              <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td>
            </tr>
           </table>
         </td>
        </tr>
        <tr>
         <td colspan="9"> <span class="gensmall">
           <input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" />
           </span></td>
        </tr>
        <!-- END switch_advanced_qr -->
        <tr>
         <td colspan="9"><span class="gen">
           <textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);"></textarea>
           </span></td>
        </tr>
      </table>
      </span></td>
   </tr>
   <!-- BEGIN switch_advanced_qr -->
   <tr>
     <td class="row1" valign="top"><span class="gen"><b>{L_OPTIONS}</b></span><br /><span class="gensmall">{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td>
     <td class="row2"><span class="gen"> </span>
      <table cellspacing="0" cellpadding="1" border="0">
        <!-- BEGIN switch_html_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="disable_html" {S_HTML_CHECKED} />
         </td>
         <td><span class="gen">{L_DISABLE_HTML}</span></td>
        </tr>
        <!-- END switch_html_checkbox -->
        <!-- BEGIN switch_bbcode_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="disable_bbcode" {S_BBCODE_CHECKED} />
         </td>
         <td><span class="gen">{L_DISABLE_BBCODE}</span></td>
        </tr>
        <!-- END switch_bbcode_checkbox -->
        <!-- BEGIN switch_smilies_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="disable_smilies" {S_SMILIES_CHECKED} />
         </td>
         <td><span class="gen">{L_DISABLE_SMILIES}</span></td>
        </tr>
        <!-- END switch_smilies_checkbox -->
        <!-- BEGIN switch_signature_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="attach_sig" {S_SIGNATURE_CHECKED} />
         </td>
         <td><span class="gen">{L_ATTACH_SIGNATURE}</span></td>
        </tr>
        <!-- END switch_signature_checkbox -->
        <!-- BEGIN switch_notify_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="notify" {S_NOTIFY_CHECKED} />
         </td>
         <td><span class="gen">{L_NOTIFY_ON_REPLY}</span></td>
        </tr>
        <!-- END switch_notify_checkbox -->
        <!-- BEGIN switch_delete_checkbox -->
        <tr>
         <td>
           <input type="checkbox" name="delete" />
         </td>
         <td><span class="gen">{L_DELETE_POST}</span></td>
        </tr>
        <!-- END switch_delete_checkbox -->
      </table>
     </td>
   </tr>
   <!-- END switch_advanced_qr -->
   <tr>
     <td class="catBottom" colspan="2" align="center" height="28"> {S_HIDDEN_FORM_FIELDS}<input type="submit" tabindex="5" name="preview" class="mainoption" value="{L_PREVIEW}" />&nbsp;<input type="submit" accesskey="s" tabindex="6" name="post" class="mainoption" value="{L_SUBMIT}" /></td>
   </tr>
  </table>

</form>

</div>

I've looked arround for several hours and I couldn't find anything to give me a clue. I think this can be done only by a good programmer, so if someone could do the changes for me, would be very nice. icon_smile.gif Just the 3 changes required for posting.php wich it seems that I have to put in viewtopic_quickreply.tpl. icon_wink.gif Just 3 copy/paste...

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 653
Location: Texas


flag
PostPosted: Sun Jan 04, 2009 3:26 pm 
Post subject: Re: VCNP in SQR

Sylver Cheetah 53 wrote:
I think this can be done only by a good programmer, so if someone could do the changes for me, would be very nice. icon_smile.gif

You are assuming that someone will (1) have the skills to do what you are asking and (2) have the time to thoroughly reading two MODs by two different coders and (3) have the interest in actually making it work. icon_smile.gif In my opinion your best option is to get one of the two coders that wrote one of the MODs to help you out. At least that way they're already familiar with one of the two MODs you are trying to combine...

_________________
phpBBDoctor Blog
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Sun Jan 04, 2009 3:45 pm 
Post subject: Re: VCNP in SQR

I already done it, I even write on VCNP support board, but no answear. icon_sad.gif
_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Mon Jan 05, 2009 8:54 pm 
Post subject: Re: VCNP in SQR

I got a response for the guy who written SQR.
a13n.org wrote:
Unfortunately I have no solution for you, but if you have small
experience in php programming you can try modify SQR to work together
with Visual Confirmation on New Posters.
You need modify two files (viewtopic_quickreply.php and
viewtopic_quickreply.tpl) and make similar changes in them: in the
viewtopic_quickreply.php like in posting.php, and
viewtopic_quickreply.tpl like in posting_body.tpl

I am not a PHP programmer, I tryed but I couldn't so somebody please do it for me. I will pay. icon_wink.gif Or maybe... not, but at least I'll say "thanks". icon_biggrin.gif
This is the changes required for posting.php:
Code:
#-----[ FIND ]--------------------------------------
#

//
// End session management
//

#
#-----[ AFTER, ADD ]--------------------------------------
#

//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
require_once($phpbb_root_path . 'mods/vc_newposts/vc_newposts.' . $phpEx);
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

#
#-----[ FIND ]--------------------------------------
#

         prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length);

#
#-----[ AFTER, ADD ]--------------------------------------
#

//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
         $vc_newposts->check_fields();
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

#
#-----[ FIND ]--------------------------------------
#

//
// Topic review
//

#
#-----[ BEFORE, ADD ]--------------------------------------
#

//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
$vc_newposts->show_field();
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

This is posting.php WITH CHANGES ALREADY DONE:
Code:
<?php
// This file modified for Visual Confirmation on New Posters
/***************************************************************************
*                                posting.php
*                            -------------------
*   begin                : Saturday, Feb 13, 2001
*   copyright            : (C) 2001 The phpBB Group
*   email                : support@phpbb.com
*
*   $Id: posting.php,v 1.159.2.30 2006/12/16 13:11:24 acydburn Exp $
*
*
***************************************************************************/

/***************************************************************************
*
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/functions_post.'.$phpEx);

//
// Check and set various parameters
//
$params = array('submit' => 'post', 'preview' => 'preview', 'delete' => 'delete', 'poll_delete' => 'poll_delete', 'poll_add' => 'add_poll_option', 'poll_edit' => 'edit_poll_option', 'mode' => 'mode');
while( list($var, $param) = @each($params) )
{
   if ( !empty($HTTP_POST_VARS[$param]) || !empty($HTTP_GET_VARS[$param]) )
   {
      $$var = ( !empty($HTTP_POST_VARS[$param]) ) ? htmlspecialchars($HTTP_POST_VARS[$param]) : htmlspecialchars($HTTP_GET_VARS[$param]);
   }
   else
   {
      $$var = '';
   }
}

$confirm = isset($HTTP_POST_VARS['confirm']) ? true : false;
$sid = (isset($HTTP_POST_VARS['sid'])) ? $HTTP_POST_VARS['sid'] : 0;

$params = array('forum_id' => POST_FORUM_URL, 'topic_id' => POST_TOPIC_URL, 'post_id' => POST_POST_URL);
while( list($var, $param) = @each($params) )
{
   if ( !empty($HTTP_POST_VARS[$param]) || !empty($HTTP_GET_VARS[$param]) )
   {
      $$var = ( !empty($HTTP_POST_VARS[$param]) ) ? intval($HTTP_POST_VARS[$param]) : intval($HTTP_GET_VARS[$param]);
   }
   else
   {
      $$var = '';
   }
}

$refresh = $preview || $poll_add || $poll_edit || $poll_delete;
$orig_word = $replacement_word = array();

//
// Set topic type
//
$topic_type = ( !empty($HTTP_POST_VARS['topictype']) ) ? intval($HTTP_POST_VARS['topictype']) : POST_NORMAL;
$topic_type = ( in_array($topic_type, array(POST_NORMAL, POST_STICKY, POST_ANNOUNCE)) ) ? $topic_type : POST_NORMAL;

//
// If the mode is set to topic review then output
// that review ...
//
if ( $mode == 'topicreview' )
{
   require($phpbb_root_path . 'includes/topic_review.'.$phpEx);

   topic_review($topic_id, false);
   exit;
}
else if ( $mode == 'smilies' )
{
   generate_smilies('window', PAGE_POSTING);
   exit;
}

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_POSTING);
init_userprefs($userdata);
//
// End session management
//

//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
require_once($phpbb_root_path . 'mods/vc_newposts/vc_newposts.' . $phpEx);
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

if ( $userdata['user_timezone'] == '-12' )
  {
     die('Nu pute&#355;i posta deoarece a&#355;i ales timpul zonal GMT-12. Acesta este interzis deoarece este frecvent utilizat de robo&#355;i. Reveni&#355;i la profil &#351;i alege&#355;i o alt&#259; op&#355;iune. V&#259; mul&#355;umim.');
  }

//
// Was cancel pressed? If so then redirect to the appropriate
// page, no point in continuing with any further checks
//
if ( isset($HTTP_POST_VARS['cancel']) )
{
   if ( $post_id )
   {
      $redirect = "viewtopic.$phpEx?" . POST_POST_URL . "=$post_id";
      $post_append = "#$post_id";
   }
   else if ( $topic_id )
   {
      $redirect = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id";
      $post_append = '';
   }
   else if ( $forum_id )
   {
      $redirect = "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id";
      $post_append = '';
   }
   else
   {
      $redirect = "index.$phpEx";
      $post_append = '';
   }

   redirect(append_sid($redirect, true) . $post_append);
}

//
// What auth type do we need to check?
//
$is_auth = array();
switch( $mode )
{
   case 'newtopic':
      if ( $topic_type == POST_ANNOUNCE )
      {
         $is_auth_type = 'auth_announce';
      }
      else if ( $topic_type == POST_STICKY )
      {
         $is_auth_type = 'auth_sticky';
      }
      else
      {
         $is_auth_type = 'auth_post';
      }
      break;
   case 'reply':
   case 'quote':
      $is_auth_type = 'auth_reply';
      break;
   case 'editpost':
      $is_auth_type = 'auth_edit';
      break;
   case 'delete':
   case 'poll_delete':
      $is_auth_type = 'auth_delete';
      break;
   case 'vote':
      $is_auth_type = 'auth_vote';
      break;
   case 'topicreview':
      $is_auth_type = 'auth_read';
      break;
   default:
      message_die(GENERAL_MESSAGE, $lang['No_post_mode']);
      break;
}

//
// Here we do various lookups to find topic_id, forum_id, post_id etc.
// Doing it here prevents spoofing (eg. faking forum_id, topic_id or post_id
//
$error_msg = '';
$post_data = array();
switch ( $mode )
{
   case 'newtopic':
      if ( empty($forum_id) )
      {
         message_die(GENERAL_MESSAGE, $lang['Forum_not_exist']);
      }

      $sql = "SELECT *
         FROM " . FORUMS_TABLE . "
         WHERE forum_id = $forum_id";
      break;

   case 'reply':
   case 'vote':
      if ( empty( $topic_id) )
      {
         message_die(GENERAL_MESSAGE, $lang['No_topic_id']);
      }

      $sql = "SELECT f.*, t.topic_status, t.topic_title, t.topic_type 
         FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t
         WHERE t.topic_id = $topic_id
            AND f.forum_id = t.forum_id";
      break;

   case 'quote':
   case 'editpost':
   case 'delete':
   case 'poll_delete':
      if ( empty($post_id) )
      {
         message_die(GENERAL_MESSAGE, $lang['No_post_id']);
      }

      $select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, p.post_time, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid" : '';
      $from_sql = ( !$submit ) ? ", " . POSTS_TEXT_TABLE . " pt, " . USERS_TABLE . " u" : '';
      $where_sql = ( !$submit ) ? "AND pt.post_id = p.post_id AND u.user_id = p.poster_id" : '';

      $sql = "SELECT f.*, t.topic_id, t.topic_status, t.topic_type, t.topic_first_post_id, t.topic_last_post_id, t.topic_vote, p.post_id, p.poster_id" . $select_sql . "
         FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f" . $from_sql . "
         WHERE p.post_id = $post_id
            AND t.topic_id = p.topic_id
            AND f.forum_id = p.forum_id
            $where_sql";
      break;

   default:
      message_die(GENERAL_MESSAGE, $lang['No_valid_mode']);
}

if ( ($result = $db->sql_query($sql)) && ($post_info = $db->sql_fetchrow($result)) )
{
   $db->sql_freeresult($result);

   $forum_id = $post_info['forum_id'];
   $forum_name = $post_info['forum_name'];

   $is_auth = auth(AUTH_ALL, $forum_id, $userdata, $post_info);

   if ( $post_info['forum_status'] == FORUM_LOCKED && !$is_auth['auth_mod'])
   {
      message_die(GENERAL_MESSAGE, $lang['Forum_locked']);
   }
   else if ( $mode != 'newtopic' && $post_info['topic_status'] == TOPIC_LOCKED && !$is_auth['auth_mod'])
   {
      message_die(GENERAL_MESSAGE, $lang['Topic_locked']);
   }

   //
   // BEGIN - Limited post edit time MOD
   //
   if ( $mode == 'editpost' && !$is_auth['auth_mod'] && $board_config['edit_time'] != '0' && !$submit)
   {
      $current_time = time();
      $difference_sec = $current_time - $post_info['post_time'] ;
      $difference_min = ($current_time - $post_info['post_time']) / 60;
      if ($difference_min > $board_config['edit_time'] )
      {
         $message = sprintf($lang['edit_time_past'],$board_config['edit_time']) . '<br /><br />' . sprintf($lang['Click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
         message_die(GENERAL_MESSAGE, $message);
      }
   }

   //
   // END - Limited post edit time MOD
   //

   if ( $mode == 'editpost' || $mode == 'delete' || $mode == 'poll_delete' )
   {
      $topic_id = $post_info['topic_id'];

      $post_data['poster_post'] = ( $post_info['poster_id'] == $userdata['user_id'] ) ? true : false;
      $post_data['first_post'] = ( $post_info['topic_first_post_id'] == $post_id ) ? true : false;
      $post_data['last_post'] = ( $post_info['topic_last_post_id'] == $post_id ) ? true : false;
      $post_data['last_topic'] = ( $post_info['forum_last_post_id'] == $post_id ) ? true : false;
      $post_data['has_poll'] = ( $post_info['topic_vote'] ) ? true : false;
      $post_data['topic_type'] = $post_info['topic_type'];
      $post_data['poster_id'] = $post_info['poster_id'];

      if ( $post_data['first_post'] && $post_data['has_poll'] )
      {
         $sql = "SELECT *
            FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr
            WHERE vd.topic_id = $topic_id
               AND vr.vote_id = vd.vote_id
            ORDER BY vr.vote_option_id";
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not obtain vote data for this topic', '', __LINE__, __FILE__, $sql);
         }

         $poll_options = array();
         $poll_results_sum = 0;
         if ( $row = $db->sql_fetchrow($result) )
         {
            $poll_title = $row['vote_text'];
            $poll_id = $row['vote_id'];
            $poll_length = $row['vote_length'] / 86400;

            do
            {
               $poll_options[$row['vote_option_id']] = $row['vote_option_text'];
               $poll_results_sum += $row['vote_result'];
            }
            while ( $row = $db->sql_fetchrow($result) );
         }
         $db->sql_freeresult($result);

         $post_data['edit_poll'] = ( ( !$poll_results_sum || $is_auth['auth_mod'] ) && $post_data['first_post'] ) ? true : 0;
      }
      else
      {
         $post_data['edit_poll'] = ($post_data['first_post'] && $is_auth['auth_pollcreate']) ? true : false;
      }
      
      //
      // Can this user edit/delete the post/poll?
      //
      if ( $post_info['poster_id'] != $userdata['user_id'] && !$is_auth['auth_mod'] )
      {
         $message = ( $delete || $mode == 'delete' ) ? $lang['Delete_own_posts'] : $lang['Edit_own_posts'];
         $message .= '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');

         message_die(GENERAL_MESSAGE, $message);
      }
      else if ( !$post_data['last_post'] && !$is_auth['auth_mod'] && ( $mode == 'delete' || $delete ) )
      {
         message_die(GENERAL_MESSAGE, $lang['Cannot_delete_replied']);
      }
      else if ( !$post_data['edit_poll'] && !$is_auth['auth_mod'] && ( $mode == 'poll_delete' || $poll_delete ) )
      {
         message_die(GENERAL_MESSAGE, $lang['Cannot_delete_poll']);
      }
   }
   else
   {
      if ( $mode == 'quote' )
      {
         $topic_id = $post_info['topic_id'];
      }
      if ( $mode == 'newtopic' )
      {
         $post_data['topic_type'] = POST_NORMAL;
      }

      $post_data['first_post'] = ( $mode == 'newtopic' ) ? true : 0;
      $post_data['last_post'] = false;
      $post_data['has_poll'] = false;
      $post_data['edit_poll'] = false;
   }
   if ( $mode == 'poll_delete' && !isset($poll_id) )
   {
      message_die(GENERAL_MESSAGE, $lang['No_such_post']);
   }
}
else
{
   message_die(GENERAL_MESSAGE, $lang['No_such_post']);
}

//
// The user is not authed, if they're not logged in then redirect
// them, else show them an error message
//
if ( !$is_auth[$is_auth_type] )
{
   if ( $userdata['session_logged_in'] )
   {
      message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_' . $is_auth_type], $is_auth[$is_auth_type . "_type"]));
   }

   switch( $mode )
   {
      case 'newtopic':
         $redirect = "mode=newtopic&" . POST_FORUM_URL . "=" . $forum_id;
         break;
      case 'reply':
      case 'topicreview':
         $redirect = "mode=reply&" . POST_TOPIC_URL . "=" . $topic_id;
         break;
      case 'quote':
      case 'editpost':
         $redirect = "mode=quote&" . POST_POST_URL ."=" . $post_id;
         break;
   }

   redirect(append_sid("login.$phpEx?redirect=posting.$phpEx&" . $redirect, true));
}

//
// Set toggles for various options
//
if ( !$board_config['allow_html'] )
{
   $html_on = 0;
}
else
{
   $html_on = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['disable_html']) ) ? 0 : TRUE ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_html'] : $userdata['user_allowhtml'] );
}

if ( !$board_config['allow_bbcode'] )
{
   $bbcode_on = 0;
}
else
{
   $bbcode_on = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['disable_bbcode']) ) ? 0 : TRUE ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_bbcode'] : $userdata['user_allowbbcode'] );
}

if ( !$board_config['allow_smilies'] )
{
   $smilies_on = 0;
}
else
{
   $smilies_on = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['disable_smilies']) ) ? 0 : TRUE ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_smilies'] : $userdata['user_allowsmile'] );
}

if ( ($submit || $refresh) && $is_auth['auth_read'])
{
   $notify_user = ( !empty($HTTP_POST_VARS['notify']) ) ? TRUE : 0;
}
else
{
   if ( $mode != 'newtopic' && $userdata['session_logged_in'] && $is_auth['auth_read'] )
   {
      $sql = "SELECT topic_id
         FROM " . TOPICS_WATCH_TABLE . "
         WHERE topic_id = $topic_id
            AND user_id = " . $userdata['user_id'];
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, 'Could not obtain topic watch information', '', __LINE__, __FILE__, $sql);
      }

      $notify_user = ( $db->sql_fetchrow($result) ) ? TRUE : $userdata['user_notify'];
      $db->sql_freeresult($result);
   }
   else
   {
      $notify_user = ( $userdata['session_logged_in'] && $is_auth['auth_read'] ) ? $userdata['user_notify'] : 0;
   }
}

$attach_sig = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['attach_sig']) ) ? TRUE : 0 ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? 0 : $userdata['user_attachsig'] );

// --------------------
//  What shall we do?
//
if ( ( $delete || $poll_delete || $mode == 'delete' ) && !$confirm )
{
   //
   // Confirm deletion
   //
   $s_hidden_fields = '<input type="hidden" name="' . POST_POST_URL . '" value="' . $post_id . '" />';
   $s_hidden_fields .= ( $delete || $mode == "delete" ) ? '<input type="hidden" name="mode" value="delete" />' : '<input type="hidden" name="mode" value="poll_delete" />';
   $s_hidden_fields .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';

   $l_confirm = ( $delete || $mode == 'delete' ) ? $lang['Confirm_delete'] : $lang['Confirm_delete_poll'];

   //
   // Output confirmation page
   //
   include($phpbb_root_path . 'includes/page_header.'.$phpEx);

   $template->set_filenames(array(
      'confirm_body' => 'confirm_body.tpl')
   );

   $template->assign_vars(array(
      'MESSAGE_TITLE' => $lang['Information'],
      'MESSAGE_TEXT' => $l_confirm,

      'L_YES' => $lang['Yes'],
      'L_NO' => $lang['No'],

      'S_CONFIRM_ACTION' => append_sid("posting.$phpEx"),
      'S_HIDDEN_FIELDS' => $s_hidden_fields)
   );

   $template->pparse('confirm_body');

   include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
else if ( $mode == 'vote' )
{
   //
   // Vote in a poll
   //
   if ( !empty($HTTP_POST_VARS['vote_id']) )
   {
      $vote_option_id = intval($HTTP_POST_VARS['vote_id']);

      $sql = "SELECT vd.vote_id   
         FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr
         WHERE vd.topic_id = $topic_id
            AND vr.vote_id = vd.vote_id
            AND vr.vote_option_id = $vote_option_id
         GROUP BY vd.vote_id";
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, 'Could not obtain vote data for this topic', '', __LINE__, __FILE__, $sql);
      }

      if ( $vote_info = $db->sql_fetchrow($result) )
      {
         $vote_id = $vote_info['vote_id'];

         $sql = "SELECT *
            FROM " . VOTE_USERS_TABLE . " 
            WHERE vote_id = $vote_id
               AND vote_user_id = " . $userdata['user_id'];
         if ( !($result2 = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, 'Could not obtain user vote data for this topic', '', __LINE__, __FILE__, $sql);
         }

         if ( !($row = $db->sql_fetchrow($result2)) )
         {
            $sql = "UPDATE " . VOTE_RESULTS_TABLE . "
               SET vote_result = vote_result + 1
               WHERE vote_id = $vote_id
                  AND vote_option_id = $vote_option_id";
            if ( !$db->sql_query($sql, BEGIN_TRANSACTION) )
            {
               message_die(GENERAL_ERROR, 'Could not update poll result', '', __LINE__, __FILE__, $sql);
            }

            $sql = "INSERT INTO " . VOTE_USERS_TABLE . " (vote_id, vote_user_id, vote_user_ip)
               VALUES ($vote_id, " . $userdata['user_id'] . ", '$user_ip')";
            if ( !$db->sql_query($sql, END_TRANSACTION) )
            {
               message_die(GENERAL_ERROR, "Could not insert user_id for poll", "", __LINE__, __FILE__, $sql);
            }

            $message = $lang['Vote_cast'];
         }
         else
         {
            $message = $lang['Already_voted'];
         }
         $db->sql_freeresult($result2);
      }
      else
      {
         $message = $lang['No_vote_option'];
      }
      $db->sql_freeresult($result);

      $template->assign_vars(array(
         'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">')
      );
      $message .=  '<br /><br />' . sprintf($lang['Click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
      message_die(GENERAL_MESSAGE, $message);
   }
   else
   {
      redirect(append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true));
   }
}
else if ( $submit || $confirm )
{
   //
   // Submit post/vote (newtopic, edit, reply, etc.)
   //
   $return_message = '';
   $return_meta = '';

   // session id check
   if ($sid == '' || $sid != $userdata['session_id'])
   {
      $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['Session_invalid'] : $lang['Session_invalid'];
   }

   switch ( $mode )
   {
      case 'editpost':
      case 'newtopic':
      case 'reply':
         $username = ( !empty($HTTP_POST_VARS['username']) ) ? $HTTP_POST_VARS['username'] : '';
         $subject = ( !empty($HTTP_POST_VARS['subject']) ) ? trim($HTTP_POST_VARS['subject']) : '';
         $message = ( !empty($HTTP_POST_VARS['message']) ) ? $HTTP_POST_VARS['message'] : '';
         $poll_title = ( isset($HTTP_POST_VARS['poll_title']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_title'] : '';
         $poll_options = ( isset($HTTP_POST_VARS['poll_option_text']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_option_text'] : '';
         $poll_length = ( isset($HTTP_POST_VARS['poll_length']) && $is_auth['auth_pollcreate'] ) ? $HTTP_POST_VARS['poll_length'] : '';
         $bbcode_uid = '';

         prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length);
//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
         $vc_newposts->check_fields();
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

         if ( $error_msg == '' )
         {
            $topic_type = ( $topic_type != $post_data['topic_type'] && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type;

            submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length);
         }
         break;

      case 'delete':
      case 'poll_delete':
         if ($error_msg != '')
         {
            message_die(GENERAL_MESSAGE, $error_msg);
         }

         delete_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id);
         break;
   }

   if ( $error_msg == '' )
   {
      if ( $mode != 'editpost' )
      {
         $user_id = ( $mode == 'reply' || $mode == 'newtopic' ) ? $userdata['user_id'] : $post_data['poster_id'];
         update_post_stats($mode, $post_data, $forum_id, $topic_id, $post_id, $user_id);
      }

      if ($error_msg == '' && $mode != 'poll_delete')
      {
         user_notification($mode, $post_data, $post_info['topic_title'], $forum_id, $topic_id, $post_id, $notify_user);
      }

      //START MOD Keep_unread_2
      if ( $mode == 'newtopic' || $mode == 'reply' || $mode == 'quote' || ($mode == 'editpost' && $post_data['last_post']) )
      {
         //Get old tracking time and set set new default.
         $tracking_time = $board_config['tracking_unreads'][$topic_id];
         $board_config['tracking_unreads'][$topic_id] = time();
         //If the next post in this topic, beyond my "unread time", is not THIS post,
         //then mark the topic UNread at that post.
         //This covers situations where I reply to posts in the middle of a topic
         //and where people respond whilst I write a reply
         if ($tracking_time)
         {
            $sql = "SELECT post_id, post_time
            FROM "  . POSTS_TABLE . "
            WHERE post_time > $tracking_time
            AND topic_id = $topic_id
            ORDER BY post_time
            LIMIT 1";
            if ( !($result = $db->sql_query($sql)) )
            {
               message_die(GENERAL_ERROR, 'Could not query latest post information', '', __LINE__, __FILE__, $sql);
            }
            $row = $db->sql_fetchrow($result);
            if ($row['post_id'] != $post_id && $row['post_time'] > 0)
            {
               $board_config['tracking_unreads'][$topic_id] = $row['post_time'] - 1; //-1 marks the found post as unread
            }
         }
         write_cookies($userdata);
      }
      //END MOD Keep_unread_2


      $template->assign_vars(array(
         'META' => $return_meta)
      );
      message_die(GENERAL_MESSAGE, $return_message);
   }
}

if( $refresh || isset($HTTP_POST_VARS['del_poll_option']) || $error_msg != '' )
{
   $username = ( !empty($HTTP_POST_VARS['username']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['username']))) : '';
   $subject = ( !empty($HTTP_POST_VARS['subject']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['subject']))) : '';
   $message = ( !empty($HTTP_POST_VARS['message']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['message']))) : '';

   $poll_title = ( !empty($HTTP_POST_VARS['poll_title']) ) ? htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['poll_title']))) : '';
   $poll_length = ( isset($HTTP_POST_VARS['poll_length']) ) ? max(0, intval($HTTP_POST_VARS['poll_length'])) : 0;

   $poll_options = array();
   if ( !empty($HTTP_POST_VARS['poll_option_text']) )
   {
      while( list($option_id, $option_text) = @each($HTTP_POST_VARS['poll_option_text']) )
      {
         if( isset($HTTP_POST_VARS['del_poll_option'][$option_id]) )
         {
            unset($poll_options[$option_id]);
         }
         else if ( !empty($option_text) )
         {
            $poll_options[intval($option_id)] = htmlspecialchars(trim(stripslashes($option_text)));
         }
      }
   }

   if ( isset($poll_add) && !empty($HTTP_POST_VARS['add_poll_option_text']) )
   {
      $poll_options[] = htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['add_poll_option_text'])));
   }

   if ( $mode == 'newtopic' || $mode == 'reply')
   {
      $user_sig = ( $userdata['user_sig'] != '' && $board_config['allow_sig'] ) ? $userdata['user_sig'] : '';
   }
   else if ( $mode == 'editpost' )
   {
      $user_sig = ( $post_info['user_sig'] != '' && $board_config['allow_sig'] ) ? $post_info['user_sig'] : '';
      $userdata['user_sig_bbcode_uid'] = $post_info['user_sig_bbcode_uid'];
   }
   
   if( $preview )
   {
      $orig_word = array();
      $replacement_word = array();
      obtain_word_list($orig_word, $replacement_word);

      $bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : '';
      $preview_message = stripslashes(prepare_message(addslashes(unprepare_message($message)), $html_on, $bbcode_on, $smilies_on, $bbcode_uid));
      $preview_subject = $subject;
      $preview_username = $username;

      //
      // Finalise processing as per viewtopic
      //
      if( !$html_on )
      {
         if( $user_sig != '' || !$userdata['user_allowhtml'] )
         {
            $user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', '&lt;\2&gt;', $user_sig);
         }
      }

      if( $attach_sig && $user_sig != '' && $userdata['user_sig_bbcode_uid'] )
      {
         $user_sig = bbencode_second_pass($user_sig, $userdata['user_sig_bbcode_uid']);
      }

      if( $bbcode_on )
      {
         $preview_message = bbencode_second_pass($preview_message, $bbcode_uid);
      }

      if( !empty($orig_word) )
      {
         $preview_username = ( !empty($username) ) ? preg_replace($orig_word, $replacement_word, $preview_username) : '';
         $preview_subject = ( !empty($subject) ) ? preg_replace($orig_word, $replacement_word, $preview_subject) : '';
         $preview_message = ( !empty($preview_message) ) ? preg_replace($orig_word, $replacement_word, $preview_message) : '';
      }

      if( $user_sig != '' )
      {
         $user_sig = make_clickable($user_sig);
      }
      $preview_message = make_clickable($preview_message);

      if( $smilies_on )
      {
         if( $userdata['user_allowsmile'] && $user_sig != '' )
         {
            $user_sig = smilies_pass($user_sig);
         }

         $preview_message = smilies_pass($preview_message);
      }

      if( $attach_sig && $user_sig != '' )
      {
         $preview_message = $preview_message . '<br /><br />_________________<br />' . $user_sig;
      }

      $preview_message = str_replace("\n", '<br />', $preview_message);

      $template->set_filenames(array(
         'preview' => 'posting_preview.tpl')
      );

      $template->assign_vars(array(
         'TOPIC_TITLE' => $preview_subject,
         'POST_SUBJECT' => $preview_subject,
         'POSTER_NAME' => $preview_username,
         'POST_DATE' => create_date($board_config['default_dateformat'], time(), $board_config['board_timezone']),
         'MESSAGE' => $preview_message,

         'L_POST_SUBJECT' => $lang['Post_subject'],
         'L_PREVIEW' => $lang['Preview'],
         'L_POSTED' => $lang['Posted'],
         'L_POST' => $lang['Post'])
      );
      $template->assign_var_from_handle('POST_PREVIEW_BOX', 'preview');
   }
   else if( $error_msg != '' )
   {
      $template->set_filenames(array(
         'reg_header' => 'error_body.tpl')
      );
      $template->assign_vars(array(
         'ERROR_MESSAGE' => $error_msg)
      );
      $template->assign_var_from_handle('ERROR_BOX', 'reg_header');
   }
}
else
{
   //
   // User default entry point
   //
   if ( $mode == 'newtopic' )
   {
      $user_sig = ( $userdata['user_sig'] != '' ) ? $userdata['user_sig'] : '';

      $username = ($userdata['session_logged_in']) ? $userdata['username'] : '';
      $poll_title = '';
      $poll_length = '';
      $subject = '';
      $message = '';
   }
   else if ( $mode == 'reply' )
   {
      $user_sig = ( $userdata['user_sig'] != '' ) ? $userdata['user_sig'] : '';

      $username = ( $userdata['session_logged_in'] ) ? $userdata['username'] : '';
      $subject = '';
      $message = '';

   }
   else if ( $mode == 'quote' || $mode == 'editpost' )
   {
      $subject = ( $post_data['first_post'] ) ? $post_info['topic_title'] : $post_info['post_subject'];
      $message = $post_info['post_text'];

      if ( $mode == 'editpost' )
      {
         $attach_sig = ( $post_info['enable_sig'] && $post_info['user_sig'] != '' ) ? TRUE : 0;
         $user_sig = $post_info['user_sig'];

         $html_on = ( $post_info['enable_html'] ) ? true : false;
         $bbcode_on = ( $post_info['enable_bbcode'] ) ? true : false;
         $smilies_on = ( $post_info['enable_smilies'] ) ? true : false;
      }
      else
      {
         $attach_sig = ( $userdata['user_attachsig'] ) ? TRUE : 0;
         $user_sig = $userdata['user_sig'];
      }

      if ( $post_info['bbcode_uid'] != '' )
      {
         $message = preg_replace('/\:(([a-z0-9]:)?)' . $post_info['bbcode_uid'] . '/s', '', $message);
      }

      $message = str_replace('<', '&lt;', $message);
      $message = str_replace('>', '&gt;', $message);
      $message = str_replace('<br />', "\n", $message);

      if ( $mode == 'quote' )
      {
         $orig_word = array();
         $replacement_word = array();
         obtain_word_list($orig_word, $replace_word);

         $msg_date =  create_date($board_config['default_dateformat'], $postrow['post_time'], $board_config['board_timezone']);

         // Use trim to get rid of spaces placed there by MS-SQL 2000
         $quote_username = ( trim($post_info['post_username']) != '' ) ? $post_info['post_username'] : $post_info['username'];
         $message = '[quote="' . $quote_username . '"]' . $message . '[/quote]';

         if ( !empty($orig_word) )
         {
            $subject = ( !empty($subject) ) ? preg_replace($orig_word, $replace_word, $subject) : '';
            $message = ( !empty($message) ) ? preg_replace($orig_word, $replace_word, $message) : '';
         }

         if ( !preg_match('/^Re:/', $subject) && strlen($subject) > 0 )
         {
            $subject = 'Re: ' . $subject;
         }

         $mode = 'reply';
      }
      else
      {
         $username = ( $post_info['user_id'] == ANONYMOUS && !empty($post_info['post_username']) ) ? $post_info['post_username'] : '';
      }
   }
}

//
// Signature toggle selection
//
if( $user_sig != '' )
{
   $template->assign_block_vars('switch_signature_checkbox', array());
}

//
// HTML toggle selection
//
if ( $board_config['allow_html'] )
{
   $html_status = $lang['HTML_is_ON'];
   $template->assign_block_vars('switch_html_checkbox', array());
}
else
{
   $html_status = $lang['HTML_is_OFF'];
}

//
// BBCode toggle selection
//
if ( $board_config['allow_bbcode'] )
{
   $bbcode_status = $lang['BBCode_is_ON'];
   $template->assign_block_vars('switch_bbcode_checkbox', array());
}
else
{
   $bbcode_status = $lang['BBCode_is_OFF'];
}

//
// Smilies toggle selection
//
if ( $board_config['allow_smilies'] )
{
   $smilies_status = $lang['Smilies_are_ON'];
   $template->assign_block_vars('switch_smilies_checkbox', array());
}
else
{
   $smilies_status = $lang['Smilies_are_OFF'];
}

if( !$userdata['session_logged_in'] || ( $mode == 'editpost' && $post_info['poster_id'] == ANONYMOUS ) )
{
   $template->assign_block_vars('switch_username_select', array());
}

//
// Notify checkbox - only show if user is logged in
//
if ( $userdata['session_logged_in'] && $is_auth['auth_read'] )
{
   if ( $mode != 'editpost' || ( $mode == 'editpost' && $post_info['poster_id'] != ANONYMOUS ) )
   {
      $template->assign_block_vars('switch_notify_checkbox', array());
   }
}

//
// Delete selection
//
if ( $mode == 'editpost' && ( ( $is_auth['auth_delete'] && $post_data['last_post'] && ( !$post_data['has_poll'] || $post_data['edit_poll'] ) ) || $is_auth['auth_mod'] ) )
{
   $template->assign_block_vars('switch_delete_checkbox', array());
}

//
// Topic type selection
//
$topic_type_toggle = '';
if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) )
{
   $template->assign_block_vars('switch_type_toggle', array());

   if( $is_auth['auth_sticky'] )
   {
      $topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_STICKY . '"';
      if ( $post_data['topic_type'] == POST_STICKY || $topic_type == POST_STICKY )
      {
         $topic_type_toggle .= ' checked="checked"';
      }
      $topic_type_toggle .= ' /> ' . $lang['Post_Sticky'] . '&nbsp;&nbsp;';
   }

   if( $is_auth['auth_announce'] )
   {
      $topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_ANNOUNCE . '"';
      if ( $post_data['topic_type'] == POST_ANNOUNCE || $topic_type == POST_ANNOUNCE )
      {
         $topic_type_toggle .= ' checked="checked"';
      }
      $topic_type_toggle .= ' /> ' . $lang['Post_Announcement'] . '&nbsp;&nbsp;';
   }

   if ( $topic_type_toggle != '' )
   {
      $topic_type_toggle = $lang['Post_topic_as'] . ': <input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( ( $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL ) ? ' checked="checked"' : '' ) . ' /> ' . $lang['Post_Normal'] . '&nbsp;&nbsp;' . $topic_type_toggle;
   }
}

$hidden_form_fields = '<input type="hidden" name="mode" value="' . $mode . '" />';
$hidden_form_fields .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';

switch( $mode )
{
   case 'newtopic':
      $page_title = $lang['Post_a_new_topic'];
      $hidden_form_fields .= '<input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '" />';
      break;

   case 'reply':
      $page_title = $lang['Post_a_reply'];
      $hidden_form_fields .= '<input type="hidden" name="' . POST_TOPIC_URL . '" value="' . $topic_id . '" />';
      break;

   case 'editpost':
      $page_title = $lang['Edit_Post'];
      $hidden_form_fields .= '<input type="hidden" name="' . POST_POST_URL . '" value="' . $post_id . '" />';
      break;
}

// Generate smilies listing for page output
generate_smilies('inline', PAGE_POSTING);

//
// Include page header
//
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

$template->set_filenames(array(
   'body' => 'posting_body.tpl',
   'pollbody' => 'posting_poll_body.tpl',
   'reviewbody' => 'posting_topic_review.tpl')
);
// Begin Simple Subforums MOD
$all_forums = array();
make_jumpbox_ref('viewforum.'.$phpEx, $forum_id, $all_forums);

$parent_id = 0;
for( $i = 0; $i < count($all_forums); $i++ )
{
   if( $all_forums[$i]['forum_id'] == $forum_id )
   {
      $parent_id = $all_forums[$i]['forum_parent'];
   }
}

if( $parent_id )
{
   for( $i = 0; $i < count($all_forums); $i++)
   {
      if( $all_forums[$i]['forum_id'] == $parent_id )
      {
         $template->assign_vars(array(
            'PARENT_FORUM'         => 1,
            'U_VIEW_PARENT_FORUM'   => append_sid("viewforum.$phpEx?" . POST_FORUM_URL .'=' . $all_forums[$i]['forum_id']),
            'PARENT_FORUM_NAME'      => $all_forums[$i]['forum_name'],
            ));
      }
   }
}
// End Simple Subforums MOD

$template->assign_vars(array(
   'FORUM_NAME' => $forum_name,
   'L_POST_A' => $page_title,
   'L_POST_SUBJECT' => $lang['Post_subject'],

   'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))
);

//
// This enables the forum/topic title to be output for posting
// but not for privmsg (where it makes no sense)
//
$template->assign_block_vars('switch_not_privmsg', array());

//
// Output the data to the template
//
$template->assign_vars(array(
   'USERNAME' => $username,
   'SUBJECT' => $subject,
   'MESSAGE' => $message,
   'HTML_STATUS' => $html_status,
   'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'),
   'SMILIES_STATUS' => $smilies_status,

   'L_SUBJECT' => $lang['Subject'],
   'L_MESSAGE_BODY' => $lang['Message_body'],
   'L_OPTIONS' => $lang['Options'],
   'L_PREVIEW' => $lang['Preview'],
   'L_SPELLCHECK' => $lang['Spellcheck'],
   'L_SUBMIT' => $lang['Submit'],
   'L_CANCEL' => $lang['Cancel'],
   'L_CONFIRM_DELETE' => $lang['Confirm_delete'],
   'L_DISABLE_HTML' => $lang['Disable_HTML_post'],
   'L_DISABLE_BBCODE' => $lang['Disable_BBCode_post'],
   'L_DISABLE_SMILIES' => $lang['Disable_Smilies_post'],
   'L_ATTACH_SIGNATURE' => $lang['Attach_signature'],
   'L_NOTIFY_ON_REPLY' => $lang['Notify'],
   'L_DELETE_POST' => $lang['Delete_post'],

   'L_BBCODE_B_HELP' => $lang['bbcode_b_help'],
   'L_BBCODE_I_HELP' => $lang['bbcode_i_help'],
   'L_BBCODE_U_HELP' => $lang['bbcode_u_help'],
   'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'],
   'L_BBCODE_C_HELP' => $lang['bbcode_c_help'],
   'L_BBCODE_L_HELP' => $lang['bbcode_l_help'],
   'L_BBCODE_O_HELP' => $lang['bbcode_o_help'],
   'L_BBCODE_P_HELP' => $lang['bbcode_p_help'],
   'L_BBCODE_W_HELP' => $lang['bbcode_w_help'],
   'L_BBCODE_A_HELP' => $lang['bbcode_a_help'],
   'L_BBCODE_S_HELP' => $lang['bbcode_s_help'],
   'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],
   'L_EMPTY_MESSAGE' => $lang['Empty_message'],

   'L_FONT_COLOR' => $lang['Font_color'],
   'L_COLOR_DEFAULT' => $lang['color_default'],
   'L_COLOR_DARK_RED' => $lang['color_dark_red'],
   'L_COLOR_RED' => $lang['color_red'],
   'L_COLOR_ORANGE' => $lang['color_orange'],
   'L_COLOR_BROWN' => $lang['color_brown'],
   'L_COLOR_YELLOW' => $lang['color_yellow'],
   'L_COLOR_GREEN' => $lang['color_green'],
   'L_COLOR_OLIVE' => $lang['color_olive'],
   'L_COLOR_CYAN' => $lang['color_cyan'],
   'L_COLOR_BLUE' => $lang['color_blue'],
   'L_COLOR_DARK_BLUE' => $lang['color_dark_blue'],
   'L_COLOR_INDIGO' => $lang['color_indigo'],
   'L_COLOR_VIOLET' => $lang['color_violet'],
   'L_COLOR_WHITE' => $lang['color_white'],
   'L_COLOR_BLACK' => $lang['color_black'],

   'L_FONT_SIZE' => $lang['Font_size'],
   'L_FONT_TINY' => $lang['font_tiny'],
   'L_FONT_SMALL' => $lang['font_small'],
   'L_FONT_NORMAL' => $lang['font_normal'],
   'L_FONT_LARGE' => $lang['font_large'],
   'L_FONT_HUGE' => $lang['font_huge'],

   'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'],
   'L_STYLES_TIP' => $lang['Styles_tip'],

   'U_VIEWTOPIC' => ( $mode == 'reply' ) ? append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&amp;postorder=desc") : '',
   'U_REVIEW_TOPIC' => ( $mode == 'reply' ) ? append_sid("posting.$phpEx?mode=topicreview&amp;" . POST_TOPIC_URL . "=$topic_id") : '',

   'S_HTML_CHECKED' => ( !$html_on ) ? 'checked="checked"' : '',
   'S_BBCODE_CHECKED' => ( !$bbcode_on ) ? 'checked="checked"' : '',
   'S_SMILIES_CHECKED' => ( !$smilies_on ) ? 'checked="checked"' : '',
   'S_SIGNATURE_CHECKED' => ( $attach_sig ) ? 'checked="checked"' : '',
   'S_NOTIFY_CHECKED' => ( $notify_user ) ? 'checked="checked"' : '',
   'S_TYPE_TOGGLE' => $topic_type_toggle,
   'S_TOPIC_ID' => $topic_id,
   'S_POST_ACTION' => append_sid("posting.$phpEx"),
   'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields)
);

//
// Poll entry switch/output
//
if( ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['edit_poll']) ) && $is_auth['auth_pollcreate'] )
{
   $template->assign_vars(array(
      'L_ADD_A_POLL' => $lang['Add_poll'], 
      'L_ADD_POLL_EXPLAIN' => $lang['Add_poll_explain'],   
      'L_POLL_QUESTION' => $lang['Poll_question'],   
      'L_POLL_OPTION' => $lang['Poll_option'], 
      'L_ADD_OPTION' => $lang['Add_option'],
      'L_UPDATE_OPTION' => $lang['Update'],
      'L_DELETE_OPTION' => $lang['Delete'],
      'L_POLL_LENGTH' => $lang['Poll_for'], 
      'L_DAYS' => $lang['Days'],
      'L_POLL_LENGTH_EXPLAIN' => $lang['Poll_for_explain'],
      'L_POLL_DELETE' => $lang['Delete_poll'],
      
      'POLL_TITLE' => $poll_title,
      'POLL_LENGTH' => $poll_length)
   );

   if( $mode == 'editpost' && $post_data['edit_poll'] && $post_data['has_poll'])
   {
      $template->assign_block_vars('switch_poll_delete_toggle', array());
   }

   if( !empty($poll_options) )
   {
      while( list($option_id, $option_text) = each($poll_options) )
      {
         $template->assign_block_vars('poll_option_rows', array(
            'POLL_OPTION' => str_replace('"', '&quot;', $option_text),

            'S_POLL_OPTION_NUM' => $option_id)
         );
      }
   }

   $template->assign_var_from_handle('POLLBOX', 'pollbody');
}

//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
$vc_newposts->show_field();
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

//
// Topic review
//
if( $mode == 'reply' && $is_auth['auth_read'] )
{
   require($phpbb_root_path . 'includes/topic_review.'.$phpEx);
   topic_review($topic_id, true);

   $template->assign_block_vars('switch_inline_mode', array());
   $template->assign_var_from_handle('TOPIC_REVIEW_BOX', 'reviewbody');
}

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>

And this is viewtopic_quickreply.php, where the same changes has to be done:

[edit]Large code block removed[/edit]

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
roadhog
Board Member



Joined: 19 Nov 2008

Posts: 95
Location: Central Texas


flag
PostPosted: Tue Jan 06, 2009 12:56 am 
Post subject: Re: VCNP in SQR

This should be real close. You didn't include the entire file, so be sure you include the rest of it, before you try this. I'm pretty sure about the first two locations where I added the code, but I'm not so sure about the exact location of the last entry, though this seems to me to be correct. I didn't test this, though.

Code:
[code:1:f917afdfcd]<?php
/***************************************************************************
* viewtopic_quickreply.php
* -------------------
* begin : Tuesday, Apr 5, 2004
* copyright : (C) 2004 Hayk Chamyan
* email : hayk@mail.ru
*
* $Header: viewtopic_quickreply.php, 8, 09.07.2005 01:12:27, Hayk Chamyan$
*
*
***************************************************************************/

if ( !defined('IN_PHPBB') )
{
die('Hacking attempt');
exit;
}

$submit = $refresh = FALSE;
$hidden_form_fields = '<input type="hidden" name="mode" value="reply" />';
$hidden_form_fields .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';
$hidden_form_fields .= '<input type="hidden" name="' . POST_TOPIC_URL . '" value="' . $topic_id . '" />';
//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
require_once($phpbb_root_path . 'mods/vc_newposts/vc_newposts.' . $phpEx);
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

//
// Set toggles for various options
//
if ( !$board_config['allow_html'] )
{
$html_on = 0;
}
else
{
$html_on = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['disable_html']) ) ? 0 : TRUE ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_html'] : $userdata['user_allowhtml'] );
}

if ( !$board_config['allow_bbcode'] )
{
$bbcode_on = 0;
}
else
{
$bbcode_on = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['disable_bbcode']) ) ? 0 : TRUE ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_bbcode'] : $userdata['user_allowbbcode'] );
}

if ( !$board_config['allow_smilies'] )
{
$smilies_on = 0;
}
else
{
$smilies_on = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['disable_smilies']) ) ? 0 : TRUE ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? $board_config['allow_smilies'] : $userdata['user_allowsmile'] );
}

if ( ($submit || $refresh) && $is_auth['auth_read'])
{
$notify_user = ( !empty($HTTP_POST_VARS['notify']) ) ? TRUE : 0;
}
else
{
if ( $userdata['session_logged_in'] && $is_auth['auth_read'] )
{
$sql = "SELECT topic_id
FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id = $topic_id
AND user_id = " . $userdata['user_id'];
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain topic watch information', '', __LINE__, __FILE__, $sql);
}

$notify_user = ( $db->sql_fetchrow($result) ) ? TRUE : $userdata['user_notify'];
$db->sql_freeresult($result);
}
else
{
$notify_user = ( $userdata['session_logged_in'] && $is_auth['auth_read'] ) ? $userdata['user_notify'] : 0;
}
}

$attach_sig = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['attach_sig']) ) ? TRUE : 0 ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? 0 : $userdata['user_attachsig'] );
//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
         $vc_newposts->check_fields();
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

$user_sig = ( $userdata['user_sig'] != '' ) ? $userdata['user_sig'] : '';

if ( (($userdata['user_quickreply_mode']==1) && ($userdata['user_id'] != ANONYMOUS)) || (($board_config['anonymous_sqr_mode']==1) && ($userdata['user_id'] == ANONYMOUS)) )
{
$template->assign_block_vars('switch_advanced_qr', array());

//
// Signature toggle selection
//
if( $user_sig != '' )
{
$template->assign_block_vars('switch_advanced_qr.switch_signature_checkbox', array());
}

//
// HTML toggle selection
//
if ( $board_config['allow_html'] )
{
$html_status = $lang['HTML_is_ON'];
$template->assign_block_vars('switch_advanced_qr.switch_html_checkbox', array());
}
else
{
$html_status = $lang['HTML_is_OFF'];
}

//
// BBCode toggle selection
//
if ( $board_config['allow_bbcode'] )
{
$bbcode_status = $lang['BBCode_is_ON'];
$template->assign_block_vars('switch_advanced_qr.switch_bbcode_checkbox', array());
}
else
{
$bbcode_status = $lang['BBCode_is_OFF'];
}

//
// Smilies toggle selection
//
if ( $board_config['allow_smilies'] )
{
$smilies_status = $lang['Smilies_are_ON'];
$template->assign_block_vars('switch_advanced_qr.switch_smilies_checkbox', array());
}
else
{
$smilies_status = $lang['Smilies_are_OFF'];
}

//
// Notify checkbox - only show if user is logged in
//
if ( $userdata['session_logged_in'] && $is_auth['auth_read'] )
{
if ( $mode != 'editpost' || ( $mode == 'editpost' && $post_info['poster_id'] != ANONYMOUS ) )
{
$template->assign_block_vars('switch_advanced_qr.switch_notify_checkbox', array());
}
}

// Generate smilies listing for page output
generate_smilies('inline', PAGE_POSTING);

$template->assign_vars(array(

'HTML_STATUS' => $html_status,
'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'),
'SMILIES_STATUS' => $smilies_status,
'L_OPTIONS' => $lang['Options'],
'L_DISABLE_HTML' => $lang['Disable_HTML_post'],
'L_DISABLE_BBCODE' => $lang['Disable_BBCode_post'],
'L_DISABLE_SMILIES' => $lang['Disable_Smilies_post'],
'L_ATTACH_SIGNATURE' => $lang['Attach_signature'],
'L_NOTIFY_ON_REPLY' => $lang['Notify'],

// javascript
'L_BBCODE_B_HELP' => $lang['bbcode_b_help'],
'L_BBCODE_I_HELP' => $lang['bbcode_i_help'],
'L_BBCODE_U_HELP' => $lang['bbcode_u_help'],
'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'],
'L_BBCODE_C_HELP' => $lang['bbcode_c_help'],
'L_BBCODE_L_HELP' => $lang['bbcode_l_help'],
'L_BBCODE_O_HELP' => $lang['bbcode_o_help'],
'L_BBCODE_P_HELP' => $lang['bbcode_p_help'],
'L_BBCODE_W_HELP' => $lang['bbcode_w_help'],
'L_BBCODE_A_HELP' => $lang['bbcode_a_help'],
'L_BBCODE_S_HELP' => $lang['bbcode_s_help'],
'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],

'L_FONT_COLOR' => $lang['Font_color'],
'L_COLOR_DEFAULT' => $lang['color_default'],
'L_COLOR_DARK_RED' => $lang['color_dark_red'],
'L_COLOR_RED' => $lang['color_red'],
'L_COLOR_ORANGE' => $lang['color_orange'],
'L_COLOR_BROWN' => $lang['color_brown'],
'L_COLOR_YELLOW' => $lang['color_yellow'],
'L_COLOR_GREEN' => $lang['color_green'],
'L_COLOR_OLIVE' => $lang['color_olive'],
'L_COLOR_CYAN' => $lang['color_cyan'],
'L_COLOR_BLUE' => $lang['color_blue'],
'L_COLOR_DARK_BLUE' => $lang['color_dark_blue'],
'L_COLOR_INDIGO' => $lang['color_indigo'],
'L_COLOR_VIOLET' => $lang['color_violet'],
'L_COLOR_WHITE' => $lang['color_white'],
'L_COLOR_BLACK' => $lang['color_black'],

'L_FONT_SIZE' => $lang['Font_size'],
'L_FONT_TINY' => $lang['font_tiny'],
'L_FONT_SMALL' => $lang['font_small'],
'L_FONT_NORMAL' => $lang['font_normal'],
'L_FONT_LARGE' => $lang['font_large'],
'L_FONT_HUGE' => $lang['font_huge'],

'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'],
'L_STYLES_TIP' => $lang['Styles_tip'],

'S_HTML_CHECKED' => ( !$html_on ) ? 'checked="checked"' : '',
'S_BBCODE_CHECKED' => ( !$bbcode_on ) ? 'checked="checked"' : '',
'S_SMILIES_CHECKED' => ( !$smilies_on ) ? 'checked="checked"' : '',
'S_SIGNATURE_CHECKED' => ( $attach_sig ) ? 'checked="checked"' : '',
'S_NOTIFY_CHECKED' => ( $notify_user ) ? 'checked="checked"' : '')
);

}
else
{
if ( !$html_on )
{
$hidden_form_fields .= '<input type="hidden" name="disable_html" value="on" />';
}
if ( !$bbcode_on )
{
$hidden_form_fields .= '<input type="hidden" name="disable_bbcode" value="on" />';
}
if ( !$smilies_on )
{
$hidden_form_fields .= '<input type="hidden" name="disable_smilies" value="on" />';
}
if ( $attach_sig )
{
$hidden_form_fields .= '<input type="hidden" name="attach_sig" value="on" />';
}
if ( $notify_user )
{
$hidden_form_fields .= '<input type="hidden" name="notify" value="on" />';
}
}

if( !$userdata['session_logged_in'] || ( $mode == 'editpost' && $post_info['poster_id'] == ANONYMOUS ) )
{
$template->assign_block_vars('switch_username_select', array());
}
//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
$vc_newposts->show_field();
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

//
// Output the data to the template
//
if ( (($userdata['user_open_quickreply']==1) && ($userdata['user_id'] != ANONYMOUS)) || (($board_config['anonymous_open_sqr']==1) && ($userdata['user_id'] == ANONYMOUS)) )
{
$template->assign_block_vars('switch_open_qr_yes', array());
}
else
{
$template->assign_block_vars('switch_open_qr_no', array());
}

$template->assign_vars(array(
'U_POST_SQR_TOPIC' => 'javascript:sqr_show_hide();',
'SQR_IMG' => $images['quickreply'],
'L_POST_SQR_TOPIC' => $lang['Show_hide_quick_reply_form'],

'L_EMPTY_MESSAGE' => $lang['Empty_message'],
'L_QUICK_REPLY' => $lang['Quick_Reply'],
'L_USERNAME' => $lang['Username'],
'L_SUBJECT' => $lang['Subject'],
'L_MESSAGE_BODY' => $lang['Message_body']
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 653
Location: Texas


flag
PostPosted: Tue Jan 06, 2009 5:47 am 
Post subject: Re: VCNP in SQR

Sylver Cheetah 53, if you feel you must post extremely large blocks of code, please simply save it as a text file on your server and link it. There's normally no need to include the entire contents of your files in your posts, thanks.
_________________
phpBBDoctor Blog
Back to top
Sylver Cheetah 53
Board Member



Joined: 17 Dec 2008

Posts: 426
Location: Milky Way


flag
PostPosted: Tue Jan 06, 2009 12:03 pm 
Post subject: Re: VCNP in SQR

Thanks Roadhog, it works like a charm! icon_wink.gif

Here are the code changes for who needs it:
Code:
OPEN
includes/viewtopic_quickreply.php

FIND
//
// Set toggles for various options
//

BEFORE, ADD
//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
require_once($phpbb_root_path . 'mods/vc_newposts/vc_newposts.' . $phpEx);
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

FIND
$attach_sig = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['attach_sig']) ) ? TRUE : 0 ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? 0 : $userdata['user_attachsig'] );

AFTER, ADD
//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
         $vc_newposts->check_fields();
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

FIND
//
// Output the data to the template
//

BEFORE, ADD
//----------------------------------------------------------------------
// Visual Confirmation on New Posters - Begin Code Alteration
//
$vc_newposts->show_field();
//
// Visual Confirmation on New Posters - End Code Alteration
//----------------------------------------------------------------------

OPEN
templates/subSilver/viewtopic_quickreply.tpl

FIND
<!-- END switch_advanced_qr -->

AFTER, ADD
<!-- Visual Confirmation on New Posters - Begin Code Alteration -->
{VC_NEWPOSTS}
<!-- Visual Confirmation on New Posters - End Code Alteration -->


I hope this would be usefull to other people like it is to me. icon_wink.gif

_________________
Image link
My Forum || My Blog

phpBB2 forever! icon_smile.gif
Back to top
Display posts from previous:   
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Page 1 of 2 All times are GMT
Goto page 1, 2  Next
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.1458 seconds using 15 queries. (SQL 0.0041 Parse 0.0668 Other 0.0749)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo