Jump to content
xisto Community

littleweseth

Members
  • Content Count

    87
  • Joined

  • Last visited

Everything posted by littleweseth

  1. my bad - i just hacked out a regexp to look for image urls, without actually going to look at the site source. *blush* btw, instead of using the alternation operator, a quicker and more elegant way of doing (PNG|png|JPG|jpg..) would be to just use the case-insensitive modifier, 'i'. $html = @file_get_contents('http://comics.com/');$pattern = '/<(img).*?(src|SRC)=\"\/comics\/(.*?).(jpg|gif|png)/i';preg_match($pattern,$html,$matches);$image_path = 'http://comics.com/comics/'.$matches[3].'.'.$matches[4];$image = file_get_contents($image_path); By the way, i think you need to escape the backslashes, but i'm not sure. Also, don't you need /'s at the beginning and end of the pattern?
  2. If you're on a mac box, bbedit is the answer to every text based problem (well the ones that you couldn't be bothered learning PERL for, anyway). Unfortunately, you problably aren't on a mac.My personal favourite is SciTE on win/linux. CrimsonEdit is good too, but really it's just a KATE imitation. I'm not sure if either of these do multiple-file search and replace, though, and I can't check (short of installing X11 on this mac and then SciTE, but i'm feeling lazy right now).Of course, if you felt like using PHP for this job, you could do something likea) read all filenames into an array, using opendir, readdir, et. al. open each file sequentially, reading contents into string - say $StringWithTheFileInIt = file_get_contents ($filename) or something.c) do $new_string = preg_replace ("/include\s+?(\s+?'menu.htm'\s+?);/i", "/include ('menu.php');/", $StringWithTheFileInIt);. That scary-lookin thing just looks through $StringWithTheFileInIt, and replaces the old text with the new. The \s+? are to allow for any whitespace you may or may not have put in.d) overwrite the old file with the contents of $new_string, using fopen ( $filename, 'w' ).e) rinse, lather, repeat until done.Since you're using menu.php, i'm assuming that you know what most of that means :| If you do do this - i recommend you back up your stuff first in case you make a mistake and things go horribly wrong. I know the true pain of accidentally overwriting 10mb of text files with the string 'hello world'...... not cool.
  3. thablkpanda : CLIs don't scare me. I've been using the terminal in OSX to do things like edit httpd/php config files in pico, (haven't figured out vim or emacs yet) restart httpd every five damned seconds and talk to mysql. Thing is, writing a word document in vim is a less-than-easy task - though i'm quite sure you could do it, if you really felt like it. I want to use Ubuntu for day-to-day stuff, so a GUI i need.mayank : Because why should I ask for something to be given to me at cost to Canonical (a non-profit, last time i checked) when i can download it for no cost to them? Thinking about it now, though, the bandwidth to push 600mb through an internet pipe problably costs more than a couple of plastic discs, and if i downloaded through dialup i'd problably use about $40 dollars of dialup time.saint_micheal : wtf? Linux is open source, but that doesn't mean that any Q Random Hacker can go around and just put nasty code straight into CVS. In any major project - and yes, Ubuntu is a major project - there are people who check every contribution before it gets merged into the codebase. I have as much chance of getting hacked or slashed on linux as i do on windows or osx. (well, less than windows, because less viruses and nasty exploits are targeted at desktop linux users.)mike_savioe : ah, i don't think so. My dialup sessions max out at 48k and drop after 3 hours, and the max i can pull is usually 50mb or so. Are you telling me that i can download 180mb of image, then get maybe 200mb over the internet? Nice advice though : Well i've gone and ordered a couple of Ubuntu CD's (2 i386 - should have got a PPC one as well) and i'll see if Gnome cuts the mustard when the CD's arrive in a few weeks. Thanks, fellers.
  4. terminal ftp command on Mac OSX. Only because i couldn't be bothered finding an ftp client for OSX and i now know enough unix commands to get around - and you can't do a chmod 0600 * so easily in a GUI environment.round : are you in binary mode? I imagine images don't like being sent as ASCII very much.
  5. Dreamweaver ist pwnage, as far as WYSIWYG goes. It even manages to produce marginally valid code, which is amazing. (MX 2004 is fairly good, as is MX) Frontpage - should be destroyed, as should Word's web-saving features. Pure, concentrated evil.Another nice WYSIWYG editor is NVU. It's free (as in freedom and price) and while it's still a tad kludgy, if you're not using 'advanced' stuff (like PHP, or tab characters instead of spaces, grr) then it'll do you fine. It words much like Word interface-wise.Personally, though, i do everything in BBedit, merely because it just gets out of the way, unlike Dreamweaver's code view. Also, it has l33t Perl regexps, so i can do things like strip the content out of junky webpages (see w3schools.com for examples) over an entire directory of files - in a few seconds. I wub PCRE's.mizako : vim/emacs? I'm sure once you get used to the fact that it never works to way a n00b would expect it to, it's good. I use pico/nano for my tty editing needs - nothing beats sudo pico for a quick bit of httpd.conf hacking.
  6. I want to download a Ubuntu linux ISO of some form, but before I go and suck 576mb through dialup (poor me ) i would really, really like to know what the difference between KDE and Gnome is so i can pick between Kubuntu and Ubuntu. I understand that they're both windowing systems, but have no idea of the differences.At the moment, KDE looks better, but Canonical (or the Ubuntu foundation, same diff) doesn't ship out free Kubuntu CD's - only Ubuntu ones. As i understand it, you can get the same effect by installing the KDE stuff on Ubuntu, but me bieng a dialup biy and all pulling all those tasty graphics through a straw might be a bit challenging.
  7. (exam weeks) : 'Sleep? Sounds like something I read about in a book.' Usually sleep at midnight or 1am, wake up 7am to catch bus on school days - then on the following weekend, sleep till midday. Did that this morning (normally) : sleep at 12pm, get up at 7(weekdays). No-one ever told me PHP was addictive, so i stay up hacking away until sleepy time. On weekends, i stretch that a bit further.
  8. Well, I'd say that most consumer computers ship with windows - but i forgot : viruses are *small* and *efficient*.The above is good for one (1) laugh, after which you should dispose it.
  9. see the complexspiral demos at css/edge ( http://meyerweb.com/eric/css/edge/ ) for great justice. IF you thought you'd seen transparent backgrounds....Incidentally, i've never ever seen the 'transparent' property - i had to look it up. In any case, are you sure it's what you want? It shows the background of the body element as close as i can determine, or whatever it is.
  10. You know what annoys me more?DAMN AMERICAN FOOTBALL.Allow me to explain.[Lws' Bulleted List.] - They say that aussie footy is for sissies. I invite them to try it - without the damned padding. And without such a damned small ball. - They make movies about it. The movies suck, except for Remember the Titans, which was okay. Ish. On the other hand, i saw an indian cricket movie which ruled. ( the villiagers bet against the colonial english with four-times-taxes as the stakes or something if they lost) - Cricket can be played even by nerds, like yours truly. It doesn't involve getting tackled every five meters (though it does involve getting whacked in the face by hard red balls - nearly snapped my glasses more than once)</rant>Oh, and the numbers in cricket are bigger than the ones in football I encourage you to find 527 in a football score somewhere
  11. I actually didn't like the new RvB episodes (after season two) when they switched to Halo 2. The halo 2 armor just looks too chunky and like they'vee tried to go 'busy' with the design of it, whereas Halo1 armor loks like teh sheet and i want a suit."how many pop tarts have you had today?""One. Maybe two. Or six. Baker's dozen at the most.""Do you even *know* how many are in a baker's dozen?""By my count? forty three."
  12. Heh - div's even behave at school in IE6.The only reasons div's shouldn' work are if you've done something funky with the nesting of tags, the stylesheet is lost in the mail or the browser you're on suxoring. Div's have been around for a long time though, so they should damn well work even in IE 4.
  13. HOW TO CREATE A DATABASE : USING PHPmyADMIN. You should be able to find it in cPanel somewhere, and it's all very straightforward (certainly more so than hacking away at the command line.)HOW TO CONNECTED TO YOUR WEB HOSTING : using stuff. Be a little more specific - how to stop users getting to stuff unless they're logged in, how to use PHP?WHICH SPECIFIC PROGRAMS : well notepad works fine Seriously though, all you need is PHP, mySQL and some PHP scripts, which you can either write yourself (not reccomended unless you LIKE being hacked) or find somewhere else.[ As always, i recommend you look at http://www.hackingwithphp.com/ for great justice. ]Making a login script isn't really that hard. At simplest, all you need is a three column database : 'username' (unique, Primary Key), 'userpass' (a 40-char field to store a SHA-1 hash of the password in) and 'loggedin', a bool you flick when the user logs in. Then all you need is a form that the user can type their name and pass into. However, do not do this - there's so many security holes in a login script this simple that you might as well get hackmenow.trap17.com.(for this reason, i recommend you don't roll your own login script until you're good with PHP, and understand things like SQL injections and the importance of never trusting user input.)[whoa : gotta do some study for my exams tommorow now. Chemistry and Anicent history are so fun i could vomit... ]
  14. you mean 'it opens up in a new page' as in it loads a new page, or opens in a new *window*? before we go on, a little pedantism : use <?php, not <?. <? is no longer supported. Anyway, i believe the short answer is : no. Not without client-side scripting, like javascript, grabbing pages from your server and popping them into the 'content cell' of your template. If you still want to use javascript for you menu, btw, you can. You should be able to just whack the JS code into a separate file and include that, though i've never touched JS so i wouldn't know for sure. Google be thy friend and all that. Anyway, the best you can do with a pure PHP layout/menu is to keep the state of your menu-tree alive using sessions, cookies, POSTdata or some combination of the above. Actually, this i cool because the menu keeps its state across browser sessions, if you like the idea of that. Cookies aren't really hard (you just have to learn not to trust user data ) and the same applies for POSTdata. As a further aside - why tables? You could instead use html DIVs and CSS for great justice, and so on. All you need is a little simple CSS even IE can understand. Try the following : <style> body { font-family :verdana; } #header { clear : both; width : 100%; border : 1px solid silver; background : #EEEEEE; } #menu { float : left; width : 29%; border : 1px solid silver; background : #EEEEEE; } #content { float : right; width : 70%; border : 1px solid silver; background : #EEEEEE; }</style><body><div id="header"> <h1>This be muh header, dook dook dook mook.</h1></div><div id="menu"> <h2>Menu</h2> Menu Item <br> Menu Item <br> Menu Item <br> Menu Item <br> Menu Item <br> Menu Item <br></div><div id="content"> Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.Hello, world. Lorem Ipsum.</div></body>
  15. Well pixelrift appears to have died a horrible death a few days after they moved servers or something - which sucksors, because they were providing 500M storage and all that other nice stuff.Coolfreepages/Curvedspaces I had for a while, but I left it for thirty days and my account got a bad case of dead. Nowadays they aren't allowng any new signups.So, here I is at Xisto with 150mb of space and various other pwnage. I still can't believe it's ad free 'n' all that. Finally, I can go back to not having to use all kinds of wierd CSS trickery to compensate for a hundred pixels of ad-banner at the top of my f-socking pages
  16. As a point of curiosity, the corresponding thread on the Astonshell forums (astonshell.com/forums) is up to around 67-70 pages at 25 posts per page, and has been going for a year or two now. Phear!Anyways, i'm listening to TripleJ on my trusty transistor radio. I finally found a nice little coil of thin-gauge insulated copper wire (the kind of stuff they use in motors and so on) and attached a few meters to the antenna for great justice. It's taped to the wall along my window frame and runs along the curtain rail for a little bit.As a point of interest, if you live in a metal framed or roofed house - your entire house is a very, very nice TV antenna. I knew a guy who ran a wire up to the underside of his roof, and attached that to his TV antenna for instantly crystal-clear receptin of every free-to-air station within a hundred kays.....
  17. Well i have multiple emails :School adress @eq.edu.auHotmail : liaung@hotmail.com. All the spam harvesters already have it, so I don't even bother obfuscating it anymore. I use this one for forums, public display....Gmail. Oh yeah, baby : you can use thunderbird with it, unlike hotmail, which only lets you do outlook.ISP email. bleh, who uses those?Xisto, as of yesterday.The neat thing is that i have my own first name at both gmail and hotmail. How awesome is that? (it DOES pay to have a wierd chinese name sometimes)
  18. I think i'll add that O'Reilly books pwn, whereas SAMS books do not. Oh, and 'for idiots' books suck and should be avoided - my Idiot's Guide To XML spends most of the paper making sure - for the twentieth or so time - that i really, really know what a damned attribute is. Not worth the damn paper they're printed on - this particular example is only in me possesion because it was on special ($9.99 AUD) at angus'n'robertson .
  19. The simpsons, and Futurama for entertainment. I think i watch wayyyy too much simpsons, and the crap thing is that it's always the same episodes because channel TEN is juat a little tight-fisted. I also happen to think it suxors there's only four seasons of futurama.'I don't care how many eyes he has - as long as it's less than five.'My other favourite is mythbusters. I mean, in what other show do they try to dislodge concrete from a mixer using... a few hundred bags of explosives?
  20. Obligatory slashdot : does the camera run linux?I saw an article in APCmag (aussie) about a 2gigapixel camera they made by rigging up a bunch of small cameras or something. They were on top a respectably high building taking photos of the parking lot below - and you could read all the number plates.Speed cameras of the future, eh? And maybe the papparazi can do their 'sniping' from a few clicks away. Pity you'd need to keep the camera STILL (no errant gusts of wind) while taking shots - it kind of limits the usefulness.
  21. Remember, in Soviet Russia, the iPods listen to you!Now i see a sea of ipods and ibooks marching on redmond, the last bastion of non-appleness in their final move to take over the world. Muhaha, hahaha, (coughing)hahaha.As the only actual useful bit of this post - all the mac keyboards i've use, i've hated, and don't get me started on hockeypuck mice. The mighty mouse is Way, Way overdue - finally, a scroll mouse with two buttons in that yummy white casing.
  22. soylent transparent? That just popped into my head.The idea's been around for a while - I think i read something about it in Odessy 2061 or 3001 (Arthur C Clarke), where they had a big hemispherical room with diamonds in the ceiling, arranged in the pattern of the stars.And if you though the lifegem was bad, you can also get teensy little sealed vials on a necklace - filled with your partner's body fluids of choice. Yay?
  23. as always, i'm goin to tell you about the first, and last PHP resource you'll ever need (apart from the official docs, <3 and all that)http://forums.xisto.com/no_longer_exists/ big. It's long. It has all kinds of fun stuff in, like how to generate ascii art from jpeg's. Go forth and multiply, my sons.
  24. I remember commander keen! (1-3, keen dreams, 4) And raptor, and dukenukem (1,2,3d) and raiden.... And theme park, theme hospital, and all those other fun games i played because of sheer boredom as a kid.Oh, the nostalgia.
  25. As someone sitting on a Mac box (albeit an old one) now, i'll say that i would sacrifice at least one goat for the opportunity to run OSX on an x86 box. Name the other OSes that can both baby new users and give nerds a *nix terminal?Ah well - since I don't need to be babied too much anymore, maybe it's time for me to move to linux on my x86 box - when i get it back from repairs. If you don't see me ever again, it's because linux has trapped another unwary victim :POh yes, and Apple is going to build a touch of DRM into the OS and then lock it onto Mac hardware, if you beleive slashdot. You'd have to get a specially hacked up version if you wanted to run OSX on an x86 box, and of course we're not allowed to talk about that
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.