Jump to content

Cory94bailly

Members
  • Posts

    415
  • Joined

  • Last visited

Everything posted by Cory94bailly

  1. First you would have to check the time. Then you would need either a cookie or something in a database to determine the time since it was last generated.
  2. Yeah, the creator of the script helped me out last night and told me that. I've never worked with objects/classes before. What happened to the "Topic Solved" button here? Thanks!
  3. class replayer extends users { --SNIP-- public $islive = false; --SNIP-- function chat($id, $nick, $chat) { --SNIP-- <----------- } } There's my code, I want to take the variable $islive from the above class and use it in the chat() function. How would I do it? I've tried making it a global inside of the chat() function.
  4. I guess so.. But it's a free testing host so I have no control over anything.
  5. My updated code: if($_POST['submit_multiple']) { $SubmittedIPs = explode("\n", $_POST['IPAddresses']); echo '<pre>'; print_r($SubmittedIPs); echo '</pre>'; foreach($SubmittedIPs as $IP) { trim($IP); if(isIpaddr($IP)) { echo $IP." = ".gethostbyaddr($IP)."<br />"; } else { echo "Invalid IP Address<br />"; } } } My updated test: The spacing of the array is exactly the same for each one.
  6. I had no idea it existed until you told me Well, now I'm getting:
  7. That's why I'm using trim() on each IP before it's 'analyzed'
  8. I'm trying to make it separate by line breaks, commas, dashes, and spaces would be nice too I don't understand why if I print_r it, it looks normal.. But while checking the IPs, it says they're all invalid except for either the first or last...
  9. What would be your suggestion? I took out \r from the pattern and when I look at it with print_r, it looks fine.. But if I use the actual code, they all show "Invalid IP Address" except for the last one.
  10. The weird thing is that I print_r'd before and it looked fine.. Now you're right. I took out the "\r" from the split pattern and it stopped doing it. I thought \n was used by windows OS and \r was used by others, why is a line break considered \n and \r at the same time?
  11. Well I guess I'll jump right into the code.. The function: function isIpaddr ($ipaddr) { if (ereg("^([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})$", $ipaddr, $digit)) { if (($digit[1] <= 255) && ($digit[2] <= 255) && ($digit[3] <= 255) && ($digit[4] <= 255)) { return TRUE; } } return FALSE; } The loop and IF statement: if($_POST['submit_multiple']) { $SubmittedIPs = split("[\n|\r|,|-]", $_POST['IPAddresses']); foreach($SubmittedIPs as $IP) { trim($IP); if(isIpaddr($IP)) { echo $IP." = ".gethostbyaddr($IP)."<br />"; } else { echo "Invalid IP Address<br />"; } } } There's my relevant code.. Now the only problem so far is that I am getting this: (The IPs and Hostnames are obviously fake..) The problem is that they are valid IP addresses and I've done a few checks to see what's wrong. I've checked the array and it is working fine by splitting up a textbox into an array of IPs and the IPs are fine inside the array. I then tested the script by echoing the output of just the function with each IP, I got all "1"s (TRUE). I just can't figure out why it's displaying both parts of the if statement.. Thanks for any help!
  12. I'm currently making a GreaseMonkey script for a Live Support script that I use on a daily basis. Here's the Live Support's HTML (Client-Side): And here's what I have so far (I was testing): var busy = document.getElementsByTagName('tr')[4].getElementsByTagName('td')[0].getElementsByTagName('a')[1]; busy.parentNode.removeChild(busy); My code is working well but it only removes the bolded part in the above quote. Yeah, I know.. That's all the code I posted is supposed to do... But I'm trying to completely remove " | <a href="javascript:parent.window.do_reject(***)">busy</a></td>" I looked around regex and I couldn't really understand how to use it or if it would even work for what I'm trying to accomplish. It might be hard to understand what I'm asking for.. I'm just trying to remove this: | [b]<a href="javascript:parent.window.do_reject(***)">busy</a></td> from the quote at the top of the thread. If you need more explaining, I will gladly do that Does anybody have any ideas?
  13. As far as I know, there's no limit. They couldn't show only part of the staff, that would cause alot of confusion. But thank you alot. It works nicely It's a chance for me to learn too I'll mark it resolved now.
  14. Exactly. I have the same amount of access that everyone else has. I need to make it count the HTML table rows via the source. I am emphasizing html because I want people to know that it is not MySQL rows.
  15. I know how much you guys hate people asking for help without any starting code but I'm not even sure how to start this.. I want a script to read this page and count all the admins and referees. If anyone is willing to help, here's a sample of the html code: <div class="boxInner"><h3>Arena Referees</h3><table class="list"><thead><tr><th style="width:16px;"></th><th style="width:150px;">Name</th><th style="width:300px;">Position</th><th style="width="150px;">Gamertag</th></tr></thead><tbody><tr><td><a href="http://gamebattles.com/profile/GottaHaveFaith78"><img src="http://media.gamebattles.com/icons/16/profile.png" class="icon16" /></a></td><td class="alt1">Faith</td><td><b>Head Referee</B></td><td class="alt1">GB CombatBarbie</td></tr><tr><td class="alt2"><a href="http://gamebattles.com/profile/Jack.-"><img src="http://media.gamebattles.com/icons/16/profile.png" class="icon16" /></a></td><td>Jack</td><td class="alt2"><b>Asst. Head Referee</b></td><td>Get Jacked x</td></tr><tr><td><a href="http://gamebattles.com/profile/amghawk"><img src="http://media.gamebattles.com/icons/16/profile.png" class="icon16" /></a></td><td class="alt1">Mike</td><td><b>Asst. Head Referee (IS)</b></td><td class="alt1">GB amghawk</td></tr><tr><td class="alt2"><a href="http://gamebattles.com/profile/cory94bailly"><img src="http://media.gamebattles.com/icons/16/profile.png" class="icon16" /></a></td><td>Cory</td><td class="alt2">Referee</td><td>Cory xz</td></tr><tr><td><a href="http://gamebattles.com/profile/crago"><img src="http://media.gamebattles.com/icons/16/profile.png" class="icon16" /></a></td> I'm just wondering how I could even count them. Any help will be appreciated, thanks.
  16. http://custom.simplemachines.org/mods/index.php?mod=2324 That's the one I'm using on my site, it works perfectly.
  17. Well since cookies are client-side, you have a huge chance of getting 'hacked'. I would suggest sessions.
  18. Wow, I honestly don't know how I didn't realize that.. Oh well, that's what I get for coding at 1AM Thanks
  19. Yeah, I know.. I'm just stuck, I don't know how but I am! index.php <?php require("includes/includes.php"); ?> <html> <head> <title><?php echo $site_title; ?></title> </head> <body> Hi. </body> </html> includes.php <?php function includefile($filename) { if(file_exists($filename)) { include($filename); } else { die('<span style="color: red">Missing File: '.$filename.'</span>'); } } includefile("includes/config.php"); includefile("includes/functions.php"); includefile("includes/mysql_connect.php"); ?> config.php <?php $site_title = "Cory's Game"; //Name of site $mysql_connection_type = "2"; //1 = Normal,2 = Persistant (Persistant is only recommended if you know what you're doing!) $mysql_host = "localhost"; //MySQL Host Servers (Usually "localhost") $mysql_username = "root"; //MySQL Username $mysql_password = ""; //MySQL Password $mysql_database = "game"; //MySQL Database $mysql_prefix = ""; //Name added to the beginning of each table name (Example: "test" would be "test_users") ?> (I know, the comments aren't needed.. lol) But on 'index.php', the title is just this: I honestly don't know why I'm getting that error unless the including/requiring messes up declaring variables? Thanks for any help (even the basics)!
  20. Here's my script: http://cory.110mb.com/generator.php Put this in the 'head': <script type="text/javascript"> <!-- function toggle_visibility(id) { var e = document.getElementById(id); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } //--> </script> Here's your checkbox: <input type="checkbox" name="mlgvariant" id="mlgvariant" onclick="toggle_visibility('custom_mapset');" /> Then I just made a 'span' with the name inside the toggle_visibility javascript function: <span name="custom_mapset" id="custom_mapset" style="display: block"> <label for="mapset">Custom Mapset:</label> <select name="mapset" style="width: 220"> -----SNIP----- </span> I'm sure you could easily tweak that to work for what you need. If you need any further explanation to my codes, go ahead and ask
  21. What you're looking for is just not possible unless the site already has a "Users Online" script uploaded...
  22. $maps = $_POST['maps']; $mlg = array("Capture the Flag on Highrise", "Demolition on Highrise", "Search and Destroy on Highrise", "Capture the Flag on Invasion", "Demolition on Invasion", "Search and Destroy on Invasion", "Search and Destroy on Karachi", "Capture the Flag on Scrapyard", "Demolition on Scrapyard", "Search and Destroy on Scrapyard", "Capture the Flag on Terminal", "Demolition on Terminal", "Search and Destroy on Terminal"); $mlg_amount = "12"; //Make sure you take the # of MLG setups and subtract 1! (13 MLG setups = 12.) $i=0; while($i<$maps) { $i++; echo $mlg[rand(0,$mlg_amount)]; echo "<br />"; } Yes, I know.. It could be better but I am lazy and I made this when I was extremely tired. How could I possibly weigh a certain option more? I would guess obviously putting the same options in more than once would work but how would I go on making it like "$map_scrapyard = '30';", 30 being 30%? Any ideas? If more code is needed, I can do that.. (Also, if anyone is willing to help me clean-up the code, please tell me.. I think I have alot of un-needed code)
  23. I've always thought of this.. If you want to keep the script open-source but require the footer, you could possibly encode your credits but put a variable that is required to run the site? Make it more complicated than what I said.. Make it seem like it's something normal in your code but it secretly exits the script or something...
  24. Also, why does it not show the number of posts on the left?
  25. Just tried that.. I'm pretty sure they blocked it.. I was just reading their FAQ and I saw something that they were running in "CGI Mode"...
×
×
  • 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.