Jump to content

php_tom

Members
  • Posts

    264
  • Joined

  • Last visited

    Never

Everything posted by php_tom

  1. Am I missing something??? I use Notepad/Nedit or Crimson/SCite/Notepad++ if its really complicated... Maybe Probably I'm a geek.
  2. My main browser is FireFox, although I use that as well as IE and Opera when testing web development projects, especially because IE tends to do weird stuff with my CSS. Typically I write my CSS for FireFox and then go back and try to make it compatible for IE, while making it still work in FF. AAAAAAAAARRRGG!!!! Maybe one day someone will either make and follow STRICT standards for web browsers, or just create a universal browser.
  3. Try this: <html> <head> <script type='text/javascript'> var x, y, winWidth, winHeight; function init() { getWinSize(); if (window.Event) { document.captureEvents(Event.MOUSEMOVE); } document.onresize = getWinSize; document.onmousemove = getXY; setInterval('check();', 1); } function getWinSize() { winWidth = document.body.clientWidth-2; winHeight = document.body.clientHeight-2; } function getXY(e) { x = (window.Event) ? e.pageX : event.clientX; y = (window.Event) ? e.pageY : event.clientY; } function check() { if((x<=1 || x>=winWidth) || (y<=1 || y>=winHeight)) alert('Off Page'); } </script> </head> <body onload='init();'> Your web page goes here...<br> </body> </html> Hope this helps some.
  4. Hey, thanks for all the suggestions guys. I'm working on a new version which can handle 1337, and things like "ba dw or d" or "word1word2". It also will look at the context a word is in, e.g. words in the sentence "he's a badwording badword, I hate the badword!" would get filtered, but the sentence "Jesus rode into Jerusalem on an ass" would not (because of word strength and frequency). About the bad words file: I keep it encrypted because I don't want someone to find a list of filthy language on my server in plain text. The 'encryption' (in case you haven't figured out from the code) is simply base64_encode(base64_encode(theEntireFileAsAString)); I'd like to make the filter smarter, rather than the dictionary larger, because even though I'm using a hashtable-type lookup with the dictionary, more words in the dictionary will still slow down the algorithm... Please keep the suggestions coming, having input from the kind of people who might use this code is useful. Thanks!
  5. Oops! It didn't work in IE... but this should: <html> <head> <script type='text/javascript'> var t, begin, end, curr, obj; function start() { obj = document.getElementById('img1'); var img_width = 800; var win_width = document.body.offsetWidth; begin = -img_width; end = (win_width/2)-(img_width/2); curr = begin; obj.style.left = curr+"px"; obj.style.visibility = "visible"; t = setInterval("moveLeft();", 10); } function moveLeft() { if(curr>=end) clearInterval(t); else { curr+=2; obj.style.left = curr+"px"; } } </script> </head> <body onload='start();'> <img src='image.JPG' id='img1' align='center' style='visibility:hidden; position:absolute;' /> </body> </html>
  6. Here's an HTML/JavaScript page that should do the job: <html> <head> <script type='text/javascript'> var t, begin, end, curr, obj; function start() { obj = document.getElementById('img1'); var img_width = 800; var win_width = document.body.offsetWidth; begin = -img_width; end = (win_width/2)-(img_width/2); curr = begin; obj.style.left = curr+"px"; obj.style.visibility = "visible"; t = setInterval("moveLeft();", 10); } function moveLeft() { if(curr>=end) clearInterval(t); else { curr+=2; obj.style.left = curr+"px"; } } </script> </head> <body> <img src='image.jpg' id='img1' onload='start();' align='center' style='visibility:hidden; position:absolute;' /> </body> </html> The variables you need to change are img_width and the src of the img tag. Hope that helps...
  7. Hehehehe... churches often have fantastic websites... the one you mention is done in flash, though. One of the best websites I've seen for JavaScript menus is http://www.dynamicdrive.com/style/, they have all kinds of menus, and of course you can redo the CSS custom if you want. Before I discovered this site, I did all of my menus by hand! For example: http://www.cs.wisc.edu/~tomas. It looks good, although there are some alignment issues in FireFox. Hope this helps some...
  8. Hey everyone... I've been working on a connection speed test so I can give users a download time estimate for bigger files. It only works if you have JavaScript enabled in your browser, but I think it's pretty accurate (like, within ~50%). Please try it out, let me know what you think, or if you have any suggestions for tweaking it to get better performance. <html> <body> <script type="text/javascript"> var start, end; var c = 0; function start() { var d = new Date(); start = d.getTime(); c++; // The image should probably be at least 50KB if you want the test to be accurate. document.getElementById('img1').src = "connTest.jpg?t="+start; // The ?t=1230478659256 at the end prevents browser caching. } function loaded(){ var d = new Date(); end = d.getTime(); // I hard-coded the image size -- 396320 bits... you could use PHP's filesize() or something. var connSpeed = Math.round(396320/(end-start)); // connSpeed will be in kBITSps // Now I redirect to the destination page, which can access $_GET['speed'] dynamically window.location.href = "download.php?speed="+connSpeed; } </script> <img id='img1' onload='if(c==1) loaded();' style='visibility:hidden;' /> <script type='text/javascript'>start();</script> <noscript> <!-- No JavaScript? Redirect to destination page and test if($_GET['speed'] == "") --> <meta HTTP-EQUIV="REFRESH" content="0; url=download.php"> </noscript> </body> </html> Attached is the image I made, connTest.jpg. Let me know if this works for you! [attachment deleted by admin]
  9. Great, thanks. Dumb bug... it's fixed now!
  10. If you don't want lots of spam, you might try checking if the 'email me' form is empty or has valid input before sending it... Otherwise the site looks good.
  11. A small bug where capitalized words get through. Should be fixed now... Two of the words you posted ??? are still not filtered because they aren't in the library... One will certainly be added, the other I'm not sure, I could see innocent uses of the same word. Maybe I'll add a 'filter strength' setting... Anyway, thanks.
  12. If you go to http://primaryupload.com/media/process.php you get a bunch of errors that give the user a pretty good idea of how your 'process.php' script works... Probably the best way to fix it is to change the index file in /media/ to something else... or you could turn off error messages... BTW I like how short you were able to make the 'process' script!
  13. heehee... my bad. I fixed that (at least) now.
  14. Hey, everyone. I've been working on Aquarium, a PHP badwords filter. Check out the site at http://aquarium-filter.sourceforge.net On that page, you can try out the filter, or download the source and check that out... I realize there are other text filters out there, the reasons for making it were 1. I can never find a bad words file to use, so I finally made one, it's included (encrypted so no one can read it easily) in the source. Maybe others will find this useful. 2. I was trying to make something that filters words similar to badwords, not just bad words. So, for example, if 'badword' was in the bad-words list, it would be nice to have 'b@dword', 'bdword', and 'badwrd' filtered. I'd love to hear some feedback from you all on the engine. I realize that it does not filter words with whitespace in them, e.g. 'ba dw ord', that's something I'm working on... Try out the demo on the sourceforge page, post your comments here. If you find a bad word that doesn't get filtered, I'd like to know... maybe you can run PHP's base64_encode() on it <-- [so the forum admins don't get angry] and post it here. Thanks!
×
×
  • 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.