Skip to content
Browse files

RSS links open in new window. Added smiley's to pull from SMF to shou…

…tbox.
  • Loading branch information...
1 parent d1f4d22 commit a55aa7b384b59af5599c1c8b26a3f2df1b5935ce @IchBin committed May 29, 2012
Showing with 3,156 additions and 3,128 deletions.
  1. +3,126 −3,126 SMF2/Sources/TPSubs.php
  2. +30 −2 SMF2/tp-files/tp-modules/TPShout/Sources/TPShout.php
View
6,252 SMF2/Sources/TPSubs.php
3,126 additions, 3,126 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
32 SMF2/tp-files/tp-modules/TPShout/Sources/TPShout.php
@@ -810,14 +810,15 @@ function tp_bbc_highlight(something, mode)
function shout_smiley_code()
{
- global $context, $settings, $user_info, $txt, $modSettings;
+ global $context, $settings, $user_info, $txt, $modSettings, $db_prefix, $smcFunc;
// Initialize smiley array...
$context['tp_smileys'] = array(
'postform' => array(),
'popup' => array(),
);
-
+ // Load smileys - don't bother to run a query if we're not using the database's ones anyhow.
+ if (empty($modSettings['smiley_enable']) && $user_info['smiley_set'] != 'none')
$context['tp_smileys']['postform'][] = array(
'smileys' => array(
array('code' => ':)', 'filename' => 'smiley.gif', 'description' => $txt['icon_smiley']),
@@ -839,7 +840,34 @@ function shout_smiley_code()
),
'last' => true,
);
+ elseif ($user_info['smiley_set'] != 'none')
+ {
+ if (($temp = cache_get_data('posting_smileys', 480)) == null)
+ {
+ $request = $smcFunc['db_query']('', '
+ SELECT code, filename, description, smiley_row, hidden
+ FROM {db_prefix}smileys
+ WHERE hidden IN ({int:val1}, {int:val2})
+ ORDER BY smiley_row, smiley_order',
+ array('val1' => 0,
+ 'val2' => 2)
+ );
+
+ while ($row = $smcFunc['db_fetch_assoc']($request))
+ {
+ $row['code'] = htmlspecialchars($row['code']);
+ $row['filename'] = htmlspecialchars($row['filename']);
+ $row['description'] = htmlspecialchars($row['description']);
+ $context['tp_smileys'][empty($row['hidden']) ? 'postform' : 'popup'][$row['smiley_row']]['smileys'][] = $row;
+ }
+ $smcFunc['db_free_result']($request);
+
+ cache_put_data('posting_smileys', $context['tp_smileys'], 480);
+ }
+ else
+ $context['tp_smileys'] = $temp;
+ }
// Clean house... add slashes to the code for javascript.
foreach (array_keys($context['tp_smileys']) as $location)
{

0 comments on commit a55aa7b

Please sign in to comment.
Something went wrong with that request. Please try again.