*

Recent

Author Topic: Admin Panel  (Read 12339 times)

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Admin Panel
« on: August 31, 2011, 01:05:54 AM »
Is there anyway you could make it so that the admin panel doesnt have all the side bars and top nav/banner and make it like its own separate look like most admin panels because for one it is very crowded looking having all the side bars and what not on the admin panel and two it just plain looks better and would make it seem more professional i guess you could call it. Just a thought.

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Admin Panel
« Reply #1 on: September 01, 2011, 10:23:06 AM »
Have to give that one some thought. The admin panel is integrated with the rest of the script's template system partly so that it can take advantage of the security, without having to maintain it in multiple spots. Let me give it some thought though, see what we can come up with.

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: Admin Panel
« Reply #2 on: September 01, 2011, 04:31:24 PM »
alright

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Admin Panel
« Reply #3 on: September 01, 2011, 09:23:25 PM »
It might be doable by making a different template made up the way you want it, and then modifying the root index.php where it says

Code: [Select]

include ('templates/'.$template.'/template.php');



to something along the lines of

Code: [Select]

if ( $_GET['action'] = 'admin' ) {
include ('templates/'.$template.'/admintemplate.php'); } else {

include ('templates/'.$template.'/template.php');
};


Then all you should need to do is mod the template.php file to suit and save it as admintemplate.php, I think.
« Last Edit: September 01, 2011, 09:28:57 PM by kurt »

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: Admin Panel
« Reply #4 on: September 02, 2011, 12:54:49 PM »
Ah yea that would make sense, i dont have time to test it till next week but if i get it working maybe i can post the admin template for you so u dont have to do the work?

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Admin Panel
« Reply #5 on: September 03, 2011, 11:45:31 AM »
That would be most acceptable to us. Thanks!

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: Admin Panel
« Reply #6 on: September 09, 2011, 04:15:35 PM »
Ok i found this and tried it and what this code does is make it so that it is changed for every single page and not just the admin panel page if your account is an admin. Im going to mess with it some more and try to make it only do it when viewing the admin panel
« Last Edit: September 09, 2011, 04:21:21 PM by spagetiokillers »

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Admin Panel
« Reply #7 on: September 27, 2011, 11:33:50 PM »
Try this - works for me.  ;D

index.php

replace the include*.* with

Code: [Select]
if ( $_GET['action'] == 'admin' ) {/*Do Nothing*/} else {
include ('templates/'.$template.'/template.php');
};

pages/admin/index.php

Before the ?> at the bottom add

Code: [Select]
include ('templates/'.$template.'/admin-template.php');
Copy template.php to admin-template.php and chop out what you don't want.
« Last Edit: September 28, 2011, 03:51:34 PM by mort »

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: Admin Panel
« Reply #8 on: September 28, 2011, 02:16:54 PM »
Wow amazing mort thanks for the great help.

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Admin Panel
« Reply #9 on: September 28, 2011, 03:54:10 PM »
You're welcome and it must have been late at night - - - - :(

Before the <? add

should have been:

Before the ?> at the bottom add

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: Admin Panel
« Reply #10 on: September 28, 2011, 06:37:35 PM »
Thanks!

lopa

  • Newbie
  • *
  • Posts: 20
  • Force: +1/-0
Re: Admin Panel
« Reply #11 on: February 05, 2012, 12:12:14 AM »
This script can be improved by changing it to:

Code: [Select]
if (!isset($_GET['action']))
    $_GET['action'] = null;

if ( $_GET['action'] == 'admin' ) {/*Do Nothing*/} else {
include ('templates/'.$template.'/template.php');
};

This prevents the code from trying to read $_GET['action'] when the element may not be defined.
« Last Edit: February 05, 2012, 12:20:32 AM by lopa »

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: Admin Panel
« Reply #12 on: February 05, 2012, 01:18:40 AM »
Don't hate on me for this lol but you could simplify that.


if(isset($_GET['action']) && $_GET['action'] == 'admin' ){
    include (
'templates/'.$template.'/template.php');
}


Just less code to worry about that way, but either way works of course.

lopa

  • Newbie
  • *
  • Posts: 20
  • Force: +1/-0
Re: Admin Panel
« Reply #13 on: February 05, 2012, 06:43:25 PM »
Don't hate me for the alternatives.  ;D

The fix you posted only addresses a single element.

I was going to simplify it with something like you suggest  but I had something coming that would more or less keep things consistent with a lot less work for quite a lot of other errors of the same nature that exist in both the front and back end of your script.

And here are just some of them. ;)

Your script is using array elements without checking whether they exists. You should make sure that your code does not try to read things like $_GET['action'] etc, when an array element may not be defined.

And this is a couple of examples of one way of overcoming it.

Code: [Select]
$action = isset($_GET['action']) ? $_GET['action'] : null;

switch ($action) { ... }


$cmd = isset($_GET['cmd']) ? $_GET['cmd'] : null;

switch ($cmd) { ... }


Or, you can fix this in a way that doesn't require altering your switch logic, by giving $_GET['action'] etc, a defined (but "empty") value if action isn't given in a query string:


if (!isset($_GET['action']))
    $_GET['action'] = null;

switch ($_GET['action']) { ... }


if (!isset($_GET['cmd']))
    $_GET['cmd'] = null;

switch ($_GET['cmd']) { ... }


if (!isset($_GET['type']))
    $_GET['type'] = null;

switch ($_GET['type']) { ... }


if (!isset($_GET['page']))
    $_GET['page'] = null;


if (!isset($_GET['name']))
    $_GET['name'] = null;

if (!isset($_GET['case']))
    $_GET['case'] = null;

Needless to say, I've been looking at your script with "full error reporting"; and most of the errors are generated because of insufficient arguments being applied as to whether something or anything exists or not.

Take your pick, but there are a lot of undefined errors, simply because they lack an argument while others are simply not defined.
« Last Edit: February 05, 2012, 06:59:57 PM by lopa »

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: Admin Panel
« Reply #14 on: February 05, 2012, 07:51:51 PM »
Yeah I know lol its awful.

I am working on V2.1 right now and I been fixing tons of errors and adding error reportings.
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.

I think the new version will work a lot better then the previous ones.
I have fixed a lot of things so far.
I am about to work on a language php class right now before I finish fixing all the files.

There also is a new template system that will work a lot better then the current or the one before the current.

I'll hopefully have the new release candidate released in three weeks mayyyybe. I am going on vacation in 2 weeks though so no promises.