Not Solved problem with Colorful Announcements
#1
Not Solved
i use Colorful Announcements ,when i use it.. it show two announce in forum.. what i mast to do ? before when i used it.. it show one announce ?!
this is code for plugin
<?php
/**
 *  Renkli Duyuru  -  Colorful Announcements
 * 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", "renkliduyuru_index_start");

function renkliduyuru_info()
{	
	return array(
		"name" => "Colorful Announcements",
		"description" => "Forum Anasayfanızda Renkli Duyuru Gösterebilirsiniz.",
		"website" => "http://www.mybbturkiye.com",
		"author" => "LowBattery",
		"authorsite" => "http://www.lowbattery.info",
		"version" => "1.0",
		"compatibility" => "14*,16*",
	);
}

function renkliduyuru_install()
{
    global $settings, $mybb, $db;
	
if($db->field_exists("rduyurus", "users"))
	{
	$db->write_query("ALTER TABLE ".TABLE_PREFIX."users DROP rduyurus"); 
	}
	
    $settings_group = array(
        'gid'          => 'NULL',
        'name'         => 'rduyurup',
        'title'        => 'Renkli Duyuru Sistemi Ayarları',
        'description'  => 'Renkli Duyuru Sisteminin Ayarlarını buradan yapabilirsiniz.',
        'disporder'    => '2',
        'isdefault'    => 'no'
    );
    $db->insert_query('settinggroups', $settings_group);
    $gid = $db->insert_id();
	
    $setting = array(
        'sid'          => 'NULL',
        'name'         => 'duyuru',
        'title'        => 'Duyuru',
        'description'  => 'Buraya Görüntülenecek Duyuruyu Yazınız.',
        'optionscode'  => 'textarea',
        'value'        => 'by (LowBattery).info - MyBBTurkiye.com',
        'disporder'    => '1',
        'gid'          => intval( $gid )
    );
    $db->insert_query( 'settings', $setting );	
	
    $setting = array(
        'sid'          => 'NULL',
        'name'         => 'renk1',
        'title'        => 'Arkaplan',
        'description'  => 'Arkaplan Rengini buradan belirleyebilirsiniz - Renk Kodlarını yazınız.',
        'optionscode'  => 'textarea',
        'value'        => '#D6ECA6',
        'disporder'    => '4',
        'gid'          => intval( $gid )
    );
    $db->insert_query( 'settings', $setting );	
		
    $setting = array(
        'sid'          => 'NULL',
        'name'         => 'renk2',
        'title'        => 'Üst Çizgi Rengi',
        'description'  => 'Üst Çizgi Rengini buradan ayarlayabilirsiniz. - Renk Kodlarını yazınız.',
        'optionscode'  => 'textarea',
        'value'        => '#8DC93E',
        'disporder'    => '7',
        'gid'          => intval( $gid )
    );
    $db->insert_query( 'settings', $setting );	
	
    $setting = array(
        'sid'          => 'NULL',
        'name'         => 'renk3',
        'title'        => 'Alt Çizgi Rengi',
        'description'  => 'Alt Çizgi Rengini buradan ayarlayabilirsiniz. - Renk Kodlarını yazınız.',
        'optionscode'  => 'textarea',
        'value'        => '#8DC93E',
        'disporder'    => '10',
        'gid'          => intval( $gid )
    );
    $db->insert_query( 'settings', $setting );				
		
	$db->write_query("ALTER TABLE ".TABLE_PREFIX."users ADD rduyurus int NOT NULL default 0");

	rebuild_settings();
	
	$insertarray = array(
		"title" => "rduyuru",
		"template" => "<style>
.duyuru {
    background: {\$mybb->settings[\'renk1\']};
    border-top: 2px solid {\$mybb->settings[\'renk2\']};
    border-bottom: 2px solid {\$mybb->settings[\'renk3\']};
    text-align: center;
    margin: 10px auto;
    padding: 5px 20px;
}
</style>
<p class=\"duyuru\"><b>{\$mybb->settings[\'duyuru\']}</b></p>
<br>",
		"sid" => -1,
		"dateline" => TIME_NOW
	);
	
	$db->insert_query("templates", $insertarray);
}

function renkliduyuru_is_installed()
{
	global $db;
	
	if($db->field_exists("rduyurus", "users"))
	{
		return true;
	}
	
	return false;
}

function renkliduyuru_activate()
{
	global $db;
	
	include MYBB_ROOT."/inc/adminfunctions_templates.php";
	
	find_replace_templatesets("index", "#".preg_quote("{\$header}")."#i", "{\$header}\r\n{\$rduyuru}");
}

function renkliduyuru_deactivate()
{
	global $db;
	
	include MYBB_ROOT."/inc/adminfunctions_templates.php";
	
	find_replace_templatesets("index", "#".preg_quote("\r\n{\$rduyuru}")."#i", "", 0);
}

function renkliduyuru_uninstall()
{
	global $db;
	
	if($db->field_exists("rduyurus", "users"))
	{
		$db->write_query("ALTER TABLE ".TABLE_PREFIX."users DROP rduyurus"); 
	}
	$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='rduyurup'");
	$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='duyuru'");
	$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='renk1'");
	$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='renk2'");
	$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='renk3'");
	
	rebuild_settings();
	
	$db->delete_query("templates", "title = 'rduyuru'");
}

function renkliduyuru_index_start()
{
	global $db, $mybb, $templates, $rduyuru;
	
	eval("\$rduyuru = \"".$templates->get("rduyuru")."\";");
}
?>

pleas tell me which Templet part i mast edit ?
Reply
#2
Not Solved
pleas how can solve this problem !!?
Reply
#3
Not Solved
pleas how can solve this problem !!?
Reply
#4
Not Solved
Its not the problem with the plug-in, check the templates.
[Image: eyadHiR.png]
Reply
#5
Not Solved
i know that .. but which part of templetes ?
Reply
#6
Not Solved
Hello,

it is not an option with this plugin atm. However you can do it manually by following this tutorial.

http://wiki.mybb.com/index.php/Help:Latest_News_Bar

Thanks Smile
Former MyBB Software Assurance Team
Server Latch Ltd - Premium Shared, Reseller and VPS Hosting for your MyBB Forum!
Reply
#7
Not Solved
thank u Conor 4 help..
but i us these plug-in , it is ok .. pleas can u check the code to fined which part of templet i mast to work on it. to solve my problem ?

thanks for you friends Wink
i fixed it with :
Admin CP --> Templates & Style --> Templates --> *expand your template set* --> Index Page Templates --> index.

and i deleted extra code .
Reply
#8
Not Solved
Link to your site ? Or post you index & header templates here. So i can look.
Reply
#9
Not Solved
thx Janota i solved problem Wink now it's OK
Reply
#10
Not Solved
Ok m8 np Wink
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)