get_ptc_ad_v2

From CashCrusaderWiki

(Difference between revisions)
Jump to: navigation, search
(Contest PTC info)
Current revision (20:45, 26 January 2012) (edit) (undo)
(Undo revision 674 by Jutaky (Talk))
 
Line 1: Line 1:
-
{{DISPLAYTITLE:init_contestptc_stats}}
+
{{DISPLAYTITLE:get_ptc_ad_v2}}
-
Action ''init_contestptc_stats'' fetches statistics of a [[Contest_Paid_To_Click_Advertising|contest PTC]] ad group.
+
Action ''get_ptc_ad_v2'' is an improved version of ''[[get_ptc_ad]]'' with added functionality like defining amount of [[PTC_(Paid2Click,_Paid_To_Click)_Ads|PTC]] ads to show at once, showing click counters of ads and country targeting.
-
'''Required CashCrusader version:''' 2.27
+
'''Required CashCrusader version:''' 2.01<br>
 +
'''Required CashCrusader version:''' 2.11 (for country targeting)<br>
 +
'''Required CashCrusader version:''' 2.20 (for translation/customization support)<br>
 +
'''Required CashCrusader version:''' 2.22 (for account type targeting)<br>
 +
'''Required CashCrusader version:''' 2.24 (for improved customization)
-
'''Example usage:'''
+
'''Example basic usage:'''
-
''<?php $contest = action('init_contestptc_stats', 'contest|1|1'); ?>''
+
''<?php action("get_ptc_ad_v2","category,5,1,1,1"); ?>''
-
'''Argument details, from left to right:'''
+
'''Details, from left to right:'''
-
contest = this is the ad group for the contest PTCs<br />
+
category = this is the ad category for PTCs you want to display<br />
-
1 = fetch last contest winner of this specific group, 1=true 0=false<br />
+
5 = this is the amount of PTC ads you want to display<br />
-
1 = calculate user's contest PTC win counter for this specific group, 1=true 0=false<br />
+
1 = show clicks left value, 1=true 0=false<br />
 +
1 = show received clicks, 1=true 0=false<br />
 +
1 = show how much the ad is worth, 1=true 0=false<br />
-
'''Return value:'''
+
'''Example translation:'''
-
This action returns an array which has contest details. If all details are not needed, the call can be optimized by disabling some statistics as described above.
+
$ptc_customization['translated'] = true;<br>
 +
$ptc_customization['message'] = 'The ad above is worth';<br>
 +
$ptc_customization['notfound'] = 'Sorry, no ads are available for you to click on this page at this time';<br>
 +
$ptc_customization['points'] = 'point(s)';<br>
 +
$ptc_customization['cash'] = 'cent(s)';<br>
 +
$ptc_customization['factor'] = 1;<br>
 +
$ptc_customization['forward'] = 'Next Page';<br>
 +
$ptc_customization['back'] = 'Previous Page';<br>
 +
$ptc_customization['clicks_left'] = ' Clicks left'; //(version 2.24)<br>
 +
$ptc_customization['clicks_received'] = ' Clicks received'; //(version 2.24)<br>
-
'''Example return value:'''
+
'''Example customization:'''
-
Array
+
$ptc_customization['link_class'] = 'ptc_link';<br>
-
(
+
$ptc_customization['target'] = '_blank';<br>
-
[prize] => $0.10
+
$ptc_customization['hide_page_number'] = true; //(version 2.24)<br>
-
[clicks_left] => 672
+
-
[last_winner] => JohnDoe
+
-
[wins] => 5
+
-
)
+
 +
''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()''.
-
[[Category:Actions|init_contestptc_stats]]
+
'''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['clicks_left'] = ' Clicks left';
 +
$ptc_customization['clicks_received'] = ' Clicks received';
 +
$ptc_customization['link_class'] = 'ptc_link';
 +
$ptc_customization['target'] = '_blank';
 +
$ptc_customization['hide_page_number'] = false;
 +
action("get_ptc_ad_v2","category,5,1,1,1");
 +
?>
 +
 
 +
 
 +
 
 +
 
 +
[[Category:Actions|get_ptc_ad_v2]]
[[Category:Customize]]
[[Category:Customize]]

Current revision

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)
Required CashCrusader version: 2.22 (for account type targeting)
Required CashCrusader version: 2.24 (for improved customization)


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';
$ptc_customization['clicks_left'] = ' Clicks left'; //(version 2.24)
$ptc_customization['clicks_received'] = ' Clicks received'; //(version 2.24)


Example customization:

$ptc_customization['link_class'] = 'ptc_link';
$ptc_customization['target'] = '_blank';
$ptc_customization['hide_page_number'] = true; //(version 2.24)

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['clicks_left'] = ' Clicks left';
  $ptc_customization['clicks_received'] = '  Clicks received';
  $ptc_customization['link_class'] = 'ptc_link';
  $ptc_customization['target'] = '_blank';
  $ptc_customization['hide_page_number'] = false;
  action("get_ptc_ad_v2","category,5,1,1,1"); 
 ?>
Personal tools
Administration manual