Jump to content

KingOfHeart

Members
  • Posts

    222
  • Joined

  • Last visited

Everything posted by KingOfHeart

  1. I was not expecting this but when I managed to connect to a chatroom and close out firefox.... The user stayed in the chatroom. This user should of pinged out by now but it's staying online. How do I end this connection? So far I turned off my internet, and blocked all access to the site.
  2. Update! I got it to stay connected and receive messages. Now I wonder how I can send messages without disconnecting. <? $host = "79.99.135.253"; $port = 6667; $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); $data = "NICK Freddy_Krueger"; $data .= chr(13); $data .= 'USER Freddy_Krueger "thegaminguniverse.com" "irc.thegaminguniverse.nl" :Murderer'; $data .= chr(13); socket_connect($socket, $host, $port); socket_sendto($socket, $data, strlen($data), 0,$host,$port); $join; while(true) { socket_recv($socket, $buffer, 1024, 0); if(strlen($buffer) > 0) echo "Recieved: $buffer<br>"; $pingpos = strpos($buffer,"PING :"); $pingcode; if($pingpos !== false) { for($n = $pingpos + 6; $n < strlen($buffer); $n++) { if($buffer[$n] == 13 || $buffer[$n] == 10) break; $pingcode .= $buffer[$n]; } $data = "PONG :" . $pingcode . chr(13); socket_sendto($socket,$data, strlen($data), 0,$host,$port); echo "Sent: $data<br>"; if($join == false) { $data = "JOIN #oz" . chr(13); socket_sendto($socket,$data, strlen($data), 0,$host,$port); echo "Sent: $data<br>"; } } } ?>
  3. I'm trying to use sockets to see if I can connect to a chatroom. I got it started but not sure where to go from here. <? $host = "79.99.135.253"; $port = 6667; $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); $data = "NICK OpenZelda"; $data .= chr(13); $data .= 'USER whoever "thegaminguniverse.com" "irc.thegaminguniverse.nl" :OZ Website'; $data .= chr(13); socket_connect($socket, $host, $port); socket_sendto($socket, $data, strlen($data), 0,$host,$port); socket_recv($socket, $buffer, 1024, 0); echo $buffer; ?> I managed to receive one message. However I know for a fact there were two messages sent back. So how do I set it up to keep receiving messages?
  4. Yes, that's what the quote said, even if I made a typo.
  5. I have a search spider for my site to help control my search box. It says it supports pearl for what "Links to include or not to include" So can you turn the link below into a pearl statement by removing "92.0;" and "subject" http://www.thegaminguniverse.com/forum/index.php?board=92.0;sort=subject Basically I want it to ignore links that have "http://www.thegaminguniverse.com/forum/index.php?board=" and end with "sort="
  6. I've used firefox, internet explorer and it works fine. When I use google chrome my one row gets stretched out too much. http://openzelda.thegaminguniverse.com/file.php?id=126 LastUpdated is really stretched out while the other rows are skinny. Any idea why?
  7. Anyone familiar with mirc scripting? All I want is a simple script to open up http://openzelda.thegaminguniverse.com/Scripts/ozlog.php Then send some text to this site. Don't know if I need sockets on the website as well, but for starters maybe I can use a GET method. http://openzelda.thegaminguniverse.com/Scripts/ozlog.php?text=sometext
  8. http://www.sphider.eu/docs.php For now I'm trying to work with it by ignoring unnecessary links to help speed up the reindex.
  9. http://openzelda.thegaminguniverse.com/ On my website I have a search box and it works fine. It not only gets the data for the regular website it gets the data for the wiki as well. However, keeping it updated is a huge pain. Sometimes the update can take hours to update (depending on how often I do it). So anyone here have a website with a search feature. How do you guys handle it?
  10. NVM, I think I got it. SELECT * FROM Downloads Where type > '0' Order By if(LENGTH(screen) > 0,1,0) Desc,lastupdate DESC,points DESC http://openzelda.thegaminguniverse.com/file.php?name=&type=0&order=7&dir=0&page=1 It looks like it first checks to see if it has a screenshot, and then it orders it by the lastest files.
  11. ok, I understand that part now. Now can you help me with my strlen problem?
  12. I still want it to list the files that have no screen. I just want to order it properly. Is there any way to use some type of if statement in the search. I've searched around and saw something about "As" or something. As far as I can tell, I update the screen field even if it's blank. So that's probably why it's not Null. [attachment deleted by admin]
  13. Why do I need to post that? Can't just give examples of a strlen if statement instead?
  14. Well just found out the null function won't work because even a blank screen seems to return some type of value. $search = "SELECT * FROM Downloads Where screen IS NOT NULL"; < listed every file. So I need any field screen that has any data in it to all return the same value.
  15. http://openzelda.thegaminguniverse.com/file.php?name=&type=1&order=7&dir=0&page=1 One of the options they can choose is to order it by screenshots. So I want all screenshots to return a value of 1 so I can order all those files by last updated. function SearchFiles() { global $filename,$fileid,$filetype,$filedir,$fileby,$official; $type = ($filetype != '10' ? $filetype : 0); $order = array("lastupdate","id","name","username","downloads","rating","points","screen","Rand()"); $direction = array("Desc","ASC"); $official_ids = array(1,89,115,6,90,131,132); $search = "SELECT * FROM Downloads "; if($fileid > 0) $search .= "Where id = '$fileid'"; else { if(strlen($filename) > 0) { $search .= "Where name LIKE '%$filename%' "; if($type > 0) $search .= "AND type = '$type' "; else $search .= "AND type > '0' "; } else if($type != 0) $search .= "Where type = '$type' "; else $search .= "Where type > '0' "; } $search .= "Order By $order[$fileby] "; if($fileby != 6) $search .= $direction[$filedir]; if($fileby != 5 & $fileby != 6) $search .= ",points DESC"; if($fileby == $search .= " Limit 5"; $sql = mysql_query($search); $n = 0; while($rows = mysql_fetch_array($sql)) { if($official == true && !in_array($rows['id'],$official_ids)) continue; $out['name'][] = ($rows['name'] == null ? "No Name" : RemoveHTML($rows['name'],true)); $out['id'][] = $rows['id']; $out['rating'][] = $rows['rating']; $sqldate = "select date_format(lastupdate,'%m-%d-%y') FROM Downloads Where id = '{$rows['id']}'"; $dresult= mysql_query($sqldate); $drows = mysql_fetch_array($dresult); $out['date'][] = formatdate($drows[0]); $data_desc = RemoveHTML($rows['description'],true); $data_desc = bbcode2html($data_desc); $out['description'][] = $data_desc; $out['downloads'][] = $rows['downloads']; $out['points'][] = $rows['points']; $out['username'][] = RemoveHTML($rows['username']); $out['userid'][] = GetGUID(RemoveHTML($rows['username'])); $out['screen'][] = RemoveHTML($rows['screen']); $out['type'][] = $rows['type']; $n++; } return $out; } The $order field are the fields in the mysql table except for Rand(). $official_ids are the some official files which can be any type. http://openzelda.thegaminguniverse.com/file.php?type=10 < Just go here to see what I mean.
  16. I mean if the column is left blank. If so return a 0, if not return a 1. (1)Last Update: January 20th, 2009 Screenshot: http://openzelda.thegaminguniverse.com/wiki/images/f/f4/Dark_side_triforce.PNG (2)Last Update: January 21st, 2009 Screenshot: http://openzelda.thegaminguniverse.com/wiki/images/f/f1/Antlion_battle.PNG (3)LastUpdate: January 16th, 2010 Screenshot:http://openzelda.thegaminguniverse.com/wiki/images/e/e9/AIScreen2.PNG Now alphabetically this is how my screenshots are listed. I'd rather have all three just return a value of 1, then order it by Last Update. So I need it to order it like 2,1,3 instead.
  17. http://openzelda.thegaminguniverse.com/file.php?name=&type=1&order=7&dir=0&page=4 I have a field named "screen". I would like to use order by to see if this field exists or not. It currently works alright by organizing the screen shot link's alphabetically. I'd rather have all screenshots just return a 1 and use a second orderby to list it by files that have been updated recently. So is this possible?
  18. I tried the one with the function but got an error. <?php function msConnectSocket($remote, $port, $timeout = 30) { # this works whether $remote is a hostname or IP $ip = ""; if( !preg_match('/^\d+\.\d+\.\d+\.\d+$/', $remote) ) { $ip = gethostbyname($remote); if ($ip == $remote) { $this->errstr = "Error Connecting Socket: Unknown host"; return NULL; } } else $ip = $remote; if (!($this->_SOCK = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) { $this->errstr = "Error Creating Socket: ".socket_strerror(socket_last_error()); return NULL; } socket_set_nonblock($this->_SOCK); $error = NULL; $attempts = 0; $timeout *= 1000; // adjust because we sleeping in 1 millisecond increments $connected; while (!($connected = @socket_connect($this->_SOCK, $remote, $port+0)) && $attempts++ < $timeout) { $error = socket_last_error(); if ($error != SOCKET_EINPROGRESS && $error != SOCKET_EALREADY) { $this->errstr = "Error Connecting Socket: ".socket_strerror($error); socket_close($this->_SOCK); return NULL; } usleep(1000); } if (!$connected) { $this->errstr = "Error Connecting Socket: Connect Timed Out After $timeout seconds. ".socket_strerror(socket_last_error()); socket_close($this->_SOCK); return NULL; } socket_set_block($this->_SOCK); return 1; } msConnectSocket("www.google.com",80,30); ?> Fatal error: Using $this when not in object context in /home/thegamin/public_html/openzelda/test/socket.php on line 13
  19. I have a few dropdown forums and would like it to select the current values that are requested. global $filename,$fileid,$filetype,$filedir,$fileby; global $months,$pg; echo "<h2>Search Files</h2>"; echo "<p>"; echo "<form name = 'File_Search' action = '#' method = 'POST'>"; echo "<table border=\"0\" width=\"100%\"><tr>"; echo "<td>File Name<br><input type = 'text' name = 'name'></td><td>File Type<br><select name = 'type'> <option value = '0'>All Types</option> <option value = 'o'>Official Files</option> <option value = '1'>Quests</option> <option value = '2'>Graphic/Spritesheets</option> <option value = '3'>Entity/Scripts</option> <option value = '4'>Sound/Music</option> <option value = '5'>QuestPack/Programs</option> <option value = '6'>Miscellaneous</option> </select></td>"; echo "<td>Order By<br><select name = 'order'> <option value = '0'>Last Updated</option> <option value = '1'>ID</option> <option value = '2'>Name</option> <option value = '3'>Downloads</option> <option value = '4'>Rating</option> <option value = '5'>Points</option> <option value = '6'>Random</option> </select></td>"; echo "<td>Acending?<br><select name = 'dir'><option value = '0'>False</option><option selected value = '1'>True</option></select></td>"; echo "</tr><tr><td rowspan = '4'><input type = 'submit' name = 'search' value = 'search'></td></tr></table></form>"; echo "</p>"; So if the $filetype equals 2 I want the dropdown box to show "Graphic/Spritesheets" by default. BTW Official Files is not actually a type so that's why I chose to give it a small letter o and will work the same way as All Types but run a different function. $fileby is used for the OrderBy field. $filedir is for the Acending field. The other data is for the other parts of the script. If you like you can give advice on the name's default because you may have a better method then what I have in my head.
  20. I have a Wifi USB (not the official nintendo one) and I was wondering how to have my wii connect to it. I managed to have this USB connect to some close by wireless internet, but that's not what I want. On my Wii I figured out how to search for close wifi internets and I wonder if this is what I need to do for what I want. I did manage to get my computer to show up on the list but I could not connect to it. BTW my internet is wired and trying to a usb for the Wii connection if you couldn't tell. So anyone have any experience with this?
  21. Quick question. If I just use POST how would I handle the page numbers? How can you click on different pages and still have the same results from the form script?
  22. Yes, but it can be converted in the url then uncovered through php. I've done it before. I also had to separate the data apart.
  23. I'm creating a little file search on my site. You can search by the name of the file or the type. You can order it by random or by a certain type. You can choose ascending or descending order. Also it will need to know the current page number. So that means my url is going to have a lot of & symbols in it. What method should I use to create a short url string. base64_encode? (How should I separate the string if the answer is yes). Should I just use Sessions (do all browsers support this?)? I'm not sure at this point. http://openzelda.thegaminguniverse.com/file.php?type=2&order=1&dir=0&page=2 This is the current page but will be changed to this (assuming I don't break it by the time you view it) http://openzelda.thegaminguniverse.com/fileb.php
  24. I tried copying and pasting that first script. I get a message saying unable to connect, then the next line said Sucess. I thought it was supposed to return some numbers or something.
  25. If my memory serves right. Try right clicking on the file/folder and look for something about permissions or Chmod or cmod. Then check everything you want to allow.
×
×
  • 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.