get_ptc_ad_v2

From CashCrusaderWiki

Revision as of 14:48, 1 May 2010 by Jutaky (Talk | contribs)
Jump to: navigation, search

Action get_ptc_ad_v2 is an improved version of get_ptc_ad with added functionality like defining amount of PTC ads to show at once, showing click counters of ads and country targeting.


Required CashCrusader version: 2.01
Required CashCrusader version: 2.11 (for country targeting)
Required CashCrusader version: 2.20 (for translation/customization support)


Example basic usage:

<?php action("get_ptc_ad_v2","category,5,1,1,1"); ?>


Details, from left to right:

category = this is the ad category for PTCs you want to display
5 = this is the amount of PTC ads you want to display
1 = show clicks left value, 1=true 0=false
1 = show received clicks, 1=true 0=false
1 = show how much the ad is worth, 1=true 0=false


Example translation:

$ptc_customization['translated'] = true;
$ptc_customization['message'] = 'The ad above is worth';
$ptc_customization['notfound'] = 'Sorry, no ads are available for you to click on this page at this time';
$ptc_customization['points'] = 'point(s)';
$ptc_customization['cash'] = 'cent(s)';
$ptc_customization['factor'] = 1;
$ptc_customization['forward'] = 'Next Page';
$ptc_customization['back'] = 'Previous Page';


Example customization:

$ptc_customization['link_class'] = 'ptc_link';
$ptc_customization['target'] = '_blank';

Link_class is the CSS class attached to each PTC link and target is HTML target for the links.

Add translation and customization PHP codes before calling the action().


Complete example with customization and translation codes:

 <?php
  $ptc_customization['translated'] = true;
  $ptc_customization['message'] = 'The ad above is worth';
  $ptc_customization['notfound'] = 'Sorry, no ads are available for you to click on this page at this time';
  $ptc_customization['points'] = 'point(s)';
  $ptc_customization['cash'] = 'cent(s)';
  $ptc_customization['factor'] = 1;
  $ptc_customization['forward'] = 'Next Page';
  $ptc_customization['back'] = 'Previous Page';
  $ptc_customization['link_class'] = 'ptc_link';
  $ptc_customization['target'] = '_blank';
  action("get_ptc_ad_v2","category,5,1,1,1"); 
 ?>
Personal tools
Administration manual