Customizing SMF > Modifications and Packages

BoardHover Mod

<< < (44/48) > >>

FrizzleFried:
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>
</div>';

// 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 />
</p>';
}
// Show lots of posts.
elseif (!empty($context['latest_posts']))
{
echo '
<table cellpadding="0" cellspacing="1" width="100%" border="0">
           <tr>
               <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>
             </tr>';


/* 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){
         $cnt++;         
         $class = ($cnt % 2) ? 'windowbg' : 'windowbg2';
         
        echo '
<tr>
<td></td>
<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>

</tr>';
       }

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

--- 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.

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


kbrookes:
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?

butchs:
Sounds lime a computer specific mouse click setting.

kbrookes:
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.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version