Changes between Version 1 and Version 2 of PerAppCredit
- Timestamp:
- Aug 15, 2014, 4:20:09 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PerAppCredit
v1 v2 16 16 == Displaying per-app credit == 17 17 18 To display per-app credit on your web site, 18 Per-app credit is displayed and exported in terms of '''sub-projects'''. 19 A sub-project is a named set of apps. 20 Define your sup-projects in ''html/project/project.inc'' in the form 21 {{{ 22 $sub_projects = array( 23 array("name" => "Remote Test", "appids" => array(16)), 24 array("name" => "Uppercase", "appids" => array(1, 25)), 25 ); 26 }}} 27 28 To display per-app credit on your web site 29 (in the user and team pages) 19 30 you must supply functions 20 31 {{{ … … 28 39 The example file '''boinc/html/project.sample/project.inc''' 29 40 contains an example of how to do this. 30 It uses helper functions to do the DB lookups and generate the HTML. 31 The part you supplies looks like 41 Remove the '''if(0)''' and change the sub-project specs to suit your project. 42 43 == Exporting per-app credit == 44 45 The script '''html/ops/export_credit_by_app.php''' exports per-app credit as two files 46 '''user_work.gz''' and '''team_work.gz''' in your html/stats directory. 47 Run this as a periodic task, with an entry of the form 32 48 {{{ 33 function project_user_credit($user){ 34 show_app_credit_user($user, "Remote Test", array(16)); 35 show_app_credit_user($user, "Uppercase", array(1, 25)); 36 } 37 38 function project_team_credit($team) { 39 show_app_credit_team($team, "Remote Test", array(16)); 40 show_app_credit_team($team, "Uppercase", array(1, 25)); 41 } 49 <task> 50 <cmd>run_in_ops ./export_credit_by_app.php</cmd> 51 <period>24 hours</period> 52 <output>export_credit_by_app.out</output> 53 </task> 42 54 }}} 43 44 You supply the application names and IDs. 45 You can combine multiple apps; 46 in this case, credit for apps 1 and 25 are summed 47 and displayed as 'Uppercase". 55 in your config.xml