Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated

Remove Logo area for registered users

10 years 3 months ago
Licenses:
JomSocial Active GURU Active Socialize Expired

hi staff,

we like reduce the top community area into the restricted site (after the login). How we can remove the LOGO bar from only registered users?

Attachments:
The following user(s) said Thank You: Daniel Soares
10 years 3 months ago
Licenses:

Hi, Brokerad.

(WARNING! Core file hack! Please, make safe copy of edited file. It means also that this file will be overwritten during upgrade, so please make a safe copy of customized file as well. Some core hacks could not working with future JomSocial releases and/or cause issues that will be not supported)

Edit this file:

ROOT/templates/socialize/tpls/blocks/header-jb.php

Replace this (line 17-59):

<header id="t3-header" class="t3-header">
    <div class="container">
        <div class="row">

            <!-- LOGO -->
            <div class="span8 logo">
                <div class="logo-<?php echo $logotype, ($logoimgsm ? ' logo-control' : '') ?>">
                    <a href="<?php echo JURI::base(true) ?>" title="<?php echo strip_tags($sitename) ?>">
                        <?php if($logotype == 'image'): ?>
                            <img class="logo-img" src="<?php echo JURI::base(true) . '/' . $logoimage ?>" alt="<?php echo strip_tags($sitename) ?>" />
                        <?php endif ?>
                        <?php if($logoimgsm) : ?>
                            <img class="logo-img-sm" src="<?php echo JURI::base(true) . '/' . $logoimgsm ?>" alt="<?php echo strip_tags($sitename) ?>" />
                        <?php endif ?>
                        <span><?php echo $sitename ?></span>
                    </a>
                    <small class="site-slogan hidden-phone"><?php echo $slogan ?></small>
                </div>
            </div>
            <!-- //LOGO -->

            <?php if($this->countModules('head-search or languageswitcherload')): ?>
            <div class="span4 clearfix">
            <?php if ($this->countModules('head-search')) : ?>
            <!-- HEAD SEARCH -->
            <div class="head-search<?php $this->_c('head-search')?>">
            <jdoc:include type="modules" name="<?php $this->_p('head-search') ?>" style="raw" />
            </div>
            <!-- //HEAD SEARCH -->
            <?php endif ?>

            <?php if ($this->countModules('languageswitcherload')) : ?>
            <!-- LANGUAGE SWITCHER -->
            <div class="languageswitcherload">
              <jdoc:include type="modules" name="<?php $this->_p('languageswitcherload') ?>" style="raw" />
            </div>
            <!-- //LANGUAGE SWITCHER -->
            <?php endif ?>
            </div>
            <?php endif ?>
        </div>
    </div>
</header>

With this:
<?php 
	$user = JFactory::getUser();
	if($user->id == '0') {
?>
<header id="t3-header" class="t3-header">
    <div class="container">
        <div class="row">

            <!-- LOGO -->
            <div class="span8 logo">
                <div class="logo-<?php echo $logotype, ($logoimgsm ? ' logo-control' : '') ?>">
                    <a href="<?php echo JURI::base(true) ?>" title="<?php echo strip_tags($sitename) ?>">
                        <?php if($logotype == 'image'): ?>
                            <img class="logo-img" src="<?php echo JURI::base(true) . '/' . $logoimage ?>" alt="<?php echo strip_tags($sitename) ?>" />
                        <?php endif ?>
                        <?php if($logoimgsm) : ?>
                            <img class="logo-img-sm" src="<?php echo JURI::base(true) . '/' . $logoimgsm ?>" alt="<?php echo strip_tags($sitename) ?>" />
                        <?php endif ?>
                        <span><?php echo $sitename ?></span>
                    </a>
                    <small class="site-slogan hidden-phone"><?php echo $slogan ?></small>
                </div>
            </div>
            <!-- //LOGO -->

            <?php if($this->countModules('head-search or languageswitcherload')): ?>
            <div class="span4 clearfix">
            <?php if ($this->countModules('head-search')) : ?>
            <!-- HEAD SEARCH -->
            <div class="head-search<?php $this->_c('head-search')?>">
            <jdoc:include type="modules" name="<?php $this->_p('head-search') ?>" style="raw" />
            </div>
            <!-- //HEAD SEARCH -->
            <?php endif ?>

            <?php if ($this->countModules('languageswitcherload')) : ?>
            <!-- LANGUAGE SWITCHER -->
            <div class="languageswitcherload">
              <jdoc:include type="modules" name="<?php $this->_p('languageswitcherload') ?>" style="raw" />
            </div>
            <!-- //LANGUAGE SWITCHER -->
            <?php endif ?>
            </div>
            <?php endif ?>
        </div>
    </div>
</header>
<?php } ?>

This condition do a magic trick:
<?php 
	$user = JFactory::getUser();
	if($user->id == '0') {
?>

It means: display below code only IF current viewing user ID is equal to zero.

If you want to do something opposite like showing this bar only for registered users you could change it like this:
if($user->id > '0')


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
The following user(s) said Thank You: onimaro, Daniel Soares
10 years 3 months ago
Licenses:
JomSocial Active GURU Active Socialize Expired

thank for speed and very good support.

10 years 3 months ago
Licenses:
JomSocial Active GURU Active Socialize Expired

Hi daniel,

We install the last version of template and this condition it is not working :(

P.s. With new version of JS and template we spent 2 day for upgrade and now is not all resolved too.

10 years 3 months ago
Licenses:

Hi, Brokerad.

This is an updated method for Socialize 2:

Edit this file: ROOT/templates/socialize/tpls/default.php (I presume that you're using default Socialize layout. If not. Just do the same for layout of your choice.

Change this (line 38);

<?php $this->loadBlock('header') ?>

with:
<?php 
	$user = JFactory::getUser();
	if($user->id == 0) {
		$this->loadBlock('header');
		}
?>


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
10 years 3 months ago
Licenses:
JomSocial Active GURU Active Socialize Expired

Hi Michal

we need inverse solution. With your change the header compare only for registred user. We need compare only for guest users.

10 years 3 months ago
Licenses:

HI, Brokerad.

I updated my code. A simple change from != to == ;)


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW