2011-04-29, 08:12 PM
2011-04-29, 08:15 PM
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.
2011-04-30, 05:04 PM
@Aries-Belgium Thank You for your Post but i will add my codes with a plugin.
2011-05-01, 01:09 AM
Why do you need a plugin?
2011-05-01, 05:01 AM
(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
2011-05-01, 09:50 AM
(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}
2011-05-02, 10:01 AM
Thank You @Janota
2011-05-02, 11:46 AM
No problem
2011-10-19, 08:34 AM
//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']);
}