Logo link to the home only if guest

MAybe this can interest...

if you desires your logo links to the home page the guest and, to the member page (or to other pages) if registered and logged in, you can simply open the file inc/design.inc.php and change this function

from

function getMainLogo() {
global $dir, $site;

$sFileName = getParam('sys_main_logo');
if(!file_exists($dir['mediaImages'] . $sFileName))
return '';

return '<a href="' . BX_DOL_URL_ROOT . '"><img src="' . $site['mediaImages'] . $sFileName . '" class="mainLogo" alt="logo" /></a>';
}

to

function getMainLogo() {
global $dir, $site;

$sFileName = getParam('sys_main_logo');
if(!file_exists($dir['mediaImages'] . $sFileName))
return '';

if (isMember()) return '<a href="' . BX_DOL_URL_ROOT . 'member.php"><img src="' . $site['mediaImages'] . $sFileName . '" class="mainLogo" alt="logo" /></a>';
else return '<a href="' . BX_DOL_URL_ROOT . '"><img src="' . $site['mediaImages'] . $sFileName . '" class="mainLogo" alt="logo" /></a>';
}

We hope it can be usefully.

See my products at http://www.boonex.com/market/posts/ilbellodelweb | Hosting: zarconia.net
Quote · 17 Feb 2011

Nice addition, thank you :-)

And in Open Source ;-)  that allows me to suggest to replace function getMainLogo() with this one:

 

function getMainLogo() {
 global $dir, $site;

    $sFileName = getParam('sys_main_logo');
 if(!file_exists($dir['mediaImages'] . $sFileName))
        return '';
 if (isMember()) return '<a href="' . BX_DOL_URL_ROOT . 'member.php"><img src="' . $site['mediaImages'] . $sFileName . '" class="mainLogo" alt="logo" width="274" height="64" /></a>';
 else return '<a href="' . BX_DOL_URL_ROOT . 'join.php"><img src="' . $site['mediaImages'] . $sFileName . '" class="mainLogo" alt="logo" width="274" height="64" /></a>';
}

 

If user is logged, logo is linked to his/her account page.
If user is not logged, logo is linked to join page.

!!! default logo size, change it to match your own logo image size !!!

Life is a fatal disease, sexually transmissible - Virginity is carcinogenic! Ask here for vaccine.
Quote · 17 Feb 2011

Maybe this thread should be moved to 'Tips and Tricks'

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 17 Feb 2011

Agree ;-)

Life is a fatal disease, sexually transmissible - Virginity is carcinogenic! Ask here for vaccine.
Quote · 17 Feb 2011

Can someone help me achieve this with the 7.1.4 version?

This code is not in inc/design.inc.php

Thank you

Quote · 2 Feb 2014

templates/base/scripts/BxBaseFunctions.php:523

Quote · 2 Feb 2014

 

templates/base/scripts/BxBaseFunctions.php:523

 Perfect. Thanks so much for your feedback.

Quote · 2 Feb 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.