1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-19 12:11:55 +02:00

Poll notice removal.

This commit is contained in:
Cameron 2016-04-20 17:37:46 -07:00
parent f6ca9f8883
commit 42191db509
2 changed files with 30 additions and 21 deletions

View File

@ -72,25 +72,22 @@ class e107_db_debug {
$this->ShowIf('Shortcodes / BBCode',$this->Show_SC_BB());
$this->ShowIf('Paths', $this->Show_PATH());
$this->ShowIf('Deprecated Function Usage', $this->Show_DEPRECATED());
if(E107_DBG_INCLUDES)
{
$this->aIncList = get_included_files();
}
}
$this->ShowIf('Included Files: '.count($this->aIncList), $this->Show_Includes());
}
function ShowIf($title,$str)
{
global $ns,$style;
$style='debug';
if (!isset($ns)) {
echo "Why did ns go away?<br />";
$ns = new e107table;
}
if (strlen($str)) {
$ns->tablerender($title, $str);
if(!empty($str))
{
e107::getRender()->setStyle('debug');
e107::getRender()->tablerender($title, $str);
}
}
@ -683,8 +680,10 @@ class e107_db_debug {
}
}
function Show_Log(){
if (!E107_DBG_BASIC || !count($this->aLog)){
function Show_Log()
{
if (empty($this->aLog))
{
return FALSE;
}
//
@ -697,8 +696,9 @@ class e107_db_debug {
foreach ($this->aLog as $curLog)
{
if (!$bRowHeaders) {
$bRowHeaders=TRUE;
if (!$bRowHeaders)
{
$bRowHeaders = true;
$text .= "<tr class='fcaption'><td><b>".implode("</b></td><td><b>", array_keys($curLog))."</b></td></tr>\n";
}

View File

@ -41,14 +41,23 @@ class poll
function remove_poll_cookies()
{
$arr_polls_cookies = array();
foreach($_COOKIE as $cookie_name => $cookie_val)
{ // Collect poll cookies
list($str, $int) = explode('_', $cookie_name, 2);
if (($str == 'poll') && is_numeric($int))
{ // Yes, its poll's cookie
$arr_polls_cookies[] = $int;
if(!empty($_COOKIE))
{
foreach($_COOKIE as $cookie_name => $cookie_val)
{ // Collect poll cookies
if(substr($cookie_name,0,5) == 'poll_')
{
// e107::getDebug()->log("Poll: ".$cookie_name);
list($str, $int) = explode('_', $cookie_name, 2);
if (($str == 'poll') && is_numeric($int))
{ // Yes, its poll's cookie
$arr_polls_cookies[] = $int;
}
}
}
}
if (count($arr_polls_cookies) > 1)
{ // Remove all except first (assumption: there is always only one active poll)
rsort($arr_polls_cookies);