Jump to content

All Active Advertisers Block


Ohio Riders

Recommended Posts

index.php?app=downloads&module=display&s



File Name: All Active Advertisers Block

File Submitter: Ohio Riders

File Submitted: 20 Jun 2013

File Category: Content Management



This is an IP.Content block that displays all active Nexus advertisements.

Use case: A listing of all active sponsors.

Example: http://ohioriders.net/index.php?/page/sponsors.html

all_active_advertisements_block_random.zip orders advertisements randomly using MySQL's rand() function.

all_active_advertisements_block_byid.zip orders advertisements by their ad_id.

Additional notes: I personally created a sponsors page in IP.Content, added this block to it, then
added a menu item to link directly to this new page using IP.Content's Navigation Menu editor. You
can see this in the demo.

Tested on 3.4.X, but should work on most others.

Kudos to Ryan Ashbrook and Michael for helping me figure it out.



%7Boption%7D



here to download this file

Link to comment
Share on other sites

  • 5 months later...

ok had to come at this form a different angle - but managed this:

$this->DB->build( array(
	'select' => 'ad_id',
	'from'   => 'nexus_ads',
	'where'  => 'ad_locations like "%fmf_square%"',
        'and' => 'ad_active=1',
	'order'  => 'ad_id ASC'

	)      );

$this->DB->execute();

while ( $row = $this->DB->fetch() )

{
    $ad_ids[] = $row['ad_id'];
}

foreach( $ad_ids as $ad_id){

   $str = file_get_contents( "{$this->settings['board_url']}/interface/advertisements.php?$ad_id" ) ;

$str = preg_replace('/<[/]{0,1}div[^>]*>/i', '', $str);
echo $str;

}

now just trying to wrap this in ONE block - right now i have this setup as a PHP block then have an html block that references this one - I'd think it would perform faster if it didn't' have to run thru two blocks.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...