Log in

View Full Version : Widen Smiliepopup Window


imcoach
02-10-2008, 06:29 AM
Hi!

Is there a way to expand the smiliepop window? I just uploaded some wider then average smilies and now one needs to scroll to see the right column..

Thx.

-Matt

k111
11-25-2008, 12:01 PM
[edit] http://www.vbulletin.com/forum/showthread.php?t=102052

found it..

ReCom
11-25-2008, 12:27 PM
After widening the smilie popup window, you might want to change the number of smilies per row to fully utilize the increased width better. Here's how:

(warning: this requires modifying a core vbulletin file, an action that is best avoided unless necessary)

0. Decide how many smilies to show per row. Let say you want 5 smilies per row.

1. Customize template smiliepopup_straggler into:
<td class="$bgclass">$smiliehtml</td>
<td class="$bgclass" colspan="$remainingcols">$smilie[text]</td>

2. Open misc.php and find the following code portion: foreach ($smcache AS $category => $smilies)
{
if (sizeof($bits) == 1)
{
eval('$smiliecells = "' . fetch_template('smiliepopup_straggler') . '";');
eval('$smiliebits .= "' . fetch_template('smiliepopup_row') . '";');
}

($hook = vBulletinHook::fetch_hook('misc_smiliespopup_categ ory')) ? eval($hook) : false;

eval('$smiliebits .= "' . fetch_template('smiliepopup_category') . '";');
$bits = array();
foreach ($smilies AS $smilie)
{
($hook = vBulletinHook::fetch_hook('misc_smiliespopup_smili e')) ? eval($hook) : false;

$smilie['js'] = addslashes_js($smilie['text']);
$smiliehtml = "<img src=\"$smilie[path]\" id=\"smilie_$smilie[smilieid]\" alt=\"" . htmlspecialchars_uni($smilie['text']) . "\" title=\"" . htmlspecialchars_uni($smilie['title']) . "\" />";
eval('$bits[] = "' . fetch_template('smiliepopup_smilie') . '";');
if (sizeof($bits) == 2)
{
exec_switch_bg();
$smiliecells = implode('', $bits);
eval('$smiliebits .= "' . fetch_template('smiliepopup_row') . '";');
$bits = array();
}
}
}
if (sizeof($bits) == 1)
{
eval('$smiliecells = "' . fetch_template('smiliepopup_straggler') . '";');
eval('$smiliebits .= "' . fetch_template('smiliepopup_row') . '";');
}


3. Notice that for the following code block if (sizeof($bits) == 1)
{
eval('$smiliecells = "' . fetch_template('smiliepopup_straggler') . '";');
eval('$smiliebits .= "' . fetch_template('smiliepopup_row') . '";');
} there are two of them, one at the top and one at the bottom of the code portion from 2. Replace both of them with if (sizeof($bits) < 5)
{
$remainingcols = (5 - sizeof($bits)) * 2 + 1;
eval('$smiliecells = "' . fetch_template('smiliepopup_straggler') . '";');
eval('$smiliebits .= "' . fetch_template('smiliepopup_row') . '";');
}

4. Find the line if (sizeof($bits) == 2) from the code portion from 2. Replace it with if (sizeof($bits) == 5)

5. Now the smilie popup window should show 5 smilies per row.

:):):)

kurti
05-09-2012, 12:17 PM
(Sorry, i know its an old thread.)

I'm still running vB 3.7.4.

I changed the size of the popupwindow in the "editor_smiliebox" template.
and added aditional smiley rows exactly like ReCom discribed.

It works well apart from one thing:
Not all elements of the background in the popupwindow adjust to the new window size.

Screenshot:
http://www.saveoursounds.net/000/smiley-window-tablewidtherror.jpg (http://www.saveoursounds.net/000/smiley-window-tablewidtherror.jpg)

I searched in the "editor_smiliebox" and "smileypopup" templates and in the "vBulletin Options" in the admin,
but could not find were to edit the width of the background table inside the popupwindow.


Can anyone help please?

Lynne
05-09-2012, 02:54 PM
To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. (Sometimes the template is the one mentioned at the very top of the page source.)

That will allow you to find the template and then you may go in and find the code and change the table to have xx columns instead of yy.

kurti
05-10-2012, 03:23 AM
Thank you Lynne, that helped. :)

I added some more colspan's (from 4 to 10) in the templates
"smiliepopup" and "smiliepopup_category". Perfect.