TinyPortal

General => Chit chat => Topic started by: disisme on February 05, 2006, 05:48:36 PM

Title: question re html overriding theme colors
Post by: disisme on February 05, 2006, 05:48:36 PM
I know zero about html or php, and I'm running Bloc's truly magnificent Cerberus scheme.

Now, my foorum has flashchat installed, and I wanted to get the info.php progoram to run.  I found some code related to another theme here and included it in my BoardIndex.template.php.  The code itself works just fine, but after initially drawing the screen and creating the nice new box for info.php to display its stuff in, the code is overiding the theme colors in the box and making it black on white.  I'd really like to retain the original scheme colors in that box.  I suspect its the iframe statement thats doing the job, but I have no clue on what it is about it thats causing the grief.  Heres the code added too boardindex.template.php right after the 'users online' section of code :

   // flashchat users
   echo '
   <tr>
      <td class="titlebg" colspan="2">Users in Chat</td>
   </tr>
   <tr>
      <td class="windowbg"></td>
      <td class="windowbg2" width="100%"><iframe frameborder="0" height="100" src="', $GLOBALS['boardurl'], '/mysite.chat/info.php" style="width: 100%; margin: 0; padding: 0; border: 0; overflow: hidden;" scrolling="no" border="0" allowtransparency="true"></iframe></td>
   </tr>';

Anybody have any clue whats going on with it?
Title: Re: question re html overriding theme colors
Post by: Xarcell on February 05, 2006, 05:52:30 PM
You added it to your board index?

I did that once and it was a pain. It'll reload everytime you browse reallly slowing down your forum.
Title: Re: question re html overriding theme colors
Post by: disisme on February 05, 2006, 05:56:01 PM
where should it go?
Title: Re: question re html overriding theme colors
Post by: Xarcell on February 05, 2006, 05:59:05 PM
Put it in an php article and create a link to it in your menu manager, or install the SMF_static page mod and put the iframe in one of those pages.

That's what I did at www.veoclan.com

You can add a TP block that shows people in the chat room.
Title: Re: question re html overriding theme colors
Post by: disisme on February 05, 2006, 06:00:09 PM
good grief...that all went way over my head :)
Title: Re: question re html overriding theme colors
Post by: Xarcell on February 05, 2006, 06:02:43 PM
I got confused. Your NOT putting the chat "room" in your board index. Just your chat info.

You can put that into a block, but I have not found a way to override color. I have the same issue. I will look into it later...
Title: Re: question re html overriding theme colors
Post by: disisme on February 05, 2006, 06:10:57 PM
ah, ok, thanks Xarcell.  My theme, as you may be aware, is greyish / black with white text.  The borders etc for the new box come up right, but when it runs the box is filled white with black text.  I dont see anywhere in my info.php that its doing anything like that, but maybe... heres the content of my info.php :

===================================
<?php

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");


/**
If this file is not in the FlashChat root folder, then change this
path to the location of the inc/common.php file.
*/
include_once('inc/common.php');

ChatServer::purgeExpired();

/**
Retrieves the number of users who are chatting in any room.
Leave the $room parameter empty to return the number of users in all room.
*/
function numusers( $room = "" )
{
if($room) {
$stmt = new Statement("SELECT COUNT(*) AS numb FROM {$GLOBALS['fc_config']['db']['pref']}connections WHERE userid IS NOT NULL AND userid <> ? AND roomid=?");
$rs = $stmt->process(SPY_USERID, $room);
   } else {
$stmt = new Statement("SELECT COUNT(*) AS numb FROM {$GLOBALS['fc_config']['db']['pref']}connections,{$GLOBALS['fc_config']['db']['pref']}rooms
WHERE userid IS NOT NULL AND userid <> ? AND ispublic IS NOT NULL
  AND {$GLOBALS['fc_config']['db']['pref']}connections.roomid = {$GLOBALS['fc_config']['db']['pref']}rooms.id");
$rs = $stmt->process(SPY_USERID);
   }
   
$rec = $rs->next();

return $rec?$rec['numb']:0;
}

/**
Retrieves a list of the users (by login ID) who are in $room.
Leave the $room parameter empty to return a list of all users in all rooms.
*/
function usersinroom( $room = "" )
{
$cms = $GLOBALS['fc_config']['cms'];
$list = array();

if($room)
{
$stmt = new Statement("SELECT userid, state, color, lang, roomid FROM {$GLOBALS['fc_config']['db']['pref']}connections WHERE userid IS NOT NULL AND userid <> ? AND roomid=?");
$rs = $stmt->process(SPY_USERID, $room);
   } else {
$stmt = new Statement("SELECT userid, state, color, lang, roomid FROM {$GLOBALS['fc_config']['db']['pref']}connections WHERE userid IS NOT NULL AND userid <> ?");
$rs = $stmt->process(SPY_USERID);
   }
   
while($rec = $rs->next())
   {
$usr = $cms->getUser($rec['userid']);
if($usr == null && $GLOBALS['fc_config']['enableBots']) $usr = $GLOBALS['fc_config']['bot']->getUser($rec['userid']);   
$list[] = array_merge($usr, $rec);
   }
   
return $list;
}

/**
Retrieves a list of all available rooms, as an array.
*/
function roomlist()
{
$list = array();

   // populate $list with the names of all available rooms
$stmt = new Statement("SELECT * FROM {$GLOBALS['fc_config']['db']['pref']}rooms WHERE ispublic IS NOT NULL order by ispermanent");
$rs = $stmt->process();

while($rec = $rs->next()) $list[] = $rec;

   //result will be an array of arrays like ('id' => <room id>, 'updated' = <timestamp>, 'created' => <timestamp>, 'name' => <room name>, 'ispublic' => <public flag>, 'ispermanent' => <autoclose flag>)
return $list;
}


$rooms = roomlist();
$roomnumb = sizeof($rooms);
?>

<html>
<title>Who's in the chat?</title>
<meta http-equiv=Content-Type content="text/html;">
<head>
<style type="text/css">
<!--
.normal {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
}
A {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 8px;
color: #0000FF;
}
A:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 8px;
color: #FF0000;
}
-->
</style>
</head>
<body>
<p class=normal>There are <?php echo numusers()?> users in <?php echo $roomnumb?> rooms.</p>
<?php if($roomnumb) { ?>
<?php foreach($rooms as $room) { ?>
<tr>
<td><?php echo "<p class=normal>" . $room['name'] . ""?></td>
<td><?php $users = usersinroom($room['id']);
foreach( $users as $user ) {echo " - " . $user['login'];}?> </td>
</tr>
<td><?php echo "
"?></td>
<?php } ?>
</table>
<?php } ?>
</body>
</html>

=========================================

Doesnt seem to be anything in there thats nuking my colors.
Title: Re: question re html overriding theme colors
Post by: disisme on February 05, 2006, 06:12:22 PM
woops..think some of that html was actually executed in the post :)  nothing serious though
Title: Re: question re html overriding theme colors
Post by: gerrymo on February 05, 2006, 06:14:17 PM
Quote from: disisme on February 05, 2006, 05:56:01 PM
where should it go?

I kept mine as a stand alone part. I open it in a popup window so members can continue to use the site whilst also using chat.
Title: Re: question re html overriding theme colors
Post by: Xarcell on February 05, 2006, 06:19:01 PM
Gerrymo has a good point.

I didn't do that because I hate pop-ups, and most of my user's have pop-ups blocked.

I wish therewas a way to run SMF without reloading content in an iframe. I tampered with ajax, but with way SMF is designed I couldn't find a solution.
Title: Re: question re html overriding theme colors
Post by: IchBin on February 05, 2006, 06:25:21 PM
There's a post on SMF that shows you exactly how to integrate the Flashchat into your forum. Loaded in the index.template.php
Title: Re: question re html overriding theme colors
Post by: disisme on February 05, 2006, 08:15:42 PM
yah, I have chat integrated...thats not what I'm after... My flashchat, when they hit the button (which is themed) opens a pop up window to lauch chat in.  What I'm trying to do is change the background and text colors for the iframe that lists my 'whos in chat' data as generated by the info.php program.  I think it may be as simple as adding bgcolor="#A9A9A9" to the <body> statement in info.php...will give that a try.
Title: Re: question re html overriding theme colors
Post by: disisme on February 05, 2006, 08:39:34 PM
Yep, thats it... my info.php for chat was nuking the colors.  I modified the <body> statement to <body bgcolor="#505050"> and in each line I write to the screen I added <font color="white">  works a treat!