News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Opening search results in new tab

Started by spiros, September 19, 2021, 10:00:57 AM

Previous topic - Next topic

spiros

I am trying to find a way how to have the search results links from Search.template.php (topic subject, user name and board name) open in a new tab, but I have no idea what should be changed.

<?php
/**
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines
 * @copyright 2011 Simple Machines
 * @license http://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.0.10
 */

function template_main()
{
global $context$settings$options$txt$scripturl$modSettings;

echo'
<form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '" name="searchform" id="searchform">
<div class="cat_bar">
<h3 class="catbg">
<span class="ie6_header floatleft">'
, !empty($settings['use_buttons']) ? '<i class="fas fa-search" title="search"></i> ' ' '$txt['set_parameters'], ' — <a href="https://www.translatum.gr/dictionary/search-browser-link.htm" style="color:rgba(83,131,148);">Click here to search with a single click on your browser</a></span>
</h3>
</div>'
;

if (!empty($context['search_errors']))
echo '
<p id="search_error" class="error">'
implode('<br />'$context['search_errors']['messages']), '</p>';

// Simple Search?
if ($context['simple_search'])
{
echo '
<fieldset id="simple_search">
<span class="upperframe"><span></span></span>
<div class="roundframe">
<div id="search_term_input">
<strong>'
$txt['search_for'], ':</strong>
<input type="text" name="search"'
, !empty($context['search_params']['search']) ? ' value="' $context['search_params']['search'] . '"' ''' maxlength="'$context['search_string_limit'], '" size="40" class="input_text" />
'
$context['require_verification'] ? '' '&nbsp;<input type="submit" name="submit" value="' $txt['search'] . '" class="button_submit" />
</div>'
;

if (empty($modSettings['search_simple_fulltext']))
echo '
<p class="smalltext">'
$txt['search_example'], '</p>';

if ($context['require_verification'])
echo '
<div class="verification>
<strong>'
$txt['search_visual_verification_label'], ':</strong>
<br />'
template_control_verification($context['visual_verification_id'], 'all'), '<br />
<input id="submit" type="submit" name="submit" value="' 
$txt['search'] . '" class="button_submit" />
</div>'
;

echo '
<a href="'
$scripturl'?action=search;advanced" onclick="this.href += \';search=\' + escape(document.forms.searchform.search.value);">'$txt['search_advanced'], '</a>
<input type="hidden" name="advanced" value="0" />
</div>
<span class="lowerframe"><span></span></span>
</fieldset>'
;
}

// Advanced search!
else
{
echo '
<fieldset id="advanced_search">
<span class="upperframe"><span></span></span>
<div class="roundframe">
<input type="hidden" name="advanced" value="1" />
<span class="enhanced">
<strong>'
$txt['search_for'], ':</strong>
<input type="text" name="search"'
, !empty($context['search_params']['search']) ? ' value="' $context['search_params']['search'] . '"' ''' maxlength="'$context['search_string_limit'], '" size="40" class="input_text" />
<script type="text/javascript"><!-- // --><![CDATA[
function initSearch()
{
if (document.forms.searchform.search.value.indexOf("%u") != -1)
document.forms.searchform.search.value = unescape(document.forms.searchform.search.value);
}
createEventListener(window);
window.addEventListener("load", initSearch, false);
// ]]></script>
<select name="searchtype">
<option value="1"'
, empty($context['search_params']['searchtype']) ? ' selected="selected"' '''>'$txt['all_words'], '</option>
<option value="2"'
, !empty($context['search_params']['searchtype']) ? ' selected="selected"' '''>'$txt['any_words'], '</option>
</select>
</span>'
;

if (empty($modSettings['search_simple_fulltext']))
echo '
<em class="smalltext">'
$txt['search_example'], '</em>';

echo '
<dl id="search_options">
<dt>'
$txt['by_user'], ':</dt>
<dd><input id="userspec" type="text" name="userspec" value="'
, empty($context['search_params']['userspec']) ? '*' $context['search_params']['userspec'], '" size="40" class="input_text" /></dd>
<dt>'
$txt['search_order'], ':</dt>
<dd>
<select id="sort" name="sort">
<option value="relevance|desc">'
$txt['search_orderby_relevant_first'], '</option>
<option value="num_replies|desc">'
$txt['search_orderby_large_first'], '</option>
<option value="num_replies|asc">'
$txt['search_orderby_small_first'], '</option>
<option value="id_msg|desc">'
$txt['search_orderby_recent_first'], '</option>
<option value="id_msg|asc">'
$txt['search_orderby_old_first'], '</option>
</select>
</dd>
<dt class="options">'
$txt['search_options'], ':</dt>
<dd class="options">
<label for="show_complete"><input type="checkbox" name="show_complete" id="show_complete" value="1"'
, !empty($context['search_params']['show_complete']) ? ' checked="checked"' ''' class="input_check" /> '$txt['search_show_complete_messages'], '</label><br />
<label for="subject_only"><input type="checkbox" name="subject_only" id="subject_only" value="1"'
, !empty($context['search_params']['subject_only']) ? ' checked="checked"' ''' class="input_check" /> '$txt['search_subject_only'], '</label>
</dd>
<dt class="between">'
$txt['search_post_age'], ': </dt>
<dd>'
$txt['search_between'], ' <input type="text" name="minage" value="', empty($context['search_params']['minage']) ? '0' $context['search_params']['minage'], '" size="5" maxlength="4" class="input_text" />&nbsp;'$txt['search_and'], '&nbsp;<input type="text" name="maxage" value="', empty($context['search_params']['maxage']) ? '9999' $context['search_params']['maxage'], '" size="5" maxlength="4" class="input_text" /> '$txt['days_word'], '</dd>
</dl>'
;

// Require an image to be typed to save spamming?
if ($context['require_verification'])
{
echo '
<p>
<strong>'
$txt['verification'], ':</strong>
'
template_control_verification($context['visual_verification_id'], 'all'), '
</p>'
;
}

// If $context['search_params']['topic'] is set, that means we're searching just one topic.
if (!empty($context['search_params']['topic']))
echo '
<p>'
$txt['search_specific_topic'], ' &quot;'$context['search_topic']['link'], '&quot;.</p>
<input type="hidden" name="topic" value="'
$context['search_topic']['id'], '" />';

echo '
</div>
<span class="lowerframe"><span></span></span>
</fieldset>'
;

if (empty($context['search_params']['topic']))
{
echo '
<fieldset class="flow_hidden">
<span class="upperframe"><span></span></span>
<div class="roundframe">
<div class="title_bar">
<h4 class="titlebg">
<a href="javascript:void(0);" onclick="expandCollapseBoards(); return false;"><img src="'
$settings['images_url'], '/expand.gif" id="expandBoardsIcon" alt="" /></a> <a href="javascript:void(0);" onclick="expandCollapseBoards(); return false;"><strong>'$txt['choose_board'], '</strong></a>
</h4>
</div>
<div class="flow_auto" id="searchBoardsExpand"'
$context['boards_check_all'] ? ' style="display: none;"' '''>
<ul class="ignoreboards floatleft">'
;

$i 0;
$limit ceil($context['num_boards'] / 2);
foreach ($context['categories'] as $category)
{
echo '
<li class="category">
<a href="javascript:void(0);" onclick="selectBoards(['
implode(', '$category['child_ids']), ']); return false;">'$category['name'], '</a>
<ul>'
;

foreach ($category['boards'] as $board)
{
if ($i == $limit)
echo '
</ul>
</li>
</ul>
<ul class="ignoreboards floatright">
<li class="category">
<ul>'
;

echo '
<li class="board">
<label for="brd'
$board['id'], '" style="margin-'$context['right_to_left'] ? 'right' 'left'': '$board['child_level'], 'em;"><input type="checkbox" id="brd'$board['id'], '" name="brd['$board['id'], ']" value="'$board['id'], '"'$board['selected'] ? ' checked="checked"' ''' class="input_check" /> '$board['name'], '</label>
</li>'
;

$i ++;
}

echo '
</ul>
</li>'
;
}

echo '
</ul>
</div>
<br class="clear" />'
;

echo '
<div class="padding">
<input type="checkbox" name="all" id="check_all" value=""'
$context['boards_check_all'] ? ' checked="checked"' ''' onclick="invertAll(this, this.form, \'brd\');" class="input_check floatleft" />
<label for="check_all" class="floatleft">'
$txt['check_all'], '</label>
<input type="submit" name="submit" value="'
$txt['search'], '" class="button_submit floatright" />
</div>
<br class="clear" />
</div>
<span class="lowerframe"><span></span></span>
</fieldset>'
;
}

}

echo '
</form>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">google.load("elements", "1", {});</script>
<script type="text/javascript" src="https://www.google.com/cse/t13n?form=searchform&t13n_langs=el"></script>

<script type="text/javascript"><!-- // --><![CDATA[
function selectBoards(ids)
{
var toggle = true;

for (i = 0; i < ids.length; i++)
toggle = toggle & document.forms.searchform["brd" + ids[i]].checked;

for (i = 0; i < ids.length; i++)
document.forms.searchform["brd" + ids[i]].checked = !toggle;
}

function expandCollapseBoards()
{
var current = document.getElementById("searchBoardsExpand").style.display != "none";

document.getElementById("searchBoardsExpand").style.display = current ? "none" : "";
document.getElementById("expandBoardsIcon").src = smf_images_url + (current ? "/expand.gif" : "/collapse.gif");
}'
;

echo '
// ]]></script>'
;
}

function 
template_results()
{
global $context$settings$options$txt$scripturl$message;

echo '
<div id="search_results">
<div class="cat_bar">
<h3 class="catbg">
'
$txt['search_adjust_query'], '
</h3>
</div>
<span class="upperframe"><span></span></span>
<div class="roundframe">'
;

// Did they make any typos or mistakes, perhaps?
if (isset($context['did_you_mean']))
echo '
<p>'
$txt['search_did_you_mean'], ' <a href="'$scripturl'?action=search2;params='$context['did_you_mean_params'], '">'$context['did_you_mean'], '</a>.</p>';

echo '
<form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '">
<strong>'
$txt['search_for'], ':</strong>
<input type="text" name="search"'
, !empty($context['search_params']['search']) ? ' value="' $context['search_params']['search'] . '"' ''' maxlength="'$context['search_string_limit'], '" size="40" class="input_text" />
<input type="submit" name="submit" value="'
$txt['search_adjust_submit'], '" class="button_submit" />
<input type="hidden" name="searchtype" value="'
, !empty($context['search_params']['searchtype']) ? $context['search_params']['searchtype'] : 0'" />
<input type="hidden" name="userspec" value="'
, !empty($context['search_params']['userspec']) ? $context['search_params']['userspec'] : '''" />
<input type="hidden" name="show_complete" value="'
, !empty($context['search_params']['show_complete']) ? 0'" />
<input type="hidden" name="subject_only" value="'
, !empty($context['search_params']['subject_only']) ? 0'" />
<input type="hidden" name="minage" value="'
, !empty($context['search_params']['minage']) ? $context['search_params']['minage'] : '0''" />
<input type="hidden" name="maxage" value="'
, !empty($context['search_params']['maxage']) ? $context['search_params']['maxage'] : '9999''" />
<input type="hidden" name="sort" value="'
, !empty($context['search_params']['sort']) ? $context['search_params']['sort'] : 'relevance''" />';

if (!empty($context['search_params']['brd']))
foreach ($context['search_params']['brd'] as $board_id)
echo '
<input type="hidden" name="brd['
$board_id']" value="'$board_id'" />';

echo '
</form>
</div>
<span class="lowerframe"><span></span></span>
</div><br />'
;

// attn:
$summary = array();
$counter 0;


if(
$context['user']['is_guest'])

    echo 
'<div class="errorbox" id="errors">
<dl>
<dt>
<strong style="" id="error_serious">Not happy with the results? You can simply click the button links below for results on <i> '
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : ''' </i>from other sources or <a href="https://www.translatum.gr/forum/index.php?action=register" target="_blank" title="Opens in new page">register</a> in the forum and ask. (This message is only displayed to non-logged in users)</strong>
</dt>
</dl>
</div>'
;
}
echo'
<div class="hide">
<div class="buttonlist">
<ul>
<li><a href="https://www.google.com/search?q='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="Google search" rel="nofollow"><span class="last">G</span></a></li>
<li><a href="https://www.google.com/search?q=%22'
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''%22" target="mytarget" title="Google phrase search" rel="nofollow"><span class="last">"G"</span></a></li>
<li><a href="https://translate.google.com/#view=home&op=translate&sl=en&tl=el&text='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="Google translate English to Greek" rel="nofollow"><span class="last">GT</span></a></li>
<li><a href="https://www.wordreference.com/engr/'
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="Wordreference bidirectional English Greek search" rel="nofollow"><span class="last">WR</span></a></li>
<li><a href="https://www.onelook.com/?loc=bm6&w='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="Onelook English monolingual  search" rel="nofollow"><span class="last">O</span></a></li>
<li><a href="https://en.wiktionary.org/w/index.php?search='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="Wiktionary search" rel="nofollow"><span class="last">W</span></a></li>
<li><a href="https://www.microsoft.com/en-us/language/Search?&langID=361&Source=true&productid=0&searchTerm='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="Microsoft English Greek search" rel="nofollow"><span class="last">MS EN&#129050;EL</span></a></li>
<li><a href="https://www.microsoft.com/en-us/language/Search?&langID=361&Source=false&productid=0&searchTerm='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="Microsoft Greek English search" rel="nofollow"><span class="last">EL&#129050;EN</span></a></li>
<li><a href="https://iate.europa.eu/search/byUrl?sl=en&tl=el&term='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="IATE English to Greek search" rel="nofollow"><span class="last">IATE: EN&#129050;EL</span></a></li>
<li><a href="https://iate.europa.eu/search/byUrl?sl=el&tl=en&term='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="IATE Greek to English search" rel="nofollow"><span class="last">EL&#129050;EN</span></a></li>
<li><a href="https://iate.europa.eu/search/byUrl?sl=fr&tl=el&term='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="IATE French to Greek search" rel="nofollow"><span class="last">FR&#129050;EL</span></a></li>
<li><a href="https://iate.europa.eu/search/byUrl?sl=el&tl=fr&term='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="IATE Greek to French search" rel="nofollow"><span class="last">EL&#129050;FR</span></a></li>
<li><a href="https://iate.europa.eu/search/byUrl?sl=de&tl=el&term='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="IATE German to Greek search" rel="nofollow"><span class="last">DE&#129050;EL</span></a></li>
<li><a href="https://iate.europa.eu/search/byUrl?sl=el&tl=de&term='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="IATE Greek to German search" rel="nofollow"><span class="last">EL&#129050;DE</span></a></li>
<li><a href="https://iate.europa.eu/search/byUrl?sl=it&tl=el&term='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="IATE Italian to Greek search" rel="nofollow"><span class="last">IT&#129050;EL</span></a></li>
<li><a href="https://iate.europa.eu/search/byUrl?sl=el&tl=it&term='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="IATE Greek to Italian search" rel="nofollow"><span class="last">EL&#129050;IT</span></a></li>
<li><a href="https://iate.europa.eu/search/byUrl?sl=el&term='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="IATE Greek to All languages search" rel="nofollow"><span class="last">EL&#129050;ALL</span></a></li>
<li><a href="https://www.linguee.com/english-greek/search?source=auto&query='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="Linguee English Greek bidirectional search" rel="nofollow"><span class="last">Ling: EN⇄EL</span></a></li>
<li><a href="https://www.linguee.com/french-greek/search?source=auto&query='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="Linguee French Greek bidirectional search" rel="nofollow"><span class="last">FR⇄EL</span></a></li>
<li><a href="https://www.linguee.com/german-greek/search?source=auto&query='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="Linguee German Greek bidirectional search" rel="nofollow"><span class="last">DE⇄EL</span></a></li>
<li><a href="http://magicsearch.org/english-greek/'
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="MagicSearch multidictionary lookup English to Greek" rel="nofollow"><span class="last">Mg: EN&#129050;EL</span></a></li>
<li><a href="http://magicsearch.org/greek-english/'
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="MagicSearch multidictionary lookup Greek to English" rel="nofollow"><span class="last">EL&#129050;EN</span></a></li>
<li><a href="http://www.greek-language.gr/greekLang/modern_greek/tools/lexica/search.html?lq='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="Τριανταφυλλίδης, Γεωργακάς και άλλα λεξικά κόμβου" rel="nofollow"><span class="last">ΤΡΦ</span></a></li>
<li><a href="https://lsj.gr/index.php?search='
, !empty($context['search_params']['search']) ? $context['search_params']['search'] : '''" target="mytarget" title="LSJ Ancient Greek to English, French, Spanish, German, Latin bidirectional search" rel="nofollow"><span class="last">LSJ</span></a></li> </ul>
</div></div>'
;
$str '';
echo '<div class="pagelinks clear floatleft"><strong>'$txt['pages'], ':</strong> '$context['page_index'], '</div>';

// Quick moderation set to checkboxes? Oh, how fun :/.
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
$str .= '
<form action="' 
$scripturl '?action=quickmod" method="post" accept-charset="' $context['character_set'] . '" name="topicForm" style="margin: 0;">';

$str .= '
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="titlebg">'
;
if (!empty($context['topics']))
{
$sort_image_id_msg '';
$sort_image_numReplies '';
$sort_image_relevance '';

$up_down_image ' <img src="' $settings['images_url'] . '/sort_' . ($context['search_params']['sort_dir'] == 'asc' 'up' 'down') . '.gif" alt="" />';

if ($context['search_params']['sort'] == 'id_msg')
$sort_image_id_msg $up_down_image;
elseif ($context['search_params']['sort'] == 'num_replies')
$sort_image_numReplies $up_down_image;
elseif ($context['search_params']['sort'] == 'relevance')
$sort_image_relevance $up_down_image;

$str .= '
<td width="65%">' 
$txt['subject'] . '</td>
<td width="5%" nowrap="nowrap">' 
$txt['by'] . '</td>';

if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
$str .= '
<td width="10" valign="middle" align="center">
<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="check" />
</td>'
;
elseif (!empty($options['display_quick_mod']))
$str .= '
<td width="4%" valign="middle" align="center"></td>'
;
}
else
$str .= '
<td width="100%" colspan="5">' 
$txt['search_no_results'] . '</td>';

$str .= '
</tr>'
;

while ($topic $context['get_topics']())
{
//
$counter++;

// Work out what the class is if we remove sticky and lock info.
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false)
$topic['class'] = substr($topic['class'], 0strrpos($topic['class'], '_sticky'));
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'locked') !== false)
$topic['class'] = substr($topic['class'], 0strrpos($topic['class'], '_locked'));

$str .= '
<tr>
<td class="windowbg' 
. ($topic['is_sticky'] && !empty($settings['seperate_sticky_lock']) ? '3' '') . '" valign="middle">
. ($topic['is_locked'] && !empty($settings['seperate_sticky_lock']) ? '<img src="' $settings['images_url'] . '/icons/quick_lock.gif" align="right" alt="" style="margin: 0;" />' '') . '
. ($topic['is_sticky'] && !empty($settings['seperate_sticky_lock']) ? '<img src="' $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" style="margin: 0;" /><b>' '') . $topic['first_post']['link'] . ($topic['is_sticky'] ? '</b>' '') . '<a name="goto_' $counter '"></a>' '
<div class="smalltext"><i>' 
$txt['in'] . ' ' $topic['board']['link'] . '</i></div>';

foreach ($topic['matches'] as $message)
{
$summary[] = array(
'subject' => $message['subject_highlighted'],
'counter' => $counter,
);
}

$num_matches_link $topic['num_matches'] > '<a title="' $txt['search_view_all'] . ' ' $topic['num_matches'] . ' ' $txt['search_match_criteria'] . '" href="' $scripturl '?action=search2;params=' $context['params'] . ';topic_search=1;acttopic=' $topic['id'] . '">&nbsp;' $topic['num_matches'] . ' </a>' $topic['num_matches'] . ' ';

$str .= '
</td>
<td class="windowbg" valign="top" width="10%">
$topic['first_post']['member']['link'] . '
</td>'
;

if (!empty($options['display_quick_mod']))
{
$str .= '
<td class="windowbg" valign="middle" align="center" width="4%">'
;
if ($options['display_quick_mod'] == 1)
$str .=  '
<input type="checkbox" name="topics[]" value="' 
$topic['id'] . '" class="check" />';
else
{
if ($topic['quick_mod']['remove'])
$str .= '
<a href="' 
$scripturl '?action=quickmod;actions[' $topic['id'] . ']=remove;sesc=' $context['session_id'] . '" onclick="return confirm(\'' $txt['quickmod_confirm'] . '\');"><img src="' $settings['images_url'] . '/icons/quick_remove.gif" width="16" alt="' $txt[63] . '" title="' $txt[63] . '" /></a>';
if ($topic['quick_mod']['lock'])
$str .= '
<a href="' 
$scripturl '?action=quickmod;actions[' $topic['id'] . ']=lock;sesc=' $context['session_id'] . '" onclick="return confirm(\'' $txt['quickmod_confirm'] . '\');"><img src="' $settings['images_url'] . '/icons/quick_lock.gif" width="16" alt="' $txt['smf279'] . '" title="' $txt['smf279'] . '" /></a>';
if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
$str .= '<br />';
if ($topic['quick_mod']['sticky'])
$str .= '
<a href="' 
$scripturl '?action=quickmod;actions[' $topic['id'] . ']=sticky;sesc=' $context['session_id'] . '" onclick="return confirm(\'' $txt['quickmod_confirm'] . '\');"><img src="' $settings['images_url'] . '/icons/quick_sticky.gif" width="16" alt="' $txt['smf277'] . '" title="' $txt['smf277'] . '" /></a>';
if ($topic['quick_mod']['move'])
$str .= '
<a href="' 
$scripturl '?action=movetopic;topic=' $topic['id'] . '.0"><img src="' $settings['images_url'] . '/icons/quick_move.gif" width="16" /></a>';
}
$str .= '
</td>'
;
}

$str .= '
</tr>'
;
}
echo ResultSummary($summary);
echo $str;
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == && !empty($context['topics']))
{
echo '
<tr class="titlebg">
<td colspan="8" align="right">
<select name="qaction"'
$context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' '''>
<option value="">--------</option>'
$context['can_remove'] ? '
<option value="remove">' 
$txt['quick_mod_remove'] . '</option>' ''$context['can_lock'] ? '
<option value="lock">' 
$txt['quick_mod_lock'] . '</option>' ''$context['can_sticky'] ? '
<option value="sticky">' 
$txt['quick_mod_sticky'] . '</option>' '', $context['can_move'] ? '
<option value="move">' 
$txt['quick_mod_move'] . ': </option>' ''$context['can_merge'] ? '
<option value="merge">' 
$txt['quick_mod_merge'] . '</option>' '''
<option value="markread">'
$txt['quick_mod_markread'], '</option>
</select>'
;

if ($context['can_move'])
{
echo '
<select id="moveItTo" name="move_to" disabled="disabled">'
;
foreach ($context['move_to_boards'] as $category)
foreach ($category['boards'] as $board)
{
if (empty($board['is_current']))
echo '
<option value="'
$board['id'], '"', !empty($board['selected']) ? ' selected="selected"' '''>'str_repeat('-'$board['child_level'] + 1), ' '$board['name'], '</option>';
}
echo '
</select>'
;
}

echo '
<input type="hidden" name="redirect_url" value="'
$scripturl '?action=search2;params=' $context['params'], '" />
<input type="submit" value="'
$txt['quick_mod_go'], '" onclick="return this.form.qaction.value != \'\' &amp;&amp; confirm(\''$txt['quickmod_confirm'], '\');" />
</td>
</tr>'
;
}

echo '
</table>'
;

if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == && !empty($context['topics']))
echo '
<input type="hidden" name="'
$context['session_var'], '" value="' $context['session_id'] . '" />
</form>'
;

// Show a jump to box for easy navigation.
echo '
<br class="clear" />
<div class="smalltext righttext" id="search_jump_to">&nbsp;</div>
<script type="text/javascript"><!-- // --><![CDATA[
if (typeof(window.XMLHttpRequest) != "undefined")
aJumpTo[aJumpTo.length] = new JumpTo({
sContainerId: "search_jump_to",
sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">'
$context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
iCurBoardId: 0,
iCurBoardChildLevel: 0,
sCurBoardName: "'
$context['jump_to']['board_name'], '",
sBoardChildLevelIndicator: "==",
sBoardPrefix: "=> ",
sCatSeparator: "-----------------------------",
sCatPrefix: "",
sGoButtonLabel: "'
$txt['quick_mod_go'], '"
});
// ]]></script>'
;

}

function 
ResultSummary($links$expand true)
{
global $txt;

if (empty($links))
return;

$expand_trigger '';
if (empty($expand))
$expand_trigger ' style="display:none;"';

$breakers = array('->''–>''-&gt;''–&gt;');
$links_str '';
foreach ($links as $link) {
$first $link['subject'];
$second '';
foreach ($breakers as $breaker) {
if (strpos($link['subject'], $breaker) !== false) {
list ($first$second) = explode($breaker$link['subject']);
break;
}
}
$first trim($first);
$second trim(strip_tags($second)) == '' '' $second;

if (!empty($second)) {
$links_str .= '
<tr>
<td style="border-bottom: 1px solid #bbb;border-right: 1px solid #bbb; width: 50%;">
<a href="#goto_' 
$link['counter'] . '">' $first '</a>
</td>
<td style="border-bottom: 1px solid #bbb;">' 
$second '</td>
</tr>'
;
}
else {
$links_str .= '
<tr>
<td style="border-bottom: 1px solid #bbb;" colspan="2">
<a href="#goto_' 
$link['counter'] . '">' $first '</a>
</td>
</tr>
'
;
}
}

$str '
<a name="goto_top"></a>
<div style="margin-bottom:8px;" id="custom_search_summary">
<div class="floatright">
<a type="button" class="rsbutton buttonLike" onclick="n=document.getElementById(\'summary\');if(n.style.display == \'none\') {n.style.display = \'block\';} else {n.style.display = \'none\';} return false;"/><i class="fa fa-list"></i> Result summary</a>
</div>
<div id="summary" class="showhide"' 
$expand_trigger '>
<span class="upperframe"><span></span></span>
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="roundframe">
$links_str '
</table>
<span class="lowerframe"><span></span></span>
</div>
</div>'
;

return $str;
}
?>

shadav

well that's not a default search template....

basically you're looking for the stuff in the
foreach ($topic['matches'] as $message)
but yeah yours has been messed with so um
you'll need to ask the theme creator or the mod creator that changed it, because I'm not seeing it

see your code is
foreach ($topic['matches'] as $message)
        {
            $summary[] = array(
                'subject' => $message['subject_highlighted'],
                'counter' => $counter,
            );

whereas a default is
foreach ($topic['matches'] as $message)
            {
                echo '
                    <div class="topic_details floatleft" style="width: 94%">
                        <div class="counter">', $message['counter'], '</div>
                        <h5>', $topic['board']['link'], ' / <a href="', $scripturl, '?topic=', $topic['id'], '.msg', $message['id'], '#msg', $message['id'], '">', $message['subject_highlighted'], '</a></h5>
                        <span class="smalltext">&#171;&nbsp;',$txt['by'],'&nbsp;<strong>', $message['member']['link'], '</strong>&nbsp;',$txt['on'],'&nbsp;<em>', $message['time'], '</em>&nbsp;&#187;</span>
                    </div>';

===

edit ok I'm assuming it's this part that you need to change

look for
function ResultSummary($links, $expand = true)then for
<td style="border-bottom: 1px solid #bbb;border-right: 1px solid #bbb; width: 50%;">
                        <a href="#goto_' . $link['counter'] . '">' . $first . '</a>
                    </td>
                    <td style="border-bottom: 1px solid #bbb;">' . $second . '</td>

<a href="#goto_' . $link['counter'] . '">change to
<a href="#goto_' . $link['counter'] . '" target="_blank">
then right below that you have another
<tr>
                    <td style="border-bottom: 1px solid #bbb;" colspan="2">
                        <a href="#goto_' . $link['counter'] . '">' . $first . '</a>
                    </td>
                </tr>
<a href="#goto_' . $link['counter'] . '">change to
<a href="#goto_' . $link['counter'] . '" target="_blank">

spiros

Thanks! I think that bit is the one that goes from the result summary to the topic link further down (anchor links). I want to leave them as they are and only have the actual topic/user/board links below changed.

I think it starts at

<td class="windowbg' . ($topic['is_sticky'] && !empty($settings['seperate_sticky_lock']) ? '3' : '') . '" valign="middle">

Arantor

It's not in the template that you need to change it since the links are not built there.

Check prepareSearchContext in Search.php. In particular the first_post array and the link element within it as referenced in the template.

spiros

Oh great, I think I almost got it with

'link' => '<a href="' . $scripturl . '?topic=' . $message['id_topic'] . '.0" target="_blank">' . $message['first_subject'] . '</a>',
Not sure how to change the member array link.

'member' => array(
                'id' => $message['last_member_id'],
                'name' => $message['last_member_name'],
                'href' => !empty($message['last_member_id']) ? $scripturl . '?action=profile;u=' . $message['last_member_id'] : '',
                'link' => !empty($message['last_member_id']) ? '<a href="' . $scripturl . '?action=profile;u=' . $message['last_member_id'] . '" title="' . $txt['profile_of'] . ' ' . $message['last_member_name'] . '">' . $message['last_member_name'] . '</a>' : $message['last_member_name']
            )
        ),

Arantor

'member' => array(
                'id' => $message['last_member_id'],
                'name' => $message['last_member_name'],
                'href' => !empty($message['last_member_id']) ? $scripturl . '?action=profile;u=' . $message['last_member_id'] : '',
                'link' => !empty($message['last_member_id']) ? '<a href="' . $scripturl . '?action=profile;u=' . $message['last_member_id'] . '" title="' . $txt['profile_of'] . ' ' . $message['last_member_name'] . '" target="_blank">' . $message['last_member_name'] . '</a>' : $message['last_member_name']
            )
        ),

spiros

Brilliant, I had to change it in this array (first_member_name) in order to work.

'member' => array(
                'id' => $message['first_member_id'],
                'name' => $message['first_member_name'],
                'href' => !empty($message['first_member_id']) ? $scripturl . '?action=profile;u=' . $message['first_member_id'] : '',
                'link' => !empty($message['first_member_id']) ? '<a href="' . $scripturl . '?action=profile;u=' . $message['first_member_id'] . '" title="' . $txt['profile_of'] . ' ' . $message['first_member_name'] . '" target="mytarget">' . $message['first_member_name'] . '</a>' : $message['first_member_name']
            )
        ),

Advertisement: