Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
Donovan
Client



Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Fri Mar 17, 2006 3:54 pm Reply with quote

I am trying to build an admin menu such as this one:

Code:
function campaign_admin_menu($title=""){

  global $bgcolor1, $bgcolor2, $admin_file;
  OpenTable(); 
  echo "<center' class='title'><b>"._TITLE." </b></center><br />\n";
  echo "<table border='1' align='center' width='100%' cellpadding='2' cellspacing='0'>\n";
  echo "<tr bgcolor='$bgcolor2'>\n";
  echo "<td align='center' valign='top' width='20%'>&nbsp;<b><u>"._CAMPAIGN."</u></b>&nbsp;</td>\n";
  echo "<td align='center' valign='top' width='20%'>&nbsp;<b><u>"._MAPS."</u></b>&nbsp;</td>\n";
  echo "<td align='center' valign='top' width='20%'>&nbsp;<b><u>"._UNITS."</u></b>&nbsp;</td>\n";
  echo "<td align='center' valign='top' width='20%'>&nbsp;<b><u>"._REPORTS."</u></b>&nbsp;</td>\n"; 
  echo "</tr>\n";
  echo "<tr>\n";
  echo "<td align='center' valign='top' width='20%' rowspan='3'>\n";
  echo "&nbsp;<a href='".$admin_file.".php?op=CampaignConfig'>"._CONFIG."</a>&nbsp;<br />\n";
  echo "&nbsp;<a href='".$admin_file.".php?op=CampaignList'>"._CAMPAIGNLIST."</a>&nbsp;<br />\n";   
  echo "</td>\n";
  echo "<td align='center' valign='top' width='20%' rowspan='3'>\n";
  echo "&nbsp;<a href='".$admin_file.".php?op=MapConfig'>"._CONFIG."</a>&nbsp;<br />\n";
  echo "&nbsp;<a href='".$admin_file.".php?op=MapList'>"._MAPLIST."</a>&nbsp;<br />\n";
  echo "&nbsp;<a href='".$admin_file.".php?op=MapAdd'>"._MAPADD."</a>&nbsp;<br />\n";
  echo "&nbsp;<a href='".$admin_file.".php?op=MapEdit'>"._MAPEDIT."</a>&nbsp;<br />\n";
  echo "</td>\n";
  echo "<td align='center' valign='top' width='20%' rowspan='3'>";
  echo "&nbsp;<a href='".$admin_file.".php?op=UnitConfig'>"._CONFIG."</a>&nbsp;<br />";
  echo "&nbsp;<a href='".$admin_file.".php?op=UnitList'>"._UNITLIST."</a>&nbsp;<br />";
  echo "&nbsp;<a href='".$admin_file.".php?op=UnitAdd'>"._UNITADD."</a>&nbsp;<br />";
  echo "&nbsp;<a href='".$admin_file.".php?op=UnitEdit'>"._UNITEDIT."</a>&nbsp;<br />";
  echo "</td>\n";
  echo "<td align='center' valign='top' width='20%' rowspan='3'>";
  echo "&nbsp;<a href='".$admin_file.".php?op=ReportConfig'>"._CONFIG."</a>&nbsp;<br />";
  echo "&nbsp;<a href='".$admin_file.".php?op=ReportList'>"._REPORTLIST."</a>&nbsp;<br />";
  echo "&nbsp;<a href='".$admin_file.".php?op=ReportAdd'>"._REPORTADD."</a>&nbsp;<br />";
  echo "&nbsp;<a href='".$admin_file.".php?op=ReportEdit'>"._REPORTEDIT."</a>&nbsp;<br />";
  echo "</td>\n"; 
  echo "</tr>\n"; 
  echo "</table>\n";
  CloseTable();
}


Which is written to a script in includes/campaign_func.php

I want to call this in the beginning of all my admin scripts so that each one will display this admin menu at the top of my page.

My first admin page when entering my module is the following:
Code:
<?php

if(!defined('ADMIN_FILE')) { die("Illegal Access Detected!!!"); }

$pagetitle = ": "._CAMPAIGN_TITLE." : "._CAMPAIGN_ADMIN;
include("header.php");
campaign_admin_menu(_CAMPAIGN_ADMIN);
include("footer.php");
?>


But it doesn't work so far. All it shows is an empty screen (not white or blank) but empty with a header and footer. No admin menu is displayed.

I studied how Nuke Projects has its admin_menu like this and am trying to duplicate it.

Any help is appreciated.
 
View user's profile Send private message Visit poster's website ICQ Number
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sat Mar 18, 2006 4:31 am Reply with quote

You aren't loading the includes/campaign_func.php file. Try
Code:
<?php

if(!defined('ADMIN_FILE')) { die("Illegal Access Detected!!!"); }

$pagetitle = ": "._CAMPAIGN_TITLE." : "._CAMPAIGN_ADMIN;
include("header.php");
include ('includes/campaign_func.php');
campaign_admin_menu(_CAMPAIGN_ADMIN);
include("footer.php");
?>
 
View user's profile Send private message
Donovan







PostPosted: Sat Mar 18, 2006 1:47 pm Reply with quote

Made some changes but still not loading the campaign_admin_menu when I bring up the first page.

Since for now all it does is bring up my admin menu I renamed it functions.php and moved it into my admin folder of my module.

This is my first page upon entering my module for admin stuff.
Code:
<?php


if(!defined('ADMIN_FILE')) { die("Illegal Access Detected!!!"); }
$module_name = "Campaign";
get_lang($module_name);
$pagetitle = ": "._CAMPAIGN_TITLE." : "._CAMPAIGN_ADMIN;
include("header.php");
include("modules/$module_name/admin/functions.php");
campaign_admin_menu(_CAMPAIGN_ADMIN);
include("footer.php");
?>


All I am doing is passing it the "Administration" value as defined in my language file. All I should see is this:


Code:
function campaign_admin_menu($title=""){

  global $bgcolor1, $bgcolor2, $admin_file;
  $module_name = "Campaign";
  include_once("modules/$module_name/language/lang-english.php");
  OpenTable(); 
  echo "<center' class='title'><b>"._TITLE." </b></center><br />\n";
  echo "<table border='1' align='center' width='100%' cellpadding='2' cellspacing='0'>\n";
  echo "<tr bgcolor='$bgcolor2'>\n";
  echo "<td align='center' valign='top' width='20%'>&nbsp;<b><u>"._CAMPAIGN."</u></b>&nbsp;</td>\n";
  echo "<td align='center' valign='top' width='20%'>&nbsp;<b><u>"._MAPS."</u></b>&nbsp;</td>\n";
  echo "<td align='center' valign='top' width='20%'>&nbsp;<b><u>"._UNITS."</u></b>&nbsp;</td>\n";
  echo "<td align='center' valign='top' width='20%'>&nbsp;<b><u>"._REPORTS."</u></b>&nbsp;</td>\n"; 
  echo "</tr>\n";
  echo "<tr>\n";
  echo "<td align='center' valign='top' width='20%' rowspan='3'>\n";
  echo "&nbsp;<a href='".$admin_file.".php?op=CampaignConfig'>"._CONFIG."</a>&nbsp;<br />\n";
  echo "&nbsp;<a href='".$admin_file.".php?op=CampaignList'>"._CAMPAIGNLIST."</a>&nbsp;<br />\n";   
  echo "</td>\n";
  echo "<td align='center' valign='top' width='20%' rowspan='3'>\n";
  echo "&nbsp;<a href='".$admin_file.".php?op=MapConfig'>"._CONFIG."</a>&nbsp;<br />\n";
  echo "&nbsp;<a href='".$admin_file.".php?op=MapList'>"._MAPLIST."</a>&nbsp;<br />\n";
  echo "&nbsp;<a href='".$admin_file.".php?op=MapAdd'>"._MAPADD."</a>&nbsp;<br />\n";
  echo "&nbsp;<a href='".$admin_file.".php?op=MapEdit'>"._MAPEDIT."</a>&nbsp;<br />\n";
  echo "</td>\n";
  echo "<td align='center' valign='top' width='20%' rowspan='3'>";
  echo "&nbsp;<a href='".$admin_file.".php?op=UnitConfig'>"._CONFIG."</a>&nbsp;<br />";
  echo "&nbsp;<a href='".$admin_file.".php?op=UnitList'>"._UNITLIST."</a>&nbsp;<br />";
  echo "&nbsp;<a href='".$admin_file.".php?op=UnitAdd'>"._UNITADD."</a>&nbsp;<br />";
  echo "&nbsp;<a href='".$admin_file.".php?op=UnitEdit'>"._UNITEDIT."</a>&nbsp;<br />";
  echo "</td>\n";
  echo "<td align='center' valign='top' width='20%' rowspan='3'>";
  echo "&nbsp;<a href='".$admin_file.".php?op=ReportConfig'>"._CONFIG."</a>&nbsp;<br />";
  echo "&nbsp;<a href='".$admin_file.".php?op=ReportList'>"._REPORTLIST."</a>&nbsp;<br />";
  echo "&nbsp;<a href='".$admin_file.".php?op=ReportAdd'>"._REPORTADD."</a>&nbsp;<br />";
  echo "&nbsp;<a href='".$admin_file.".php?op=ReportEdit'>"._REPORTEDIT."</a>&nbsp;<br />";
  echo "</td>\n"; 
  echo "</tr>\n"; 
  echo "</table>\n";
  CloseTable();
}


Now I do have other admin pages within my admin directory, for example

admin.php?op=MatchReport

that look like this.

Code:
<?php


/************************************************************************
* ETO Campaign Mod
* By: Donovan [3rd ID]
* http://www.eto-league-com
* Copyright © 2006 by ETO
* License: GNU/GPL
************************************************************************/
if(!defined('ADMIN_FILE')) { die("Illegal Access Detected!!!"); }
include_once("modules/$module_name/language/lang-english.php");
$pagetitle = ": "._TITLE.": "._EDITMAP;
include("header.php");
campaign_admin_menu(_EDITMAP);
echo "<br />\n";
    OpenTable();
   echo "<center><font class=\"content\"><b>" . _MATCHREPORT. "</b></font></center><br><br>"
   ."<form method=\"post\" action=\"".$admin_file.".php\">"

etc
etc...


And everything appear fine with my campaign_admin_menu at the top of my table.

Just don't know why it wont appear when I first enter.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©