Сирожиддин
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.
Kod · PHP59 qator
public static function display_place($user_id = 0, $place = '') {

    global $headmod;

    $place = explode(",", $place);

    $placelist = parent::load_lng('places');

    if (array_key_exists($place[0], $placelist)) {

        if ($place[0] == 'news') {

            $news = mysql_fetch_array(mysql_query("SELECT * FROM `cms_news` WHERE `id` = '".$place[1]."'"));

            return '

                <a href="' . self::$system_set['homeurl'] . '/news/index.php?act=view&amp;id=' . $place[1] . '">

                    '.mb_substr($news['name'], 0, 30).'...

                </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.
Kod · PHP3 qator
require_once('../incfiles/core.php');

$headmod = 'news,'.$id;


Namuna: http://fc-arsenal.uz/users/index.php?act=online