Jump to content

redbullmarky

Staff Alumni
  • Posts

    2,863
  • Joined

  • Last visited

    Never

Everything posted by redbullmarky

  1. i tend to not like switching too much between browsers. because Firefox just has an absolutly essential bit of development kit for me (Firebug), I use it for work all the time (aside from testing where i'll play with the others). as a result, i'm pretty comfortable with FF now so use it for all my personal browsing, too - both PC and Mac
  2. i've dropped support too, however i still need to keep up to scratch with IE6 hacks as my place of work still do support v6.
  3. with regards to the Acid 2 test, unfortunately I managed to come across some leaked code from IE8: if ($url == 'http://www.webstandards.org/files/acid2/test.htm') { # load pre-drawn image cut from an Opera screenshot. that'll fool 'em loadImage('acid2_opera.gif') } else { # now we have determined those pesky web people are not looking at the Acid page, we can render the page normally. # that is to say, broken. if (stristr($url, 'microsoft.com')) { outputPageProperly(); } else if (stristr($url, 'firefox')) { reallyBuggerThingsUpToMakeThemBelieveFirefoxIsCrap() } else if (styleSheetLooksValid()) { invalidateStylesheet() } else { invalidateSomethingElseAnyway() } }
  4. nah not really, but many of the sites i develop are more "application" (mostly jobs boards/recruitment sites, social sites, etc) than "content", so with all the dynamic content, i tend to find CMS's quite restrictive straight out of the box. sure, i spose i could hack one up to make it do what i need, but i tend to find it easier to roll my own stuff as what i tend to do can get quite specific. if i need to bash out a very simple content site, like a personal site or a portfolio or very simple business card type site for a client, i'lll probably use CMS Made Simple. Having said that though, there's nothing wrong with learning by hacking up a CMS to do what you want. I learnt by pulling phpBB to bits. I took a step back from CMS's when I realised they didnt really fit my requirements, so tend to use a framework (along the lines of CakePHP or CodeIgniter) as I can put content management functionality ontop of it if i need to, but otherwise it's flexible enough for me to be able to build things quickly.
  5. in its literal terms, CMS = Content Management System. there are so many out there (especially written in PHP) that it's pretty tricky to pick one in particular. It basically depends on your needs. Most of the CMS's i find are best suited towards relatively "static" sites - ie, just pages and pages of content but not much in terms of interactivity. There are CMS's that take things further, but they tend to be very overblown and overly complex. if you want to play around with a few, then http://www.opensourcecms.com/ is your friend. Some of the recommended/popular would be: - Drupal (tricky but very flexible - however, tonnes of mods/extensions available that might fit your needs) - Joomla (easier to use but not very flexible without some serious work, IMO) - CMS Made Simple (probably the pick of the bunch for something lightweight and easyish to jump straight into and customise) - SilverStripe (i love this one, however it seems quite taxing on resources ATM)
  6. you could try http://www.server2go-web.de/ i had a similar-ish issue a few weeks back. it didn't fit my requirements (as i needed it to work on Mac and Windows) but it might be a solution for yourself.
  7. i dont use this one for everything, and this may be an old one, but it has done me good for many things. here's my full class, based on the "Beyond Template Engines" article mentioned above: <?php class View { public $vars = array(); public $html; public $layout = null; private $config = array(); function __construct() { // config settings - eg, gzip, etc $this->config = Config::load('view'); if (!isset($this->config['layout'])) { $this->config['layout'] = 'master.tpl'; } $this->layout = $this->config['layout']; // i have some vars that can be set as default - eg, copyright messages, etc $pagevars = Config::load('page'); if (sizeof($pagevars)) { $this->vars = array_merge($this->vars, $pagevars); } } /* * loads a template file and returns the output * */ function load($filename) { extract($this->vars); ob_start(); include(TEMPLATE_PATH . '/' . $filename); $this->html = ob_get_clean(); return $this->html; } /** * loads/parses a template but puts the output into a template var * */ function loadtovar($varname, $filename) { if ($html = $this->load($filename)) { $this->set($varname, $html); } else { return false; } } /* * sets a view var * */ function set($varname, $value = '') { if (!is_array($varname)) { $this->vars[$varname] = $value; } else { foreach($varname as $key=>$var) { $this->vars[$key] = $var; } } } /* * displays the final output * */ function render($return = false) { $this->vars['pagebody'] = $this->html; if ($this->layout) { ob_start(); echo $this->load($this->layout); $html = ob_get_clean(); } else { $html = $this->html; } if (!$return) { // gzip enabled by config? if (isset($this->config['gzip']) && $this->config['gzip'] == true) { ob_start(); ob_start('ob_gzhandler'); echo $html; ob_end_flush(); header('Content-Length: '.ob_get_length()); ob_end_flush(); } else { echo $html; } } else { return $html; } } } ?> i stripped out some code for sake of easier grasp, and it depends on a few things, so wont work "as is", but i'm sure you could work it out. TEMPLATE_PATH and the Config settings being the two main dependencies that shouldnt take much work do figure out how to remove. usage: $tpl = new View(); $tpl->set('title', 'Hello World!'); $tpl->loadtovar('body', 'mybody.tpl'); $tpl->load('mytemplate.tpl'); $out = $tpl->render(); the following is a layout example. master.tpl: <html> <head> </head> <body> <?=$pagebody ?> </body> </html> and the following is an individual "view" template. mytemplate.tpl: <h1><?=$title ?></h1> <p><?=nl2br($body) ?></p> and the following is an individual snippet, just used to show how 'loadtovar' would be used. mybody.tpl: I am a page body.
  8. i like the way CakePHP do it (sure, it's not original, but Cake first introduced me to the concept) - they have a master "layout" as well as individual views. The master layout contains the main structure of the page, ie what's consistent through the site. in the final 'render' method, the template requested is merged in with the layout and the final result returned. i have to admit tho (and thorpe (i think) might be the one to agree) I love the way Django handle views and templates. Whilst some of the code may appear alien at first, the manual should give you another approach that is pretty good as far as building output goes - especially in terms of template inheritance. http://www.djangoproject.com/documentation/templates/
  9. dude, your request isn't that specific. for books, take a look here: http://www.phpfreaks.com/forums/index.php/topic,58799.0.html and for resources for advanced topics (OOP, design patterns, Application design, etc) see here: http://www.phpfreaks.com/forums/index.php/topic,107835.0.html hope that helps - but for the sake of keeping "please recommend books" topics to a bare minimum considering the question comes up a ridiculous amount of times, i'm locking this one.
  10. no offence dude, but we're not here to do your homework. if you reckon you have a rubbish chemistry teacher, go take it up with the headteacher and explain your reasons why you can't do your homework as a result. funnily enough, the lessons i recall mucking around in and not listening are also the ones where i thought the teacher was rubbish. only when i realised that it was only a few of us that werent getting anywhere did i realise that it wasn't infact anything to do with the teachers skills but my own ignorance in class.... topic locked.
  11. cgm, you have a good point. To address them though: 1, The main site is very old and therefore vulnerable, and recent attacks have meant it has been taken down. The new site is being developed as we speak, with security heavily in mind. SMF, on the other hand, we have not much control over as it's a 3rd party system. 2, Because two wrongs don't make a right, etc. There is a very very strong case for legal action should PHPFreaks owner go down that road. However, getting one's own back would blow a case completely out of the water. It's a shame that people feel the need to hit a free community, considering many of the people I'm sure would have gotten help from here in the first place in their early days, but shit happens.
  12. i already have one, but often i work whilst travelling (ie, no internet connection) so i tend to keep my dev stuff on localhost. ps. deadonarrival, thanks for your reply yesterday - the site being restored obviously knocked out a few posts but help noted anyhow. the reply wasn't exactly what i was after, but for anyone else, his reply (from my email notification) was: to which i replied that i need something I can plug into a Mac, a PC, etc - even if each platform have a seperate installation to run, as long as the MySQL databases, webroots, etc are shared.
  13. Hi all Just wondering if anyone has anything like my title suggests. I can find certain small servers etc that will run on a drive, but what i'm after is more specific. Normally I work on my home (Vista) laptop, with a copy of XAMPP installed. However sometimes i'm working on Mac OSX. So just wondering if there's a one-solution-fits-all for this - is there a way i can keep all my PHP files and MySQL databases on the single medium (ie, my USB drive) so i can move between computers easily enough? Cheers
  14. @able - just to clarify, nobody as yet here has said output buffering is evil - just that using it to "smooth over" errors that should not be produced in the first place is bad. If you look at some of the code where they tell you to "throw ob_start at the top", the sheer spaghettiness (!) of the code clearly points out that they're not using output buffering to take advantage of it's more useful benefits - more just hacking something dirty together as quickly as possible. in many a tutorial where you see an 'ob_start()' right at the top of the code, you'll also see heavy use of the "shut-up" operator (@). my advice if you're just starting out (and hence possibly not ready for stuff like MVC, etc to structure things nicely) is to put ALL your logic in a block at the very top of your PHP file. This logic should NOT have a single echo or any raw HTML. This block will deal with form input checks, mysql stuff, redirection, etc. Anything you want to display at this point, store it in a variable. After you've closed this PHP block with your good old ?> tag, then comes the HTML. If you're using PHP after this point, it really should only be concerned with stuff regarding the display. for example: <?php if ($_GET['test'] == 'redirect') { header("Location: /somewhereelse.php"); exit; } else { $title = 'Hello World'; $body = 'Lorem Ipsum etc etc etc etc....'; $extrabody = 'This is a test'; } ?> <html> ... <body> <h1><?php echo $title ?></h1> <p><?php echo nl2br($body) ?></p> <?php if ($extrabody): ?> <p><?php echo nl2br($extrabody) ?></p> <?php endif ?> </body> ... </html> apologies for the non-ob_start related lesson, but hopefully it'll help you sort out your code structures in future so that hacks are not required to handle errors and stuff. ob_*** will come in useful in the future when you start getting into seperating out your PHP files from your HTML templates - ie, templating. Hope that helps Cheers
  15. ob_*** (or outbut buffering) functions should be left well alone unless you're using it for its correct purpose. i see so many people using it to handle 'header' errors, when just a bit of organising of code and a little more understanding of exactly how PHP is actually processing your page is much better. in its proper use, ob_start will start output buffering - that is to say that anything you 'echo' will not be output to the screen, but will be placed inside of a buffer. this buffer can then be manipulated or emptied or just about whatever you want, and when you want to, you just dump the contents to the screen. common uses would be for 'templating' or manipulation of an entire page just before outputting it. in its 'hacky' use - when you have output something to the screen but then send a 'header' (for example, to redirect the page), PHP will generate an error along the lines of 'headers already sent' and the page will not redirect. however, starting output buffering first (with ob_start()) means that anything output (including these errors) that would cause the page to not redirect, is stored in the buffer instead (and emptied to the screen at the end of your script). a better practice to avoid the hacky method is to do ALL checks/processing that may end up in a redirect (ie, with header("Location: /someurl") ) before you send ANY output (be it via an echo, or actul HTML). also, following the header line with a call to exit() is common practice. so in your case - lose the ob_start line altogether (never let ANYONE tell you this is good practice or the right thing to do in 2008) and add exit() to the line after the header. so: header("Location: http://www.your_site.com"); exit; .. rest of code here...
  16. i echo your thoughts 100% - i too was virtually a complete beginner when i first came across the site, so I as much as anyone else wants it back. All I can say is, there's a lot of exciting input going into the redevelopment so watch this space closely. All of us involved in the development process are very keen to get things back up and rolling, but as ober said, things will take a little time.
  17. to be honest, any decent programming language can teach you the principles of game development quite well. before getting into web development, i used to be heavily into games development as i loved the maths for stuff like trajectories, AI, etc. I used to do my early code in Pascal or Basic. Whilst you wont get commercial results along the lines of the examples you've given, you'll get both: 1, an idea of the maths that goes into any game, never mind a 3D one 2, generic concepts of programming that you can apply fairly easily to any "advanced" language. I've heard some decent reviews of C# from those that use it. The only issue is, to the most extent, it ties it down to Windows OS's. Sure, there are cross-compilers, but I tend to find this sort of practice quite messy. Either way, there are free/cheap applications that I would recommend choosing from: - dev c++ - free IDE for the free GCC compiler - BlitzBasic - not free but quite cheap. Do not underestimate Basic (especially this one) as a good knowledge foundation before moving on. - Visual C++/C# - I think theres a free 'express' version of Visual Studio that has these - Turbo C/C++ - Freely downloadable now as they're quite old, but they are very simple and do have their uses in teaching the basics of the language. Anything you learn is definitely still applicable to more recent versions of the language. Don't expect though to be able to code the next Halo overnight - it will take you YEARS of hard work and learning. I remember my first 3D "world" - nothing but flat walls, no textures, etc - the maths involved already got quite intense. In fact, I'd recommend staying away from 3D programming to start with anyway, as 2D has enough to begin with. Having said that, ID Software do have a good collection of their back-catalogue source code (Doom, Quake, etc) available to download and see how it all works. SourceForge too is a good resource for 3D games, and may also give you a better idea of what languages are used than you'll get from a PHP forum Good luck.
  18. and two popular ones: http://tinymce.moxiecode.com (my personal fave) and http://www.fckeditor.net
  19. you may find it easier to install and pull apart a working application rather than try to learn a framework, if your problem is being able to understand but not write code as you say. Forums, blogs and many other similar apps are great (i learnt php from phpBB). Using a complete application rather than a framework will let you actually get quick results by changing things around, and see how things are actually being applied. You'll find frameworks and stuff much easier to get your head around after this.
  20. Hi and welcome to the forums Please note that where you posted this topic initially (Competitions) is for just that - competitions. Please get yourself acquainted with the different boards here and read the descriptions before posting. Cheers
  21. yup i get the same - just sits there doing not much. edit it did work, and i did recieve the notification, but took a few minutes for it to work. though i doubt many are going to sit and wait that long for it to do that
  22. seperating the HTML into 'templates' instead of using PHP to echo it also has the advantage of easier to maintain/reskin pages in addition to keeping line breaks in tact for when viewing source.
  23. svn itself isn't too tricky to install either on your server or localhost
  24. £7.50 is about $15 though not great but not terrible either to start with, but there shouldnt be any reason to charge at least £12ph+ to start with and build up from there. generally i dont even consider hourly rates but tend to look at the project as a whole, and make my figures based on the time it would take (including amends, testing, unexpected issues, etc) and what i'd feel comfortable with.
  25. <suspicious> dingus, are you positive it's not actually your site ? </suspicious>
×
×
  • 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.