Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Modules
Author Message
rebelt
Worker
Worker



Joined: May 07, 2006
Posts: 172

PostPosted: Sun Aug 19, 2012 8:48 am Reply with quote

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 Wink ) but still points to the original module admin files.

The files are here 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 
View user's profile Send private message Visit poster's website
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sun Aug 19, 2012 8:55 am Reply with quote

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. 
View user's profile Send private message
rebelt







PostPosted: Sun Aug 19, 2012 9:14 am Reply with quote

Do you mean something like
Code:
case 'TableMaint':

to
Code:
case 'SinglesTableMaint':

in case php
Code:
        case 'SinglesTableMaint':

            include_once 'modules/' . $module_name . '/admin/TableMaint.php';
            break;

in admin/index.php.
 
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Sun Aug 19, 2012 6:09 pm Reply with quote

Search for

Code:
if (!isset($op))

    $op = '';


Replace with

Code:
if (!isset($GET))

    $GET = '';
 
View user's profile Send private message
rebelt







PostPosted: Mon Aug 20, 2012 1:50 am Reply with quote

@ 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
Code:
    case 'Doubles':


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;
}
 
rebelt







PostPosted: Mon Aug 20, 2012 4:32 am Reply with quote

Solved
 
Palbin







PostPosted: Mon Aug 20, 2012 6:50 am Reply with quote

rebelt, glad you got it sorted out. If you need anymore help let us know.

unicornio, no sure what you were getting at.
 
hicuxunicorniobestbuildpc







PostPosted: Fri Feb 01, 2013 7:16 am Reply with quote

Hi Palbin, after reading your post again I notice it was other things. I think I went offtopic accidentally. Sorry.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating 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 ©