مرجع پارسی MyBB

نسخه‌ی کامل: درخواست پلاگین
شما درحال مشاهده‌ی نسخه‌ی متنی این صفحه می‌باشید. مشاهده‌ی نسخه‌ی کامل با قالب‌بندی مناسب.
سلام دوستان من هر چی سرچ کردم به نتیجه ای نرسیدم
من یه پلاگین لازم دارم که زیر تاپیک ها بزنه کاربران زیر از این موضوع دیدن کردند
ممنون میشم منو راهنمایی کنید
سلام برادر king92 درسته رقیبیم ولی میخواستی من میدادم

بفرما

http://mods.mybb.com/view/who-view-thread
دستت درد نکنه
ولی این انگلیسیشه
پارسیشو نداری؟
فارسیش هست ولی ورژن قدیمی این هست بعد ارور میده بعضی جاهاش نمیشه با تنظیماتش ور رفت

این پلاگین کلش همین متنه نصبش کن جملات انکلیسیش رو پدا کن تو همین متن فارسیشو بنویس.

کد php:
<?php

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("showthread_start""whoreadthread_run");

function 
whoreadthread_info() {
    return array(
    
'name'        => 'Who view thread',
    
'description'    => 'Show lasts users who have visited a thread.',
    
'website'        => 'http://www.habbocean.com/forum/',
    
'author'        => 'Mirko T.',
    
'authorsite'    => 'http://www.habbocean.com/forum/',
    
'version'        => '1.1',
    
'compatibility'     => '16*',
    
'guid'              => 'bf68597452d5a59ee0def578e2cba4fe'
    
);
}

function 
whoreadthread_activate() {
    global 
$db$mybb;
    
    
// Adding New Template
    
$wvt_template = array(
        
"title"        => 'who_visit_thread',
    
"template"    => $db->escape_string('
<br/>
<table class="tborder" cellspacing="1" cellpadding="4" border="0">
<tbody>
<tr>
<td class="thead"><strong>Who read this thread?</strong></div></td>
</tr>
<tr>
<td class="tcat"><span class="smalltext"><em><strong>{$totalvisitors} User(s) read this thread:</strong></em></span></td>
</tr>
<tr>
<td class="trow1">{$threadvisitorslist}
</td>
</tr>
</tbody>
</table>'
),
        
"sid"            => "-1",
        
"version"    => 1600,
        
"dateline"    => TIME_NOW
    
);
    
$db->insert_query('templates'$wvt_template);

    require_once 
MYBB_ROOT."/inc/adminfunctions_templates.php";
    
find_replace_templatesets("showthread""#".preg_quote('{$similarthreads}')."#i",'{$similarthreads}{$who_visit_thread}');

    
// Settings
    
$gid $db->insert_id();
    
$whoreadthread_group = array(
        
"gid"            => "NULL",
        
"name"           => "whoreadthread",
        
"title"          => "Who Read Thread",
        
"description"    => "Shows users who have visited the thread.",
        
"disporder"      => "1",
        
"isdefault"      => "no",
    );
    
$db->insert_query("settinggroups"$whoreadthread_group);

    
$gid $db->insert_id();
    
$whoreadthread_setting_1 = array(
        
"sid"            => "NULL",
        
"name"           => "whoreadthread_1",
        
"title"          => "Enable?",
        
"description"    => "",
        
"optionscode"    => "yesno",
        
"value"          => "0",
        
"disporder"      => "1",
        
"gid"            => intval($gid),
    );
    
$whoreadthread_setting_2 = array(
        
"sid"            => "NULL",
        
"name"           => "whoreadthread_2",
        
"title"          => "Default Sort Field",
        
"description"    => "Select the field that you want members to be sorted by default.",
        
"optionscode"    => "select\n
uid=ID
username=Username
dateline=Read Time"
,
        
"value"          => "1",
        
"disporder"      => "2",
        
"gid"            => intval($gid),
    );
    
$whoreadthread_setting_3 = array(
        
"sid"            => "NULL",
        
"name"           => "whoreadthread_3",
        
"title"          => "Default Sort Order",
        
"description"    => "Select the order that you want members to be sorted by default.",
        
"optionscode"    => "select\n
ASC=Ascending
DESC=Descending"
,
        
"value"          => "1",
        
"disporder"      => "3",
        
"gid"            => intval($gid),
    );
    
$whoreadthread_setting_4 = array(
        
"sid"            => "NULL",
        
"name"           => "whoreadthread_4",
        
"title"          => "Maximum Users To Display?",
        
"description"    => "Enter the maximum number of users you want to display.",
        
"optionscode"    => "text",
        
"value"          => "100",
        
"disporder"      => "4",
        
"gid"            => intval($gid),
    );
    
$whoreadthread_setting_5 = array(
        
"sid"            => "NULL",
        
"name"           => "whoreadthread_5",
        
"title"          => "Show read time?",
        
"description"    => "Select Yes if you want to display username & time, No if you want to display only Username.",
        
"optionscode"    => "yesno",
        
"value"          => "1",
        
"disporder"      => "5",
        
"gid"            => intval($gid),
    );
    
$db->insert_query("settings"$whoreadthread_setting_1);
    
$db->insert_query("settings"$whoreadthread_setting_2);
    
$db->insert_query("settings"$whoreadthread_setting_3);
    
$db->insert_query("settings"$whoreadthread_setting_4);
    
$db->insert_query("settings"$whoreadthread_setting_5);

    
// Rebuilding settings
    
rebuild_settings();
}

function 
whoreadthread_deactivate() {
    global 
$db$mybb;
    
$db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title = 'who_visit_thread'");

    require_once 
MYBB_ROOT."/inc/adminfunctions_templates.php";
    
find_replace_templatesets("showthread""#".preg_quote('{$who_visit_thread}')."#i"''0);

    
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='whoreadthread'");
    
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='whoreadthread_1'");
    
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='whoreadthread_2'");
    
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='whoreadthread_3'");
    
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='whoreadthread_4'");
    
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='whoreadthread_5'");

    
// Rebuilding settings
    
rebuild_settings();
}

// Run plugin
function whoreadthread_run() {
    global 
$db$mybb$lang$templates$who_visit_thread$tid;

    if(
$mybb->settings['whoreadthread_1'] == 1) {

      
$field $mybb->settings['whoreadthread_2'];
      
$order $mybb->settings['whoreadthread_3'];
      if(
$mybb->settings['whoreadthread_4'] < 1) { $limit "1"; } else { $limit $mybb->settings['whoreadthread_4']; }

      
$query $db->query("SELECT r.*, u.username, u.usergroup, u.displaygroup FROM ".TABLE_PREFIX."threadsread r LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = r.uid) WHERE r.tid = '{$tid}' AND u.uid != '0' ORDER BY r.{$field} {$order} LIMIT {$limit}");
      
$totalvisitors $db->num_rows($query);

          if(
$totalvisitors 0) {

           
$comma '';

            while(
$row $db->fetch_array($query)) {

            
$row['username'] = $db->escape_string(htmlspecialchars($row[username]));
            
$username format_name($row['username'], $row['usergroup'], $row['displaygroup']);
            
$profilelink build_profile_link($username$row['uid']);


              if(
$mybb->settings['whoreadthread_5'] == 1) {
                
$readdate my_date($mybb->settings['dateformat'], $row['dateline']);
                
$readtime my_date($mybb->settings['timeformat'], $row['dateline']);
                
$threadvisitorslist .= "{$comma}{$profilelink} <span class='smalltext'>({$readdate}{$readtime})</span>";
              } else {
                
$threadvisitorslist .= "{$comma}{$profilelink}";
              }
             
$comma $lang->comma;
            }
          
    eval(
"\$who_visit_thread = \"".$templates->get("who_visit_thread")."\";");

         }
    }

}

?>
برای دوستان عزیزم Heart
پارسی شدهHeartBlush