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:
// 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'], ' "', $context['latest_post']['link'], '" ', $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>';
}
Can someone please point to me where I am supposed to put the
<div class="windowbg2_hover" onclick="window.location.href=\'', $post['href'], '\'"> </div>
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.