Display message to non-logged in users in Search results

Started by spiros, May 04, 2020, 10:33:55 AM

Previous topic - Next topic

spiros

I want to display a message to non-logged in users in Search results (Search.template.php), how can this be done?

Doug Heffernan

Quote from: spiros on May 04, 2020, 10:33:55 AM
I want to display a message to non-logged in users in Search results (Search.template.php), how can this be done?

What version of Smf do you need this for and where do you want it to be displayed.

For smf 2.0.17 to display it above the search results block find this code:

if ($context['compact'])

And add above:

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

    echo 'Hello guest <br />';
}


Anyways, if you want to display it elsewhere, you can experiment inside the function template_results() function. Hope it helps.

spiros



Advertisement: