need help with error - error

Started by digit, November 28, 2011, 08:44:38 PM

Previous topic - Next topic

digit

I have a problem when I place the forum in maintenance mode, or when the forum throws out an error.  I KNOW where it's happening...   with a mod of mine.

When in maintenance mode, (or in the case of an error) nothing appears on any page below where I am calling an ssi function.... in index.template.php

ssi_chatOnline();

here is...  ssi_chatOnline();


function ssi_chatOnline($output_method = 'echo')
{
global $db_prefix, $scripturl, $txt;

$users = array();
$userIDs = array();
$result = db_query("SELECT userID
FROM ${db_prefix}ajaxchat_online WHERE NOW() <= DATE_ADD(dateTime, interval 2 MINUTE)
", __FILE__, __LINE__);
while($row = mysql_fetch_assoc($result)) {
array_push($userIDs, $row['userID']);
}
mysql_free_result($result);

$users['IDs'] = array_unique($userIDs);
$users['links'] = array();
if (count($users['IDs']) > 0){
$query = "SELECT mem.ID_MEMBER, mem.realName, mem.ID_GROUP, mg.onlineColor, mg.ID_GROUP
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}membergroups AS mg ON
(mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))WHERE ";
foreach ($users['IDs'] as $ID)
$query .= 'ID_MEMBER = '. $ID . ' OR ';
//remove the last OR
$query = substr($query, 0, strlen($query)-3);

$result = db_query($query, __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($result))
{
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'];
if($row['onlineColor'] != ""){
$link.= '" style="color: ' . $row['onlineColor'];
}
$link.= '" target="luyf">' . $row['realName'] . '</a>';
    array_push($users['links'], $link);
}
mysql_free_result($result);
}
if ($output_method != 'echo')
return $users;
else{
if (count($users['links']) == 0 )
  echo '<center><a href="http://www.mysite.com/chat/index.php"><font color="#FF0000">Our Chat - Now Open To Bronze, Silver &amp; Gold Members!</font></a> -  <a href="http://www.mysite.com/chat/index.php">Enter Chat Room</a></center>';
elseif (count($users['links']) == 1 )
  echo 'There is 1' . $txt['chat_aUser']. ' ', implode($users['links']) , ' - <a href="http://www.mysite.com/chat/index.php">Enter Chat Room</a>';
else
  echo count($users['links']). $txt['chat_users']. ' ', implode(', ', $users['links']);
}
}


If someone could tell me why this is crashing the rest of the page, I'd greatly appreciate it.

Thanks.

Digit

Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

MC73

What is the error ? i take it that your error is in your logs ?
Over 1100 Online Flash Games 

digit

Nothing showing up in the logs....   just everything is blank starting with that ssi call and below.....   If I remove that ssi call the page displays fine.

This problem only occurs when I put the forum in maintenance mode, or in case of a forum error. (none of the error text is being displayed)

So somewhere in that ssi function is crashing the rest of the page.

Thanks.
Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

MC73

Might be in your best interest to post the Q's at their respected mod section ..... 
Over 1100 Online Flash Games 

Illori

if you are getting a blank page, check your server error log for the error.

Advertisement: