Nukemods Forum  
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 55
5 members and 50 guests
affiz4iliate6ec, cliaw9cckhereto, mariacolmanyne3, medaricalddw93g, parttarcts
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
» .:.

Go Back   Nukemods Forum > PHP-Nuke 7.x > Nuke 7.x - Modules

Reply
 
LinkBack Thread Tools Display Modes
Question about admin modules
Old
  (#1 (permalink))
Junior Member
 
Status: Offline
Posts: 4
Join Date: Feb 2005
Question about admin modules - 02-02-2005, 02:44 PM

Greetings everyone.

I recently got into php-nuke module scripting and yesterday I got stuck with a new admin module I'm working on. The problem's that the module has to be in 4 php files instead of one. I'm confused on how to go with this. Any ideas or help would be most appreciated. Thanks for reading.
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#2 (permalink))
Junior Member
 
Status: Offline
Posts: 4
Join Date: Jan 2005
Location: France
02-02-2005, 05:51 PM

First step

Declare all your functions in your case.php file i.e

switch($op) {
# page1
case "function1":

# page2
case "function2":

# page3
case "function3":

# page4
case "function4":

include("modules/$module_name/admin/index.php");
break;

In you links file declare the first function to call from your admin panel
i.e.
adminmenu("".$admin_file.".php?op=function1", "Yourmodule", yourmodule.gif");

For jumping between files, do links like this

You're in file A and you want to call function functionzzzzz in your file B do
<a href=\"".$admin_file.".php?op=functionzzzzz\">"._o k."</a>";
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#3 (permalink))
Junior Member
 
Status: Offline
Posts: 4
Join Date: Feb 2005
02-03-2005, 11:19 AM

I see. I will try out. Thanks a lot

There's another issue. This is one of the modules I'm working on:

rdblist.php
Code:
<?php
if (!eregi("admin.php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }
$querystr = "SELECT radminsuper, admlanguage FROM "
.$prefix."_authors where aid='$aid'";
$result = sql_query($querystr, $dbi) or die ("invalied query");
list($radminsuper) = sql_fetch_row($result, $dbi);
if ($radminsuper==1) {

function rdblist() {
	
	include ("header.php");
    GraphicAdmin();
    OpenTable();
	echo "<center><font class=\"title\">Test test</font></center>";
    CloseTable();
	include("footer.php");
}

}
?>
case.rdblist.php
Code:
<?php
if (!eregi("admin.php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }

switch($op) {
	
	case "rdblist":
	include("admin/modules/rdblist.php");
	break;

}
?>
links.rdblist.php
Code:
<?php

if (!eregi("admin.php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }

if ($radminsuper == 1) {
    adminmenu("admin.php?op=rdblist", ""._ROUTINGDB."", "reset.gif");
}

?>
Everything looks set ok to me, however, when I click on the module icon in the Admin Panel, I get transferred to a white blank page. Any ideas what could causing this ?? =/
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#4 (permalink))
Junior Member
 
Status: Offline
Posts: 4
Join Date: Jan 2005
Location: France
02-03-2005, 12:41 PM

Code:
<?php
if (!eregi("admin.php", $_SERVER['PHP_SELF'])) { die ("Access Denied"); }
$querystr = "SELECT radminsuper, admlanguage FROM "
.$prefix."_authors where aid='$aid'";
$result = sql_query($querystr, $dbi) or die ("invalied query");
list($radminsuper) = sql_fetch_row($result, $dbi);
if ($radminsuper==1) {

function rdblist() {
   
   include ("header.php");
    GraphicAdmin();
    OpenTable();
   echo "<center><font class=\"title\">Test test</font></center>";
    CloseTable();
   include("footer.php");
}

switch($op) {
   
   case "rdblist":
   rdblist();
   break;
}
} else {
   include("header.php");
   GraphicAdmin();
   OpenTable();
   echo "<center>"._ERROR."

You do not have admin permission for \"$module_name\"</center>";
   CloseTable();
   include("footer.php");
}

?>
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#5 (permalink))
Junior Member
 
Status: Offline
Posts: 4
Join Date: Feb 2005
02-03-2005, 02:40 PM

Thanks :wink:
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#6 (permalink))
Junior Member
 
Status: Offline
Posts: 4
Join Date: Jan 2005
Location: France
02-03-2005, 03:30 PM

:wink:
What are u working on?
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#7 (permalink))
Junior Member
 
Status: Offline
Posts: 4
Join Date: Feb 2005
02-04-2005, 05:20 AM

It's a database for IRC server link applications. I had it as a standalone database with its own login and passwords for the routing members of the IRC network until they've asked me to implement the scripts to php-nuke. Once again I thank you for your help.
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Admin User Permissions not letting me set myself as Admin MurphDog Purged Topics 8 01-10-2006 01:37 AM
Question about Admin and Moderator groups dochogan Open topics 4 12-20-2004 10:34 PM
Disabling Inactive modules in modules block Krutch Nuke 7.x - Modules 2 12-14-2004 10:43 AM
cannot add new site admin in admin cp aramis Nuke 7.x - General 2 10-10-2004 06:55 AM
top posters block question: can admin be excluded? sweetquads Nuke 6.5 to 6.9 - Blocks 1 07-09-2003 07:57 PM




vBulletin Skin developed by: vBStyles.com


LinkBacks Enabled by vBSEO 3.3.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31