Login   Register  
PHP Classes
elePHPant
Icontem

File: test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Vagharshak Tozalakyan  >  Concurrent Code Rotator  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Sample code
Class: Concurrent Code Rotator
Serve a random advertisement from multiple options
Author: By
Last change:
Date: 2005-05-20 04:49
Size: 735 bytes
 

Contents

Class file image Download
<?php

// Include class definition.
require_once 'ccrotator.class.php';

// File to keep counter information, should have writing permissions.
$counter_file 'tracker';

// Create class object.
$ccr = new CodeRotator $counter_file );

// Add codes to be randomly displayed.
// Work cycle will finish after 2+5+7+3+3=20 exposures.
$ccr->AddCode 'b1''<p>code1</p>');
$ccr->AddCode 'b2''<p>code2</p>');
$ccr->AddCode 'b3''<p>code3</p>');
$ccr->AddCode 'b4''<p>code4</p>');
$ccr->AddCode 'b5''includes/code.txt'3FROM_FILE );

// Comment next line if you do not want to display debug information.
$ccr->debug_mode TRUE;

// Display selected code.
$ccr->ShowCode ( );

?>