Ticket #202: ticket-202 v1.diff
File ticket-202 v1.diff, 3.5 KB (added by , 17 years ago) |
---|
-
html/ops/index.php
44 44 candidates for User of the Day.</span></li>\n"; 45 45 } 46 46 47 $local_rev_file = '../../local.revision'; 48 $remote_rev_file = '../cache/repository.revision'; 49 $remote_URL = 'http://boinc.berkeley.edu/svn/trunk'; 50 $update_interval = 60*60*24*7; // check $remote_URL every 7 days 51 52 if (file_exists($local_rev_file)) { 53 $local_rev = file_get_contents($local_rev_file); 54 $remote_rev = 0; 55 56 if (!file_exists($remote_rev_file) || (filemtime($remote_rev_file)+$update_interval < time())) { 57 // get the html output of $remote_url 58 if ($f = fopen($remote_URL, "r")) { 59 while (!feof($f)) { 60 $html_buffer = fgets($f, 512); 61 // Search for the line: Revision 12530 .... 62 $pos = strpos($html_buffer, "Revision "); 63 if ($pos != false) { 64 $remote_rev = substr($html_buffer, $pos + 9, 5); 65 break; 66 } 67 } 68 fclose($f); 69 } 70 file_put_contents($remote_rev_file, $remote_rev); 71 } 72 73 $remote_text = ''; 74 if (file_exists($remote_rev_file)) { 75 $remote_rev = file_get_contents($remote_rev_file); 76 $remote_text = " Newest repository revision: ".$remote_rev; 77 } 78 echo "<li>Currently used svn revison: ".$local_rev.$remote_text."</li>\n"; 79 } 80 47 81 echo "</ul>\n"; 48 82 49 83 echo " 50 84 <p> 51 85 <table border='0'><tr valign='top'> 52 86 <td><b>Browse database:</b> 53 <ul> 87 <ul> 54 88 <li><a href=\"db_action.php?table=platform\">Platforms</a></li> 55 89 <li><a href=\"db_action.php?table=app\">Applications</a></li> 56 90 <li><a href=\"db_form.php?table=app_version\">Application versions</a></li> … … 61 95 <li><a href=\"db_form.php?table=result&detail=low\">Results</a></li> 62 96 </ul> 63 97 64 </td> 98 </td> 65 99 <td><b>Regular Operations:</b> 66 100 <ul> 67 101 <li><a href=\"profile_screen_form.php\">Screen user profiles </a></li> … … 69 103 <li><a href='manage_special_users.php'>Manage special users</a></li> 70 104 </ul> 71 105 72 </td> 106 </td> 73 107 <td><b>Special Operations:</b> 74 108 <ul> 75 109 <li><a href='manage_apps.php'>Manage applications</a></li> … … 85 119 </li> 86 120 <li> 87 121 <form method=\"get\" action=\"clear_host.php\"> 88 Clear Host: 122 Clear Host: 89 123 <input type=\"text\" size=\"5\" name=\"hostid\"> 90 124 <input type=\"submit\" value=\"Clear RPC\"> 91 125 </form> … … 102 136 $show_only = array('all'); // Add all appid's you want to display, or 'all' 103 137 $result = mysql_query("select id, name, deprecated from app"); 104 138 while ($app = mysql_fetch_object($result)) { 105 if ( in_array($app->id, $show_only) 139 if ( in_array($app->id, $show_only) 106 140 || ( in_array("all", $show_only) 107 141 && (!$app->deprecated || $show_deprecated) 108 142 ) … … 113 147 <ul> 114 148 <li> Past 24 hours: 115 149 <a href='result_summary.php?appid=$app->id&nsecs=86400'>summary</a> | 116 <a href='pass_percentage_by_platform.php?appid=$app->id&nsecs=86400'>pass percentage by platform</a> | 150 <a href='pass_percentage_by_platform.php?appid=$app->id&nsecs=86400'>pass percentage by platform</a> | 117 151 <a href='failure_result_summary_by_host.php?appid=$app->id&nsecs=86400'>failure by host</a> | 118 152 <a href='failure_result_summary_by_platform.php?appid=$app->id&nsecs=86400'> failure by platform</a> 119 153 <li>Past 7 days: