mehrzad

پبغام خطای Fatal Error was detected! در کیوننا

7 پست در این موضوع

ارسال شده در (ویرایش شده)

هنگام پاسخ دادن به موضوعات در تالار این پیغام خطا ظاهر یشه

لطفا راهنمایی بفرمایید

500 Internal Server Error

Fatal Error was detected!

Fatal Error: Access to undeclared static property: KunenaAccessJoomla16::$viewLevels in components/com_kunena/libraries/integration/joomla16/access.php on line 127

The error was detected in the Kunena Component.

For support click here: Kunena Support

Go back

ویرایش شده در توسط saber

Share this post


Link to post
Share on other sites
آموزش ووکامرس قالب جوملا قالب وردپرس قالب رایگان وردپرس قالب رایگان جوملا هاست نامحدود هاست جوملا هاست لاراول هاست وردپرس هاست ارزان هاست ربات تلگرام خرید دامنه آموزش ساخت ربات تلگرام با php آموزش html و css آموزش لاراول آموزش cPanel آموزش php آموزش سئو وردپرس آموزش امنیت وردپرس آموزش وردپرس آموزش فرم ساز RSform آموزش سئو جوملا آموزش فروشگاه ساز Hikashop آموزش فروشگاه ساز ویرچومارت آموزش طراحی سایت آگهی تبلیغاتی آموزش امنیت جوملا آموزش طراحی سایت فروش فایل آموزش طراحی قالب ریسپانسیو با Helix آموزش جوملا 3 آموزش ساخت ربات دکمه ی شیشه ای آموزش ساخت ربات همکاری در فروش آموزش ساخت ربات جذب ممبر آموزش ساخت ربات ضد اسپم آموزش ساخت ربات پیوست فایل سورس ربات مدیر گروه | ربات مدیر گروه همسریابی

طبق گفته سایت رسمی خود کیوننا شما به مسیر زیر برید

administrator/components/com_kunena/libraries/integration/joomla16/access.php

و خط 19 رو به شکل زیر تغییر بدید

protected static $viewLevels = false;

Share this post


Link to post
Share on other sites

سلام دوست عزیز

بررسی کردم اما مقدار روی false بود

چی باید بکنم؟

Share this post


Link to post
Share on other sites

مقدار رو نباید تغییر بدید باید عبارت static رو به کد خودتون اضافه کنید

Share this post


Link to post
Share on other sites

لطفا بفرمایید دقیقا کجا باید اضافه بشه و بولد شده نمایش بدین

<?php

/**

* @version $Id$

* Kunena Component

* @package Kunena

*

* @Copyright © 2008 - 2011 Kunena Team. All rights reserved.

* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL

* @link Kunena - To Speak! Next Generation Forum Component for Joomla - Home

*

**/

//

// Dont allow direct linking

defined( '_JEXEC' ) or die('');

jimport ( 'joomla.access.access' );

class KunenaAccessJoomla16 extends KunenaAccess {

protected $viewLevels = false;

function __construct() {

// Detect all but Joomla 1.5

if (KUNENA_JOOMLA_COMPAT == '1.5')

return null;

$this->priority = 25;

}

protected function loadAdmins() {

$admins = array_merge($this->getAuthorisedUsers('core.admin', 'com_kunena'), $this->getAuthorisedUsers('core.manage', 'com_kunena'));

$list = array();

foreach ( $admins as $userid ) {

$item = new StdClass();

$item->userid = (int) $userid;

$item->catid = 0;

$list[] = $item;

}

return parent::loadAdmins($list);

}

protected function loadModerators() {

$db = JFactory::getDBO ();

$query = "SELECT u.id AS userid, m.catid

FROM #__users AS u

INNER JOIN #__kunena_users AS ku ON u.id=ku.userid

LEFT JOIN #__kunena_moderation AS m ON u.id=m.userid

LEFT JOIN #__kunena_categories AS c ON m.catid=c.id

WHERE u.block='0' AND ku.moderator='1' AND (m.catid IS NULL OR c.moderated='1')";

$db->setQuery ( $query );

$list = (array) $db->loadObjectList ();

KunenaError::checkDatabaseError ();

return parent::loadModerators($list);

}

function loadAllowedCategories($user) {

$user = JFactory::getUser($user);

$accesslevels = (array) $user->authorisedLevels();

$groups_r = (array) JAccess::getGroupsByUser($user->id, true);

$groups = (array) JAccess::getGroupsByUser($user->id, false);

$categories = KunenaCategory::loadCategories();

$catlist = array();

foreach ( $categories as $category ) {

// Check if user is a moderator

if (self::isModerator($user->id, $category->id)) {

$catlist[$category->id] = $category->id;

}

// Check against Joomla access level

elseif ($category->accesstype == 'joomla.level') {

if ( in_array($category->access, $accesslevels) ) {

$catlist[$category->id] = $category->id;

}

}

// Check against Joomla user group

elseif ($category->accesstype == 'none') {

$pub_access = in_array($category->pub_access, $category->pub_recurse ? $groups_r : $groups);

$admin_access = in_array($category->admin_access, $category->admin_recurse ? $groups_r : $groups);

if ($pub_access || $admin_access) {

$catlist[$category->id] = $category->id;

}

}

}

return $catlist;

}

protected function checkSubscribers($category, &$userids) {

if (empty($userids)) {

return;

}

$userlist = implode(',', $userids);

if ($category->accesstype == 'joomla.level') {

// Check against Joomla access levels

$groups = $this->getGroupsByViewLevel($category->access);

$userids = $this->getUsersByGroup($groups, true, $userids);

} elseif ($category->accesstype == 'none') {

// Check against Joomla user groups

$public = $this->getUsersByGroup($category->pub_access, $category->pub_recurse, $userids);

$admin = $category->admin_access && $category->admin_access != $category->pub_access ? $this->getUsersByGroup($category->admin_access, $category->admin_recurse, $userids) : array();

$userids = array_unique ( array_merge ( $public, $admin ) );

}

}

/**

* Method to return a list of groups which have view level (derived from Joomla 1.6)

*

* @param integer $userId Id of the user for which to get the list of authorised view levels.

*

* @return array List of view levels for which the user is authorised.

*/

public function getGroupsByViewLevel($viewlevel) {

// Only load the view levels once.

if (empty(self::$viewLevels)) {

// Get a database object.

$db = JFactory::getDBO();

// Build the base query.

$query = $db->getQuery(true);

$query->select('id, rules');

$query->from('`#__viewlevels`');

// Set the query for execution.

$db->setQuery((string) $query);

// Build the view levels array.

foreach ($db->loadAssocList() as $level) {

self::$viewLevels[$level['id']] = (array) json_decode($level['rules']);

}

}

return isset(self::$viewLevels[$viewlevel]) ? self::$viewLevels[$viewlevel] : array();

}

/**

* Method to return a list of user Ids contained in a Group (derived from Joomla 1.6)

*

* @param int $groupId The group Id

* @param boolean $recursive Recursively include all child groups (optional)

*

* @return array

*/

public function getUsersByGroup($groupId, $recursive = false, $inUsers = array()) {

// Get a database object.

$db = JFactory::getDbo();

$test = $recursive ? '>=' : '=';

if (empty($groupId)) {

return array();

}

if (is_array($groupId)) {

$groupId = implode(',', $groupId);

}

$inUsers = implode(',', $inUsers);

// First find the users contained in the group

$query = $db->getQuery(true);

$query->select('DISTINCT(user_id)');

$query->from('#__usergroups as ug1');

$query->join('INNER','#__usergroups AS ug2 ON ug2.lft'.$test.'ug1.lft AND ug1.rgt'.$test.'ug2.rgt');

$query->join('INNER','#__user_usergroup_map AS m ON ug2.id=m.group_id');

$query->where("ug1.id IN ({$groupId})");

if ($inUsers) $query->where("user_id IN ({$inUsers})");

$db->setQuery($query);

$result = (array) $db->loadResultArray();

// Clean up any NULL values, just in case

JArrayHelper::toInteger($result);

return $result;

}

protected function getAuthorisedUsers($action, $asset = null) {

$action = strtolower(preg_replace('#[\s\-]+#', '.', trim($action)));

$asset = strtolower(preg_replace('#[\s\-]+#', '.', trim($asset)));

// Default to the root asset node.

if (empty($asset)) {

$asset = 1;

}

// Get all asset rules

$rules = JAccess::getAssetRules ( $asset, true );

$data = $rules->getData ();

// Get all action rules for the asset

$groups = array ();

if (!empty($data [$action])) {

$groups = $data [$action]->getData ();

}

// Split groups into allow and deny list

$allow = array ();

$deny = array ();

foreach ( $groups as $groupid => $access ) {

if ($access) {

$allow[] = $groupid;

} else {

$deny[] = $groupid;

}

}

// Get userids

if ($allow) {

// These users can do the action

$allow = $this->getUsersByGroup ( $allow, true );

}

if ($deny) {

// But these users have explicit deny for the action

$deny = $this->getUsersByGroup ( $deny, true );

}

// Remove denied users from allowed users list

return array_diff ( $allow, $deny );

}

}

Share this post


Link to post
Share on other sites

توی همون اوایل فایلتون که این کلاس شروع میشه یعنی این قسمت

  class KunenaAccessJoomla16 extends KunenaAccess {
protected $viewLevels = false;

قسمت

protected $viewLevels = false;

به صورت زیر تغییرش بدید

protected static $viewLevels = false;

Share this post


Link to post
Share on other sites

برای ارسال نظر یک حساب کاربری ایجاد کنید یا وارد حساب خود شوید

برای اینکه بتوانید نظر ارسال کنید نیاز دارید که کاربر سایت شوید

ایجاد یک حساب کاربری

برای حساب کاربری جدید در انجمن ما ثبت نام کنید. عضویت خیلی ساده است !


ثبت نام یک حساب کاربری جدید

ورود به حساب کاربری

دارای حساب کاربری هستید؟ از اینجا وارد شوید


ورود به حساب کاربری