(11-06-2012, Saat:12:27)ßyßurak Adlı Kullanıcıdan Alıntı: kurdum olmadı hocam bunun kodunu verirmisiniz.. ve nereye ekleyeceğimizi anlatın herkes yapsın
Buyrun Hocam;
PHP Kod:
<?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("postbit", "ban_button_start");
$plugins->add_hook("postbit_pm", "ban_button_start");
function ban_button_info() {
return array(
'name' => 'Postbitte Kullaniciyi Banla Butonu',
'description' => 'Forumunuzun Postbitine Kullaniciyi Banla Butonu Ekler.<br /><img src="http://destek.mybbgrup.com/turkey.gif">Turkce Ceviri: <a href="http://mybbdepo.com">Borsea</a>',
'website' => 'http://www.mybbdepo.com',
'author' => 'Mirko T.',
'authorsite' => 'http://www.mybbdepo.com',
'version' => '2.0',
'compatibility' => '16*',
'guid' => '50a367b84c3d522b60c6d25daa3bf52e'
);
}
function ban_button_activate() {
global $db, $mybb;
// Adding New Template
$bb_template = array(
"title" => 'postbit_ban',
"template" => $db->escape_string('<a href="modcp.php?action=banuser&uid={$post[\'uid\']}" id="ban_post_{$post[\'pid\']}"><img src="{$theme[\'imglangdir\']}/postbit_ban.gif" alt="Bu kullaniciyi banla" title="Bu kullaniciyi banla" /></a>
<div id="ban_post_{$post[\'pid\']}_popup" class="popup_menu" style="display: none;">{$post_ban}{$post_editban}{$post_unban}</div>
<script type="text/javascript">
// <!--
if(use_xmlhttprequest == "1")
{
new PopupMenu("ban_post_{$post[\'pid\']}");
}
// -->
</script>'),
"sid" => "-2",
"version" => 1600,
"dateline" => TIME_NOW
);
$db->insert_query('templates', $bb_template);
require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("postbit", "#".preg_quote('{$post[\'button_warn\']}')."#i",'{$post[\'button_warn\']}{$post[\'button_ban\']}');
}
function ban_button_deactivate() {
global $db, $mybb;
$db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title = 'postbit_ban'");
require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("postbit", "#".preg_quote('{$post[\'button_ban\']}')."#i", '', 0);
}
// Run plugin
function ban_button_start(&$post) {
global $db, $mybb, $templates, $theme;
if($mybb->usergroup['canmodcp'] != 0 && $post['uid'] != $mybb->user['uid'] && ($post_type == 0 || $post_type == 2)) {
$query = $db->query("SELECT uid FROM ".TABLE_PREFIX."banned WHERE uid = '{$post['uid']}'");
$row = $db->fetch_array($query);
if($db->num_rows($query) < 1 ) {
$post_ban = "<div class=\"popup_item_container\"><a href=\"modcp.php?action=banuser&uid={$post['uid']}\" class=\"popup_item\">Uyeyi Banla</a></div>";
} else {
$post_editban = "<div class=\"popup_item_container\"><a href=\"modcp.php?action=banuser&uid={$post['uid']}\" class=\"popup_item\">Bani Duzenle</a></div>";
$post_unban = "<div class=\"popup_item_container\"><a href=\"modcp.php?action=liftban&uid={$post['uid']}&my_post_key={$mybb->post_code}\" class=\"popup_item\">Uyenin Banini Kaldir</a></div>";
}
eval("\$post['button_ban'] = \"".$templates->get("postbit_ban")."\";");
}
}
?>

