Jump to content

MySQL_Narb

Members
  • Posts

    250
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://crazyquest.novahost.org/

Profile Information

  • Gender
    Not Telling

MySQL_Narb's Achievements

Regular Member

Regular Member (3/5)

5

Reputation

  1. Sorry, somehow the HTML I copied in must have gotten cutoff. Even when there is a closing tag, it does not get a match. And I'm actually doing this in JavaScript, and I don't think it has an HTML parser like PHP that I know of. This was the only REGEX specific section I saw, so I just posted it here. And I'll look for the "s" parameter, but I thought that was basically "m"
  2. I need the Regex to capture everything in-between the body tags. Although, it doesn't seem to work. http://regexr.com/38n6r Any ideas
  3. Here is bossScenario: var bossScenario = { 'active': false, 'scenario_ID':0, 'boss': {} }; Here is a list of scenarios: var scenarios = { 1 : { 'func' : function(bossDifficulty){ /*var me = bossScenario['boss'][1]; var vars = me['vars']; vars[rbSoldiers] = bossDifficulty*100000; vars[reward] = bossDifficulty;*/ alert('test'); //randBossBattle(vars); }, 'vars' : { rbSoldiers : 0, reward : 0 } } } In bossScenario, I will assign a scenario to the 'boss' property. And then I will run the below code: bossScenario['boss'][sID]['func'](bossDifficulty); The above code will successfully alert "test"; however, next time I go to run the function, I get this error in the console: Uncaught TypeError: Object #<Object> has no method 'func' It's as if the 'func' property and its function are being removed from the bossScenario function after it is ran. Why is this?
  4. Why doesn't setrawcookie('saved_game', $data[0]['data'], time() + (10 * 365 * 24 * 60 * 60), '/'); Overwrite the existing saved_game cookie? It simply refuses to overwrite the exsting cookie data. The cookie is being set here, in JavaScript: document.cookie = 'saved_game=' + saveCookie + '; expires=Sun, 25 Dec 2020 20:47:11 UTC; path=/';
  5. Wow, you are a life saver! Thank you!
  6. SELECT SUM(`money_earned`),SUM(`army_strength`),SUM(`worker_opm`) FROM `highscores` ORDER BY SUM(`money_earned`) DESC LIMIT $start,$per_page Above is my query pulling data from highscores. In the table highscores, there is a field called "group" to indicate the group they belong to. The purpose of this function is to get the total money of each group by getting the sum of all money from the member's submitted scores, and then ordering by `money_earned` DESC; Is there a way to do this? like get the sums of `money_earned` where all group numbers equal eachother e.g, it would get the total $$$ for everyone of group 4, total $$$ for everyone in group 3, etc
  7. I still couldn't figure out how to make these parallel: foreach($servers as $server){ $ip = explode(':', $server['ip']); $port = (!isset($ip[1]) || empty($ip[1])) ? $port = '43594' : $ip[1]; $ip = $ip[0]; $socket = @fsockopen($ip, $port, $errNo, $errStr, 3); if(!$socket){ //offline }else{ //online } }
  8. I'll have to read back over the manual for fsock. Thanks! I'm not sure cURL is what I need her. The servers I'm making requests to aren't HTTP servers.
  9. I have a site where server owners can advertise their own servers, and I want to display these servers' online/offline statuses. When testing just 3 servers with the fsockopen, it takes a couple seconds. When my site grows, it's going to have 100s of servers. Is there a faster method? I plan on running a cron every 10 minutes to update server statuses.
  10. I have a toplist site that allows users to submit their private game servers to my site. And one of the new features I plan on implementing is online status and uptime percentage. I have planned to make a cron that runs every 10 minutes that will go through each server registered in the database and update the online status (will have to attempt to make a connection to the server). And of course, after checking the status, set the status of the servers on my website to their online/offline results. On top of that, I will need to keep a record of the offline/online statuses every 10 minutes in a MySQL table, in order to calculate the uptime percentage Now, is there a more efficient way to do this? Won't having to make a connection to each server registered in our database be a major resource hog? Here's the stats of my VPS: . Number of CPU's: 1 CPU Speed: 1000MHz Memory: 1GB Disk Space: 10GB Bandwidth limit: 1TB
  11. I'm allowing my users to use a very basic wysiwyg editor to make their posts a bit more fancy; however, I would assume that this gives them the ability to put raw HTML into their posts? So how would I limit the HTML to only what the editor supports (e.g: images, font color, bold, italics, and strike).
  12. Not sure how this is going to help, but O.K. if(!in_array($proxy_split[1], $this->banned_ports)){ $checked[] = $proxy; $this->curl->addSession('http://www.google.com', array( CURLOPT_PROXY => $proxy, CURLOPT_FOLLOWLOCATION => true, CURLOPT_PROXYTYPE => CURLPROXY_HTTP, CURLOPT_TIMEOUT => 120, CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1', CURLOPT_RETURNTRANSFER => true )); }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.