Jump to content
MakeWebGames

Recommended Posts

Posted

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 poll.gif 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)

Posted

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

Posted

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?

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...