فارسی سازی پلاگین های mybb
به نام خدا
با سلام خدمت دوستان عزیز P30World ...
این اولین پست من در این انجمن هست و من قصد دارم با کمک شما دوستان عزیز فارسی سازی پلاگین های مای بی بی را بیاموزم و ممنون میشم که کمکم کنید ( من به سفارش یکی از دوستان به این سایت اومدم و گفته که اعضای این سایت کمکت می کنند :31: ) .
من در حال حاضر می خواستم این پلاگین رو فارسی کنم ولی با مشکلاتی بر خورد می کنم که توضیح می دم این سورس کد ها هستش که پلاگینی با نام onlinetoday هستش
این کد پلاگینش هست
کد:
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <meta content="fa" http-equiv="Content-Language" />
<?php
/**
* MyBB 1.4
* Copyright © 2008 Samuel
*/
// 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("index_start", "onlinetoday_run");
function onlinetoday_info()
{
return array(
"name" => "Online Today",
"description" => "Shows you who has been online in the last 24 Hours",
"website" => "http://gally.x10hosting.com/mybb/",
"author" => "Samuel",
"authorsite" => "http://gally.x10hosting.com/mybb/",
"version" => "1.1",
"guid" => "3fcc54ee559b73e0778e137eddcd6301",
"compatibility" => "14*"
);
}
function onlinetoday_activate()
{
global $db, $mybb;
$query = $db->simple_select("settinggroups", "COUNT(*) as rows");
$rows = $db->fetch_field($query, "rows");
$insertarray = array(
'name' => 'onlinetoday',
'title' => 'Show Users Who Have Been online Today',
'description' => 'Options on the online today plugin',
'disporder' => $rows+1,
'isdefault' => 0
);
$db->insert_query("settinggroups", $insertarray);
$group['gid'] = $db->insert_id();
$insertarray = array(
'name' => 'onlinetoday_active',
'title' => 'Enable Show Users Who Have Been Online Today Plugin?',
'description' => 'Enable Show Users Who Have Been online Today Plugin?',
'optionscode' => 'onoff',
'value' => 1,
'disporder' => 0,
'gid' => $group['gid']
);
$db->insert_query("settings", $insertarray);
rebuild_settings();
include MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("index_boardstats", '#{\$whosonline}(\r?)\n#', "{\$whosonline}\n{\$online_today}\n");
$insert_array = array(
'title' => "online_today_index",
'template' => "<tr>
<td class=\"tcat\"><strong>{\$lang->whos_online_today}</strong></td>
</tr>
<tr>
<td class=\"trow1\"><span class=\"smalltext\">{\$lang->online_note_today}<br />{\$onlinemembers}</span></td>
</tr>",
'sid' => "-1",
'dateline' => TIME_NOW
);
$db->insert_query("templates", $insert_array);
}
function onlinetoday_deactivate()
{
global $db, $mybb;
include MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("index_boardstats", '#{\$online_today}(\r?)\n#', "", 0);
$db->delete_query("templates", "title = 'online_today_index'");
$db->write_query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN(
'onlinetoday_active'
)");
$db->delete_query("settinggroups", "name = 'onlinetoday'");
rebuild_settings();
}
function onlinetoday_run()
{
global $db, $mybb, $templates, $theme, $lang, $online_today;
$lang->load("onlinetoday");
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <meta content="fa" http-equiv="Content-Language" />
$online_today = '';
if($mybb->settings['onlinetoday_active'] == "1")
{
$onlinedate = time() - 24*60*60;
$query = $db->simple_select(
"users",
"uid, username, usergroup, displaygroup",
"lastactive > $onlinedate ORDER BY username ASC"
);
$comma = '';
$onlinecount = 0;
while($user = $db->fetch_array($query))
{
++$onlinecount;
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
$user['profilelink'] = build_profile_link($user['username'], $user['uid']);
eval("\$onlinemembers .= \"".$templates->get("index_whosonline_memberbit", 1, 0)."\";");
$comma = ", ";
}
$memberword = ($onlinecount != 1) ? $lang->online_member_plural : $lang->online_member_singular;
$lang->online_note_today = $lang->sprintf($lang->online_note_today, my_number_format($onlinecount), $memberword, 24);
eval("\$online_today = \"".$templates->get("online_today_index")."\";");
}
}
?>
اینم کد بخش زبانش که خودم قسماتاییشو فارسی کردم :31:
کد:
<?php
$l['online_member_plural'] = "اعضا";
$l['online_member_singular'] = "عضو";
$l['online_note_today'] = "{1} {2} آنلاين {3} hours.";
$l['whos_online_today'] = "Who بب Online Today";
?>
مشکل اینجاست که بعد فارسی سازی وقتی پلاگین رو نصب میکنی به جای نوشته ها علامت سوال میده , ممنون میشم کمکم کنید ( اینم بگم که من از کد نویسی چیزی بلد نیستم :41: ) :11: