*

Recent

Author Topic: Admin Panel  (Read 13238 times)

lopa

  • Newbie
  • *
  • Posts: 20
  • Force: +1/-0
Re: Admin Panel
« Reply #15 on: February 06, 2012, 12:06:19 AM »
Yeah I know lol its awful.

There was possibly a time when it wasn't, but it certainly is outdated now.

Such as if id isn't defined display error and don't continue rest of code'
If id doesn't exist in db display error
etc.

Personally, I don't think that killing the "rest" of the script because of an undefined variable is a good idea.

It should also be unnecessary in that if "PHP Error Reporting" is turned on - It will report the errors without killing the script, unless they are really bad errors. ?


Anyhow, here's a couple that are not so obvious.

myaccount.php

If you select Undisclosed, $msel and $fsel are then undefined.
If you select Male, $fsel is then undefined.
If you select Female, $msel is then undefined.


And in blog.php

I'm still trying to work out what this is supposed to do as it comes up undefined and doesn't appear to serve any purpose?
$blogentry = $in['blogentry'];

But, I'll leave it to you to fix/look at them - As I don't see any point in looking at this script any longer if you are working on and making changes to it.

What I'd like to do now is have a look at what spaggetiokiller has done to improve the original script before you release a new version of what you have changed.

That's if he wants to make it available.

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: Admin Panel
« Reply #16 on: February 06, 2012, 12:24:29 AM »
Well what I mean is it kills the rest of the body content.
So say someone didn't enter a id for a game it would echo an error and publish the rest of the template and then exit.
But it wouldn't continue to the next code, that being a select query or whatever else.

Yeah the blog entry var, no clue.. Kurt built the blog feature.
I came across that same thing a few hours ago and I just decided to remove it.

lopa

  • Newbie
  • *
  • Posts: 20
  • Force: +1/-0
Re: Admin Panel
« Reply #17 on: February 06, 2012, 03:46:05 AM »
Quote
So say someone didn't enter a id for a game it would echo an error and publish the rest of the template and then exit.

That makes it somewhat clearer. ;)

You may want to consider using "Alert Errors" for javascript-enabled browsers and <noscript> to echo the error for those who don't have javascript enabled.

It may mean a bit more scripting, but it's a whole lot faster, neater and is pretty well accepted to be the "modern" way of speeding a lot of things up, by not having to load additional templates etc just to get a message across?

And from here, I think I'll leave it all alone until the next "Official" release, though I may continue to browse here and maybe offer something here and there.

Chow! ;)