Skip to main content
Topic: I cannot find this two little Popups in CSS... (Read 3736 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

I cannot find this two little Popups in CSS...

...even don't  know if they are named "popups"... ;)

I would like to change their background-color and maybe the font-size. They are in the boards if I touch a topic-name... and and the other ones appaer if a like is given.

Where can I find them?

 

Re: I cannot find this two little Popups in CSS...

Reply #1

Because there is none.
It's a simple "title" attribute without any particular styling.

You can find some tricks to "fake" some styling, for example:
http://stackoverflow.com/questions/2011142/how-to-change-the-style-of-title-attribute-inside-the-anchor-tag
but it really doesn't work that well, because it actually shows two tooltips: the real one and the fake (with styles), and "real one" always appears above the fake one producing an odd effect.

If you want to style it differently, you probably have to install a jQuery plugin that converts the title attribute to a proper tooltip, or change the template to make it a tooltip by yourself...
Bugs creator.
Features destroyer.
Template killer.

Re: I cannot find this two little Popups in CSS...

Reply #2

Ah! Okay... I think I prefer to let them stay in white... ;)  I would be far too complicated for me to change them.

Thank you very much, emanuele...

Re: I cannot find this two little Popups in CSS...

Reply #3

There could be one available:
http://jqueryui.com/tooltip/
but it requires loading jQueryUI in the message index as well, and jQueryUI is a rather big piece of javascript (223KB). If you don't mind that, it should be somehow easy to do.
Bugs creator.
Features destroyer.
Template killer.

Re: I cannot find this two little Popups in CSS...

Reply #4

Or possibly use the built in SiteTooltip function that we use for the message preview's on hover (its in script_elk.js)  O:-)

Re: I cannot find this two little Popups in CSS...

Reply #5

 emanuele has lost track of all the things that are around. LOL
Bugs creator.
Features destroyer.
Template killer.

Re: I cannot find this two little Popups in CSS...

Reply #6

LOL .. I know the feeling.

@Ruth If I'm looking right, those are the message and likes tooltips, and those do already use the above SiteTooltip function.  To style those find the .tooltips area(s) in the .css

In index_light.css it looks like:
Code: [Select]
/* Styles for the tooltips. */
.tooltip {
border: 1px solid #aaa;
border-radius: 4px;
background: #fff;
box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.3);
}

Re: I cannot find this two little Popups in CSS...

Reply #7

Quote from: emanuele –
 emanuele has lost track of all the things that are around. LOL

No wonder you have, emanuele... ;) There are such a lot of things to get completly lost, even when they were created by yourself.

Does anybody knows how many parts belong to a forum? Is there a counter for all the files or the lines? I would like to know.

Thank you very much, Spuds. :)  I have changed them now. It looks much better in my theme if they are not white.

Another question about those "tooltips/popups", wich are in the boards:

They can show the first or the last post of a topic. If they show the last post, would it be possible to add them to your code for a custom  PHP-Block in portal, wich shows the recent posts?

It would be very nice to get this "hover-effect" there as well.

Code: [Select]
	global $context, $settings, $scripturl, $txt, $user_info, $modSettings, $posts, $color_profile;

$db = database();

$exclude_boards = null;
$num_recent = !empty($parameters[0]) ? $parameters[0] : (isset($_GET['limit']) ? (int) $_GET['limit'] : 20);
$show_body = !empty($parameters[1]) ? $parameters[1] : false;

if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
$exclude_boards = array($modSettings['recycle_board']);
else
$exclude_boards = empty($exclude_boards) ? array() : $exclude_boards;

$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
$icon_sources = array();
foreach ($stable_icons as $icon)
$icon_sources[$icon] = 'images_url';

// Find all the posts in distinct topics.  Newer ones will have higher IDs.
$request = $db->query('', '
SELECT
m.poster_time, ms.subject, m.id_topic, m.id_member, m.id_msg, b.id_board, t.num_replies, t.num_views, b.name AS bName,
IFNULL(mem.real_name, m.poster_name) AS poster_name, ' . ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' : '
IFNULL(lt.id_msg, IFNULL(lmr.ID_MSG, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from') . ', LEFT(m.body, 384) AS body, m.smileys_enabled, mf.icon
FROM ({db_prefix}messages AS m, {db_prefix}topics AS t, {db_prefix}boards AS b, {db_prefix}messages AS ms)
INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)' . (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:id_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:id_member})' : '') . '
WHERE t.id_last_msg >= ' . ($modSettings['maxMsgID'] - 35 * min($num_recent, 5)) . '
AND t.id_last_msg = m.id_msg
AND b.id_board = t.id_board' . (empty($exclude_boards) ? '' : '
AND b.id_board NOT IN ({array_int:exclude_boards})') . '
AND {raw:query_see_board}
AND ms.id_msg = t.id_last_msg
ORDER BY t.id_last_msg DESC
LIMIT {int:limit}',
array(
'id_member' => $user_info['id'],
'exclude_boards' => $exclude_boards,
'query_see_board' => $user_info['query_wanna_see_board'],
'limit' => (int) $num_recent,
)
);
$posts = array();
$color_ids = array();
while ($row = $db->fetch_assoc($request))
{
// Shorten the body if needed
if ($show_body)
{
$ellip = '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0" title="' . $row['subject'] . '">...</a>';
$row['body'] = Util::shorten_html(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), 128, $ellip, false);
censorText($row['body']);
}

// Censor the subject.
$row['subject'] = preg_replace('/^' . preg_quote($txt['response_prefix']) . '/', '', $row['subject']);
censorText($row['subject']);

// Collect the color ids :)
$color_ids[$row['id_member']] = $row['id_member'];

if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.png') ? 'images_url' : 'default_images_url';

// Build the array.
$posts[] = array(
'board' => array(
'id' => $row['id_board'],
'name' => $row['bName'],
'href' => $scripturl . '?board=' . $row['id_board'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['bName'] . '</a>'
),
'topic' => $row['id_topic'],
'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>'
),
'subject' => $row['subject'],
'short_subject' => Util::shorten_text($row['subject'], 25),
'preview' => $show_body ? $row['body'] : '',
'time' => standardTime($row['poster_time']),
'timestamp' => forum_time(true, $row['poster_time']),
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#new">' . $row['subject'] . '</a>',
'new' => !empty($row['is_read']),
'new_from' => $row['new_from'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.png" style="vertical-align: middle;" alt="' . $row['icon'] . '" />',
'views' => $row['num_views'],
'replies' => $row['num_replies'],
);
}
$db->free_result($request);

// Colorization
if (!empty($color_ids) && sp_loadColors($color_ids) !== false)
{
foreach ($posts as $key => $value)
{
if (!empty($color_profile[$value['poster']['id']]['link']))
$posts[$key]['poster']['link'] = $color_profile[$value['poster']['id']]['link'];
}
}

$context['recent_topics'] = $posts;

// Just return if we have no results
if (empty($posts))
return $txt['error_sp_no_posts_found'];

echo '
<div>';

foreach ($posts as $post)
{
echo '
<div style="display: table-row">
<div style="display: table-cell; padding: 0 8px;border-bottom:1px dashed #6394BD;text-align: center;" class="centericon">
', $post['icon'], '
</div>
<div class="" style="display: table-cell;border-bottom:1px dashed #6394BD;width:100%;">
<b><a href="', $post['href'], '">', $post['subject'], '</a></b>
', $post['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new" rel="nofollow"><span class="new_posts"> ' . $txt['new'] . '</span></a>';

echo '
<div class="smalltext">
', $txt['by'], ' ', $post['poster']['link'], ' ', $txt['in'], ' ', $post['board']['link'], '
</br />
', $post['time'], ' | ', $txt['views'], ': ', $post['views'], ' | ', $txt['replies'], ': ', $post['replies'], '
</div>';

if ($show_body)
echo '
<div class="middletext">
', $post['preview'], '
</div>';

echo '
</div>
</div>';
}

echo '
</div>';

Re: I cannot find this two little Popups in CSS...

Reply #8

Try this (I have not done much testing on it)
Code: [Select]
global $context, $settings, $scripturl, $txt, $user_info, $modSettings, $posts, $color_profile;

$db = database();

$exclude_boards = null;

// Number of items to show
$num_recent = 20;

// Show the body preview on hover
$show_preview = true;

// Show the body preview
$show_body = false;

// Number of characters to show in the preview, 0 is all
$preview_char = 128;

// First or last message for the preview
$preview_last = false;

if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
$exclude_boards = array($modSettings['recycle_board']);
else
$exclude_boards = empty($exclude_boards) ? array() : $exclude_boards;

$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
$icon_sources = array();
foreach ($stable_icons as $icon)
$icon_sources[$icon] = 'images_url';

// If empty, no previews at all
if (empty($show_preview) && empty($show_body))
$preview_bodies = '';
// If 0 means everything
elseif (empty($preview_char))
$preview_bodies = ', ml.body AS last_body, mf.body AS first_body';
// else a SUBSTRING
else
$preview_bodies = ', SUBSTRING(ml.body, 1, ' . ($preview_char + 256) . ') AS last_body, SUBSTRING(mf.body, 1, ' . ($preview_char + 256) . ') AS first_body';

// Find all the posts in distinct topics.  Newer ones will have higher IDs.
$request = $db->query('substring', '
SELECT
mf.poster_time, mf.subject, ml.id_topic, mf.id_member,
ml.id_msg, b.id_board, b.name AS bName,
t.num_replies, t.num_views, t.id_first_msg, t.id_last_msg,
IFNULL(mem.real_name, mf.poster_name) AS poster_name, ' . ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' : '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= ml.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from') . ', mf.smileys_enabled, mf.icon, mg.online_color' .
$preview_bodies . '
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)
INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)
LEFT JOIN {db_prefix}boards AS b ON (b.id_board = mf.id_board)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = mf.id_member)' . (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' : '') . '
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = mem.id_group)
WHERE t.id_last_msg >= {int:likely_max_msg}
AND b.id_board = t.id_board' . (empty($exclude_boards) ? '' : '
AND b.id_board NOT IN ({array_int:exclude_boards})') . '
AND {query_wanna_see_board}' . ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}
AND ml.approved = {int:is_approved}' : '') . '
ORDER BY t.id_last_msg DESC
LIMIT {int:limit}',
array(
'current_member' => $user_info['id'],
'exclude_boards' => $exclude_boards,
'limit' => (int) $num_recent,
'is_approved' => 1,
'likely_max_msg' => $modSettings['maxMsgID'] - 35 * min($num_recent, 5),
'preview_char' => $preview_char,
)
);
$posts = array();
$color_ids = array();
while ($row = $db->fetch_assoc($request))
{
// Shorten and censor the body as needed
$row['body'] = '';
if (!(empty($show_preview) && empty($show_body)))
{
if (!empty($preview_char))
{
$row['body'] = strip_tags(strtr(parse_bbc($preview_last ? $row['last_body'] : $row['first_body'], false, $row['id_first_msg']), array('<br />' => "\n", ' ' => ' ')));
$row['body'] = Util::shorten_text($row['body'], !empty($modSettings['preview_characters']) ? $modSettings['preview_characters'] : $preview_char, true);
}
elseif (!empty($show_preview))
$row['body'] = strip_tags(strtr(parse_bbc($preview_last ? $row['last_body'] : $row['first_body'], false, $row['id_first_msg']), array('<br />' => "\n", ' ' => ' ')));

censorText($row['body']);
}

// Censor the subject.
$row['subject'] = preg_replace('/^' . preg_quote($txt['response_prefix']) . '/', '', $row['subject']);
censorText($row['subject']);

// Collect the color ids :)
$color_ids[$row['id_member']] = $row['id_member'];

if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.png') ? 'images_url' : 'default_images_url';

// Build the array.
$posts[] = array(
'board' => array(
'id' => $row['id_board'],
'name' => $row['bName'],
'href' => $scripturl . '?board=' . $row['id_board'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['bName'] . '</a>'
),
'topic' => $row['id_topic'],
'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>'
),
'subject' => $row['subject'],
'short_subject' => Util::shorten_text($row['subject'], 25),
'preview' => $row['body'],
'time' => standardTime($row['poster_time']),
'timestamp' => forum_time(true, $row['poster_time']),
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#new">' . $row['subject'] . '</a>',
'new' => !empty($row['is_read']),
'new_from' => $row['new_from'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.png" style="vertical-align: middle;" alt="' . $row['icon'] . '" />',
'views' => $row['num_views'],
'replies' => $row['num_replies'],
);
}
$db->free_result($request);

// Colorization
if (!empty($color_ids) && sp_loadColors($color_ids) !== false)
{
foreach ($posts as $key => $value)
{
if (!empty($color_profile[$value['poster']['id']]['link']))
$posts[$key]['poster']['link'] = $color_profile[$value['poster']['id']]['link'];
}
}

$context['recent_topics'] = $posts;

// Just return if we have no results
if (empty($posts))
return $txt['error_sp_no_posts_found'];

// Preview tips?
if (!empty($show_preview))
addInlineJavascript('
$(document).ready(function () {
$(".sp_custom_tr2").SiteTooltip({
hoverIntent: {
sensitivity: 10,
interval: 150,
timeout: 50
}
});
});', true);

echo '
<style>
.sp_custom_tr {display: table-cell; padding: 0 8px;border-bottom:1px dashed #6394BD;text-align: center;}
.sp_custom_tr1 {display: table-cell;border-bottom:1px dashed #6394BD;width:100%;}
.sp_custom_tr2 {font-weight: bold;}

</style>

<div>';

foreach ($posts as $post)
{
echo '
<div style="display: table-row">
<div class="sp_custom_tr centericon">
', $post['icon'], '
</div>
<div class="sp_custom_tr1" >
<a class="sp_custom_tr2" href="', $post['href'], '" title="', $post['preview'], '">', $post['subject'], '</a>
', $post['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new" rel="nofollow"><span class="new_posts"> ' . $txt['new'] . '</span></a>';

echo '
<div class="smalltext">
', $txt['by'], ' ', $post['poster']['link'], ' ', $txt['in'], ' ', $post['board']['link'], '
</br />
', $post['time'], ' | ', $txt['views'], ': ', $post['views'], ' | ', $txt['replies'], ': ', $post['replies'], '
</div>';

if (!empty($show_body))
echo '
<div class="middletext">
', $post['preview'], '
</div>';

echo '
</div>
</div>';
}

echo '
</div>';

Re: I cannot find this two little Popups in CSS...

Reply #9

Thank you very much, Spuds! :) This is so kind of you...

 It works perfect...even with the first post of a topic, wich I do prefer for the boards.

My members will be very glad to have this block in portal, it is very comfortable this way, with this "preview" and it looks nice. I really like it.

Re: I cannot find this two little Popups in CSS...

Reply #10

Hello, Spuds!

I don't want you to work again with this, I am really happy with the code for this custom  PHP-Block, as it was before, I just want to tell you, that the code with the preview is not exactly working - I had not noticed this before.

The topics are in the correct order, but the member, wich has written the last post in topic and the date of the last post are not displayed. The block with the preview shows always the topicstarter and the date of the first post in topic.

I add two screenshots, wich show the difference...

Re: I cannot find this two little Popups in CSS...

Reply #11

I think I understand, try this one
Code: [Select]
	global $context, $settings, $scripturl, $txt, $user_info, $modSettings, $posts, $color_profile;

$db = database();

$exclude_boards = null;

// Number of items to show
$num_recent = 20;

// Show the body preview on hover
$show_preview = true;

// Show the body preview text in the block
$show_body = false;

// Number of characters to show in the preview, 0 is all
$preview_char = 128;

// First or last message for the preview
$preview_last = false;

if ($exclude_boards === null && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0)
$exclude_boards = array($modSettings['recycle_board']);
else
$exclude_boards = empty($exclude_boards) ? array() : $exclude_boards;

$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
$icon_sources = array();
foreach ($stable_icons as $icon)
$icon_sources[$icon] = 'images_url';

// If empty, no previews at all
if (empty($show_preview) && empty($show_body))
$preview_bodies = '';
// If 0 means everything
elseif (empty($preview_char))
$preview_bodies = ', ml.body AS last_body, mf.body AS first_body';
// else a SUBSTRING
else
$preview_bodies = ', SUBSTRING(ml.body, 1, ' . ($preview_char + 256) . ') AS last_body, SUBSTRING(mf.body, 1, ' . ($preview_char + 256) . ') AS first_body';

// Find all the posts in distinct topics.  Newer ones will have higher IDs.
$request = $db->query('substring', '
SELECT
mf.subject,
ml.id_msg, ml.id_topic, ml.id_member, ml.poster_time,
b.id_board, b.name AS bName,
t.num_replies, t.num_views, t.id_first_msg, t.id_last_msg,
IFNULL(mem.real_name, ml.poster_name) AS poster_name, ' . ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' : '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= ml.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from') . ', mf.smileys_enabled, mf.icon, mg.online_color' .
$preview_bodies . '
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)
INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)
LEFT JOIN {db_prefix}boards AS b ON (b.id_board = mf.id_board)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = ml.id_member)' . (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' : '') . '
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = mem.id_group)
WHERE t.id_last_msg >= {int:likely_max_msg}
AND b.id_board = t.id_board' . (empty($exclude_boards) ? '' : '
AND b.id_board NOT IN ({array_int:exclude_boards})') . '
AND {query_wanna_see_board}' . ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}
AND ml.approved = {int:is_approved}' : '') . '
ORDER BY t.id_last_msg DESC
LIMIT {int:limit}',
array(
'current_member' => $user_info['id'],
'exclude_boards' => $exclude_boards,
'limit' => (int) $num_recent,
'is_approved' => 1,
'likely_max_msg' => $modSettings['maxMsgID'] - 35 * min($num_recent, 5),
'preview_char' => $preview_char,
)
);
$posts = array();
$color_ids = array();
while ($row = $db->fetch_assoc($request))
{
// Shorten and censor the body as needed
$row['body'] = '';
if (!(empty($show_preview) && empty($show_body)))
{
if (!empty($preview_char))
{
$row['body'] = strip_tags(strtr(parse_bbc($preview_last ? $row['last_body'] : $row['first_body'], false, $row['id_first_msg']), array('<br />' => "\n", ' ' => ' ')));
$row['body'] = Util::shorten_text($row['body'], !empty($modSettings['preview_characters']) ? $modSettings['preview_characters'] : $preview_char, true);
}
elseif (!empty($show_preview))
$row['body'] = strip_tags(strtr(parse_bbc($preview_last ? $row['last_body'] : $row['first_body'], false, $row['id_first_msg']), array('<br />' => "\n", ' ' => ' ')));

censorText($row['body']);
}

// Censor the subject.
$row['subject'] = preg_replace('/^' . preg_quote($txt['response_prefix']) . '/', '', $row['subject']);
censorText($row['subject']);

// Collect the color ids :)
$color_ids[$row['id_member']] = $row['id_member'];

if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.png') ? 'images_url' : 'default_images_url';

// Build the array.
$posts[] = array(
'board' => array(
'id' => $row['id_board'],
'name' => $row['bName'],
'href' => $scripturl . '?board=' . $row['id_board'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['bName'] . '</a>'
),
'topic' => $row['id_topic'],
'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>'
),
'subject' => $row['subject'],
'short_subject' => Util::shorten_text($row['subject'], 25),
'preview' => $row['body'],
'time' => standardTime($row['poster_time']),
'timestamp' => forum_time(true, $row['poster_time']),
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#new',
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#new">' . $row['subject'] . '</a>',
'new' => !empty($row['is_read']),
'new_from' => $row['new_from'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.png" style="vertical-align: middle;" alt="' . $row['icon'] . '" />',
'views' => $row['num_views'],
'replies' => $row['num_replies'],
);
}
$db->free_result($request);

// Colorization
if (!empty($color_ids) && sp_loadColors($color_ids) !== false)
{
foreach ($posts as $key => $value)
{
if (!empty($color_profile[$value['poster']['id']]['link']))
$posts[$key]['poster']['link'] = $color_profile[$value['poster']['id']]['link'];
}
}

$context['recent_topics'] = $posts;

// Just return if we have no results
if (empty($posts))
return $txt['error_sp_no_posts_found'];

// Preview tips?
if (!empty($show_preview))
addInlineJavascript('
$(document).ready(function () {
$(".sp_custom_tr2").SiteTooltip({
hoverIntent: {
sensitivity: 10,
interval: 150,
timeout: 50
}
});
});', true);

echo '
<style>
.sp_custom_tr {display: table-cell; padding: 0 8px;border-bottom:1px dashed #6394BD;text-align: center;}
.sp_custom_tr1 {display: table-cell;border-bottom:1px dashed #6394BD;width:100%;}
.sp_custom_tr2 {font-weight: bold;}

</style>

<div>';

foreach ($posts as $post)
{
echo '
<div style="display: table-row">
<div class="sp_custom_tr centericon">
', $post['icon'], '
</div>
<div class="sp_custom_tr1" >
', $post['new'] ? '' : '<a href="' . $scripturl . '?topic=' . $post['topic'] . '.msg' . $post['new_from'] . ';topicseen#new" rel="nofollow"><span class="new_posts"> ' . $txt['new'] . '</span></a>', '
<a class="sp_custom_tr2" href="', $post['href'], '" title="', $post['preview'], '">', $post['subject'], '</a>';

echo '
<div class="smalltext">
', $txt['by'], ' ', $post['poster']['link'], ' ', $txt['in'], ' ', $post['board']['link'], '
</br />
', $post['time'], ' | ', $txt['views'], ': ', $post['views'], ' | ', $txt['replies'], ': ', $post['replies'], '
</div>';

if (!empty($show_body))
echo '
<div class="middletext">
', $post['preview'], '
</div>';

echo '
</div>
</div>';
}

echo '
</div>';

Re: I cannot find this two little Popups in CSS...

Reply #12

This one is working absolutely perfekt! :)  Thank you very much, Spuds!