كود :
<?php
/**
* Ads Manager - Reklam Alan Plugini
* Copyright 2008 - LowBattery - www.lowbattery.info
*/
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", "adsmanager_index_start");
function adsmanager_info()
{
return array(
"name" => "ظ‡ط§ظƒ ظ…ط¯ظٹط± ط§ظ„ط¥ط¹ظ„ط§ظ†ط§طھ",
"description" => "ظ‡ط§ظƒ ظ…ط¯ظٹط± ط§ظ„ط¥ط¹ظ„ط§ظ†ط§طھ ظٹط¬ط¹ظ„ ظ„ظƒ ط¥ط¹ظ„ط§ظ†ظٹظ† ظپظٹ ط§ظ„طµظپطط© ط§ظ„ط±ط¦ظٹط³ظٹط©",
"website" => "http://www.mybbturkiye.com",
"author" => "LowBattery",
"authorsite" => "http://www.lowbattery.info",
"version" => "1.0",
"compatibility" => "14*",
);
}
function adsmanager_install()
{
global $settings, $mybb, $db;
if($db->field_exists("adsmngers", "users"))
{
$db->write_query("ALTER TABLE ".TABLE_PREFIX."users DROP adsmngers");
}
$settings_group = array(
'gid' => 'NULL',
'name' => 'adsmng',
'title' => 'ظ…ط¯ظٹط± ط§ظ„ط¥ط¹ظ„ط§ظ†ط§طھ ',
'description' => 'ط®ظٹط§ط±ط§طھ ظ…ط¯ظٹط± ط§ظ„ط¥ط¹ظ„ط§ظ†ط§طھ',
'disporder' => '2',
'isdefault' => 'no'
);
$db->insert_query('settinggroups', $settings_group);
$gid = $db->insert_id();
$setting = array(
'sid' => 'NULL',
'name' => 'rl1',
'title' => 'ط±ط§ط¨ط· ط§ظ„ظ…ظˆظ‚ط¹ ط§ظ„ط£ظˆظ„',
'description' => 'ط§ط¯ط®ظ„ ط±ط§ط¨ط· ط§ظ„ظ…ظˆظ‚ط¹ ط§ظ„ط£ظˆظ„',
'optionscode' => 'textarea',
'value' => 'www.liwa4ever.co.cc',
'disporder' => '1',
'gid' => intval( $gid )
);
$db->insert_query( 'settings', $setting );
$setting = array(
'sid' => 'NULL',
'name' => 'ra1',
'title' => 'ط±ط§ط¨ط· طµظˆط±ط© ط§ظ„ظ…ظˆظ‚ط¹ ط§ظ„ط£ظˆظ„',
'description' => 'ط§ط¯ط®ظ„ ط±ط§ط¨ط· طµظˆط±ط© ط§ظ„ظ…ظˆظ‚ط¹ ط§ظ„ط£ظˆظ„',
'optionscode' => 'textarea',
'value' => 'http://img225.imageshack.us/img225/8941/reklam3nb4qy.gif',
'disporder' => '2',
'gid' => intval( $gid )
);
$db->insert_query( 'settings', $setting );
$setting = array(
'sid' => 'NULL',
'name' => 'rl2',
'title' => 'ط±ط§ط¨ط· ط§ظ„ظ…ظˆظ‚ط¹ ط§ظ„ط«ط§ظ†ظٹ',
'description' => 'ط§ط¯ط®ظ„ ط±ط§ط¨ط· ط§ظ„ظ…ظˆظپط¹ ط§ظ„ط«ط§ظ†ظٹ',
'optionscode' => 'textarea',
'value' => 'www.liwa4ever.co.cc',
'disporder' => '3',
'gid' => intval( $gid )
);
$db->insert_query( 'settings', $setting );
$setting = array(
'sid' => 'NULL',
'name' => 'ra2',
'title' => 'ط±ط§ط¨ط· طµظˆط±ط© ط§ظ„ظ…ظˆظ‚ط¹ ط§ظ„ط«ط§ظ†ظٹ',
'description' => 'ط§ط¯ط®ظ„ ط±ط§ط¨ط· طµظˆط±ط© ط§ظ„ظ…ظˆظ‚ط¹ ط§ظ„ط«ط§ظ†ظٹ',
'optionscode' => 'textarea',
'value' => 'http://img225.imageshack.us/img225/8941/reklam3nb4qy.gif',
'disporder' => '4',
'gid' => intval( $gid )
);
$db->insert_query( 'settings', $setting );
$setting = array(
'sid' => 'NULL',
'name' => 'ral1',
'title' => 'Text URL',
'description' => 'Write Under Text URL.',
'optionscode' => 'textarea',
'value' => '/',
'disporder' => '6',
'gid' => intval( $gid )
);
$db->insert_query( 'settings', $setting );
$setting = array(
'sid' => 'NULL',
'name' => 'ryaz1',
'title' => 'ظ…ط¹ظ„ظˆظ…ط§طھ ط§ط®ط±ظ‰ ( طھط¸ظ‡ط± طھططھ ط§ظ„ط¥ط¹ظ„ط§ظ†ط§طھ)',
'description' => 'ط§ط¯ط®ظ„ ظ…ط«ظ„ط§ : ط§ظ„ط«ظ…ظ† - ط·ط±ظٹظ‚ط© ط§ظ„ط¯ظپط¹',
'optionscode' => 'textarea',
'value' => 'www.liwa4ever.co.cc',
'disporder' => '7',
'gid' => intval( $gid )
);
$db->insert_query( 'settings', $setting );
$db->write_query("ALTER TABLE ".TABLE_PREFIX."users ADD adsmngers int NOT NULL default 0");
rebuild_settings();
$insertarray = array(
"title" => "adsmnger",
"template" => "<center>
<a href=\"{\$mybb->settings[\'rl1\']}\" target=\"_blank\"><img src=\"{\$mybb->settings[\'ra1\']}\">
<a href=\"{\$mybb->settings[\'rl2\']}\" target=\"_blank\"><img src=\"{\$mybb->settings[\'ra2\']}\">
<br />
</center>
<div align=\"right\"><a href=\"{\$mybb->settings[\'ral1\']}\">{\$mybb->settings[\'ryaz1\']}</a></div><br>",
"sid" => -1,
"dateline" => TIME_NOW
);
$db->insert_query("templates", $insertarray);
}
function adsmanager_is_installed()
{
global $db;
if($db->field_exists("adsmngers", "users"))
{
return true;
}
return false;
}
function adsmanager_activate()
{
global $db;
include MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("index", "#".preg_quote("{\$header}")."#i", "{\$header}\r\n{\$adsmnger}");
}
function adsmanager_deactivate()
{
global $db;
include MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("index", "#".preg_quote("\r\n{\$adsmnger}")."#i", "", 0);
}
function adsmanager_uninstall()
{
global $db;
if($db->field_exists("adsmngers", "users"))
{
$db->write_query("ALTER TABLE ".TABLE_PREFIX."users DROP adsmngers");
}
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='adsmng'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='ra1'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='rl1'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='ra2'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='rl2'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='ral1'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='ryaz1'");
rebuild_settings();
$db->delete_query("templates", "title = 'adsmnger'");
}
function adsmanager_index_start()
{
global $db, $mybb, $templates, $adsmnger;
eval("\$adsmnger = \"".$templates->get("adsmnger")."\";");
}
?>