Add data to global.css with a Plugin
#1
Sorry for my English Angel

I have a qustion, can i write css codes to global.css?
Reply
#2
AdminCP > Themes & templates > click your theme > click global.php. Now go to the advanced tab and add your code on the bottom or change the sections you want.
Reply
#3
@Aries-Belgium Thank You for your Post but i will add my codes with a plugin.
Reply
#4
Why do you need a plugin?
-Paul H.

Cogisne lingua latina?
Reply
#5
(2011-04-29, 08:15 PM)Aries-Belgium Wrote: AdminCP > Themes & templates > click your theme > click global.php. Now go to the advanced tab and add your code on the bottom or change the sections you want.

Its global.css
Reply
#6
(2011-05-01, 01:09 AM)Darth Stabro Wrote: Why do you need a plugin?

It doesnt matter why he needs a plugin to do it, thats what he wants to do.

What I normally do is create a new template add the additional css into that template, then call that template using a variable in the required template.

The following example will add the template to your "global templates", just add the css you want (Ive just placed some example css).

$css_template = array(
"title"		=> 'new_css',
"template"	=> $db->escape_string('
<style type="text/css">
.cssclass {
color:#000000;
font-size: 12px;
}
</style>
'),
"sid"		=> "-1",
"version"	=> "1.6",
"dateline"	=> TIME_NOW
);
$db->insert_query('templates', $css_template);

Then call that template, for example use a variable like so:
{$new_css}
Reply
#7
Thank You @Janota
Reply
#8
No problem Wink
Reply
#9
//yeni css ekleme
	$stylesheet = '.board_message {
	background: #EFEFEF;
	color: #333333;
	border-top: 2px solid #D4D4D4;
	border-bottom: 2px solid #D4D4D4;
	padding: 5px;
	margin-top: 10px;
}';

	$new_stylesheet = array(
		'name'         => 'board_messages.css',
		'tid'          => 1,
		'attachedto'   => '',
		'stylesheet'   => $stylesheet,
		'lastmodified' => TIME_NOW
	);

	$sid = $db->insert_query('themestylesheets', $new_stylesheet);
	$db->update_query('themestylesheets', array('cachefile' => "css.php?stylesheet={$sid}"), "sid='{$sid}'", 1);

	$query = $db->simple_select('themes', 'tid');
	while($theme = $db->fetch_array($query))
	{
		require_once MYBB_ADMIN_DIR.'inc/functions_themes.php';
		update_theme_stylesheet_list($theme['tid']);
	}

	
	
//css silme
	$db->delete_query('themestylesheets', "name='board_messages.css'");

	$query = $db->simple_select('themes', 'tid');
	while($theme = $db->fetch_array($query))
	{
		require_once MYBB_ADMIN_DIR.'inc/functions_themes.php';
		update_theme_stylesheet_list($theme['tid']);
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)