1

我在实现自己想要开发的模块时遇到了问题。

我的步骤:

  1. /admin/includes/application_top.php+define('FILENAME_MYMODULE', 'test_mymodule.php');

  2. /lang/german/admin/gm_german.php+define('BOX_MYMODULE', 'MyModule');

  3. /lang/german/sections/_samples/admin_menu.lang.inc.php+'BOX_MYMODULE' => 'MyModule',

  4. INSERT INTO ``gm_lang_files_content`` VALUES('', 246, 'BOX_MYMODULE', 'MyModule');

  5. /system/conf/AdminMenu/gambio_menu.xml+<menuitem sort="10" link="FILENAME_MYMODULE" title="{$txt.BOX_MYMODULE}" />

现在我的问题是,当我清除缓存并重新加载时,我没有看到我的菜单选项。如果我在 gm_ebay.php 中更改 test_mymodule.php 或其他方式,它将起作用。

为什么它不适用于我的文件?

我将非常感谢您的帮助

4

2 回答 2

1

我找到了解决方案,我想像我这样的新手在 gambio 中搜索它。

最后一点插入数据库 ALTER TABLE admin_accessADD myfileINT( 1 ) NOT NULL DEFAULT '0';

并将其更新为 1 为真

于 2013-08-13T02:11:02.123 回答
0

更新的解决方案以保持可更新:

菜单条目:/user_classes/conf/admin_menu/menu_mymodule.xml

<?xml version="1.0"?>
<!-- {load_language_text section="admin_menu"} -->
<admin_menu>
    <menugroup id="BOX_HEADING_IMPORT_EXPORT">
        <menuitem sort="10" link="mymodule.php" link_param="your=param" title="MyModule" />
    </menugroup>
</admin_menu>

创建 /admin/includes/modules/mymodule/css/mymodule_backend.css

创建 /admin/includes/modules/mymodule/index.php

<?php
$string =  '<td class="boxCenter" width="100%" valign="top">

<table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td class="pageHeading" style="background-image: url(images/icons/amicicard_30.png);float:left;">&nbsp;MyModule</td>
            <td class="pageHeading" align="right"><img src="images/pixel_trans.gif" border="0" alt="" width="HEADING_IMAGE_WIDTH" height="HEADING_IMAGE_HEIGHT"></td>
          </tr>
</table>

<span class="main">
';


echo $string;

echo "Do your work here like that.<br>";
echo "You can include classes etc. in here and use echo as output.";

echo '</div>';

创建 /admin/mymodule.php

    <?php
$version = phpversion();
$majorVersion = explode('.', $version);
$majorVersion = intval($majorVersion[0]);

if ($majorVersion < 5)
{
    return;
}

require('includes/application_top.php');
$isPopup = isset($_GET['popup']) ? true : false;

?>
    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $_SESSION['language_charset']; ?>">
        <title><?php echo TITLE; ?></title>
        <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
        <link rel="stylesheet" type="text/css" href="includes/modules/mymodule/css/mymodule_backend.css">

    </head>
    <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<?php

if (!$isPopup)
{
    //include header:
    require(DIR_WS_INCLUDES . 'header.php');

    //include body:
    echo '<table border="0" width="100%" cellspacing="2" cellpadding="2">
            <tr>
                <td class="columnLeft2" width="'.BOX_WIDTH.'" valign="top"><table border="0" width="'.BOX_WIDTH.'" cellspacing="1" cellpadding="1" class="columnLeft">';

    //include left navigation:
    require(DIR_WS_INCLUDES . 'column_left.php');

    echo '</table></td>';
}
else
{
    //include body:
    echo '<table border="0" width="100%" cellspacing="2" cellpadding="2">
            <tr>
                <td class="columnLeft2" width="100%" valign="top"><table border="0" width="0" cellspacing="1" cellpadding="1" class="columnLeft">';

}

require_once('./includes/modules/mymodule/index.php');

echo '</tr></table>';




if (!$isPopup)
{
    //footer:
    require(DIR_WS_INCLUDES . 'footer.php');
}

echo '<br>
      </body>
      </html>';

require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

像用户提到的那样更新您的数据库不公平

最后一点插入数据库 ALTER TABLE admin_access ADD myfile INT( 1 ) NOT NULL DEFAULT '0';

并将其更新为 1 为真

而已。

结果图像

于 2016-02-02T16:47:15.613 回答