Hide Promo Block when logged in

Not my doing, I am just reposting to make it easier to find. At some point HoustonLively posted the Dolphin 7 code changes, removed it, then Stuart083 reposted it. Dolphin 6 version was posted by mrpowless.

 

For Dolphin 7:

// This change will show the Promo image reloader to guests only, and it will not be displayed once a user is logged in. This will allow site owners to use the Promo image

// rotator to show guests what they can do on the site, and not annoy logged in members with what they already know.

In the file: /inc/design.inc.php

Find:

function getPromoCode() {

global $site;

$sSiteUrl = BX_DOL_URL_ROOT;

if( getParam( 'enable_flash_promo' ) != 'on' )

 

Change to:

function getPromoCode() {

global $site;

$sSiteUrl = BX_DOL_URL_ROOT;

if(!isMember())

if( getParam( 'enable_flash_promo' ) != 'on' )

 

//<------------------------------------------------------------------------------------------------------------->

For Dolphin 6:

open inc.design.inc.php

in:

function getPromoCode()

after:

$sCode = '<div class="promo_code_wrapper">' . getParam( 'custom_promo_code' ) . '</div>';

insert:

elseif( $logged['member'])
{
$sCode = '';
}

 

inside the '' you can put a language string _indexinfo , for example to add alternate text/html from the admin settings/languages setting

 

Have fun

 

Light man a fire keep him warm for a night, light him ON fire & he will be warm the rest of his life
Quote · 5 Dec 2010

Updated for 7.0.8 (thanks to rhimpr):

Go to: templates/base/scripts/BxBaseIndexPageView.php  and look for

if( getParam( 'enable_flash_promo' ) != 'on' )

add beofre it;

if(!isMember())

Quote · 24 Oct 2011

Thank you honestly, Joe Wa,

you rock. You are the only one that has got it right; 'how to hide the promo block for logged in members"

...for Dolphin7.09

...I have only be looking for false answers for a day or so...

JOE WA IS THE ONLY ONE THAT PUT IT RIGHT

Quote · 2 Mar 2012

How can I get the same result with what I have on my site?

 

function getPromoImagesArray() {
	global $dir;

    $aAllowedExt = array('jpg' => 1, 'png' => 1, 'gif' => 1, 'jpeg' => 1);
	$aFiles = array();
	$rDir = opendir( $dir['imagesPromo'] );
	if( $rDir ) {
		while( $sFile = readdir( $rDir ) ) {
			if( $sFile == '.' or $sFile == '..' or !is_file( $dir['imagesPromo'] . $sFile ) )
				continue;
            $aPathInfo = pathinfo($sFile);
            $sExt = strtolower($aPathInfo['extension']);
            if (isset($aAllowedExt[$sExt])) {
                $aFiles[] = $sFile;
            }
Sometimes communicating your problem and putting it out there is enough to solve it
Quote · 7 Jul 2012

you can try this

put it on top of your function

if(!isMember()) {

return;

}

so much to do....
Quote · 7 Jul 2012

 RE:

How can I get the same result with what I have on my site?

 

function getPromoImagesArray() {
	global $dir;

    $aAllowedExt = array('jpg' => 1, 'png' => 1, 'gif' => 1, 'jpeg' => 1);
	$aFiles = array();
	$rDir = opendir( $dir['imagesPromo'] );
	if( $rDir ) {
		while( $sFile = readdir( $rDir ) ) {
			if( $sFile == '.' or $sFile == '..' or !is_file( $dir['imagesPromo'] . $sFile ) )
				continue;
            $aPathInfo = pathinfo($sFile);
            $sExt = strtolower($aPathInfo['extension']);
            if (isset($aAllowedExt[$sExt])) {
                $aFiles[] = $sFile;
            }

 I'm curious... what makes you think that you need a different solution than the one already given by JoeWa?

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 7 Jul 2012

 RE:

you can try this

put it on top of your function

if(!isMember()) {

return;

}

 Wrong

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 7 Jul 2012

Nevermind, I found out I have a different set up on my template....gonna have to consult with the designer.

houstonlively, you were right!  I was looking at the wrong function and when I applied the code on the right function it worked but since I use a certain template the frame around the images was still there so the result was a promo frame with nothing in it, blank!!

Prashank25, thanks man.

Sometimes communicating your problem and putting it out there is enough to solve it
Quote · 7 Jul 2012
 
 
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.