Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
Doulos
Life Cycles Becoming CPU Cycles


Joined: Jun 06, 2005
Posts: 640

PostPosted: Sat Dec 30, 2017 2:48 pm Reply with quote

How can I use a custom background in news articles only?
 
View user's profile Send private message
Doulos
PostPosted: Sun Dec 31, 2017 11:31 am Reply with quote

Never mind, I figured out how to do what I wanted by using the message module instead of using the news module. Made for sense anyway since I only wanted a custom background in the one message.
 
neralex
Site Admin


Joined: Aug 22, 2007
Posts: 1441

PostPosted: Thu Jan 11, 2018 1:17 am Reply with quote

Before the include of the header.php you can add in each module-file custom-css - inline and also as prepared file or you can define the css-class in your style.css of your theme. Set the css-class to an container or an element.


php Code:
	$style = '<style type="text/css">

body {background: #fff;}
.myclass {background: #fff;}
}
</style>' . PHP_EOL;
addCSSToHead($style,'inline');

$cssfile= 'path/to/my/css-file.css';
addCSSToHead($cssfile,'file');

include_once 'header.php';

$row = $db->sql_fetchrow($result);
if ($row['sid'] == '125678' ) {
$mycustomclass = 'myclass';
} else {
$mycustomclass = '';
}


Or in the theme.php maybe in the themearticle() function:

php Code:
	if ($sid == '125678' ) {

$mycustomclass = 'myclass';
} else {
$mycustomclass = '';
}


After that you can use the variable like this:

php Code:
echo '<div class="' . $mycustomclass . '">Lorem Ipsum dolar...</div>';


Last edited by neralex on Thu Jan 11, 2018 2:57 pm; edited 1 time in total 
View user's profile Send private message
Doulos
PostPosted: Thu Jan 11, 2018 5:45 am Reply with quote

Thanks, nerelax. I'll check it out when I get a chance.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©