redbullmarky
Staff Alumni-
Posts
2,863 -
Joined
-
Last visited
Never
Everything posted by redbullmarky
-
what makes you think it's built on a CMS of sorts? I'd stab a guess that they rolled their own for their specific needs - there's nothing hugely complex about the site. Most of the time, when a site is more like an "application" rather than mostly content, it's generally not a CMS due to how restrictive they can be. if it's the sort of thing you want to learn about though, break the site down into bits - ie, rating, commenting, database storage/MySQL, user management/authentication (ie, for register/logins, etc) and look up on those scripts. i'd always advise looking up and learning how to make your own though, rather than just finding loads of little ones and piecing them all together, to avoid the clunky security mess you'll probably end up with.
-
hmmm..."22 reasons why IE5 and 6 are the best browsers on the planet" ?
-
[SOLVED] Why use {} in "if / else" scripts
redbullmarky replied to dreamwest's topic in Miscellaneous
you can use the ternary operator for multiple if/else, but i'd recommend against it due to readability. i use it, but only for very simple stuff. example of the above code with ternary: <?php $age = 4; echo ($age > 10) ? 'False 10 is greater than 4' : (($age == 4) ? 'This is correct' : 'True 10 is greater than 4'); ?> not exactly readable.... -
[SOLVED] Why use {} in "if / else" scripts
redbullmarky replied to dreamwest's topic in Miscellaneous
as rajivgonsalves said, it's good practice. the majority of if/else statements will have more than one line in the blocks, so the brackets are then required. using brackets also for just single line statements keeps things consistent. i'm sure there are other reasons, but those are mine. -
[SOLVED] Constructor Stores Wrong Values to Instance Variables
redbullmarky replied to Anthop's topic in PHP Coding Help
when you're dealing with class properties, you don't need to use two $ - so instead of: $this->$variable1 use $this->variable1 giving the following output: full code: <?php class Constructor { var $variable1; var $variable2; function Constructor() { $num_args = func_num_args(); $arg_list = func_get_args(); if($num_args >= 1) { $this->variable1 = $arg_list[0]; } if($num_args >= 2) { $this->variable2 = $arg_list[1]; } else { $this->variable2 = 10; } } function CreateNewStatically() { return new Constructor(2, 9); } function display() { echo $this->variable1; echo ", "; echo $this->variable2; } } $p1 = new Constructor(1); $p1->display(); echo("<br />"); $p2 = Constructor::CreateNewStatically(); $p2->display(); echo("<br />"); $p3 = new Constructor(); $p3->display(); echo("<br />"); -
PHP is not persistent. If you wish to store items across pages, then sessions will help you out.
-
i choose the second one because this topic really isn't serving any purpose other than remind me of those stupid games i used to play in the classroom at junior school.
-
Hello and welcome to the forums Please make yourself familiar with the boards here and read the board descriptions before posting. @PHPFreaks is for Questions/comments/suggestions regarding this site, not general questions. Moved.
-
yes. unless you want to pay a small fortune, GIMP is the way forward.
-
open up the folder: C: >> Program Files >> Adobe >> Adobe Dreamweaver CS3 >> configuration >> DocumentTypes In there you'll find a file called MMDocumentTypes.xml. Shut down Dreamweaver first, open the file up, and look for a line similar to this: <documenttype id="PHP_MySQL" servermodel="PHP MySQL" internaltype="Dynamic" winfileextension="php,php3,php4,php5,tpl" macfileextension="php,php3,php4,php5,tpl" file="Default.php" writebyteordermark="false"> simply add the extension in question, and restart dreamweaver. If you can't find the above file, just do a search in both your Program Files directory, and your user directory (making sure the search includes hidden files) and you'll find it somewhere. Note - if you're on Vista, I believe you'll have to open up Notepad with admin privs (right click Notepad, click on Run as Administrator) then open the file from there. disclaimer: back up the file first! I won't be responsible if you bugger your installation of DW up
-
if you consider that this site could also be used as a work resource, and the fact that it's Christmas/New Year period so people are either not working or doing family stuff, would explain a few things...
-
in which case, the best way (IMO) would be to play around with several CMS' that are already on the market and decide which fits the bill the most in terms of what it does, and the way it works and is structured. Some to consider might be Wordpress, Joomla, Mambo, Drupal and even forum software like phpBB and SMF. All of them, to various extent, adopt the MVC pattern (or at least just template seperation) and all allow for extensive plugins/modifications/theming, etc. Once you've found one you're happy and comfortable working with, you can either change it to suit your needs or use it as a guideline to roll your own. You'll learn a tonne about patterns (even if you don't put names to them yet) as you go along. For MVC itself though, try a framework like CakePHP/CodeIgniter and read their manuals. Both offer a decent insight into what MVC is about and what it can do for you.
-
n3p3, with all due respect - if you're a newbie, then MVC/design patterns/modules, etc are all terms to steer clear of for a while. You'd be better Googling for a PHP CMS that's already established (of which there are many) or just getting to grips with the PHP basics
-
Merry Christmas to all and all a good night
redbullmarky replied to helraizer's topic in Miscellaneous
merry xmas! i tend not to hope too much, else i get socks. if i don't hope, and get socks anyway, i'm cool with that cos my socks are just about done in. failing that, gadgets are good. wii/itouch being near (at) the top of the list -
would there be any particular reason for not using an existing forum? SMF/phpBB are two popular examples and easy enough to integrate. for others, both free and paid, refer to here: http://www.phpfreaks.com/forums/index.php/topic,172303.0.html
-
the problem with CMS's (as thorpe sort of touches on) is they're all overblown and try and be too "one-fits-all". I've not found one CMS that: - makes complete logical sense to the end user - hiding technical stuff away if needs be, displaying sitemap/tree as expected, etc - is also easy to customise and adapt. sure, all of them have a handful of plugins, themes, etc, but the API's for many is vast and over complex. - is also fast - easily adaptable for non-content driven sites - social network, commerce, etc unless it fits all of the above, i wont look at it for anything other than research purposes. so i'm with teng here for now - i roll my own, and its generally more like a framework with a small CMS element than a fully blown CMS.
-
Logic Help - Finding the 'content' picture in HTML?
redbullmarky replied to meman1188's topic in Application Design
facebooks way of doing things is quite slick. (for anyone that doesn't know, when sending a message, all you do is past the URL of the article in the message window, and an AJAXy thing inserts a brief article preview as well as an image) it lets you pick from any of the images on the page (aside from background ones). i've not noticed it pick the exact image yet (as i've only tried it once), but my guess would be it's just analysing the pageflow a bit, excluding things like 'logo.gif' (and other common element names), and picking an image close to a header tag providing the page is sort of formatted well enough. -
this would need more info, as i'd need to know what it needed to be integrated into - ie, a custom website, or an existing CMS (like wordpress, for example). there's nothing really otherwise tricky here though - so how Liquid Fire could justify 8k is beyond me - especially if you're NOT writing from scratch. even $2,500 upwards is kind of pushing the boundaries of what takes the piss, in my opinion. especially considering it's not really a unique project that requires ultra-custom, ultra-unique scripts. Many of the features could be found open-source and put into place quite easily, so the initial comment could easily be turned on its head when talking to the client when discussing how much the cost can be reduced by using 3rd party, tried and tested pieces. personally, i might be able to get some of the lower figures mentioned, but i reckon it'd probably be the last bit of work i ever got from that particular client...
-
i can't speak for arrays other than to say that displaying an array literally outputs 'Array' unless you're referring directly to one of its elements: $names = array('male'=>'Bob', 'female'=>'Sue'); echo $names; // outputs 'Array' echo $names['male']; // outputs 'Bob' with objects, there's a fair few magic methods that handle what you're on about: http://uk2.php.net/oop5.magic the __toString one being the one you mention: hope that helps
-
[SOLVED] Problem with objects starting value.
redbullmarky replied to Foser's topic in PHP Coding Help
poco, looking at Foser's original code, he already has a valid constructor (method with same name as class) - __construct is PHP5 only, but the named constructor works for both 4 and 5. the problem i can see is you're not actually assigning the values to the object properties. instead of just $this->width; $this->height; you need $this->width = $width; $this->height = $height; so: <?php class Rectangle { var $width; var $height; function Rectangle($width, $height){ $this->width = $width; $this->height = $width; } function area(){ return $this->width * $this->height; } } $myRectangle = new Rectangle(10,20); echo $myRectangle->area(); ?> should do the trick hope that helps Cheers Mark -
They're so good, he put his name on it! Apparently... they're fantastic. just don't look at the drip tray in too much detail, else you'll feel sick at what you've been eating BEFORE using it on a side note: considering the effort that's gone into the grill, anyone have a clue why the drip tray is a flimsy little plastic thing that you have to put under the front, rather than something you clip on or something? reminds me of positioning a bucket under a leaky ceiling.
-
your email address is currently set to hidden. only yourself and administrators can see it, hence why it's displayed on your profile in italics. not obvious, i know, but you're safe