Jump to content

redbullmarky

Staff Alumni
  • Posts

    2,863
  • Joined

  • Last visited

    Never

Everything posted by redbullmarky

  1. its not too bad, however: 1, it's kinda hugging the left side of the page for dear life. 2, some pages suffer from far too much spacing/seperation, some pages seem very cramped. no middle ground anywhere. 3, far too many links in your nav. maybe you should try and group up some of them or merge some of the pages together. too much nav = overwhelming. 4, the font in the nav is too small. i can understand having it that small to fit it all on as there's so many, but if you follow number 3 above, you could do with upping the font size a little.
  2. maybe we should start a 'best frameworks' argument somewhere else, but having looked at ZF, I can pretty much say that it's far too chunky and OTT as far as i'm concerned. i had a look at django after thorpes comments and, whilst i have little understanding of python, it seemed pretty well structured and easyish to grasp - whereas after DL'ing the Zend framework and spending a fair chunk of time with it, it really doesnt come across as user friendly at all. Too much of a 'PHP OOP showcase' for my liking, rather than a lightweight, easy to use product. Most of the weight behind it at the moment is the name of the company and the hype, IMHO. I'm also not into '[b]strict[/b] best practice' either - and having learnt certain 'best practices', all 3 of my faves break the rules occasionally (CodeIg, Cake, Rails) but kind of all have an "i dont give a toss" attitude and do whats right for easy of use rather than best practice. Ronald, will be interested to find out what your conclusions are in the end.
  3. i'd actually say that cake could be improved. whilst it's not too hard to pick up and is bloody good, it's still somewhat 'heavy' and comes with a learning curve that others are starting to bring down. but i do agree that looking at existing frameworks will greatly help with the structure. as i'm building mine, i'm using 3 frameworks as reference points - CodeIgniter (www.codeigniter.com), CakePHP (www.cakephp.org) and rails (www.rubyonrails.org). All three are actually very similar implementations of the MVC structure. personally, what i've tried to do is to keep my framework and application completely seperate. in effect, i have two folders. my httpdocs, which contains my app specific stuff, and my framework folder. the essentials of these is the index.php in the httpdocs. literally all this does is to include a single file in my framework directory, which does the job off pulling everything together automatically. httpdocs: img folder, js folder, css folder, app folder (containing my app specific config, code and templates), index.php framework: framework.php, libraries folder (including template engine, DB, PDF handling classes etc), helpers folder. this way, i never have to touch the framework. all i need to do is make a few tweaks to the app config file, tell the index.php where my framework is located, and voila - my framework does the rest. as i've forced a structure, its very easy for my framework to work out where all its bits and pieces are automatically.
  4. doctype is what goes right at the top of your page. such as: [code] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> [/code] right click/view source of most web pages and you'll see a bunch of stuff like that - all which serves the purpose of making sure your document is handled correctly by the client browser.
  5. [url=http://uk2.php.net/time]time()[/url] will do the job. [url=http://uk2.php.net/date]date()[/url] will do the job too, probably easier. as i'm generous: [code] <?php // get the current hour (24hr format) $hour_of_day = date('H'); $output = 'Good '; if ($hour_of_day < 12) // 12pm {    $output .= 'morning'; } else if ($hour_of_day < 17) // 5pm {    $output .= 'afternoon'; } else {    $output .= 'evening'; } echo $output; ?> [/code]
  6. "you have to keep pissing in the wind to learn how to keep your shoes dry..."
  7. that's what modulus is. it's the remainder after division has been performed - so it actually returns a number, not true/false. [code] <?php echo 15 % 7; // gives 1 echo 14 % 7; // gives 0 echo 8 % 7; // gives 1 ?> [/code] so in your case, you're actually checking to see if the result is zero cheers
  8. after logging in, it looks a little more interesting than first entering the site. there's still a lack of much in terms of visuals - images/pictures, general styling, etc. obviously you've put a fair bit of work in to the site as a whole, so kudos for that, but my points i originally made still stand. you need to try and stand out from other SN sites if you can. think about "why would someone join me to chat to a few people, whereas they can join myspace and chat to millions?". i'm sure you get my point. it needs something to make it stand out on its own. whilst i dont personally like social networking sites (i use myspace, but for music, etc) i still appreciate myspace for what it is and how popular it is. you need something that's either unique or special to entice people to you instead of them, rather than almost trying to duplicate one of the most popular sites on the web with less features, less style, etc. first impressions don't immediately tell me what the special thing might be that would make people think you not myspace. like i say, it's not bad. try and look for something that'd make it stand out, use a little more images to liven its appearance up a little bit and you'll have something that at least justifies the features and effort you've put in. cheers Mark
  9. i hate to sound like an arse, but unless you provide a test account, i cannot see anything that would entice me to join when sites like myspace do the job well enough already. there are no images, no evidence of existing members, and no...well nothing really. everything just seems to try and force me to either register or login, which (due to me being an awkward sod) I won't do out of principle. I generally like to get a feel for a place and enjoy a place BEFORE i've even logged in. nothing's really terrible, just a little bland as they are. what's your selling point? what makes you different to all the trillions of social networking sites out there already? why should the average joe join your site? etc etc cheers Mark
  10. hmmm. Excuse the bluntness here 1) what is it? it's not immediately obvious at all. 2) you have two of the worst fonts you could pick on one page. the default font, and Comic Sans. 3) it's very green 4) the goooooooooooooooooogle ads jump out too much. i hate gooooooogle ads when there appears to be no effort to place them properly, rather just throwing them on the page to gain clicks and revenue. passing them off also as 'Our sponsors' is not good either. it just seems kinda misleading. 5) the page [url=http://validator.w3.org/check?uri=http%3A%2F%2Fwelink.ej.am%2F]has no DOCTYPE and does not validate[/url]. for such a basic site to validate is not great, TBH
  11. [quote author=warris link=topic=112863.msg464338#msg464338 date=1162920723] Oh soz I just said I dint like it and what's oldmanice. [/quote] sorry, i must have gotten you mixed up with the other 'oldmanice' who said his name was Warris, posted questions in the misc forum, bumped posts that were 400 years old and asked every question under the sun APART from anything php related.
  12. oldmanice, that wasnt the question nor did it play any relevence to the thread, especially as it's now been dead for older than a week. as you're on a PHP forum, maybe something relevent to PHP would be more suited rather than bumping old miscellaneous threads from yesteryear.
  13. the hard lines and the over-use of blue don't do it for me. it needs softening up a touch, as it causes the site to seem too busy and not immediately straightforward. the 'contact us' link as a mailto is a no-no too. for those of us that sometimes dont have their email program open, it can be a pain when it launches. you could do with a proper contact form - both for users benefit, and for yours (spam). it's not terrible, and the layout itself seems fine, but it does have some styling issues that need to be address just to to make things a little clearer. cheers Mark
  14. ...shouldnt really be using an FTP program or building websites anyway
  15. [quote author=Jenk link=topic=114130.msg464240#msg464240 date=1162908769] it would have to be: [code]<?php class MyClass {   private static $my_instance;   function getInstance()   {       self::$my_instance = new MyClass();   } } ?>[/code] [/quote] whoops my bad. cheers ;)
  16. i maybe wrong, but surely it'd be better as: [code] <?php class MyClass {   private static $my_instance;   function getInstance()   {       $this->my_instance =& new MyClass();   } } ?> [/code]
  17. as i've said before, look at CodeIgniter or Cake, especially the former. The documentation alone will give you a nice (laymans-ish) crash course in MVC, and just taking a look at a sample application will give you the idea of how structured sites are much easier to maintain.
  18. i'm with Jenk on this one, although I would not recommend Smarty at all, mainly due to its whole new syntax, not just its bulk . btherl is right in saying also there is no best way, but i certainly think there are best 'ways'. i must admit i do have a real problem with the whole echo"<div>hello world</div>" style of coding, mainly because it makes things such an arse to fix if you need to tweak a layout. not on about seperation/MVC/templating here, I just reckon that there are so many ways to code that avoid this approach that there isn't really an excuse to totally form a layout using 'echo'. Using HTML inside PHP in my opinion is worse than using PHP inside HTML. until relatively recently, I generally used Dreamweavers templating. However, this still meant hard to maintain  files as I'd have a HTML file with loads of PHP stuck at the top. updating a site, or getting someone to update it, generally meant using Dreamweaver - not everyone has that. So then I found this: http://www.massassi.com/php/articles/template_engines/ There's literally enough code on there to form a basic templating class which works, just so that you can "nail" that particular type of coding and play around with it. The goal here is to keep your HTML/PHP seperate, so you're either dealing with PHP, HTML and not one bit mash-up of both. My own templating "engine" is based on that, albeit with tonnes bolted on as I've needed it along the way. When using templates, I'm also a fan of the "alternative" php syntax, using things like: [code] <html> <body>   <h1>This is my <?=$listname ?> list</h1>   <ul>       <? foreach ($posts as $post): ?>       <li><?=$post['title'] ?></li>       <? endforeach; ?>   </ul> </body> [/code] using short tags, etc as well. This kinda keeps the "tags" similar and simple like other template systems like Smarty and is the way Ruby on Rails does it - using the native code rather than a whole new syntax. Some people don't like this way as it can be turned off, but as the default installation has it switched on (or at least that's what I've found so far) and PHP6 is keeping these short tags, I don't really see too many issues - especially as everyone seems to be trying to be "Ruby on Rails" about what they do these days. After all that waffle, I guess my point is - keep your HTML and your business logic seperate. This way you can avoid the need to have echo's all over the place. My new framework literally has a single echo in the entire thing - to dump the final rendered page to the screen. If I want to redraw a template, I don't break my application. If I want to rewrite my application in a different way/style, etc, I don't break my templates. Ok, so all of that is advocating using MVC/templates rather than your original question of coding style, etc, but I'm sure you can see it all helps keep things tidy, which is the whole point of worrying about clean code in the first place. Cheers Mark
  19. there are quite a few. this one's good (and gets pretty tricky): http://www.mod-x.co.uk
  20. a VPS will generally have the whole lot set up for you already and will generally come with something like cpanel or plesk. personally it's what i use myself and the space+freedom it provides is great. if you want a different version of PHP/MySQL, then you have the freedom to do stuff like that. might not be relevent depending where you're based but i use http://www.webfusion.co.uk/vps
  21. i can't remember the details, but i remember seeing somewhere that typing a 'long' IP in the address bar will resolve just like a domain name/IP would. if you do this: [code] <?php echo long2ip(1089059683); ?> [/code] you get: 64.233.187.99, which also takes you straight to Google.
  22. [quote author=neylitalo link=topic=113561.msg461552#msg461552 date=1162451710] [quote author=Crayon Violent link=topic=113561.msg461547#msg461547 date=1162450918] or make a graphing calculator using the gd library. [/quote] +10 ninja points if you get this one. That would be super cool. [/quote] hmm i have this sneaky feeling that someone has read that, and is hacking up some GD scripts as we speak...
  23. Hi again You'll have to forgive me for being a little rude here, but I would say that your best bet would not be to attempt to make your own just yet. Some of the fundamental issues you need to know (modularising, organising, features, etc) isn't something easily learnt overnight, but something that comes with time and practice. Personally, if I was in your shoes, I'd compromise - I'd be downloading a copy of Drupal. It's a little scary at first, but absolutely rammed with features to build sites of all sorts - have a look at their site and look at some of the sites built using it and you'll get the idea that it's not just for "home users", but large sites too. On the other hand, I'd be delving right into the Drupal code and structure, making sure I knew how it was working, etc. This way, I'm able to knock up a full site using a CMS whilst learning how to organise/structure/code one at the same time. Compromise. If the size of the code and the practices used in these fully fledged CMS's doesnt confuse or scare you off somewhat, then maybe you're ready to try, if that's what you wish to do. In terms of modularising, this can be described in many ways, but in this case, it's about making your code expandable. There's no use having a CMS that can only do one type of thing, which is where I agree a little with ober's sentiment that many are geared towards blogs. One look at the code of pretty much ANY fully featured CMS is that there is more code than you can throw a stick at, doing all sorts of things. Without any structure, thought and planning before hand, this could get extremely messy and hard to maintain as it grows. OOP, and employing the Model/View/Controller (MVC) design pattern will help you out tonnes (look at the 'Resources' tab at the top of the [u][url=http://www.phpfreaks.com/forums/index.php/board,58.0.html]Application Design[/url][/u] forum). I'd only personally recommend someone built a full CMS for two reasons: 1) to learn/fun 2) need something specific. in the latter's case, there are so many plugins and mods for many of the CMS's I listed that it's probably gonna be something out of this world if you can't find a plugin for it. hope that helps Cheers Mark
  24. have you looked at ones already on the market? not necessarily to use (unless that's an option) but at least to get an idea of what to include. that's gonna be better homework than having a bunch of strangers "guessing"  ;) http://www.drupal.org - Drupal http://www.joomla.org - Joomla http://source.mambo-foundation.org - Mambo http://phpnuke.org - phpNuke the list goes on, but i guess these are some of the more popular ones for PHP
  25. can you try and be a little more detailed? what stage are you at now? i personally like to start with a wishlist of sorts. if you've got a fair bit of experience with CMS's, then you'll know what you like/dislike about others both from a features and a coding/structure point of view, and which ones you feel comfortable with and why. try and decide what parts of your CMS are gonna be part of its 'Core', and which parts are better classed as 'addins'. From there, I generally find the coding standards, directory structure and some skeleton files normally helps me visualise how everything is going to fit together. how it goes from there depends on what you're specifically after. cheers Mark
×
×
  • 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.