Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* Advertisements
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: josh $
|
||||
* @copyright (c) 2010 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/community/board/license.html
|
||||
* @package IP.Board
|
||||
* @link http://www.invisionpower.com
|
||||
* @since 17th February 2010
|
||||
* @version $Revision: 6017 $
|
||||
*/
|
||||
|
||||
class IPSAdCode extends IPSAdCodeDefault
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
return parent::__construct( $registry );
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if the specified member group can view ads
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param integer $group_id Group to check
|
||||
* @return bool
|
||||
*/
|
||||
public function userCanViewAds()
|
||||
{
|
||||
/* Check to see if the system is globally disabled */
|
||||
if( ! ipsRegistry::$settings['ad_code_global_enabled'] )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Check to see if this member group can view ads */
|
||||
if( ipsRegistry::$settings['ad_code_exempt_groups'] )
|
||||
{
|
||||
if( ipsMember::isInGroup( ipsRegistry::member()->fetchMemberData(), explode( ',', ipsRegistry::$settings['ad_code_exempt_groups'] ) ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets global advertising code for display
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $position header or footer
|
||||
* @param string $code Key for code to be displayed at specified position
|
||||
* @return void
|
||||
*/
|
||||
public function setGlobalCode( $position, $code )
|
||||
{
|
||||
$code = $this->settings[ $code ];
|
||||
|
||||
if( $position == 'header' )
|
||||
{
|
||||
$this->headerCode = $code;
|
||||
}
|
||||
else if( $position == 'footer' )
|
||||
{
|
||||
$this->footerCode = $code;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves global advertising code for display
|
||||
*
|
||||
* @access public
|
||||
*
|
||||
* @param string $position header or footer
|
||||
* @param string $code Code to be displayed at specified position
|
||||
* @return void
|
||||
*/
|
||||
public function getGobalCode( $position )
|
||||
{
|
||||
if( $position == 'header' )
|
||||
{
|
||||
return $this->headerCode;
|
||||
}
|
||||
else if( $position == 'footer' )
|
||||
{
|
||||
return $this->footerCode;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Ad Code
|
||||
* This is really just a passthrough so we can extend
|
||||
*
|
||||
* @param string Key
|
||||
*/
|
||||
public function getAdCode( $key )
|
||||
{
|
||||
return $this->settings[ $key ];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user