EDITED AGAIN to resolve some php warnings when user changes the url by hand
EDITED to work also for search pattern "user,"
This will show if the search is made by one or more users and the link to eliminate the user/users from the search
Edit search.php from Bender:
Put
<?php osc_current_web_theme_path('header.php') ; ?>
<div class="list-header">
<div class="resp-wrapper">
<?php
if(strpos($_SERVER['REQUEST_URI'], '/user,') !== false)
{
echo '<h5 style="margin-top: -25px;">Results from profile:';
$uri = $_SERVER['REQUEST_URI'];
$poz = strpos($uri, '/user,');
$rest = substr($uri, ($poz+6) );
$beguri=substr($uri,0,$poz);
preg_match('/\d+/', $rest, $matches);
if(!empty($matches)) if(!is_array($matches[0])) {
$usr = User::newInstance()->findByPrimaryKey($matches[0]);
echo ' <a href="'.osc_user_public_profile_url($matches[0]).'">' . $usr['s_name'] . '</a>';
$rest=substr($rest,strlen($matches[0]));
}
while(strpos($rest,",")===0)
{
$rest=substr($rest,1);
preg_match('/\d+/', $rest, $matches);
if(!empty($matches)) if(!is_array($matches[0]))
{ $usr = User::newInstance()->findByPrimaryKey($matches[0]);
echo ', <a href="'.osc_user_public_profile_url($matches[0]).'">' . $usr['s_name'] . '</a>';
$rest = substr($rest , strlen($matches[0]));
}
}
$searchwithoutusersuri = $beguri . $rest;
echo '. | <a style="" href="'.$searchwithoutusersuri.'">Eliminate</a> </h5> ';
}
?>
<?php osc_run_hook('search_ads_listing_top'); ?>
instead of
<?php osc_current_web_theme_path('header.php') ; ?>
<div class="list-header">
<div class="resp-wrapper">
<?php osc_run_hook('search_ads_listing_top'); ?>
For Modern:
edit search.php (the original file from modern)
Put:
<div id="main">
<?php
if(strpos($_SERVER['REQUEST_URI'], '/user,') !== false)
{
echo '<h5 style="margin-top: -25px;">Results from profile:';
$uri = $_SERVER['REQUEST_URI'];
$poz = strpos($uri, '/user,');
$rest = substr($uri, ($poz+6) );
$beguri=substr($uri,0,$poz);
preg_match('/\d+/', $rest, $matches);
if(!empty($matches)) if(!is_array($matches[0])) {
$usr = User::newInstance()->findByPrimaryKey($matches[0]);
echo ' <a href="'.osc_user_public_profile_url($matches[0]).'">' . $usr['s_name'] . '</a>';
$rest=substr($rest,strlen($matches[0]));
}
while(strpos($rest,",")===0)
{
$rest=substr($rest,1);
preg_match('/\d+/', $rest, $matches);
if(!empty($matches)) if(!is_array($matches[0]))
{ $usr = User::newInstance()->findByPrimaryKey($matches[0]);
echo ', <a href="'.osc_user_public_profile_url($matches[0]).'">' . $usr['s_name'] . '</a>';
$rest = substr($rest , strlen($matches[0]));
}
}
$searchwithoutusersuri = $beguri . $rest;
echo '. | <a style="" href="'.$searchwithoutusersuri.'">Eliminate</a> </h5> ';
}
?>
instead of
<div id="main">
These mods together with Teseo's mod mentioned earlier and the other mods from user-public-profile should work.
You may need to adjust the styling to fit your themes, in mobile view and destktop view.