Displaying CSS Title (with my solution)

Talk about new features for CMSMS and modules.
Post Reply
User avatar
fredt
Forum Members
Forum Members
Posts: 144
Joined: Mon Jun 27, 2005 10:36 am

Displaying CSS Title (with my solution)

Post by fredt »

When I look at the generated CSS, it's quite difficult to figure from which sub-CSS the property comes.
So I modified stylesheet.php this way:

if ($config['dbms'] == 'mysqli' || $config['dbms'] == 'mysql')
{
$db = mysql_connect($config['db_hostname'], $config['db_username'], $config['db_password']);
mysql_select_db($config['db_name']);
if ($name != '')
$sql="SELECT css_text FROM ".$config['db_prefix']."css WHERE css_name = '" . mysql_real_escape_string($name, $db) . "'";
else
$sql="SELECT c.css_text,c.css_id,c.css_name FROM ".$config['db_prefix']."css c,".$config['db_prefix']."css_assoc ac WHERE ac.assoc_type='template' AND ac.assoc_to_id = $templateid AND ac.assoc_css_id = c.css_id AND c.media_type = '" . mysql_real_escape_string($mediatype, $db) . "'";
$result=mysql_query($sql);
while ($result && $row = mysql_fetch_assoc($result))
{
$css .= "\n\n\n/* *** CSS Name : ".$row['css_name'] . " *** */\n\n". $row['css_text'];
}
}


So now I get this CSS

Code: Select all

/* *** CSS Name : Typography *** */

/* A CSS Framework by Mike Stenhouse of Content with Style */

/* TYPOGRAPHY */
	body {
		text-align: left;
I think this could/should be polished... and added to the standard stylesheet.php?
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: Displaying CSS Title (with my solution)

Post by Elijah Lofgren »

A patch that does something just like this made it into SVN trunk today: http://dev.cmsmadesimple.org/tracker/in ... d=103  ;)
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
Post Reply

Return to “Feature ideas”