1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 14:17:49 +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('Shortcodes / BBCode',$this->Show_SC_BB());
$this->ShowIf('Paths', $this->Show_PATH()); $this->ShowIf('Paths', $this->Show_PATH());
$this->ShowIf('Deprecated Function Usage', $this->Show_DEPRECATED()); $this->ShowIf('Deprecated Function Usage', $this->Show_DEPRECATED());
if(E107_DBG_INCLUDES) if(E107_DBG_INCLUDES)
{ {
$this->aIncList = get_included_files(); $this->aIncList = get_included_files();
} }
$this->ShowIf('Included Files: '.count($this->aIncList), $this->Show_Includes()); $this->ShowIf('Included Files: '.count($this->aIncList), $this->Show_Includes());
} }
function ShowIf($title,$str) function ShowIf($title,$str)
{ {
global $ns,$style;
$style='debug'; if(!empty($str))
{
if (!isset($ns)) { e107::getRender()->setStyle('debug');
echo "Why did ns go away?<br />"; e107::getRender()->tablerender($title, $str);
$ns = new e107table;
}
if (strlen($str)) {
$ns->tablerender($title, $str);
} }
} }
@@ -683,8 +680,10 @@ class e107_db_debug {
} }
} }
function Show_Log(){ function Show_Log()
if (!E107_DBG_BASIC || !count($this->aLog)){ {
if (empty($this->aLog))
{
return FALSE; return FALSE;
} }
// //
@@ -697,8 +696,9 @@ class e107_db_debug {
foreach ($this->aLog as $curLog) foreach ($this->aLog as $curLog)
{ {
if (!$bRowHeaders) { if (!$bRowHeaders)
$bRowHeaders=TRUE; {
$bRowHeaders = true;
$text .= "<tr class='fcaption'><td><b>".implode("</b></td><td><b>", array_keys($curLog))."</b></td></tr>\n"; $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() function remove_poll_cookies()
{ {
$arr_polls_cookies = array(); $arr_polls_cookies = array();
foreach($_COOKIE as $cookie_name => $cookie_val) if(!empty($_COOKIE))
{ // Collect poll cookies {
list($str, $int) = explode('_', $cookie_name, 2); foreach($_COOKIE as $cookie_name => $cookie_val)
if (($str == 'poll') && is_numeric($int)) { // Collect poll cookies
{ // Yes, its poll's cookie
$arr_polls_cookies[] = $int; 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) if (count($arr_polls_cookies) > 1)
{ // Remove all except first (assumption: there is always only one active poll) { // Remove all except first (assumption: there is always only one active poll)
rsort($arr_polls_cookies); rsort($arr_polls_cookies);