I need help

271
.
anyone have code and data set JohnCMS wapbuilder with no source. Give me sir. Guided possible. thanks a lot.
Demo: vni.mobi
http://saoviet.vni.mobi
.
This is for 3 last posts from forum on main site.

In incfiles folder create file showforum.php and put in it this code:
<?
{
global $user_id;

$set_forum = $datauser['set_forum'] ? unserialize($datauser['set_forum']) : array();
$settings = $set['lastThemes'] ? unserialize($set['lastThemes']) : array('totalThemes' => 3, 'timeCache' => 30);
if($settings['totalThemes'] > 0 && !$set_forum['viewThemes']) {
$themesOut = '';
$file_cache = 'files/cache/lastThemes.dat';
  /*echo '<div class="phdr"><b>Последние темы форума</b></div>';*/
$req = mysql_query("SELECT * FROM `forum` WHERE `type`='t'" . ($rights >= 7 ? '' : " AND `close`!='1'") . " ORDER BY `time` DESC LIMIT " . $settings['totalThemes']);
while (($res = mysql_fetch_assoc($req)) !== false) {
if ($res['close']) $themesOut .= '<div class="rmenu">';
else $themesOut .=  $i % 2 ? '<div class="mainpagebubble2">' : '<div class="mainpagebubble1">';
    $nickUser = mysql_fetch_assoc(mysql_query("SELECT `from` FROM `forum` WHERE `type` = 'm' AND `close` != '1' AND `refid` = '" . $res['id'] . "' ORDER BY `time` DESC LIMIT 1"));
    $totalPosts = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='m' AND `refid`='" . $res['id'] . "'" . ($rights >= 7 ? '' : " AND `close` != '1'")), 0);
    $endPage = ceil($totalPosts / $kmess);
$icons = array(
(!$res['vip'] ? '<img src="../theme/' . $set_user['skin'] . '/images/op.gif" alt=""/>' : ''),
($res['vip'] ? '<img src="../theme/' . $set_user['skin'] . '/images/pt.gif" alt=""/>' : ''),
($res['realid'] ? '<img src="../theme/' . $set_user['skin'] . '/images/rate.gif" alt=""/>' : ''),
($res['edit'] ? '<img src="../theme/' . $set_user['skin'] . '/images/tz.gif" alt=""/>' : '')
);
$themesOut .= functions::display_menu($icons, '&#160;', '&#160;') .
'<a href="forum/index.php?id=' . $res['id'] . '">' . $res['text'] . '</a> [' . $totalPosts . ']';
if ($endPage > 1) $themesOut .= '<a href="index.php?id=' . $res['id'] . '&amp;page=' . $endPage . '">&#160;&gt;&gt;</a>';
$themesOut .= '<div class="sub">' . $res['from'];
if (!empty($nickUser['from'])) $themesOut .= '&#160;/&#160;' . $nickUser['from'];
$themesOut .= ' <span class="gray">(' . functions::display_date($res['time']) . ')</span></div></div>';
++$i;
}
if ($settings['timeCache'] > 0 && time() < (filemtime($file_cache) + $settings['timeCache'])) {
echo file_get_contents($file_cache);
} else {
echo $themesOut;
    if($settings['timeCache'] > 0)
    file_put_contents($file_cache, $themesOut);
}
}
}
?>


Then in Your main site input this code:
require_once ('../incfiles/showforum.php');
.
tại sao ở file trên dùng trong function mà ở dưới lại require file là như nào?
nếu dùng function thì gọi ra kiểu khác còn đã tạo hẳn file riêng thì phải gọi kiểu khác nhé!
Всего: 3