1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-29 10:50:25 +02:00

Forum Issue #260: Hide poll tab if it is not installed. Also fix for menu_manager item insert with PDO.

This commit is contained in:
Cameron
2016-03-23 10:22:21 -07:00
parent f1a2c00160
commit 1c16094dea
3 changed files with 18 additions and 15 deletions

View File

@@ -337,14 +337,14 @@ class e_menuManager {
'menu_name' => $val['menu_name'], 'menu_name' => $val['menu_name'],
'menu_location' => $val['menu_location'], 'menu_location' => $val['menu_location'],
'menu_order' => $val['menu_order'], 'menu_order' => $val['menu_order'],
'menu_class' => $val['menu_class'], 'menu_class' => intval($val['menu_class']),
'menu_pages' => '', 'menu_pages' => '',
'menu_path' => $row['menu_path'], 'menu_path' => $row['menu_path'],
'menu_layout' => $this->dbLayout, 'menu_layout' => $this->dbLayout,
'menu_parms' => '' 'menu_parms' => ''
); );
$sql->db_Insert("menus",$insert); $sql->insert("menus",$insert);
e107::getLog()->add('MENU_01',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$menu_count.'[!br!]'.$row['menu_path'],E_LOG_INFORMATIVE,''); e107::getLog()->add('MENU_01',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$menu_count.'[!br!]'.$row['menu_path'],E_LOG_INFORMATIVE,'');
} }
@@ -756,14 +756,14 @@ class e_menuManager {
'menu_name' => $row['menu_name'], 'menu_name' => $row['menu_name'],
'menu_location' => $location, 'menu_location' => $location,
'menu_order' => $menu_count, 'menu_order' => $menu_count,
'menu_class' => $row['menu_class'], 'menu_class' => intval($row['menu_class']),
'menu_pages' => '', 'menu_pages' => '',
'menu_path' => $row['menu_path'], 'menu_path' => $row['menu_path'],
'menu_layout' => $this->dbLayout, 'menu_layout' => $this->dbLayout,
'menu_parms' => '' 'menu_parms' => ''
); );
$sql->db_Insert("menus",$insert, $this->debug); $sql->insert("menus",$insert, $this->debug);
e107::getLog()->add('MENU_01',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$menu_count.'[!br!]'.$row['menu_path'],E_LOG_INFORMATIVE,''); e107::getLog()->add('MENU_01',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$menu_count.'[!br!]'.$row['menu_path'],E_LOG_INFORMATIVE,'');
$menu_count++; $menu_count++;
@@ -1697,7 +1697,7 @@ class e_menuManager {
} }
elseif($_POST['mode'] == 'update') elseif($_POST['mode'] == 'update')
{ {
$sql->db_Update("menus","menu_location = ".intval($area)." WHERE menu_id = ".intval($insertID)."",$this->debug); $sql->update("menus","menu_location = ".intval($area)." WHERE menu_id = ".intval($insertID)."",$this->debug);
} }
$c = 0; $c = 0;
@@ -1712,7 +1712,7 @@ class e_menuManager {
{ {
list($b,$id) = explode("-",$val); list($b,$id) = explode("-",$val);
$order[] = $id; $order[] = $id;
$sql->db_Update("menus","menu_order = ".$c." WHERE menu_id = ".intval($id)."",$this->debug); $sql->update("menus","menu_order = ".$c." WHERE menu_id = ".intval($id)."",$this->debug);
$c++; $c++;
} }

View File

@@ -477,6 +477,7 @@ class e_db_mysql
} }
catch(PDOException $ex) catch(PDOException $ex)
{ {
$sQryRes = false; $sQryRes = false;
} }
} }
@@ -530,9 +531,9 @@ class e_db_mysql
{ {
$buglink = is_null($rli) ? $this->mySQLaccess : $rli; $buglink = is_null($rli) ? $this->mySQLaccess : $rli;
if(is_array($query)) if(is_array($query) && is_object($ex))
{ {
$query = "PREPARE: ".$query['PREPARE']."<br />BIND:".print_a($query['BIND'],true); // ,true); $query = "ERROR: ".$ex->errorInfo[2]."<br />PREPARE: ".$query['PREPARE']."<br />BIND:".print_a($query['BIND'],true); // ,true);
} }
$db_debug->Mark_Query($query, $buglink, $sQryRes, $aTrace, $mytime, $pTable); $db_debug->Mark_Query($query, $buglink, $sQryRes, $aTrace, $mytime, $pTable);

View File

@@ -371,15 +371,17 @@ class plugin_forum_post_shortcodes extends e_shortcode
function sc_poll($parm='') function sc_poll($parm='')
{ {
if(is_readable(e_PLUGIN."poll/poll_class.php"))
{
require_once(e_PLUGIN."poll/poll_class.php");
$pollo = new poll;
$type = ($parm == 'front') ? 'front' : 'forum';
$poll_form = $pollo -> renderPollForm($type); if(!e107::isInstalled('poll'))
{
return null;
} }
require_once(e_PLUGIN."poll/poll_class.php");
$pollo = new poll;
$type = ($parm == 'front') ? 'front' : 'forum';
$poll_form = $pollo -> renderPollForm($type);
if ($this->var['action'] == 'nt' && check_class($this->forum->prefs->get('poll')) && strpos(e_QUERY, 'edit') === false) if ($this->var['action'] == 'nt' && check_class($this->forum->prefs->get('poll')) && strpos(e_QUERY, 'edit') === false)
{ {