*

Recent

Author Topic: better place for admin links  (Read 5837 times)

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
better place for admin links
« on: May 18, 2009, 03:18:55 PM »
I built a better way to get to the admin links.
I dont know about other people but I just dont like having all the links on the left, it takes up way to much space.
so here's what I did..:

For edit and delete links on the page of the game, open the pages dictionary and open up the file called play.php and add this:
Code: [Select]
<?php
if($usrdata['user_level'] == 2){
?>

<br />
<br />
<table width="40%">
<tr>
<td class="header2">Admin Options</td>
</tr>
<tr>
<td class="content2">
<?php
echo 
'<center><a href=\''.$domain.'/index.php?action=admin&case=managegames&cmd=edit&ID='.$ID.'\'><img src=\''.$domain.'/templates/default/images/editbtn.png\' border=\'0\'> Edit Game<img src=\''.$domain.'/templates/default/images/editbtn.png\' border=\'0\'></a> |  
 <a href=\''
.$domain.'/index.php?action=admin&case=managegames&cmd=delete&ID='.$ID.'\'  onclick="return confirm(\'Are you sure you want to delete this game?\')"> <img src=\''.$domain.'/templates/default/images/deletebtn.png\' border=\'0\'>Delete Game<img src=\''.$domain.'/templates/default/images/deletebtn.png\' border=\'0\'></a>
</center>'
;
?>

<br />
<br />
<small>Mod by: Adam LaCombe</small>
</td>
</tr>
</table>
<?
}
?>
right at the bottom of the page.

__________________________________________________________

To get rid of those admin links on the left and move them to their own page...
go to the templates dictionary then default and open up the file called header.php
find this code:
Code: [Select]
<?php
if($usrdata['user_level'] == 2){
?>

<table width="100%">
<tr>
<td class="header2">Admin Panel</td>
</tr>
<tr>
<td class="content2">
<?php
echo '<ul class=\'catmenu\'>
<li><a href=\''
.$domain.'/index.php?action=admin&case=addgame\'>Add Game</a></li>
<li><a href=\''
.$domain.'/index.php?action=admin&case=addvid\'>Add Video</a></li>
<li><a href=\''
.$domain.'/index.php?action=admin&case=managegames\'>Manage Games</a></li>
<li><a href=\''
.$domain.'/index.php?action=admin&case=managevids\'>Manage Videos</a></li>
<li><a href=\''
.$domain.'/index.php?action=admin&case=addvidcategory\'>Add Video Category</a></li>
<li><a href=\''
.$domain.'/index.php?action=admin&case=addcategory\'>Add Category</a></li>
<li><a href=\''
.$domain.'/index.php?action=admin&case=managevidcategories\'>Manage Video Categories</a></li>
<li><a href=\''
.$domain.'/index.php?action=admin&case=managecategories\'>Manage Categories</a></li>
<li><a href=\''
.$domain.'/index.php?action=admin&case=addlink\'>Add Link</a></li>
<li><a href=\''
.$domain.'/index.php?action=admin&case=managelinks\'>Manage Links</a></li>
<li><a href=\''
.$domain.'/index.php?action=admin&case=approvecomments\'>Approve Comments</a></li>
<li><a href=\''
.$domain.'/index.php?action=admin&case=settings\'>Site Settings</a></li>
<li><a href=\''
.$domain.'/index.php?action=admin&case=managemembers\'>Manage Memebers</a></li>
<li><a href=\''
.$domain.'/index.php?action=admin&case=newsletter\'>Manage Newsletters</a></li>
<li><a href=\''
.$domain.'/index.php?action=admin&case=newsletter&cmd=newnewsletter\'>New Newsletter</a></li>
</ul>'
;
?>

</td>
</tr>
</table>
<?
}
?>
and remove it.

go back to the top of the file and find:
Code: [Select]
echo ' <div class=\'menutop\'>';
if($seo_on == 1){
echo ' <ul>
<li><a href=\''.$domain.'\' title=\'Home\'>Home</a></li>
<li><a href=\''.$domain.'/mostplayed/\' title=\'Most Played\'>Most Played</a></li>
<li><a href=\''.$domain.'/newest/\' title=\'Newest\'>Newest</a></li><li><a href="'.$domain.'/memberslist/" title="Member List">Member List</a></li>
<li><a href=\''.$domain.'/search/\' title=\'Search\'>Search</a></li>

';
if(!isset($suserid)){
echo ' <li class=\'floatr\'><a href=\''.$domain.'/login/\'>Login</a></li>
<li class=\'floatr\'><a href=\''.$domain.'/signup/\'>Signup</a></li>';
}else{
echo '
<li class=\'floatr\'><a href=\''.$domain.'/logout/\'>Logout</a></li>
<li class=\'floatr\'><a href=\''.$domain.'/myaccount/\'>My Account</a></li>';
}
and add this after:

Code: [Select]
?>
<?php
if($usrdata['user_level'] == 2){
?>

<?php
echo '<li class=\'floatr\'><a href=\''.$domain.'/index.php?action=admin&case=home\'>Admin</a></li>';
?>

<?
}
?>
<?php


now go to the pages dictionary and open the admin dictionary, find index.php and add this:
Code: [Select]
case 'home':
include ('home.php');
break;
after:
Code: [Select]
default:
include ('statics.php');
break;


and finally create a new file called home.php in the admin dictionary. add this to that file:
Code: [Select]
<table>
<tr>
<td>
<ul class=\'catmenu\'>
<li><a href=\''.$domain.'/index.php?action=admin&case=addgame\'>Add Game</a></li>
<li><a href=\''.$domain.'/index.php?action=admin&case=managegames\'>Manage Games</a></li>
<li><a href=\''.$domain.'/index.php?action=admin&case=addcategory\'>Add Category</a></li>
<li><a href=\''.$domain.'/index.php?action=admin&case=managecategories\'>Manage Categories</a></li>
<li><a href=\''.$domain.'/index.php?action=admin&case=addlink\'>Add Link</a></li>
<li><a href=\''.$domain.'/index.php?action=admin&case=managelinks\'>Manage Links</a></li>
<li><a href=\''.$domain.'/index.php?action=admin&case=approvecomments\'>Approve Comments</a></li>
<li><a href=\''.$domain.'/index.php?action=admin&case=settings\'>Site Settings</a></li>
<li><a href=\''.$domain.'/index.php?action=admin&case=managemembers\'>Manage Memebers</a></li>
<li><a href=\''.$domain.'/index.php?action=admin&case=newsletter\'>Manage Newsletters</a></li>
<li><a href=\''.$domain.'/index.php?action=admin&case=newsletter&cmd=newnewsletter\'>New Newsletter</a></li>
</ul>
</td>
</tr>
</table>

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: better place for admin links
« Reply #1 on: May 18, 2009, 10:15:22 PM »
You're actually hitting on something I've been working on for the next release lol. I've been wanting to move the admin links into their own Admin home page if you will.

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: better place for admin links
« Reply #2 on: May 24, 2009, 02:28:08 PM »
that just go's to show great minds do think alike.
I have actually stopped making "mods" for this script cuz i have been trying to create my own forum/flash portal. I have gotten to having a login system, avatars, and you can post stuff but I just cant figure out how to add a PM system. I had tryed looking at the one danny made for this script and seeing what i could do from there but i have no idea lol.

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: better place for admin links
« Reply #3 on: May 24, 2009, 03:54:36 PM »
That's also one of the things I've been woring on. The messaging system that he wrote up is now part of the test/dev install, and even has a box in the profile page for each person to send them a message.

The avatars, I'm not quite sure how I want to work those in just yet, but That is also something I'm wanting to get into it hopefuly by version 2.0

Plus I'm working on(long term not next release) in the back of my mind a forum add on.

I also have a couple of things I'm working on for this or the next release that those who know what they're doing are really going to appreciate. Things that could really start helping in traffic flow. ;)

Too bad that you've given up working on this one. Things should get interesting here in the not too distant future.

Adam LaCombe

  • Sr. Member
  • ****
  • Posts: 433
  • Force: +17/-0
    • My Blog
Re: better place for admin links
« Reply #4 on: May 24, 2009, 04:14:25 PM »
oh kool! i havnt really given up on the script I just kinda got bored..
I get bored easy but I could maybe help you out with the forum..
I have mine running pretty well but if you want I could try and see what I could do to integrate what I have into this script?

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: better place for admin links
« Reply #5 on: May 24, 2009, 04:34:30 PM »
If you feel up to it sure. we were not planning on if for a bit, what we have planned is large enough a chunck for us right now. We will go through it before making it official, need to make sure that it is secure, etc, but it would save us from having to make it. Every person helping code something speeds up the process and take a little off our load.

kurt

  • Developer
  • Hero Member
  • ******
  • Posts: 634
  • Force: +16/-1
Re: better place for admin links
« Reply #6 on: May 25, 2009, 12:59:57 PM »
It occures to us that if you are going to do this, we should probably talk about how we want the database structured to conform how the script is being altered as I write this, as well as variables. PM me and I will give you details.
« Last Edit: May 25, 2009, 01:02:12 PM by kurt »