TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 30, 2024, 12:29:04 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,174
  • Total Topics: 21,220
  • Online today: 147
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 93
  • Total: 93

TP Shout shows too many smileys!

Started by brianjw, August 21, 2008, 12:14:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

brianjw

Hi, I used to use TP Adv shout but my members used NONE of it so I just went to the easy manageable TP Shout module. TP Adv Shout only showed the simple smileys such as the ones on this site. However TP Shout shows those and then shows ALL the other smileys I have which is too many to display on a shoutbox. Let's just say when you click the expand icon, you have to scroll down to see the shout form and shoutbox. How would I make it so it only shows these smileys:

'smileys' => array(
array('code' => ':)', 'filename' => 'smiley.gif', 'description' => $txt[287]),
array('code' => ';)', 'filename' => 'wink.gif', 'description' => $txt[292]),
array('code' => ':D', 'filename' => 'cheesy.gif', 'description' => $txt[289]),
array('code' => ';D', 'filename' => 'grin.gif', 'description' => $txt[293]),
array('code' => '>:(', 'filename' => 'angry.gif', 'description' => $txt[288]),
array('code' => ':(', 'filename' => 'sad.gif', 'description' => $txt[291]),
array('code' => ':o', 'filename' => 'shocked.gif', 'description' => $txt[294]),
array('code' => '8)', 'filename' => 'cool.gif', 'description' => $txt[295]),
array('code' => '???', 'filename' => 'huh.gif', 'description' => $txt[296]),
array('code' => '::)', 'filename' => 'rolleyes.gif', 'description' => $txt[450]),
array('code' => ':P', 'filename' => 'tongue.gif', 'description' => $txt[451]),
array('code' => ':-[', 'filename' => 'embarrassed.gif', 'description' => $txt[526]),
array('code' => ':-X', 'filename' => 'lipsrsealed.gif', 'description' => $txt[527]),
array('code' => ':-\\', 'filename' => 'undecided.gif', 'description' => $txt[528]),
array('code' => ':-*', 'filename' => 'kiss.gif', 'description' => $txt[529]),
array('code' => ':\'(', 'filename' => 'cry.gif', 'description' => $txt[530])
),

That's just the code from TPShout.php that shows the ONLY smileys I want to appear above the shoutbox. None others!

Please let me know how I would go about doing something like this thanks. :)


IchBin

If you look right under that code you just posted from the TPShout.php file you'll see where the rest of the smileys are called from. Just remove the code.

elseif ($user_info['smiley_set'] != 'none')
{
if (($temp = cache_get_data('posting_smileys', 480)) == null)
{
$request = db_query("
SELECT code, filename, description, smileyRow, hidden
FROM {$db_prefix}smileys
WHERE hidden IN (0, 2)
ORDER BY smileyRow, smileyOrder", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
$row['code'] = htmlspecialchars($row['code']);
$row['filename'] = htmlspecialchars($row['filename']);
$row['description'] = htmlspecialchars($row['description']);

$context['smileys'][empty($row['hidden']) ? 'postform' : 'popup'][$row['smileyRow']]['smileys'][] = $row;
}
mysql_free_result($request);

cache_put_data('posting_smileys', $context['smileys'], 480);
}
else
$context['smileys'] = $temp;
}

brianjw

When I removed that code, NO smileys showed. And the expand/collapse button still showed but with no smileys...

bloc

You need that code...but you could set a limit to it, forcing it to only fetch 15-16 smileys there. Depending on how the order are on the installed ones you should get the original ones first.
This code:

$request = db_query("
SELECT code, filename, description, smileyRow, hidden
FROM {$db_prefix}smileys
WHERE hidden IN (0, 2)
ORDER BY smileyRow, smileyOrder", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))


needs to be:

$request = db_query("
SELECT code, filename, description, smileyRow, hidden
FROM {$db_prefix}smileys
WHERE hidden IN (0, 2)
ORDER BY smileyRow, smileyOrder LIMIT 16", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))



IchBin

Hmm... for some reason I totally read that code wrong.  :idiot2:

brianjw

Thanks that worked great :)
I also removed the [more] link because when I did 16 it showed only like 14 smileys and 2 were in the [more] popup. So I removed the [more] popup link and then just changed 16 to 18 and it works perfect. :)