Isomerizer Posted May 18, 2009 Posted May 18, 2009 Haven't created a free mod in a while, so his my contribution to the forum. 1. Create a new file called poll.php with the following code: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. 2. Under phpmyadmin run this SQL: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. 3. Save this image and upload to server. Hope it comes in handy, I know there is a poll system that comes with the mccodes, but I herd it sucks and it seems everything is being recoded lately. :wink: Demo: www.isomerizer.com/demo/poll.php (user: demo, pass: demo) Quote
Karlos Posted May 18, 2009 Posted May 18, 2009 Re: [mccodes v2] Poll Modificaton I'm gonna sound a bit n00by here.. But You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. means? :-P Quote
Isomerizer Posted May 18, 2009 Author Posted May 18, 2009 Re: [mccodes v2] Poll Modificaton I'm gonna sound a bit n00by here.. But You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. means? :-P It's just a function in the class that's public (can be used anywhere), they're 3 types. Public, private, protected. More info here: http://uk3.php.net/manual/en/language.o ... bility.php Using public before the function is not required, as it will be defined as public if nothing is declared. But it's my personal preference. :P Quote
Karlos Posted May 18, 2009 Posted May 18, 2009 Re: [mccodes v2] Poll Modificaton Well so far I understand that Public - Works Private - Undefined Error Protected - Fatal Error But now, may I ask why would there need to be Private & Protected? Surely functions would actually benefit from being public? Quote
Isomerizer Posted May 18, 2009 Author Posted May 18, 2009 Re: [mccodes v2] Poll Modificaton Well, it all comes down to security... Public - Can be used anywhere, any class, anywhere on the server. Private - Can only be used / viewed in the class its defined in. Protected - Limited access can only be used by class its defined in or parent class. Basically, If you try to use a function / var outside the class that's private or protected, your gonna error. Unless it's defined in a function inside the class. I'm not 100% sure if I'm correct however, as I'm fairly new to PHP OOP. Quote
Karlos Posted May 18, 2009 Posted May 18, 2009 Re: [mccodes v2] Poll Modificaton Thanks! It kinda helps.. But still very confusing.. Maybe I should learn about the basic parts of OOP first :-P Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.