исправлены нотисы в смайлах git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@244 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
nanosimbiot 2011-08-22 06:16:11 +00:00
commit 8edd74d3d9
4 changed files with 16 additions and 16 deletions

View file

@ -7,9 +7,6 @@ if (!empty($setmodules))
return; return;
} }
function update_smilies () { $GLOBALS['datastore']->update('smile_replacements'); }
register_shutdown_function('update_smilies');
require('./pagestart.php'); require('./pagestart.php');
// ACP Header - END // ACP Header - END
@ -60,9 +57,9 @@ if( isset($_GET['import_pack']) || isset($_POST['import_pack']) )
// //
// Import a list a "Smiley Pack" // Import a list a "Smiley Pack"
// //
$smile_pak = ( isset($_POST['smile_pak']) ) ? $_POST['smile_pak'] : $_GET['smile_pak']; $smile_pak = (string) request_var('smile_pak', '');
$clear_current = ( isset($_POST['clear_current']) ) ? $_POST['clear_current'] : $_GET['clear_current']; $clear_current = (int) request_var('clear_current', '');
$replace_existing = ( isset($_POST['replace']) ) ? $_POST['replace'] : $_GET['replace']; $replace_existing = (int) request_var('replace', '');
if ( !empty($smile_pak) ) if ( !empty($smile_pak) )
{ {
@ -77,6 +74,7 @@ if( isset($_GET['import_pack']) || isset($_POST['import_pack']) )
{ {
message_die(GENERAL_ERROR, "Couldn't delete current smilies", "", __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, "Couldn't delete current smilies", "", __LINE__, __FILE__, $sql);
} }
$datastore->update('smile_replacements');
} }
else else
{ {
@ -142,6 +140,7 @@ if( isset($_GET['import_pack']) || isset($_POST['import_pack']) )
{ {
message_die(GENERAL_ERROR, "Couldn't update smilies!", "", __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, "Couldn't update smilies!", "", __LINE__, __FILE__, $sql);
} }
$datastore->update('smile_replacements');
} }
} }
} }
@ -149,7 +148,6 @@ if( isset($_GET['import_pack']) || isset($_POST['import_pack']) )
$message = $lang['SMILEY_IMPORT_SUCCESS'] . "<br /><br />" . sprintf($lang['CLICK_RETURN_SMILEADMIN'], "<a href=\"" . append_sid("admin_smilies.php") . "\">", "</a>") . "<br /><br />" . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], "<a href=\"" . append_sid("index.php?pane=right") . "\">", "</a>"); $message = $lang['SMILEY_IMPORT_SUCCESS'] . "<br /><br />" . sprintf($lang['CLICK_RETURN_SMILEADMIN'], "<a href=\"" . append_sid("admin_smilies.php") . "\">", "</a>") . "<br /><br />" . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], "<a href=\"" . append_sid("index.php?pane=right") . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message); message_die(GENERAL_MESSAGE, $message);
} }
else else
{ {
@ -182,7 +180,9 @@ else if( isset($_POST['export_pack']) || isset($_GET['export_pack']) )
// //
// Export our smiley config as a smiley pak... // Export our smiley config as a smiley pak...
// //
if ( $_GET['export_pack'] == "send" ) $export_pack = (string) request_var('export_pack', '');
if ( $export_pack == "send" )
{ {
$sql = "SELECT * $sql = "SELECT *
FROM " . BB_SMILIES; FROM " . BB_SMILIES;
@ -255,6 +255,7 @@ else if ( $mode != "" )
{ {
message_die(GENERAL_ERROR, "Couldn't delete smiley", "", __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, "Couldn't delete smiley", "", __LINE__, __FILE__, $sql);
} }
$datastore->update('smile_replacements');
$message = $lang['SMILEY_DEL_SUCCESS'] . "<br /><br />" . sprintf($lang['CLICK_RETURN_SMILEADMIN'], "<a href=\"" . append_sid("admin_smilies.php") . "\">", "</a>") . "<br /><br />" . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], "<a href=\"" . append_sid("index.php?pane=right") . "\">", "</a>"); $message = $lang['SMILEY_DEL_SUCCESS'] . "<br /><br />" . sprintf($lang['CLICK_RETURN_SMILEADMIN'], "<a href=\"" . append_sid("admin_smilies.php") . "\">", "</a>") . "<br /><br />" . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], "<a href=\"" . append_sid("index.php?pane=right") . "\">", "</a>");
@ -347,6 +348,7 @@ else if ( $mode != "" )
{ {
message_die(GENERAL_ERROR, "Couldn't update smilies info", "", __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, "Couldn't update smilies info", "", __LINE__, __FILE__, $sql);
} }
$datastore->update('smile_replacements');
$message = $lang['SMILEY_EDIT_SUCCESS'] . "<br /><br />" . sprintf($lang['CLICK_RETURN_SMILEADMIN'], "<a href=\"" . append_sid("admin_smilies.php") . "\">", "</a>") . "<br /><br />" . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], "<a href=\"" . append_sid("index.php?pane=right") . "\">", "</a>"); $message = $lang['SMILEY_EDIT_SUCCESS'] . "<br /><br />" . sprintf($lang['CLICK_RETURN_SMILEADMIN'], "<a href=\"" . append_sid("admin_smilies.php") . "\">", "</a>") . "<br /><br />" . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], "<a href=\"" . append_sid("index.php?pane=right") . "\">", "</a>");
@ -392,6 +394,7 @@ else if ( $mode != "" )
{ {
message_die(GENERAL_ERROR, "Couldn't insert new smiley", "", __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, "Couldn't insert new smiley", "", __LINE__, __FILE__, $sql);
} }
$datastore->update('smile_replacements');
$message = $lang['SMILEY_ADD_SUCCESS'] . "<br /><br />" . sprintf($lang['CLICK_RETURN_SMILEADMIN'], "<a href=\"" . append_sid("admin_smilies.php") . "\">", "</a>") . "<br /><br />" . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], "<a href=\"" . append_sid("index.php?pane=right") . "\">", "</a>"); $message = $lang['SMILEY_ADD_SUCCESS'] . "<br /><br />" . sprintf($lang['CLICK_RETURN_SMILEADMIN'], "<a href=\"" . append_sid("admin_smilies.php") . "\">", "</a>") . "<br /><br />" . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], "<a href=\"" . append_sid("index.php?pane=right") . "\">", "</a>");

View file

@ -57,7 +57,7 @@ $bb_cfg['css_ver'] = 1;
// Increase number of revision after update // Increase number of revision after update
$bb_cfg['tp_version'] = '2.1 Stable'; $bb_cfg['tp_version'] = '2.1 Stable';
$bb_cfg['tp_release_state'] = 'R243'; $bb_cfg['tp_release_state'] = 'R244';
$bb_cfg['tp_release_date'] = '22-08-2011'; $bb_cfg['tp_release_date'] = '22-08-2011';
$bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger $bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger

View file

@ -97,7 +97,7 @@ function prepare_message ($message)
// Either in a window or inline // Either in a window or inline
function generate_smilies($mode) function generate_smilies($mode)
{ {
global $bb_cfg, $template, $lang, $images, $user; global $bb_cfg, $template, $lang, $images, $user, $datastore;
$inline_columns = 4; $inline_columns = 4;
$inline_rows = 7; $inline_rows = 7;
@ -108,13 +108,9 @@ function generate_smilies($mode)
$user->session_start(); $user->session_start();
} }
if (!$sql = CACHE('bb_cache')->get('smilies')) $data = $datastore->get('smile_replacements');
{
$sql = DB()->fetch_rowset("SELECT emoticon, code, smile_url FROM ". BB_SMILIES ." ORDER BY smilies_id");
CACHE('bb_cache')->set('smilies', $sql);
}
if ($sql) if ($sql = $data['smile'])
{ {
$num_smilies = 0; $num_smilies = 0;
$rowset = array(); $rowset = array();

View file

@ -13,6 +13,7 @@ foreach ($rowset as $smile)
{ {
$smilies['orig'][] = '#(?<=^|\W)'. preg_quote($smile['code'], '#') .'(?=$|\W)#'; $smilies['orig'][] = '#(?<=^|\W)'. preg_quote($smile['code'], '#') .'(?=$|\W)#';
$smilies['repl'][] = ' <img class="smile" src="'. $bb_cfg['smilies_path'] .'/'. $smile['smile_url'] .'" alt="'. $smile['emoticon'] .'" align="absmiddle" border="0" />'; $smilies['repl'][] = ' <img class="smile" src="'. $bb_cfg['smilies_path'] .'/'. $smile['smile_url'] .'" alt="'. $smile['emoticon'] .'" align="absmiddle" border="0" />';
$smilies['smile'][] = $smile;
} }
$this->store('smile_replacements', $smilies); $this->store('smile_replacements', $smilies);