Customizing SMF > Modifications and Packages

BoardHover Mod

<< < (44/48) > >>

I have been trying ... unsuccessfully ... to add this mod to the RECENT POST list in my modded default layout (I have the Statistics and Jquery mod installed which changes how the RECENT POSTS work from the default theme)...

Here is the code:

--- Code: --- // This is the "Recent Posts" bar.

if (!empty($settings['number_recent_posts']) && (!empty($context['latest_posts']) || !empty($context['latest_post'])))
echo '
<div id="tab1" class="tab_content">
<div class="hslice" id="recent_posts_content">
<div class="entry-title" style="display: none;">', $context['forum_name_html_safe'], ' - ', $txt['recent_posts'], '</div>
<div class="entry-content" style="display: none;">
<a rel="feedurl" href="', $scripturl, '?action=.xml;type=webslice">', $txt['subscribe_webslice'], '</a>

// Only show one post.
if ($settings['number_recent_posts'] == 1)
// latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
echo '
<strong><a href="', $scripturl, '?action=recent">', $txt['recent_posts'], '</a></strong>
<p id="infocenter_onepost" class="middletext">
', $txt['recent_view'], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt['recent_updated'], ' (', $context['latest_post']['time'], ')<br />
// Show lots of posts.
elseif (!empty($context['latest_posts']))
echo '
<table cellpadding="0" cellspacing="1" width="100%" border="0">
               <td class="catbg2" style="text-align:left;" colspan="2">',$txt['recent_title'],'</td>
               <td class="catbg2" style="text-align:center;">',$txt['recent_replies'],'</td>
               <td class="catbg2" style="text-align:center;">',$txt['recent_views'],'</td>
               <td class="catbg2" style="text-align:center;">',$txt['recent_boardname'],'</td>
               <td class="catbg2" style="text-align:center;">',$txt['recent_by'],'</td>
               <td class="catbg2" style="text-align:right;">',$txt['recent_time'],'</td>

/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */

$cnt = 0;
foreach ($context['latest_posts'] as $post){
         $class = ($cnt % 2) ? 'windowbg' : 'windowbg2';
        echo '
<td class="', $class, '" title="', $post['preview'] ,'">', $post['link'], '</td>
<td class="', $class, '" style="text-align:center;">', $post['replies'], '</td>
<td class="', $class, '" style="text-align:center;">', $post['views'], '</td>
<td class="', $class, '" style="text-align:center;">',$post['board']['link'], '</td>
<td class="', $class, '" style="text-align:center;">',$post['poster']['link'], '</td>
<td class="', $class, '" style="text-align:right;" nowrap="nowrap">', $post['time'], '</td>


echo '
echo '

--- End code ---

Can someone please point to me where I am supposed to put the

--- Code: ---<div class="windowbg2_hover" onclick="window.location.href=\'', $post['href'], '\'"> </div>
--- End code ---

line that I think is necessary to get this to work?   I am also trying (unsuccessfully) to add this mod to the "show unread posts since last visit" and "show new replies" lists...  Any/all help is greatly appreciated.  I know enough about PHP to get me in trouble... barely.

The mod is tested to work flawlessly with the default theme.  The mod uses it's own JS "" in the "/Themes/default/scripts" directory.  It will not work without "" in the "/Themes/default/scripts" directory. Try installing the mod before you install the jquery mod.

Hi there,

I've inherited a forum with this mod installed - it's a nice addition to the forum.

The one complaint I get however is that when people use command/control-click or middle click to open in a new tab, it also loads the original window with the link, which isn't really expected behaviour.

Is there any way to fix that?

Sounds lime a computer specific mouse click setting.

No, it's not.

Every single member has this issue and looking at the code I think I can see why - I just don't know how to fix it.

Any attempt to open links to sub forums or threads in a new window or tab (not just middle-click methods) results in both a new window/tab being created AND the original page being refreshed with the target of the link.


[0] Message Index

[#] Next page

[*] Previous page

Go to full version