News:

Who uses forums anymore?

Main Menu

ospap - Alpha1

Started by iago, September 14, 2005, 06:46:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Warrior

You..actually use globals?
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling

Sidoh

#121
Quote from: Warriorx86] link=topic=2860.msg34158#msg34158 date=1129578198]
You..actually use globals?
Sometimes complexity makes code suck, you need to realize this.  Developing some huge class hierarchy for some things is not only a complete waste of time, but you get caught up in doing that and it makes the entire system run slower and less efficiently.

This is straight from SMF's Sources/Profile.php.  Unmodified (but clipped because I didn't want to copy the entire function).

function saveProfileChanges(&$profile_vars, &$post_errors, $memID)
{
        global $db_prefix, $user_info, $txt, $modSettings, $user_profile, $newpassemail, $valida$

        // These make life easier....
        $old_profile = &$user_profile[$memID];

        // Permissions...
        if ($context['user']['is_owner'])
        {
                $changeIdentity = allowedTo(array('profile_identity_any', 'profile_identity_own'$
                $changeOther = allowedTo(array('profile_extra_any', 'profile_extra_own'));
        }
        else
        {
                $changeIdentity = allowedTo('profile_identity_any');
                $changeOther = allowedTo('profile_extra_any');
        }


Note the global.  :P

Don't think that I'm not capable of developing a class hierarchy, because it's quite easy.  However, there's just some things in which it's worth isn't quite good enough.

Joe

Resurrected from the depths of page three, suggestion!

You might want to line up those rebelious textboxes in your register section.

Log in:<BR>
  <FORM ACTION="login.php" METHOD="POST">
    <TABLE>
      <TR><TD>Username:</TD> <TD><INPUT TYPE="text" NAME="username"></TD></TR>
      <TR><TD>Password:</TD> <TD><INPUT TYPE="password" NAME="password"></TD></TR>
      <TR><TD><INPUT TYPE="submit" VALUE="Log in"></TR><TD>
    </TABLE>
  </FORM>
<HR>
If you haven't registered already, register an account:<BR>

  <FORM ACTION="create_account.php" METHOD="post">
    <TABLE>
      <TR><TD>Username:</TD> <TD><INPUT TYPE="text" NAME="username" VALUE=""></TD></TR>
      <TR><TD>Password:</TD> <TD><INPUT TYPE="password" NAME="password" VALUE=""></TD></TR>
      <TR><TD>Confirm:</TD>  <TD><INPUT TYPE="password" NAME="password2" VALUE=""></TD></TR>
      <TR><TD>Email:</TD>    <TD><INPUT TYPE="text" NAME="email" value=""></TD></TR>
      <TR><TD>Email you when somebody posts a comment to your picture?</TD> <TD><INPUT TYPE="checkbox" NAME="notify_comments" CHECKED="checked"></TD></TR>
      <TR><TD>Email you when somebody posts a new picture? (Note: this will probably get annoying)</TD> <TD><INPUT TYPE="checkbox" NAME="notify_pictures" VALUE="0"></TD></TR>
      <TR><TD><INPUT TYPE="submit" VALUE="Create Account"></TR><TD>
    </TABLE>
  </FORM>
<HR>
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.