Changeset 178532
- Timestamp:
- 12/01/2009 06:44:52 PM (16 years ago)
- Location:
- wp-vent-spy/trunk
- Files:
-
- 5 edited
-
includes/buildTable.php (modified) (5 diffs)
-
includes/cURL.php (modified) (1 diff)
-
includes/status.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
wp-vent-spy.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-vent-spy/trunk/includes/buildTable.php
r160724 r178532 2 2 //buildtable 3 3 //require_once('logtimer.php'); 4 function buildTable( &$stat, $name, $cid ,$base , $chcolor, $adcolor, $phcolor, $uscolor, $fancy) {4 function buildTable( &$stat, $name, $cid ,$base) { 5 5 $tab1 = "\t"; 6 6 $tab2 = "\t\t"; … … 10 10 $nl = "\n"; 11 11 12 $addchan = "<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px;'>";13 $closechan = "</font></td></tr></table>";14 $closeimg = "</td><td style='height: 14px;' <font size='2' style=\"color: ".$chcolor.";\">";15 12 $chan = $stat->ChannelFind( $cid ); 16 13 17 if($fancy == "FALSE"){ 18 19 if($stat->ClientFind($cid)){ 20 switch($chan->m_prot){ 21 case 1: 22 $chanImg = "<font style=\"color: #ff0000; font-weight: bold; font-size: 9pt;\">-</font>"; 23 break; 24 case 2: 25 $chanImg = "<font style=\"color: #ffff00; font-weight: bold; font-size: 9pt;\">-</font>"; 26 break; 27 default: 28 $chanImg = "<font style=\"color: #00ff00; font-weight: bold; font-size: 9pt;\">-</font>"; 29 break; 30 } 31 }else{ 32 switch($chan->m_prot){ 33 case 1: 34 $chanImg = "<font style=\"color: #ff0000; font-weight: bold; font-size: 9pt;\">+</font>"; 35 break; 36 case 2: 37 $chanImg = "<font style=\"color: #ffff00; font-weight: bold; font-size: 9pt;\">+</font>"; 38 break; 39 default: 40 $chanImg = "<font style=\"color: #00ff00; font-weight: bold; font-size: 9pt;\">+</font>"; 41 break; 42 } 14 if($stat->ClientFind($cid)){ 15 switch($chan->m_prot){ 16 case 1: 17 $cha = $tab2."<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px; width: 18px;'><img style='padding-top: 2px; padding-right: 3px;' src='http://www.onykage.com/vspy/images/chan_pass_on.gif' alt='' /></td><td style='height: 14px;' <font size='2'>" . $name . "</font></td></tr></table>".$nl; 18 break; 19 case 2: 20 $cha = $tab2."<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px; width: 18px;'><img style='padding-top: 2px; padding-right: 3px;' src='http://www.onykage.com/vspy/images/chan_auth_on.gif' alt='' /></td><td style='height: 14px;' <font size='2'>" . $name . "</font></td></tr></table>".$nl; 21 break; 22 default: 23 $cha = $tab2."<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px; width: 18px;'><img style='padding-top: 2px; padding-right: 3px;' src='http://www.onykage.com/vspy/images/chan_pub_on.gif' alt='' /></td><td style='height: 14px;' <font size='2'>" . $name . "</font></td></tr></table>".$nl; 24 break; 43 25 } 44 } else { 45 $imgOtag = "<img style='padding-top: 2px; padding-right: 3px;' src='".$_SERVER['HTTP_REFERER']."wp-content/plugins/wp-vent-spy/includes/images/"; 46 $imgCtag = "' alt='' />"; 47 if($stat->ClientFind($cid)){ 48 switch($chan->m_prot){ 49 case 1: 50 $img = "chan_pass_on.gif"; 51 break; 52 case 2: 53 $img = "chan_auth_on.gif"; 54 break; 55 default: 56 $img = "chan_pub_on.gif"; 57 break; 58 } 59 }else{ 60 switch($chan->m_prot){ 61 case 1: 62 $img = "chan_pass_off.gif"; 63 break; 64 case 2: 65 $img = "chan_auth_off.gif"; 66 break; 67 default: 68 $img = "chan_pub_off.gif"; 69 break; 70 } 26 }else{ 27 switch($chan->m_prot){ 28 case 1: 29 $cha = $tab2."<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px; width: 18px;'><img style='padding-top: 2px; padding-right: 3px;' src='http://www.onykage.com/vspy/images/chan_pass_off.gif' alt='' /></td><td style='height: 14px;' <font size='2'>" . $name . "</font></td></tr></table>".$nl; 30 break; 31 case 2: 32 $cha = $tab2."<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px; width: 18px;'><img style='padding-top: 2px; padding-right: 3px;' src='http://www.onykage.com/vspy/images/chan_auth_off.gif' alt='' /></td><td style='height: 14px;' <font size='2'>" . $name . "</font></td></tr></table>".$nl; 33 break; 34 default: 35 $cha = $tab2."<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px; width: 18px;'><img style='padding-top: 2px; padding-right: 3px;' src='http://www.onykage.com/vspy/images/chan_pub_off.gif' alt='' /></td><td style='height: 14px;' <font size='2'>" . $name . "</font></td></tr></table>".$nl; 36 break; 71 37 } 72 $chanImg = $imgOtag.$img.$imgCtag; 73 } 74 $cha = $tab2.$addchan.$chanImg.$closeimg.$name.$closechan.$nl; 38 } 75 39 if($base){ 76 if($fancy == "FALSE"){ 77 $cha = "<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px;'></td><td style='height: 14px;' <font size='2' style=\"color: ".$chcolor.";\">" . $name . "</font></td></tr></table>"; 78 } else { 79 $cha = "<table border='0' cellpadding='0' cellspacing='0' style='height: 14px;'><tr><td style='height: 14px;'><img style='padding-top: 2px;' src='".$_SERVER['HTTP_REFERER']."wp-content/plugins/wp-vent-spy/includes/images/pc.gif' alt='' /></td><td style='height: 14px;' <font size='2' style=\"color: ".$chcolor.";\">" . $name . "</font></td></tr></table>"; 80 } 40 $cha = "<table border='0' cellpadding='0' cellspacing='0' style='height: 14px; width: 18px;'><tr><td style='height: 14px; width: 18px;'><img style='padding-top: 2px;' src='http://www.onykage.com/vspy/images/pc.gif' alt='' /></td><td style='height: 14px; width: 18px;' <font size='2'>" . $name . "</font></td></tr></table>"; 81 41 echo $tab1."<div style='font-family: arial, 'lucida console', sans-serif; font-size: 7pt;'>".$nl.$tab2."<strong>\n"; 82 42 echo $tab3.$cha.$nl; … … 104 64 //echo "<div>"; 105 65 106 $flags = $uscolor;66 $flags = "#386DA1"; 107 67 108 68 if ( $client->m_admin ) 109 $flags = $adcolor;69 $flags = "#8F2E11"; 110 70 111 71 if ( $client->m_phan ) 112 $flags = $phcolor;72 $flags = "#98A019"; 113 73 114 74 //if ( strlen( $flags ) ) … … 117 77 if($client->m_comm){$comm = ", " . $client->m_comm;} 118 78 if(substr($client->m_comm,0,7)=="http://"){$link = "href='" . $client->m_comm . "' target='_blank'";} 119 if($fancy == "FALSE"){ 120 echo $tab5."<table border='0' cellpadding='0' cellspacing='0' style='table-layout: fixed; margin: 1px; cursor: pointer;'><tr><td style='height: 14px;'></td><td style='height: 14px; font-size: 8pt; font-family: arial, 'lucida console', sans-serif;'><a style='text-decoration: none;' ".$link." title='Ping:" . $client->m_ping . ", Connected: " . logtime($inputval) . " " . $comm . "'><font style=\"color: ".$flags.";\">" . $client->m_name . "</font></a></td></tr></table>\n"; 121 }else{ 122 echo $tab5."<table border='0' cellpadding='0' cellspacing='0' style='table-layout: fixed; margin: 1px; cursor: pointer;'><tr><td style='height: 14px;'><img src='".$_SERVER['HTTP_REFERER']."wp-content/plugins/wp-vent-spy/includes/images/user_off.gif' alt='' /></td><td style='height: 14px; color: ".$flags."; font-size: 8pt; font-family: arial, 'lucida console', sans-serif;'><a style='text-decoration: none;' ".$link." title='Ping:" . $client->m_ping . ", Connected: " . logtime($inputval) . " " . $comm . "'><font style=\"color: ".$flags.";\">" . $client->m_name . "</font></a></td></tr></table>\n"; 123 } 124 //echo $tab5."<div style='color: ".$flags."; font-size: 8pt; font-family: arial, 'lucida console', sans-serif;'><img src='".$_SERVER['HTTP_REFERER']."wp-content/plugins/wp-vent-spy/includes/images/user_off.gif' alt='' /><a ".$link." title='Ping:" . $client->m_ping . ", Connected: " . logtime($inputval) . " " . $comm . "'>" . $client->m_name . "</a>".$nl."</div>".$nl; 79 echo $tab5."<table border='0' cellpadding='0' cellspacing='0' style='table-layout: fixed; margin: 1px; cursor: pointer;'><tr><td style='height: 14px; width: 18px;'><img src='http://www.onykage.com/vspy/images/user_off.gif' alt='' /></td><td style='height: 14px; color: ".$flags."; font-size: 8pt; font-family: arial, 'lucida console', sans-serif;'><a style='text-decoration: none;' ".$link." title='Ping:" . $client->m_ping . ", Connected: " . logtime($inputval) . " " . $comm . "'>" . $client->m_name . "</a></td></tr></table>\n"; 80 //echo $tab5."<div style='color: ".$flags."; font-size: 8pt; font-family: arial, 'lucida console', sans-serif;'><img src='http://www.onykage.com/vspy/images/user_off.gif' alt='' /><a ".$link." title='Ping:" . $client->m_ping . ", Connected: " . logtime($inputval) . " " . $comm . "'>" . $client->m_name . "</a>".$nl."</div>".$nl; 125 81 // echo "</div>\n"; 126 82 $comm = ""; … … 144 100 //} 145 101 146 buildTable( $stat, $cn, $stat->m_channellist[ $i ]->m_cid, "" , $chcolor, $adcolor, $phcolor, $uscolor, $fancy);102 buildTable( $stat, $cn, $stat->m_channellist[ $i ]->m_cid, "" ); 147 103 } 148 104 } 149 105 150 echo $tab4."</div>\n";151 echo $tab3."</div>\n";106 echo "\t\t\t\t</div>\n"; 107 echo "\t\t\t</div>\n"; 152 108 } 153 109 ?> -
wp-vent-spy/trunk/includes/cURL.php
r167812 r178532 43 43 CURLOPT_FOLLOWLOCATION => true, // follow redirects 44 44 CURLOPT_ENCODING => "", // handle all encodings 45 CURLOPT_USERAGENT => " ql.sjkp.dk spider v01", // who am i45 CURLOPT_USERAGENT => "vent-spy", // who am i 46 46 CURLOPT_AUTOREFERER => true, // set referer on redirect 47 47 CURLOPT_CONNECTTIMEOUT => 3, // timeout on connect -
wp-vent-spy/trunk/includes/status.php
r167812 r178532 11 11 $hosted = $_POST['hosted']; 12 12 $fancy = $_POST['fancy']; 13 13 14 14 15 if($hosted == "FALSE") { … … 32 33 33 34 } else { 34 $tmp = cURLget_webpage("http://www.onykage.com/vspy/extremespy.php?svr=".$_POST['vaddy']."&prt=".$_POST['vport']."&psw=".$_POST['vpass'] );35 $tmp = cURLget_webpage("http://www.onykage.com/vspy/extremespy.php?svr=".$_POST['vaddy']."&prt=".$_POST['vport']."&psw=".$_POST['vpass']."&page=".$_POST['thispage']); 35 36 if ($tmp['errno'] == 0){ 36 37 $stuff = $tmp['content']; -
wp-vent-spy/trunk/readme.txt
r167812 r178532 85 85 replaced php file_get_content() with cURL libs as a php.ini workaround for hosted option. 86 86 87 1.0.366 88 fixed several precurser parse and instant errors. 89 added some security fixes 90 added some statitical resorce information to help with debugging. 91 87 92 == Frequently Asked Questions == 88 93 -
wp-vent-spy/trunk/wp-vent-spy.php
r167812 r178532 20 20 Description: Ventrilo Status Monitor for Wordpress 21 21 Author: Onykage 22 Version: 1.0.3 2622 Version: 1.0.366 23 23 Author URI: http://www.onykage.com 24 24 */ … … 69 69 //|>> replaced file_get_content with cURL. for a php.ini workaround. | 70 70 //| | 71 //|-----------------------------------------------------------------------------| 72 //|2009-12-01 >> Update | 73 //| | 74 //|>> fixed several precurser parse and instant errors. | 75 //|>> added some security fixes | 76 //|>> added some statitical resorce information to help with debugging. | 77 //| | 71 78 //|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-| 72 79 //| GPL & MIT LICENSE | … … 97 104 98 105 // Hook for adding admin menus 99 add_action('admin_menu', ' mt_add_pages');100 add_action('admin_head', ' options_tools');106 add_action('admin_menu', 'vspy_add_pages'); 107 add_action('admin_head', 'vspy_options_tools'); 101 108 102 109 // action function for above hook 103 function mt_add_pages() {110 function vspy_add_pages() { 104 111 // Add a new submenu under Options: 105 add_options_page('WP Vent Spy', 'WP Vent Spy', 'administrator', 'VentSpy Options', ' mt_options_page');112 add_options_page('WP Vent Spy', 'WP Vent Spy', 'administrator', 'VentSpy Options', 'vspy_options_page'); 106 113 } 107 114 108 function options_tools() {115 function vspy_options_tools() { 109 116 $plugin_url = defined('WP_PLUGIN_URL') ? trailingslashit(WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__))) : trailingslashit(get_bloginfo('wpurl')) . PLUGINDIR . '/' . dirname(plugin_basename(__FILE__)); 110 117 ?> … … 115 122 116 123 // mt_options_page() displays the page content for the options submenu 117 function mt_options_page() {124 function vspy_options_page() { 118 125 include 'includes/options.php'; 119 126 } … … 121 128 122 129 //error_reporting(E_ALL); 123 add_action("widgets_init", ' register');130 add_action("widgets_init", 'load_vspy_widget'); 124 131 125 function widget($args){132 function vspy_widget($args){ 126 133 wp_enqueue_script("jquery"); 127 134 $plugin_url = defined('WP_PLUGIN_URL') ? trailingslashit(WP_PLUGIN_URL . '/' . dirname(plugin_basename(__FILE__))) : trailingslashit(get_bloginfo('wpurl')) . PLUGINDIR . '/' . dirname(plugin_basename(__FILE__)); … … 145 152 } 146 153 function getStatus(){ 147 jQuery.post("<?php echo $plugin_url; ?>includes/status.php", {vaddy: "<?php echo get_option('vaddy'); ?>", vport: "<?php echo get_option('vport'); ?>", vpass: "<?php echo get_option('vpass'); ?>", vsname: "<?php echo get_option('vsname'); ?>", hosted: "<?php echo get_option('hosted'); ?>", fancy: "<?php echo get_option('fancytog'); ?>", chcolor: "<?php echo get_option('chcolor'); ?>", adcolor: "<?php echo get_option('adcolor'); ?>", phcolor: "<?php echo get_option('phcolor'); ?>", uscolor: "<?php echo get_option('uscolor'); ?>" },154 jQuery.post("<?php echo $plugin_url; ?>includes/status.php", {vaddy: "<?php echo get_option('vaddy'); ?>", vport: "<?php echo get_option('vport'); ?>", vpass: "<?php echo get_option('vpass'); ?>", vsname: "<?php echo get_option('vsname'); ?>", hosted: "<?php echo get_option('hosted'); ?>", fancy: "<?php echo get_option('fancytog'); ?>", chcolor: "<?php echo get_option('chcolor'); ?>", adcolor: "<?php echo get_option('adcolor'); ?>", phcolor: "<?php echo get_option('phcolor'); ?>", uscolor: "<?php echo get_option('uscolor'); ?>", thispage: "<?php echo get_bloginfo('url');?>"}, 148 155 function(data){ 149 156 jQuery('#vspy').html(data); … … 163 170 echo $args['after_widget']; 164 171 } 165 function register(){166 wp_register_sidebar_widget( 'vspy1', 'WP Vent Spy', ' widget', array('description' => __('A simple Ventrilo server status monitor for Wordpress.')) );172 function load_vspy_widget(){ 173 wp_register_sidebar_widget( 'vspy1', 'WP Vent Spy', 'vspy_widget', array('description' => __('A simple Ventrilo server status monitor for Wordpress.')) ); 167 174 } 168 175
Note: See TracChangeset
for help on using the changeset viewer.