SimplePortal

Support => English Support => Topic started by: stramonium on May 10, 2014, 05:13:10 PM

Title: undefined index : allow view results
Post by: stramonium on May 10, 2014, 05:13:10 PM
Hi all , i have a problem in smf registry . This is about simple portal .
Code: [Select]
http://www.stregoneria.net/forum/index.php?
8: Undefined index: allow_view_results
File: /home/stregon1/public_html/forum/Sources/PortalBlocks.php
Riga: 1237

Code: [Select]
http://www.stregoneria.net/forum/index.php?
8: Undefined index: allow_vote
File: /home/stregon1/public_html/forum/Sources/PortalBlocks.php
Riga: 1217

Someone can help me please?
File attached
Title: Re: undefined index : allow view results
Post by: phantomm on May 10, 2014, 05:50:14 PM
Do you have any custom PHP blocks added in portal?
Title: Re: undefined index : allow view results
Post by: stramonium on May 11, 2014, 05:48:24 AM
Yes i have a custom php block . It is needed to browse "enter in chat" and count the number of user .
I use ajax-chat .
To obtain the block:

Code: ("Block code") [Select]
$count = count(chatOnlineUsers());
$user = chatOnlineUsers();
$userName = '';
for ( $i = 0; $i < $count; $i++)
{
  $userName .= $user[$i];
  if($i != $count-1)
  {
     $userName .= ', ';
  }
}
if ($count == 0 )
echo '<b>Nessun Utente in Chat</b>';
elseif ($count == 1 )
  echo '<b>1 Utente in Chat:</b><br />'.$userName;
else
  echo '<b>'.$count.' Utenti in Chat:</b><br />'.$userName;

echo '<br /><br />';
echo '<div style="text-align:center;"><a href="http://www.stregoneria.net/forum/chat/index.php"><u><b>Entra in Chat!</b></u></a></div>';
echo '<br /><br />';

at the down of  load.php , before >?   add code :

Code: [Select]
function chatOnlineUsers(){
global $smcFunc;

$userName = array();
$result = $smcFunc['db_query']('', '
SELECT userName
FROM ajax_chat_online WHERE NOW() <= DATE_ADD(dateTime, interval 2 MINUTE)' ,
  array()
);
while($row = $smcFunc['db_fetch_assoc']($result)) {
array_push($userName, $row['userName']);
}
$smcFunc['db_free_result']($result);
return array_unique($userName);
}


File attached

P.S Thanks for the answer.
Title: Re: undefined index : allow view results
Post by: AngelinaBelle on May 12, 2014, 02:27:31 PM
In the attached PortalBlocks.php, those two lines occur in function sp_showPoll
This block depends on the ssi function ssi_showPoll, which is passed a topic id number.
I am not very familiar with the ssi_showPoll function, but I imagine that, if it was unhappy with the topic id (topic did not exist or had no poll associated with it), it might not return the values the block is expecting to see.

What do you see in your showPoll block?  Does that seem to be working OK?
SimplePortal 2.3.8 © 2008-2024, SimplePortal