Author Topic: ospap - Alpha1  (Read 27551 times)

0 Members and 1 Guest are viewing this topic.

Offline Warrior

  • supreme mac daddy of trolls
  • Hero Member
  • *****
  • Posts: 7503
  • One for a Dime two for a Quarter!
    • View Profile
Re: ospap - Alpha1
« Reply #120 on: October 17, 2005, 03:43:18 pm »
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

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: ospap - Alpha1
« Reply #121 on: October 17, 2005, 04:08:53 pm »
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).

Code: [Select]
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.
« Last Edit: October 17, 2005, 04:11:56 pm by Sidoh »

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: ospap - Alpha1
« Reply #122 on: December 29, 2005, 11:17:14 pm »
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>
I'd personally do as Joe suggests

You might be right about that, Joe.