Hi, Khách!
![]() | ![]() ![]() ![]() ![]() |
TUT hướng dẫn thêm mod web đầu đủ cho wap JohnCMS 4.4 by MHaTinh.Com
Do anh em phàn nàn tớ share theme mà không hướng dẫn nên hôm nay làm cái tut hướng dẫn đầy đủ luôn
+Di chuyển hai files head.php và end.php ở thư mục vào thư mục pages
+Mở file incfiles/classes/core.php
Tìm
Thêm vào dưới
+Mở file users/includes/profile/settings.php
Tìm
echo '<p><h3>Wap ' . $lng['design_template' . '</h3><select name="wapskin">';
foreach (glob('../theme/*/style.css') as $val) {
$dir = explode('/', dirname($val));
$theme = array_pop($dir);
if (file_exists("../theme/$theme/.web"))continue;
echo '<option' . (core::$user_set['wapskin' == $theme ? ' selected="selected">' : '>') . $theme . '</option>';
}
echo '</select></p>';
Copy code
foreach (glob('../theme/*/style.css') as $val) {
$dir = explode('/', dirname($val));
$theme = array_pop($dir);
if (file_exists("../theme/$theme/.web"))continue;
echo '<option' . (core::$user_set['wapskin' == $theme ? ' selected="selected">' : '>') . $theme . '</option>';
}
echo '</select></p>';
Copy code
Thêm vào dưới
echo '<p><h3>Web ' . $lng['design_template' . '</h3><select name="webskin">';
foreach (glob('../theme/*/style.css') as $val) {
$dir = explode('/', dirname($val));
$theme = array_pop($dir);
if (file_exists("../theme/$theme/.wap"))continue;
echo '<option' . (core::$user_set['webskin' == $theme ? ' selected="selected">' : '>') . $theme . '</option>';
}
echo '</select></p>';
Copy code
foreach (glob('../theme/*/style.css') as $val) {
$dir = explode('/', dirname($val));
$theme = array_pop($dir);
if (file_exists("../theme/$theme/.wap"))continue;
echo '<option' . (core::$user_set['webskin' == $theme ? ' selected="selected">' : '>') . $theme . '</option>';
}
echo '</select></p>';
Copy code
+Mở file panel/includes/settings.php
Tìm dòng
Thêm vào dưới
mysql_query("UPDATE `cms_settings` SET `val`='" . functions::check($_POST['webskindef') . "' WHERE `key` = 'webskindef'");
Copy code
Copy code
Tìm dòng
echo '<p><h3>' . $lng['design_template' . '</h3>*<select name="skindef">';
$dir = opendir('../theme');
while ($skindef = readdir($dir)) {
if (($skindef != '.') && ($skindef != '..') && ($skindef != '.svn')) {
$skindef = str_replace('.css', '', $skindef);
echo '<option' . ($set['skindef' == $skindef ? ' selected="selected">' : '>') . $skindef . '</option>';
}
}
closedir($dir);
echo '</select>' .
'</p><p><input type="submit" name="submit" value="' . $lng['save' . '"/></p></div></form>' .
'<div class="phdr">*</div>' .
'<p><a href="index.php">' . $lng['admin_panel' . '</a></p>';
Copy code
$dir = opendir('../theme');
while ($skindef = readdir($dir)) {
if (($skindef != '.') && ($skindef != '..') && ($skindef != '.svn')) {
$skindef = str_replace('.css', '', $skindef);
echo '<option' . ($set['skindef' == $skindef ? ' selected="selected">' : '>') . $skindef . '</option>';
}
}
closedir($dir);
echo '</select>' .
'</p><p><input type="submit" name="submit" value="' . $lng['save' . '"/></p></div></form>' .
'<div class="phdr">*</div>' .
'<p><a href="index.php">' . $lng['admin_panel' . '</a></p>';
Copy code
Thay thế bằng
echo '<h3>Theme wap </h3>*<select name="skindef">';
$dir = opendir('../theme');
while ($themes = readdir($dir)) {
if (($themes != '.') && ($themes != '..') && ($themes != '.svn')) {
$themes = str_replace('.css', '', $themes);
if (file_exists("../theme/$themes/.web"))continue;
echo '<option' . ($set['skindef' == $themes ? ' selected="selected">' : '>') . $themes . '</option>';
}
}
closedir($dir);
echo '</select><br />';
// Them theme web
echo '<h3>Theme wap</h3>*<select name="webskindef">';
$dir = opendir('../theme');
while ($themes = readdir($dir)) {
if (($themes != '.') && ($themes != '..') && ($themes != '.svn')) {
$themes = str_replace('.css', '', $themes);
if (file_exists("../theme/$themes/.wap"))continue;
echo '<option' . ($set['webskindef' == $themes ? ' selected="selected">' : '>') . $themes . '</option>';
}
}
closedir($dir);
echo '</select><br />';
echo '<p><input type="submit" name="submit" value="' . $lng['save' . '"/></p></div></form>' .
'<div class="phdr">*</div>' .
'<p><a href="index.php">' . $lng['admin_panel' . '</a></p>';
Copy code
$dir = opendir('../theme');
while ($themes = readdir($dir)) {
if (($themes != '.') && ($themes != '..') && ($themes != '.svn')) {
$themes = str_replace('.css', '', $themes);
if (file_exists("../theme/$themes/.web"))continue;
echo '<option' . ($set['skindef' == $themes ? ' selected="selected">' : '>') . $themes . '</option>';
}
}
closedir($dir);
echo '</select><br />';
// Them theme web
echo '<h3>Theme wap</h3>*<select name="webskindef">';
$dir = opendir('../theme');
while ($themes = readdir($dir)) {
if (($themes != '.') && ($themes != '..') && ($themes != '.svn')) {
$themes = str_replace('.css', '', $themes);
if (file_exists("../theme/$themes/.wap"))continue;
echo '<option' . ($set['webskindef' == $themes ? ' selected="selected">' : '>') . $themes . '</option>';
}
}
closedir($dir);
echo '</select><br />';
echo '<p><input type="submit" name="submit" value="' . $lng['save' . '"/></p></div></form>' .
'<div class="phdr">*</div>' .
'<p><a href="index.php">' . $lng['admin_panel' . '</a></p>';
Copy code
+Upload hai files head.php vào end.php vào thư mục incfiles
+Upload thư mục mhatinh vào thư mục theme ở wap bạn
+Chạy đường dẫn http://domain/install.php để cập nhật data
+Đường đẫn theme web của bạn là http://domain/tmod.php?mod=mhatinh
Link Download: http://mhatinh.com/forum/index.php?act=file&id=34

Trực Tuyến:
Khách: 1