Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Blocks
Author Message
AndyB
Worker
Worker



Joined: Jun 03, 2004
Posts: 231
Location: Torrevieja, Spain

PostPosted: Tue Jan 19, 2010 4:28 pm Reply with quote

Quick (ish) one guys;

I'm trying to modify a theme; I've managed to change all the various colours EXCEPT one set;

the expanding/ collapsing forums block (center)- I can't seem to work out which attribute it is I need to change for the font colour in the top of the table

([Forum] Topic Replies Author Views Last Post )

These are in bold.

If someone could please advise which css fill (theme or forums within the theme folder) and which particular part (style) it would be much appreciated.

I can provide a link to the dev server if required.
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Thu Jan 21, 2010 2:24 am Reply with quote

I believe I put that directly into the block code. Take a look and if it isn't there let me know. I'm on my way into bed but I'll check back later.
 
View user's profile Send private message
AndyB







PostPosted: Thu Jan 21, 2010 4:06 am Reply with quote

thanks, Raven. I'm guessing (if it is) it's just a matter of tweaking the code to pick up the css? (I'm guessing one of the fields from the forum css?)

I'll see if I can get access to the block code from work, and take a look Wink
 
AndyB







PostPosted: Thu Jan 21, 2010 5:02 am Reply with quote

here's what I found (took some finding!)

in the forum collapsing block:
Code:
global $admin, $bgcolor1, $bgcolor2, $db, $prefix, $sitename, $textcolor1, $textcolor2, $user, $user_prefix, $currentlang, $language;


I then looked into index.php and found
Code:
 if (file_exists('themes/'.$ThemeSel.'/modules/'.$name.'/'.$mod_file.'.php')) {

        $modpath = 'themes/'.$ThemeSel.'/';

But I notice the font colour is the same for any theme, so guessed it's possibly not defined? As it turned out, that wasn't the case; the theme I'm "playing" with has had some issues (I managed to sort most of them by looking into the relevant files- nothing major- posting to wrong directories for images, etc.)

I then opened up theme/theme.php
I found the following:
Code:
$block="left";

$bgcolor1 = "#ffffff";
$bgcolor2 = "#cccccc";
$bgcolor3 = "#ffffff";
$bgcolor4 = "#cccccc";
$textcolor1 = "#666666";
$textcolor2 = "#333333";


I figured I'd change the hex value (in my case for that block, $textcolor1) and it worked....

My question is (and it *may* be fairly simple for some one with more experience)

Is it possible to change either the reference in the forum collapsing block to pick up a particular field from the css file? (either the one for the forum, OR the one for the site)

And/ or do the same to the theme.php file? Maybe define somewhere in one of the main config files/ where the theme is defined in the DB that $color1,2,etc and bgcolor1,2 etc. are a particular field in the site's theme css file?

Just a thought. Sorry if I'm being a pain- figure if as much as possible is in one configuration file for the theme (css?) then it makes it easier for all blocks, whether used or not to pick up the theme....

Feedback welcome Wink
 
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Thu Jan 21, 2010 7:08 am Reply with quote

You can certainly edit the block to use whatever css classes you wish, but alot of modules use the $bgcolor1, $bgcolor2, $bgcolor3 and $bgcolor4 values so it wouldn't be easy to replace them globally. When this variable is used a hex value is expected, and you would end up with errors if you tried to replace it with a class... here is just one example from the content module:

Code:
echo '   <tr style="background-color: '.$bgcolor4.';">'.PHP_EOL;
 
View user's profile Send private message Visit poster's website
AndyB







PostPosted: Thu Jan 21, 2010 7:48 am Reply with quote

could you not use a configuration file (xml?) that substituted the variable for an equivalent declaration in the .css?

That way, no matter which theme any one was using/ if it changed, the colours would alter accordingly. (Not sure if I'm explaining myself here)

I think what I'm trying to say, is, instead of something being hard coded into a block/ module, the config file is used, thus saving any colour "mis-match" like I've just experienced. (Or does it do that already, and I've got it all wrapped around my tits) Razz
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Blocks

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 ©