Ich würde diese Funktion gerne nutzen.
Dafür muss aber ein Suchparameter eingetragen werden.
Die Suchfunktion vom SMF übergibt die Suchbegriffe allerdings mit POST
und so steht in der URL nur http://forum.domain.com/index.php?action=search2
Da sollte aber http://forum.domain.com/index.php?action=search2&search=Suchbegriffe stehen.
Hab jetzt schon das POST mit GET ersetzt, dann sieht die Such-URL aber so aus:
http://forum.domain.com/index.php?search=Suchbegriffe
wie bekomme ich das action=search2& in die URL rein?
hier noch der Auschnitt aus der Search.template.php
<form action="', $scripturl, '?action=search2" method="get" name="searchform" id="searchform">
<table width="80%" border="0" cellspacing="0" cellpadding="3" align="center">
<tr>
<td>', theme_linktree(), '</td>
</tr>
</table>
<table width="80%" border="0" cellspacing="0" cellpadding="4" align="center" class="tborder">
<tr class="titlebg">
<td>' . $txt[183] . '</td>
</tr><tr>
<td class="windowbg">';
if ($context['simple_search'])
{
echo '
<b>' . $txt[582] . ':</b><br />
<input type="text" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' size="40" />
<input type="submit" name="submit" value="' . $txt[182] . '" /><br />
<a href="' . $scripturl . '?action=search;advanced">' . $txt['smf298'] . '</a>
<input type="hidden" name="advanced" value="0" />';
}
else
{
echo '
<input type="hidden" name="advanced" value="1" />
<table><tr>
<td>
<b>', $txt[582], ':</b>
</td>
<td></td>
<td>
<b>', $txt[583], ':</b>
</td>
</tr><tr>
<td>
<input type="text" name="search"', !empty($context['search_params']['search']) ? ' value="' . $context['search_params']['search'] . '"' : '', ' size="40" />
</td><td>
<select name="searchtype">
<option value="1"', empty($context['search_params']['searchtype']) ? ' selected="selected"' : '', '>', $txt[343], '</option>
<option value="2"', !empty($context['search_params']['searchtype']) ? ' selected="selected"' : '', '>', $txt[344], '</option>
</select>
</td><td>
<input type="text" name="userspec" value="', empty($context['search_params']['userspec']) ? '*' : $context['search_params']['userspec'], '" size="40" />
</td>
</tr><tr>
<td colspan="3"> </td>
</tr><tr>
<td colspan="2"><b>', $txt['search_options'], ':</b></td>
<td><b>', $txt['search_post_age'], ': </b></td>
</tr><tr>
<td colspan="2">
<label for="show_complete"><input type="checkbox" name="show_complete" id="show_complete" value="1"', !empty($context['search_params']['show_complete']) ? ' checked="checked"' : '', ' class="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="check" /> ', $txt['search_subject_only'], '</label>
</td>
<td>
', $txt['search_between'], ' <input type="text" name="minage" value="', empty($context['search_params']['minage']) ? '0' : $context['search_params']['minage'], '" size="5" maxlength="5" /> ', $txt['search_and'], ' <input type="text" name="maxage" value="', empty($context['search_params']['maxage']) ? '9999' : $context['search_params']['maxage'], '" size="5" maxlength="5" /> ', $txt[579], '.
</td>
</tr><tr>
<td colspan="3"> </td>
</tr><tr>
<td colspan="2"><b>', $txt['search_order'], ':</b></td>
<td> </td>
</tr><tr>
<td colspan="2">
<select name="sort">
<option value="relevance|desc">', $txt['search_orderby_relevant_first'], '</option>
<option value="numReplies|desc">', $txt['search_orderby_large_first'], '</option>
<option value="numReplies|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>
</td>
<td> </td>
</tr></table>
<br /><br />
<b>', $txt[189], ':</b><br /><br />
<table width="80%" border="0" cellpadding="1" cellspacing="0">';
$temp_boards = array();
foreach ($context['categories'] as $category)
{
$temp_boards[] = array(
'name' => $category['name']
);
$temp_boards = array_merge($temp_boards, array_values($category['boards']));
}
$max_boards = ceil(count($temp_boards) / 2);
if ($max_boards < 2)
$max_boards = 2;
for ($i = 0; $i < $max_boards; $i++)
{
echo '
<tr>
<td width="50%">';
if (isset($temp_boards[$i]['id']))
echo '
', str_repeat(' ', $temp_boards[$i]['child_level']), '<input type="checkbox" id="brd' . $temp_boards[$i]['id'] . '" name="brd[' . $temp_boards[$i]['id'] . ']" value="' . $temp_boards[$i]['id'] . '"', empty($context['search_params']['brd']) || in_array($temp_boards[$i]['id'], $context['search_params']['brd']) ? ' checked="checked"' : '', ' class="check" />
<label for="brd' . $temp_boards[$i]['id'] . '">' . $temp_boards[$i]['name'] . '</label>';
else
echo '<span style="text-decoration: underline;">', $temp_boards[$i]['name'], '</span>';
echo '
</td>';
if (isset($temp_boards[$i + $max_boards]))
{
echo '
<td width="50%">';
if (isset($temp_boards[$i + $max_boards]['id']))
echo '
', str_repeat(' ', $temp_boards[$i + $max_boards]['child_level']), '<input type="checkbox" id="brd' . $temp_boards[$i + $max_boards]['id'] . '" name="brd[' . $temp_boards[$i + $max_boards]['id'] . ']" value="' . $temp_boards[$i + $max_boards]['id'] . '"', empty($context['search_params']['brd']) || in_array($temp_boards[$i + $max_boards]['id'], $context['search_params']['brd']) ? ' checked="checked"' : '', ' class="check" />
<label for="brd' . $temp_boards[$i + $max_boards]['id'] . '">' . $temp_boards[$i + $max_boards]['name'] . '</label>';
else
echo '<span style="text-decoration: underline;">', $temp_boards[$i + $max_boards]['name'], '</span>';
echo '
</td>';
}
echo '
</tr>';
}
echo '
</table><br />
<input type="checkbox" name="all" id="check_all" value="" checked="checked" onclick="invertAll(this, this.form, \'brd\');" class="check" /><i> <label for="check_all">', $txt[737], '</label></i>
<br />
<br />
<table border="0" cellpadding="2" cellspacing="0" align="left">
<tr>
<td valign="bottom">
<input type="submit" name="submit" value="', $txt[182], '" />
</td>
</tr>
</table>';
}
echo '
</td>
</tr>
</table>
</form>';
}
was muss ich ändern, damit das funktioniert?
Bitte um Hilfe!
hallo,
ich habe den "Mist" erst mal wider ausgebaut...
Viel zu viel Krempel drin, den man nicht braucht, wenn man nicht gerade was Gewerbliches laufen hat und das Kaufverhalten eines Kunden zurückverfolgen muss/möchte ist das Dingen voll für die Tonne.
Ansonten such mal hier im Forum, so schwer isses nicht das einzubauen. Ich weiß es leider nicht mehr wie das ging, habe es aber auch geschaft.
was heisst ausgebaut?
Die website-suche bei Google muss nicht eingebaut werden.
Nur angeschaltet!
Mir geht es darum wie ich statt search2 in der URL search=keywords bekomme anhand des obigen Sripts.
Das geht mit get statt post aber funktioniert nicht richtig. ;)