هاست لینوکس

آخرین بسته‌ی MyBB: نسخه‌ی 1.8.27 MyBB منتشر شد


امتیاز موضوع:
  • 1 رأی - میانگین امتیازات: 5
  • 1
  • 2
  • 3
  • 4
  • 5
█مهم█ عدم نمایش پروفایل به کاربرانی که در لیست سیاه هستند
#11
به نظر من اینو باید توی فانکشن اصلی بذاری که عمل کنه.

یا اینکه این فانکشنو توی همون پلاگین بکار بگیری.
«دقیقا توی قسمتی که باعث میشه گزینه محدود کردن پروفایل برای همه ایجاد بشه»


ههه اگر بخوای اونا هم اینطور بشه دیگه باید آستینا رو بالا بزنی و توی اونا هم اعمال کنی.
نصب و آپدیت انجمن مای بی بی | پلاگین و پوسته | تغییرات داخلی انجمن
نصب و بروزرسانی وردپرس طراحی پوسته های وردپرسی سبک با سئوی بالا
شخصی سازی پوسته های مای بی بی و وردپرس
طراحی سیستم مدیریت محتوای اختصاصی و خاص با برترین زبان های برنامه نویسی دنیا
جهت سفارش در تلگرام: firstboy000@
پاسخ
 سپاس شده توسطMyBulletian (۱۳۹۳/۱/۱۱، ۱۶:۰۳:۵۰ عصر)
#12
الان یه چیزی که تو مای بی بی خوب نیست اینه

همین مای بی بی ایران میشه pars رو به عنوان مدیریت کل در لیست سیاه - ایگنور قرار داد!!

درسته محدودیتی روش اعمال نمیشه اما اصلا خوب نیست مدیران سایت در ایگنور لیست قرار بگیره ، کاش مثه وی بی میشه کاری کرد کاربر با پیغام خطا مواجه بشه!!

یکی بزرگواری کنه این پلاگین رو ادیت کنه ممنونش میشم ، والا چیز شاخ و خاصی نداره

الان ببینید یک کاربر ما تازه عضو شده ، با اینکه دسترسی به تنظیمات نداره که چطوری پروفایلشو محدود کنه برای کاربران

اما پروفایل جز مدیران برای همه بستس : شما مجاز به دیدن پروفایل Mahsa112 نمی باشید

به همین دلیل بود بنده ازین پلاگین استفاده نمیکردم ، چون سرخورد یهو میدیدیم پروفایل یک کاربر رو میبست یا به صورت پیشفرض روی بسته قرار میگرفت! نمیدونم مشکل از کجاست اما فایل پلاگین همینی که پایین میبینیده فکر کنم یکی بزرگواری کنه ی تغییرات کوچیک توش بده حل شه مشکل
پلاگین برای 1.4 هستش! یا بشه فقط تنظیمات گزینه مخفی کردن پروفایل برای همرو از توش برداشت حذف کرد اون موقع فکر کنم مشکل رفع شه!
کد php:
<?php

/**
 * Author: Hamid Nozari
 * Comaptible with: MyBB 1.4.*
 * Website: http://www.shceg.com
 * License: GNU/GPL
 * User Profile Premission v1.0.1 - 2010/02/13
 * Use at your own risk

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
    die(
"Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

$plugins->add_hook("datahandler_user_update""upp_update");
$plugins->add_hook("member_profile_start","upp_member_profile");
$plugins->add_hook('usercp_profile_start''upp_template_update');

function 
upp_info()
{
    return array(
        
"name"            => "User Profile Premission",
        
"description"    => "This plugin allows each user to specify what users have access to his profile and see it",
        
"website"        => "http://www.shceg.com",
        
"author"        => "Hamid Nozari",
        
"authorsite"    => "http://www.shceg.com",
        
"version"        => "1.0.1",
        
"guid"             => "ccd76b688c5556826b1c97d396fee518",
        
"compatibility" => "14*"
    
);
}

function 
upp_install()
{
    global 
$db;

    
//Delete old template if exist
    
$db->delete_query("templates""title='upp_usercp'");
    
    
//Insert template
    
$upp_usercp = array(
        
"title"    =>  "upp_usercp",
        
"template" =>  "<br />

<fieldset class=\"trow2\">
<legend><strong>{\$lang->uppusercp_title}</strong></legend>
<table cellspacing=\"0\" cellpadding=\"{\$theme[tablespace]}\" width=\"100%\">
    <tr>
        <td>
            <select name=\"upp\">
                <option value=\"0\" {\$selected1}>{\$lang->upp_nobody}</option>
                <option value=\"1\" {\$selected2}>{\$lang->upp_friends}</option>
                <option value=\"2\" {\$selected3}>{\$lang->upp_everyone}</option>
            </select>
        </td>
    </tr>
</table>
</fieldset>
                        "
,
        
"sid"      =>  '-1',
        
"version"  =>  '',
        
"dateline" => TIME_NOW
        
);
    
$db->insert_query("templates"$upp_usercp);
    
    
//Insert upp field to users table
    
if(!$db->field_exists('upp''users'))
    {
        
$db->query("ALTER TABLE ".TABLE_PREFIX."users ADD `upp` tinyint(1) NOT NULL default '2'");
    }
}

function 
upp_is_installed()
{
    global 
$db;
    
    if(
$db->field_exists('upp''users'))
    {
        return 
true;
    }
    
    return 
false;
}

function 
upp_activate()
{
    global 
$db;
 
    include 
MYBB_ROOT.'/inc/adminfunctions_templates.php';
    
find_replace_templatesets("usercp_profile""#".preg_quote('{$customfields}')."#i"'{$upp}{$customfields}');
}

function 
upp_deactivate()
{
    global 
$db;

    include 
MYBB_ROOT."/inc/adminfunctions_templates.php";
    
find_replace_templatesets("usercp_profile""#".preg_quote('{$upp}')."#i"''0);
}

function 
upp_uninstall()
{
    global 
$db;
    
    
//Delete template
    
$db->delete_query("templates""title='upp_usercp'");
    
    
//Drop upp field from users tabel
    
if($db->field_exists('upp''users'))
    {
        
$db->query("ALTER TABLE ".TABLE_PREFIX."users DROP `upp`");
    }
}

function 
upp_update()
{
    global 
$mybb$db;
    
$upp intval($mybb->input['upp']);
    
    if (
$upp 2)
        
$upp 0;
    
    
//Update upp field in users table
    
$db->query("UPDATE ".TABLE_PREFIX."users SET upp = " $upp " WHERE uid = " $mybb->user['uid']);
}

function 
upp_member_profile()
{
    global 
$db$mybb$uid$lang$theme$memprofile;
    
    
upp_lang();
    
    
// Set $uid var
    
if($mybb->input['uid'])
    {
        
$uid intval($mybb->input['uid']);
    }
    else
    {
        
$uid $mybb->user['uid'];
    }
    
    
// Set logged user uid
    
$this_user $mybb->user['uid'];
    
    
//Check user premission to see desired profile
    
if ($uid != $this_user)
        if (!
CanViewUserProfile($uid$this_user))
        {
            
$ret=$db->simple_select('users','username, usergroup, displaygroup, upp','uid = '.$uid);
            
$upp $db->fetch_array($ret);
            
$username format_name($upp['username'], $upp['usergroup'], $upp['displaygroup']);
            if (
$upp['upp'] == 1)
                
error($lang->sprintf($lang->upp_error_friend$username));
            else
                
error($lang->sprintf($lang->upp_error$username));
        }
}

function 
upp_template_update()
{
    global 
$mybb$templates$theme$upp$lang$selected1$selected2$selected3;
    
upp_lang();
    
    
//Set user upp state
    
$selected1 $selected2 $selected3 "";
    
    if (
$mybb->user['upp']==0)
        
$selected1 "selected";
    else
    if (
$mybb->user['upp']==1)
        
$selected2 "selected";
    else 
    if (
$mybb->user['upp']==2)
        
$selected3 "selected";
        
    eval(
"\$upp= \"".$templates->get("upp_usercp")."\";");
}

//Functions//
function upp_lang()
{
    global 
$lang;
    
    
$lang->load('upp',false,true);
    
$l['uppusercp_title']='Who can view my profile:';
    
$l['upp_nobody']='Nobody';
    
$l['upp_friends']='My friend\'s only';
    
$l['upp_everyone']='Everyone';
    
$l['upp_error'] = 'You don\'t have premission to see {1} profile';
    
$l['upp_error_friend'] = 'Only {1} friend\'s can see his profile';
    
    foreach(
$l as $key=>$val)
    {
        if(!
$lang->$key)
        {
            
$lang->$key=$val;
        }
    }
}

function 
CanViewUserProfile($uid$this_user)
{
    global 
$db$mybb;

    
$gid $mybb->user['usergroup'];
    
    if (
$gid == || $gid == || $gid == 6)
        return 
true;
    
    
$ret $db->simple_select('users','upp, buddylist, ignorelist','uid = '.$uid);
    
$upp $db->fetch_array($ret);
    
$buddylist $upp['buddylist'];
    
$ignorelist $upp['ignorelist'];
    
$upp $upp['upp'];

    if (
$upp == 0)
    {
        return 
false;
    }
    else
    if (
$upp == 1)
    {
        
$buddyuidarray explode(",",$buddylist);
        if (
in_array($this_user$buddyuidarraytrue))
            return 
true;
        else 
            return 
false;
    }
    else
    {
        
$buddyuidarray explode(",",$ignorelist);
        if (
in_array($this_user$buddyuidarraytrue))
            return 
false;
    }
    return 
true;
}
?>

یک چیز دیگه من فکر میکنم تنظیمات این پلاگین این شکلیه
هیچکس ، فقط دوستان ، همه
یعنی اولین گزینه بروی هیچکس قرار داره ! برای همین کاربر یک بار پروفایلشو بروز رسانی میکنه شاید خود به خود بدون تغییر اون تنظیم بروی گزینه اول قرار بگیره!! نمیدونم ارتباطی داره یا خیر!
پاسخ
 سپاس شده توسطشماره مجازی (۱۴۰۱/۸/۲۶، ۰۱:۵۳:۳۵ صبح) ، گراف مسنجر (۱۴۰۱/۱۰/۳، ۰۴:۱۵:۳۲ صبح) ، چارتر ۴۲۴ (۱۴۰۲/۹/۱۲، ۱۵:۱۷:۱۰ عصر)


پرش به انجمن:


کاربرانِ درحال بازدید از این موضوع: 1 مهمان