Foydalanuvchi qaysi yangilikni o'qiyotganini ko'rsatuvchi qo'shimcha. JohnCMS scriptining Krite modlagan news modulida ishlaydi.
incfiles/classes/functions.php dan
display_place nomli funksiyani toping, va u kodni boshidan-oxirigacha o'chiring keyin o'rniga bu kodni yozing.
public static function display_place($user_id = 0, $place = '') {
global $headmod;
$placelist = parent::load_lng('places');
if ($place[0] == 'news') {
return '
<a href="' . self::$system_set['homeurl'] . '/news/index.php?act=view&id=' . $place[1] . '">
</a>
';
}
if ($place[0] == 'profile') {
if ($place[1] == $user_id) {
return '<a href="' . self::$system_set['homeurl'] . '/users/profile.php?user=' . $place[1] . '">' . $placelist['profile_personal'] . '</a>';
} else {
$user = self::get_user($place[1]);
return $placelist['profile'] . ': <a href="' . self::$system_set['homeurl'] . '/users/profile.php?user=' . $user['id'] . '">' . $user['name'] . '</a>';
}
} elseif ($place[0] == 'online' && isset($headmod) && $headmod == 'online') { return $placelist['here'];
} else {
return str_replace('#home#', self::$system_set['homeurl'], $placelist[$place[0]]); }
}
return '<a href="' . self::$system_set['homeurl'] . '/index.php">' . $placelist['homepage'] . '</a>';
}
news/index.php ga bu kodni almashtiring.
require_once('../incfiles/core.php');
$headmod = 'news,'.$id;
Namuna: http://fc-arsenal.uz/users/index.php?act=online