TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,021
  • Total Topics: 21,332
  • Online today: 744
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 587
  • Total: 587

question re html overriding theme colors

Started by disisme, February 05, 2006, 05:48:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

disisme

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?

Xarcell

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.


Xarcell

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.

disisme

good grief...that all went way over my head :)

Xarcell

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...

disisme

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.

disisme

woops..think some of that html was actually executed in the post :)  nothing serious though

gerrymo

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.

Xarcell

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.

This website is proudly hosted on Crocweb Cloud Website Hosting.