Hi guys,
I am working on customizing my USER search results to include avitars while leaving the CONTENT search result output alone.
Here is what I have so far:
This code passes search_item to phptemplate. It belongs in template.php
<?php
function phptemplate_search_item($user, $fields = array()) {
return _phptemplate_callback('search_item', array('user' => $user, 'fields' => $fields));
}
?>
Then I have another file, search_item.tpl.php, which uses an if else statement to output one type of search results for content searches, and a different output for user searches. What I tried to do was put my modified output in the if statement and the origonal search code (from search.module) into the else statement.
if (arg(0)=="search"&&arg(1)=="user") { //modified search output for user searches
<div id="profilelist">
<?php if($user->picture):
endif;
if(!$user->picture):
endif;
print l(ucwords($user->name), 'user/'. $user->uid);
Name: print ucwords($user->profile_fname)
print ucwords($user->profile_lname)
Location: print ucwords($user->profile_city)
, print ucwords($user->profile_country)
}
else { //code taken from search.module
if (module_hook($type, 'search_item')) {
$output = module_invoke($type, 'search_item', $item);
}
else {
$output = '
'. check_plain($item['title']) .'
';
$info = array();
if ($item['type']) {
$info[] = $item['type'];
}
if ($item['user']) {
$info[] = $item['user'];
}
if ($item['date']) {
$info[] = format_date($item['date'], 'small');
}
if (is_array($item['extra'])) {
$info = array_merge($info, $item['extra']);
}
$output .= '
'. ($item['snippet'] ? '
'. $item['snippet'] . '