Search Addition for v.0.0.2
Works for
• View new posts
• View unanswered posts
• View active topics
• View your posts
• Advanced search (Display results as: [x] Topics)
Demo: View unanswered posts (User Guest)
http://4seven.bplaced.net/forum/media/index.phpAs Guest only these links are visible
View unanswered posts • View active topics
More you see as logged in user (login (un: test / pw: testuser))
Go to index and click on: View unanswered posts • View unread posts • View new posts • View active topics
or
View your posts
or
Use named search mode
Installationopensearch.php
findCode:
}
if ($topic_id && ($topic_id == $result_topic_id))
before addCode:
if (!isset($topic_ids))
{
$topic_ids = array();
}
$topic_ids[] = $result_topic_id;
findCode:
unset($rowset);
after addCode:
if ((isset($topic_ids) && ($user->data['user_id'] != ANONYMOUS)))
{
$sql = 'SELECT max(post_id) as post_id, topic_id, forum_id, poster_id
FROM ' . POSTS_TABLE . '
WHERE poster_id = ' . $user->data['user_id'] . '
AND ' . $db->sql_in_set('topic_id', $topic_ids) . '
GROUP BY topic_id';
$result = $db->sql_query_limit($sql, sizeof($topic_ids));
$linkformat = append_sid($phpbb_root_path . 'viewtopic.' . $phpEx, array('f' => '%1$s', 't' => '%2$s', 'p' => '%3$s', '#' => 'p' . '%3$s'));
$topic_ids = array_flip($topic_ids);
while ($row = $db->sql_fetchrow($result)){
$rownr = $topic_ids[$row['topic_id']];
$url = sprintf($linkformat, $row['forum_id'], $row['topic_id'], $row['post_id']);
$template->alter_block_array('searchresults', array(
'U_LATEST_POST' => $url,
), $rownr, 'change');}
$db->sql_freeresult($result);
$template->assign_vars(array(
'WROTE_IMG' => $phpbb_root_path . '/images/arrw.png',
));
}
openstyles/prosilver/template/search_results.html
findCode:
<!-- IF not S_IS_BOT --><a href="{searchresults.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF -->
after addCode:
<!-- IF searchresults.U_LATEST_POST --> <a href="{searchresults.U_LATEST_POST}" title="{L_VIEW_MY_LATEST_POST}"><img src="{WROTE_IMG}" alt="" /></a><!-- ENDIF -->
• Clear all Board-, Template-, Style- and Browser-Caches