Changeset 203254
- Timestamp:
- 02/08/2010 02:32:43 PM (15 years ago)
- Location:
- woopra/trunk
- Files:
-
- 2 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
woopra/trunk/css/analytics.css
r200971 r203254 123 123 */ 124 124 125 .woopra _table {125 .woopratable { 126 126 width: 100%; 127 127 } 128 128 129 129 130 .woopra _table td, .woopra_table th {130 .woopratable th { 131 131 height: 20px; 132 132 padding: 5px; … … 163 163 } 164 164 165 .w linechart{165 .w { 166 166 text-align: center; 167 167 padding: 5px !important; -
woopra/trunk/inc/admin.php
r201117 r203254 185 185 186 186 /** jQuery Scripts */ 187 wp_enqueue_script( 'woopra-analytics', $plugin_url. '/js/jquery.analytics.js', array('jquery') );187 wp_enqueue_script( 'woopra-analytics', $plugin_url. '/js/jquery.analytics.js', array('jquery') ); 188 188 wp_localize_script( 'woopra-analytics', 189 189 'woopraL10n', … … 234 234 ) 235 235 ); 236 237 // ** jQuery UI Datepicker **/ 238 wp_enqueue_script( 'woopra-datepicker', $plugin_url . '/js/ui.datepicker.js', array('jquery') ); 239 240 // @todo Update with Flash Version 241 wp_enqueue_script( 'woopra-swfobject', $plugin_url . '/js/swfobject.js' ); 236 // ** jQuery Plugins Needed **/ 237 wp_enqueue_script( 'woopra-md5', $plugin_url . '/js/jquery.md5.js', array('jquery', 'woopra-analytics') ); 238 wp_enqueue_script( 'woopra-flash', $plugin_url . '/js/jquery.flash.js', array('jquery', 'woopra-analytics') ); 239 wp_enqueue_script( 'woopra-datepicker', $plugin_url . '/js/ui.datepicker.js', array('jquery', 'woopra-analytics') ); 240 242 241 // *** SYTLE SHEETS ***/ 243 242 wp_enqueue_style( 'woopra-analytics', $plugin_url . '/css/analytics.css' ); -
woopra/trunk/inc/render.php
r201708 r203254 226 226 arsort($entries); // force arsort. 227 227 ?> 228 <table class="woopra _table" width="100%" cellpadding="0" cellspacing="0">228 <table class="woopratable" width="100%" cellpadding="0" cellspacing="0"> 229 229 <tr> 230 230 <th class="text-header"><?php _e("Day", 'woopra') ?></th> … … 241 241 242 242 // Time Code 243 243 244 //$timespentstring = $this->woopra_ms_to_string((int) $entry['totalTimeSpent']); 244 // Vistor Code 245 246 // Visitors Code 245 247 $newvisitors = (int) $entry['totalNewVisitors']; 246 248 $visitors = (int) $entry['totalVisitors']; 247 249 250 248 251 $visitorsstring = "-"; 249 252 if ($newvisitors <= $visitors && $visitors != 0) { … … 253 256 // Page Views Code 254 257 $pageviews = (int) $entry['totalPageviews']; 258 255 259 // Percent Code 256 260 $percent = round($pageviews*100/$max); 257 261 258 $hashid = $this->woopra_friendly_hash('GLOBALS'); 262 // Hash ID 263 $hashid = $this->woopra_friendly_hash($this->api_page); 259 264 260 265 ?> … … 264 269 <td class="text-item"><?php echo $visitorsstring; ?></td> 265 270 <td class="text-item"><?php echo number_format($visitors); ?></td> 266 <td class="text-item highlight"><a href="#" onclick="return expand ByDay('GLOBALS', '<?php echo $hashid; ?>', <?php echo $counter; ?>, <?php echo $entry['index']; ?>)"><?php echo number_format($pageviews); ?></a></td>271 <td class="text-item highlight"><a href="#" onclick="return expand; ?>)"><?php echo number_format($pageviews); ?></a></td> 267 272 <td class="bar"><?php echo $this->woopra_bar($percent); ?></td> 268 273 </tr> 269 <tr id="w lc-<?php echo $hashid; ?>-<?php echo $counter; ?>" style=" height: 120px; display: none;">270 <td class="w linechart" id="linecharttd-<?php echo $hashid; ?>-<?php echo $counter ?>" colspan="6"></td>274 <tr id="w-<?php echo $hashid; ?>-<?php echo $counter; ?>" style=" height: 120px; display: none;"> 275 <td class="wtd-<?php echo $hashid; ?>-<?php echo $counter ?>" colspan="6"></td> 271 276 </tr> 272 277 <?php … … 327 332 <?php 328 333 } 329 330 /** 331 * Render Referrers Section 332 * @return 333 * @param object $entries 334 * @param object $key 335 */ 336 function render_referrers($entries, $key) { 337 338 ?> 339 <table class="woopra_table" width="100%" cellpadding="0" cellspacing="0"> 340 <tr> 341 <th> </th> 342 <th class="text-header"><?php _e('Referrer', 'woopra'); ?></th> 343 <th class="text-header" width="100"><?php _e('Hits', 'woopra'); ?></th> 344 <th width="400"> </th> 345 </tr> 346 <?php 347 348 $counter = 0; 349 $sum = $this->woopra_sum($entries, 'vts'); 350 351 foreach($entries as $index => $entry) { 352 $name = urldecode($entry['name']); 353 $hits = (int) $entry['vts']; 354 $meta = urldecode($entry['meta']); 355 356 $percent = 0; 357 if ($sum != 0) 358 $percent = round($hits*100/$sum); 359 360 $hashid = $this->woopra_friendly_hash($key); 361 ?> 362 <tr<?php echo (($counter++%2==0) ? " class=\"even_row\"" : "" ); ?>> 363 <td class="index"><?php echo $counter; ?></td> 364 <td><span class="ellipsis"><a href="<?php echo $name; ?>" target="_blank"><?php echo $this->woopra_render_name($key, $name, $meta); ?></a></span></td> 365 <td width="100" class="text-item highlight"><a href="#" onclick="return expandByDay('<?php echo $key; ?>', '<?php echo $hashid; ?>', <?php echo $counter; ?>, <?php echo $entry['index']; ?>)"><?php echo $hits; ?></a></td> 366 <td class="bar"><?php echo $this->woopra_bar($percent) ?></td> 367 </tr> 368 <tr id="wlc-<?php echo $hashid; ?>-<?php echo $counter ?>" style=" height: 120px; display: none;"><td class="wlinechart" id="linecharttd-<?php echo $hashid ?>-<?php echo $counter; ?>" colspan="4"></td></tr> 369 <tr id="refexp-<?php echo $hashid; ?>-<?php echo $counter; ?>" style="display: none;"><td colspan="4" style="padding: 0;"><div id="refexptd-<?php echo $hashid; ?>-<?php echo $counter; ?>"></div></td></tr> 370 <?php 371 } 372 ?> 373 </table> 374 <?php 375 } 376 334 377 335 /** 378 336 * Render the chart data format. Using Open-Flash-2 PHP Librarys -
woopra/trunk/js/jquery.analytics.js
r201084 r203254 30 30 31 31 var pageKeys = new Array(); 32 32 33 33 34 var defaultSubTab = new Array(); … … 88 89 // Create API Key Array 89 90 pageKeys[superid + '-' + id] = keys; 91 92 93 94 90 95 91 96 // If the 'defaultSubTab' tab is null for this super id, set it to the id. … … 221 226 }, 222 227 function(returned_data) { 223 if (returned_data != null) 228 if (returned_data != null) { 229 // Return the data.. 224 230 jQuery('#woopra-data-' + area).html(returned_data); 225 else231 226 232 jQuery('#woopra-data-' + area).html(woopraL10n.error); 233 227 234 } 228 235 ); … … 231 238 232 239 /** 233 * Debug Function! 240 * Expand Line Chart for Rendering the Flash Chart 241 * @param {Object} key 242 * @param {Object} hashid 243 * @param {Object} id 244 */ 245 function expandLineChart(key, hashid, id) { 246 247 if ( jQuery('#woopra-chart-line-tr-' + hashid + '-' + id).attr('class') == 'loaded' ) 248 { 249 // Hide the 'tr' 250 jQuery('#woopra-chart-line-tr-' + hashid + '-' + id).attr("style", "display: none;").removeAttr("class"); 251 // Clear the flash element. So it can be reloaded at a future time. 252 jQuery('#woopra-chart-line-td-' + hashid + '-' + id).html(); 253 // Return False 254 return false; 255 } 256 257 // Show Chart Line 'tr' 258 jQuery('#woopra-chart-line-tr-' + hashid + '-' + id).attr("style", "display: table-row;").addClass("loaded"); 259 260 var phpfile = woopraL10n.siteurl + '/wp-admin/admin-ajax.php?action=woopra&datatype=flash&apikey=' + woopradefaultL10n.apikey + '&id=' + index + '&wkey=' + key + '&date_format=' + date_format + '&from=' + date_from + '&to=' + date_to; 261 262 // Flash jQuery Code 263 jQuery('#woopra-chart-line-td-' + hashid + '-' + id).flash({ 264 src: woopraL10n.siteurl + '/flash/open-flash-chart.swf', 265 data-file: escape(phpfile), 266 width: 968, 267 height: 110, 268 quality: 'best', 269 bgcolor: '#FFFFFF', 270 allowFullScreen: 'false', 271 menu: 'false', 272 allowScriptAccess: 'sameDomain', 273 wmode: 'transparent', 274 expressInstall: true 275 }, { 276 version: 10 277 }, 278 function(htmlOptions){ 279 jQuery(this).html(jQuery.fn.flash.transform(htmlOptions)); 280 }); 281 282 return false; 283 } 284 285 /** 286 * Debug 234 287 * @param {Object} message 235 288 */ 236 289 function debug(message) { 237 if (typeof console != 'undefined' && typeof console.debug != 'undefined' && $.fn.trackEvent.defaults.debug) {290 if (typeof console != 'undefined' && typeof console.debug != 'undefined') { 238 291 console.debug(message); 239 292 } 240 } ;293 } 241 294 242 295 /** Non "Global" Functions **/ … … 340 393 341 394 }); 342 343 /************************344 *345 * I am changing this code to jQuery Syle.346 *347 ************************/348 349 function expandByDay(key, hashid, id, index) {350 var row = document.getElementById('wlc-' + hashid + '-' + id);351 if (row.style.display == 'table-row') {352 row.style.display = 'none';353 }354 else {355 row.style.display = 'table-row';356 }357 358 if (row.className == 'loaded') {359 return false;360 }361 row.className = 'loaded';362 363 var phpfile = woopraL10n.siteurl + '/wp-admin/admin-ajax.php?action=woopra&datatype=flash&apikey=' + woopradefaultL10n.apikey + '&id=' + index + '&wkey=' + key + '&date_format=' + date_format + '&from=' + date_from + '&to=' + date_to;364 var so = new SWFObject(woopraL10n.baseurl + "/flash/open-flash-chart.swf", hashid, "968", "110", "9");365 so.addVariable("data-file", escape(phpfile));366 so.addParam("allowScriptAccess", "sameDomain");367 so.addParam("wmode", "transparent");368 so.addParam("bgcolor", "#FFFFFF");369 370 so.write('linecharttd-' + hashid + '-' + id);371 return false;372 }373 374 function expandReferrer(key, hashid) {375 trref = document.getElementById('refexp-'+hashid);376 if (trref.style.display == 'none') {377 trref.style.display = 'table-row';378 }379 else {380 trref.style.display = 'none';381 }382 if (trref.className == 'loaded') { return false; }383 384 trref.className = 'loaded';385 386 tdref = document.getElementById('refexptd-' + hashid);387 setPageLoading('refexptd-' + hashid);388 requestData('refexptd-' + hashid, key);389 return false;390 }
Note: See TracChangeset
for help on using the changeset viewer.