Skip to content
Permalink
Browse files

Migrate crumbs to a function

  • Loading branch information...
Quy committed Feb 22, 2019
1 parent f82e65d commit 51b3f7a8bed6902ec7ae58fa0a150f9ca177ebee
Showing with 13 additions and 15 deletions.
  1. +13 −15 search.php
@@ -500,9 +500,9 @@
if ($search_type[0] == 'action')
{
if ($search_type[1] == 'show_user_topics')
$crumbs_text['search_type'] = '<a href="search.php?action=show_user_topics&amp;user_id='.$search_type[2].'">'.sprintf($lang_search['Quick search show_user_topics'], pun_htmlspecialchars($search_set[0]['poster'])).'</a>';
$crumbs_text['search_type'] = array(sprintf($lang_search['Quick search show_user_topics'], pun_htmlspecialchars($search_set[0]['poster'])), 'search.php?action=show_user_topics&amp;user_id='.$search_type[2]);
else if ($search_type[1] == 'show_user_posts')
$crumbs_text['search_type'] = '<a href="search.php?action=show_user_posts&amp;user_id='.$search_type[2].'">'.sprintf($lang_search['Quick search show_user_posts'], pun_htmlspecialchars($search_set[0]['pposter'])).'</a>';
$crumbs_text['search_type'] = array(sprintf($lang_search['Quick search show_user_posts'], pun_htmlspecialchars($search_set[0]['pposter'])), 'search.php?action=show_user_posts&amp;user_id='.$search_type[2]);
else if ($search_type[1] == 'show_subscriptions')
{
// Fetch username of subscriber
@@ -514,10 +514,10 @@
else
message($lang_common['Bad request'], false, '404 Not Found');
$crumbs_text['search_type'] = '<a href="search.php?action=show_subscriptions&amp;user_id='.$subscriber_id.'">'.sprintf($lang_search['Quick search show_subscriptions'], pun_htmlspecialchars($subscriber_name)).'</a>';
$crumbs_text['search_type'] = array(sprintf($lang_search['Quick search show_subscriptions'], pun_htmlspecialchars($subscriber_name)), 'search.php?action=show_subscriptions&amp;user_id='.$subscriber_id);
}
else
$crumbs_text['search_type'] = '<a href="search.php?action='.$search_type[1].'">'.$lang_search['Quick search '.$search_type[1]].'</a>';
$crumbs_text['search_type'] = array($lang_search['Quick search '.$search_type[1]], 'search.php?action='.$search_type[1]);
}
else
{
@@ -539,21 +539,23 @@
$crumbs_text['search_type'] = sprintf($lang_search['By user show as '.$show_as], pun_htmlspecialchars($author));
}
$crumbs_text['search_type'] = '<a href="search.php?action=search&amp;keywords='.urlencode($keywords).'&amp;author='.urlencode($author).'&amp;forums='.$search_type[2].'&amp;search_in='.$search_type[3].'&amp;sort_by='.$sort_by.'&amp;sort_dir='.$sort_dir.'&amp;show_as='.$show_as.'">'.$crumbs_text['search_type'].'</a>';
$crumbs_text['search_type'] = array($crumbs_text['search_type'], 'search.php?action=search&amp;keywords='.urlencode($keywords).'&amp;author='.urlencode($author).'&amp;forums='.$search_type[2].'&amp;search_in='.$search_type[3].'&amp;sort_by='.$sort_by.'&amp;sort_dir='.$sort_dir.'&amp;show_as='.$show_as);
}
$crumbs = generate_crumbs(array(
array($lang_common['Index'], 'index.php'),
array($crumbs_text['show_as'], 'search.php'),
$crumbs_text['search_type'],
));
$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_search['Search results']);
define('PUN_ACTIVE_PAGE', 'search');
require PUN_ROOT.'header.php';
?>
<div class="linkst">
<div class="inbox crumbsplus">
<ul class="crumbs">
<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
<li><span&#160;</span><a href="search.php"><?php echo $crumbs_text['show_as'] ?></a></li>
<li><span&#160;</span><strong><?php echo $crumbs_text['search_type'] ?></strong></li>
</ul>
<?php echo $crumbs ?>
<div class="pagepost">
<p class="pagelink"><?php echo $paging_links ?></p>
</div>
@@ -750,11 +752,7 @@
<div class="pagepost">
<p class="pagelink"><?php echo $paging_links ?></p>
</div>
<ul class="crumbs">
<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
<li><span&#160;</span><a href="search.php"><?php echo $crumbs_text['show_as'] ?></a></li>
<li><span&#160;</span><strong><?php echo $crumbs_text['search_type'] ?></strong></li>
</ul>
<?php echo $crumbs ?>
<?php echo (!empty($forum_actions) ? "\t\t".'<p class="subscribelink clearb">'.implode(' - ', $forum_actions).'</p>'."\n" : '') ?>
<div class="clearer"></div>
</div>

0 comments on commit 51b3f7a

Please sign in to comment.
You can’t perform that action at this time.