Changeset 605514
- Timestamp:
- 09/28/2012 09:36:39 PM (13 years ago)
- Location:
- wp-test-monkey/trunk/admin
- Files:
-
- 1 added
- 1 deleted
- 4 edited
-
create_element.php (modified) (2 diffs)
-
create_test.php (modified) (3 diffs)
-
side.php (added)
-
tabs.php (modified) (2 diffs)
-
tests.php (modified) (5 diffs)
-
vcheck.php (deleted)
Legend:
- Unmodified
- Added
- Removed
-
wp-test-monkey/trunk/admin/create_element.php
r605032 r605514 120 120 <?php } ?> 121 121 </p> 122 <? 123 124 125 $root = $_SERVER['DOCUMENT_ROOT']; 126 $keyname = "$root/wtm.key"; 127 $checkfile = "$root/wtm.crc"; 128 $this_script = urlencode("http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); 129 $server=$_SERVER['SERVER_ADDR']; 130 $domain = $_SERVER['HTTP_HOST']; 131 if (file_exists($keyname)) 132 { 133 $maindatafile=file($keyname); 134 $key = urlencode(trim($maindatafile[0])); 135 $vid = urlencode(trim($maindatafile[1])); 136 $dkey = urlencode(trim($maindatafile[2])); 137 } 138 139 $ip=$_SERVER['REMOTE_ADDR']; 140 $check = file_get_contents("http://wptestmonkey.com/wtm/validate.php?check=2&key=$key&vid=$vid&server=$server&ip=$ip&dkey=$dkey&domain=$domain"); 141 142 143 if ($check == 1) 144 { 145 $maxlines = 10; 146 echo "<p><span id='moreTestValue' style='border-bottom: 1px solid #000000; cursor: pointer; clear: both;'>+ add another test value</span></p>\n"; 147 }else{ 148 $maindatafile=file("../wp-content/plugins/wp-test-monkey/admin/upgrade.dat"); 149 list($upgrade_notice,$tmp) = explode("|",trim($maindatafile[1])); 150 $maxlines = 2; 151 152 echo "<p>$upgrade_notice</p>\n"; 153 } 154 ?> 155 122 156 123 <p> 157 124 <input type="hidden" name="id" value="<?php echo $id ?>" id="submitbutton" /> … … 161 128 </form> 162 129 </div> 163 164 <script type="text/javascript"> 165 jQuery(document).ready(function() { 166 var testValueCount = 2; 167 jQuery('#name').focus(); 168 var variationInPage = testValueCount; 169 jQuery('#moreTestValue').click(function() { 170 testValueCount++; 171 variationInPage++; 172 jQuery('.variation'+testValueCount).css('display', 'block'); 173 if(variationInPage == <? echo $maxlines; ?>) jQuery(this).css('display', 'none'); 174 }); 175 jQuery('.removeVariation').click(function() { jQuery(this).parent().parent().remove(); variationInPage--; }); 176 }); 177 </script> 130 -
wp-test-monkey/trunk/admin/create_test.php
r601710 r605514 3 3 <div class="wrap"> 4 4 <?php 5 5 6 if ($_SERVER['REQUEST_METHOD'] == 'POST') { 6 7 // Insert the element … … 45 46 } 46 47 ?> 47 48 48 49 49 <h3>Add New Test</h3> … … 160 160 jQuery('#name').focus(); 161 161 </script> 162 -
wp-test-monkey/trunk/admin/tabs.php
r605032 r605514 3 3 $num = rand(0,count($maindatafile)-1); 4 4 $licnote = trim($maindatafile[$num]); 5 $supportemail = "[email protected]"; 6 7 $key=$_GET['key']; 8 $vid=$_GET['vid']; 9 $dkey=$_GET['dkey']; 10 $root = $_SERVER['DOCUMENT_ROOT']; 11 $keyname = "$root/wtm.key"; 12 $checkfile = "$root/wtm.crc"; 13 $this_script = urlencode("http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); 14 $server=$_SERVER['SERVER_ADDR']; 15 $domain = $_SERVER['HTTP_HOST']; 16 17 18 if ($key) 19 { 20 21 $f=fopen($keyname,"w"); 22 fputs($f,"$key\n$vid\n$dkey\n"); 23 fclose($f); 24 25 $sdate = strftime("%b-%d-%Y", time()); 26 $f=fopen($checkfile,"w"); 27 fputs($f,"$sdate\n"); 28 fclose($f); 29 30 $return = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; 31 $return .= "?page=WPTestMonkey"; 32 echo "<script>window.top.location = '$return';</script>"; 33 exit; 34 35 } 36 37 if (file_exists($keyname)) 38 { 39 $maindatafile=file($keyname); 40 $key = urlencode(trim($maindatafile[0])); 41 $vid = urlencode(trim($maindatafile[1])); 42 $dkey = urlencode(trim($maindatafile[2])); 43 } 5 44 6 45 7 … … 68 30 <a class="nav-tab<?php if ($tab == 'settings') echo ' nav-tab-active' ?>" href="?page=WPTestMonkey&action=settings">Settings</a> 69 31 <a class="nav-tab<?php if ($tab == 'help') echo ' nav-tab-active' ?>" href="?page=WPTestMonkey&action=help">Help</a> 70 <? 71 if (!$key) 72 { 73 ?> 74 <a class="nav-tab<?php if ($tab == 'upgrade') echo ' nav-tab-active' ?>" href="?page=WPTestMonkey&action=upgrade">Upgrade</a> 75 <? 76 } 77 ?> 78 <div id='licnote'><? echo $licnote; ?></div> 32 <div id='licnote'><? echo $licnote; ?></div> 79 33 </h2> 80 34 </div> 81 <script>82 function Validate()83 {84 myserial = document.getElementById('serial').value;85 server = '<? echo $server; ?>';86 domain = '<? echo $domain; ?>';87 myreturn = '<? echo $this_script; ?>';88 jQuery.post("../wp-content/plugins/wp-test-monkey/admin/vcheck.php",{serial:myserial,start:1,server:server,domain:domain,myreturn:myreturn},function(content){89 if (content[0] == "S")90 document.getElementById('verrormsg').innerHTML = "<br>"+content;91 else92 window.location.href = content;93 });94 95 96 }97 </script>98 <?99 100 101 35 102 if ($key) 103 { 104 105 $sdate = strftime("%b-%d-%Y", time()); 106 if (file_exists($checkfile)) 107 { 108 $maindatafile=file($checkfile); 109 $lastcheck = trim($maindatafile[0]); 110 if ($lastcheck != $sdate) 111 { 112 $ip=$_SERVER['REMOTE_ADDR']; 113 $check = file_get_contents("http://wptestmonkey.com/wtm/validate.php?check=2&key=$key&vid=$vid&server=$server&ip=$ip&dkey=$dkey&domain=$domain"); 114 if ($check != 1) 115 { 116 117 echo "<center><br><br>Sorry there was a problem with validation, please contact support at <a href='mailto:$supportemail'>$supportemail</a></center>"; 118 exit; 119 }else{ 120 $f=fopen($checkfile,"w"); 121 fputs($f,"$sdate\n"); 122 fclose($f); 123 } 124 } 125 }else{ 126 echo "<center><br><br>Sorry there was a problem with validation, please contact support at <a href='mailto:$supportemail'>$supportemail</a></center>"; 127 exit; 128 } 129 }else{ 130 $check = file_get_contents("http://wptestmonkey.com/wtm/validate.php?check=1&server=$server&ip=$ip&domain=$domain"); 131 132 $tmp = " 133 <div id='WTM'> 134 <img src='../wp-content/plugins/wp-test-monkey/images/wptm_register.jpg' align='right' /><h3>Upgrade</h3> 135 Thanks for trying out WP Test Monkey! 136 <br><br> 137 Upgrading is easy. Just click on the link below and you'll be taken to the payment page where you can immediately get your unlock registration code. 138 <br><br> 139 <a href='http://wptestmonkey.com/hop.php' target=_blank>Upgrade WP Test Monkey Now! oo! oo! oo!</a> 140 <br><br> 141 <h3>If you have already upgraded</h3> 142 First of all - thank you! Your support means we can afford the bananas we need to keep the Test Monkeys fed. <br><br> 143 Enter your serial # below and your license will automatically update. 144 <br> 145 <div id='verrormsg'></div> 146 <br> 147 Your serial #: <input type=text name='serial' id='serial' value=''> <input type='button' onclick='Javascript:Validate();' class='button-secondary' value='Validate Registration' /> 148 <br><br><hr> 149 </div> 150 "; 151 if ($tab == 'upgrade') 152 { 153 if ($check == "-1") 154 { 155 echo $tmp; 156 exit; 157 }else{ 158 159 160 echo $tmp; 161 162 } 163 164 } 165 166 } 167 168 ?> 36 -
wp-test-monkey/trunk/admin/tests.php
r605032 r605514 3 3 include 'tabs.php'; 4 4 $tests = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."WPTestMonkey_tests where status = 1 ORDER BY createdOn DESC"); 5 include 'side.php'; 5 6 ?> 6 7 <div class="wrap"> … … 9 10 <h3>Your active tests</h3> 10 11 <?php 11 12 foreach ($tests as $test) { 13 12 $test = VLister($tests); 13 if ($test) 14 { 15 14 16 ?> 15 17 <div style="margin-bottom: 20px;"> … … 21 23 $listAllCombinations = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."WPTestMonkey_combinations WHERE test_id=%d ORDER BY viewed DESC", $test->id)); 22 24 ?> 23 <?php echo $test->name ?>25 <?php echo $test->name; ?> 24 26 (<?php echo count($listAllCombinations); ?> active combinations) 25 27 <small> … … 167 169 echo $mvmessages['information']['createTestWhenNoTest']; 168 170 } 171 if ($sidew) echo $sidew; 169 172 170 173 … … 172 175 173 176 <? 174 $prem=1; 175 if(count($tests) > 0) 176 { 177 $root = $_SERVER['DOCUMENT_ROOT']; 178 $keyname = "$root/wtm.key"; 179 $checkfile = "$root/wtm.crc"; 180 $this_script = urlencode("http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']); 181 $server=$_SERVER['SERVER_ADDR']; 182 $domain = $_SERVER['HTTP_HOST']; 183 if (file_exists($keyname)) 184 { 185 $maindatafile=file($keyname); 186 $key = urlencode(trim($maindatafile[0])); 187 $vid = urlencode(trim($maindatafile[1])); 188 $dkey = urlencode(trim($maindatafile[2])); 189 } 190 191 $ip=$_SERVER['REMOTE_ADDR']; 192 $check = file_get_contents("http://wptestmonkey.com/wtm/validate.php?check=2&key=$key&vid=$vid&server=$server&ip=$ip&dkey=$dkey&domain=$domain"); 193 if ($check != 1) 194 { 195 $prem = 0; 196 $maindatafile=file("../wp-content/plugins/wp-test-monkey/admin/upgrade.dat"); 197 list($upgrade_notice,$tmp) = explode("|",trim($maindatafile[0])); 198 } 199 } 200 if ($prem == 1) 201 echo "<p><input type=\"button\" value=\"Create new Test\" class=\"button-secondary\" onclick=\"document.location = '?page=WPTestMonkey&action=create_test';\" /></p>"; 202 else 203 echo $upgrade_notice; 177 204 178 205 179 $tests = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."WPTestMonkey_tests where status = 0 ORDER BY createdOn"); 206 180 207 181 208 182 if(count($tests) > 0) {
Note: See TracChangeset
for help on using the changeset viewer.