我有问题要实现我自己的模块,我想开发。
我的步骤:
在/admin/includes/application_top.php
+ define('FILENAME_MYMODULE', 'test_mymodule.php');
/lang/german/admin/gm_german.php
+ define('BOX_MYMODULE', 'MyModule');
/lang/german/sections/_samples/admin_menu.lang.inc.php
+ 'BOX_MYMODULE' => 'MyModule',
INSERT INTO ``gm_lang_files_content`` VALUES('', 246, 'BOX_MYMODULE', 'MyModule');
/system/conf/AdminMenu/gambio_menu.xml
+ <menuitem sort="10" link="FILENAME_MYMODULE" title="{$txt.BOX_MYMODULE}" />
现在我的问题是,当我清除缓存并重新加载时,我没有看到我的菜单选项。 如果我在gm_ebay.php中更改test_mymodule.php或者在其他方面更改它将起作用。
为什么它适用于我的文件?
我非常感谢你的帮助
答案 0 :(得分:1)
我找到了解决方案,我觉得像gambio这样的新手会搜索它。
最后一点插入数据库
ALTER TABLE admin_access
ADD myfile
INT(1)NOT NULL DEFAULT'0';
并将其更新为1表示真实
答案 1 :(得分: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;"> 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表示真实
多数民众赞成。