Author |
Message |
rebelt
Worker
![Worker Worker](modules/Forums/images/ranks/3stars.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: May 07, 2006
Posts: 172
|
Posted:
Sun Aug 19, 2012 8:48 am |
|
Hi Guys,
I have created a duplicate module. (it's unrefined and scrappy but it functions and was needed quickly)
I'm missing something to get the admin section to work. Changed db names and op parts (I think ) but still points to the original module admin files.
Only registered users can see links on this board! Get registered or login! and I wondered if someone could have a look and tell me what I've missed.
Thanks |
_________________ I wish I knew what I was doing LOL |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
Site Admin
![](modules/Forums/images/avatars/Dilbert/Dilbert_-_Dogbert_King.gif)
Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Sun Aug 19, 2012 8:55 am |
|
If it is still pointing to the old module you need to edit the $op variables so they are unique and not the same as the other module. You need to start in case.php and make the CASE statement different. There is also a CASE statement in index.php. I would then search for "op" and update and links, forms, etc so they pass the proper "op".
I hope you are able to follow what I just said. If you do not let me know. I did not install or actually try the module FYI. |
_________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
rebelt
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Aug 19, 2012 9:14 am |
|
Do you mean something like
to
Code:case 'SinglesTableMaint':
|
in case php
Code: case 'SinglesTableMaint':
include_once 'modules/' . $module_name . '/admin/TableMaint.php';
break;
|
in admin/index.php. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm
![](modules/Forums/images/avatars/5ed231554a8492e2e09da.gif)
Joined: Aug 13, 2009
Posts: 1123
|
Posted:
Sun Aug 19, 2012 6:09 pm |
|
Search for
Code:if (!isset($op))
$op = '';
|
Replace with
Code:if (!isset($GET))
$GET = '';
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
rebelt
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Aug 20, 2012 1:50 am |
|
@ unicornio Couldn't find that code but thanks for trying to help.
@ Palbin Worked out what you meant and admin files work fine Thank You.
2nd Problem.
Did a copy of the duplicate module because I needed 3 versions.
Getting
Fatal error: Call to undefined function doubles() in C:\xampp\htdocs\raven_new\modules\RebelT_Doubles\admin\index.php on line 33 (middle line below.)
Code: case 'Doubles':
Doubles();
break;
|
In case.php it has
Any idea why it would do that?
Just in case, here is the index.php file
Code:<?php
if (!defined('ADMIN_FILE')) {
die('Illegal Access Detected!!!');
}
global $admin_file;
if (!$admin_file OR $admin_file == '') {
$admin_file = 'admin';
}
$index = 1;
define('INDEX_FILE', true);
$module_name = 'RebelT_Doubles';
global$db, $prefix, $admin_file, $module_name, $jobsetting;
$aid = substr("$aid", 0, 25);
$row = $db->sql_fetchrow($db->sql_query("SELECT title, admins FROM " . $prefix . "_modules WHERE title='RebelT_Doubles'"));
$row2 = $db->sql_fetchrow($db->sql_query("SELECT name, radminsuper FROM " . $prefix . "_authors WHERE aid='$aid'"));
$admins = explode(",", $row['admins']);
$auth_user = 0;
for ($i = 0; $i < sizeof($admins); $i++) {
if ($row2['name'] == "$admins[$i]" AND !empty($row['admins'])) {
$auth_user = 1;
}
}
if ($row2['radminsuper'] == 1 || $auth_user == 1) {
define('LEAGUE_ADMIN_FILE', true);
switch ($op) {
case 'Doubles':
Doubles();
break;
case 'DoublesTableMaint':
include_once 'modules/' . $module_name . '/admin/TableMaint.php';
break;
case 'ListDoublesTeams':
include_once 'modules/' . $module_name . '/admin/ListAllTeams.php';
break;
}
include_once 'footer.php';
} else {
echo 'You can not access this section directly';
}
// FUNCTIONS
function Singles() {
global $module_name;
addCSSToHead('modules/' . $module_name . '/admin/menu.css', 'file');
addCSSToHead('modules/' . $module_name . '/style.css', 'file');
include_once 'header.php';
league_menu();
//
//include_once 'footer.php';
}
function league_menu() {
echo '<!-- BEGIN MENU -->
<ul class="jobmenu">
<li><a href="#" class="drop">Administration</a><!-- Begin 1st list menu column -->
<div class="dropdown_1column">
<div class="col_1 firstcolumn">
<ul class="levels">
<li><a href="admin.php?op=DoublesTableMaint">Table Maintenance</a></li>
</ul>
</div>
</div>
</li><!-- End 1st menu list column -->
<li><a href="#" class="drop">League Data</a><!-- Begin 2nd menu list -->
<div class="dropdown_1column"><!-- Begin 2nd menu container -->
<div class="col_1 firstcolumn">
<ul class="levels">
<li><a href="#" class="parent">Teams</a>
<ul>
<li><a href="admin.php?op=ListDoublesTeams">List all Teams</a></li>
</ul>
</li>
<!--<li><a href="">link 4</a></li>
<li><a href="admin.php">link 5</a></li>
<li><a href="admin.php">link 6</a></li>
<li><a href="admin.php">link 7</a></li>-->
</ul>
</div>
</div><!-- End 2nd menu container -->
</li><!-- End 2nd menu list -->
<!--<li><a href="#" class="drop"></a>
<div class="dropdown_1column">
<div class="col_1 firstcolumn">
<ul class="levels">
<li><a href="#" class="parent"></a>
<ul>
<li><a href=""</a></li>
<li><a href=""</a></li>
</ul>
</li>
<li><a href="#" class="parent"></a>
<ul>
<li><a href=""></a></li>
<li><a href=""></a></li>
<li><a href=""></a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</li> -->
</ul><!-- END MENU -->';
}
|
case.php
Code:<?php
if (!defined('ADMIN_FILE')) {
die('Access Denied');
}
$module_name = basename(dirname(dirname(__FILE__)));
switch ($op) {
case 'Doubles':
case 'DoublesTableMaint':
case 'ListDoublesTeams':
include_once 'modules/' . $module_name . '/admin/index.php';
break;
}
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
rebelt
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Aug 20, 2012 4:32 am |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Aug 20, 2012 6:50 am |
|
rebelt, glad you got it sorted out. If you need anymore help let us know.
unicornio, no sure what you were getting at. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Feb 01, 2013 7:16 am |
|
Hi Palbin, after reading your post again I notice it was other things. I think I went offtopic accidentally. Sorry. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|