public function addConsoleCategory() { $consoleCatID = ""; if ($this->pluginConsoleCategory != "") { $result = $this->MySQL->query("SELECT consolecategory_id FROM " . $this->MySQL->get_tablePrefix() . "consolecategory WHERE name = '" . $this->pluginConsoleCategory . "'"); if ($result->num_rows == 0) { $consoleCatObj = new ConsoleCategory($this->MySQL); $newOrderNum = $consoleCatObj->getHighestOrderNum() + 1; $consoleCatObj->addNew(array("name", "ordernum"), array($this->pluginConsoleCategory, $newOrderNum)); $consoleCatID = $consoleCatObj->get_info("consolecategory_id"); } else { $row = $result->fetch_assoc(); $consoleCatID = $row['consolecategory_id']; } } return $consoleCatID; }
} } if ($countErrors == 0) { $sql = "\n\t\t\n\t\tCREATE TABLE IF NOT EXISTS `" . $dbprefix . "twitter` (\n\t\t `twitter_id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t `member_id` int(11) NOT NULL,\n\t\t `oauth_token` varchar(255) NOT NULL,\n\t\t `oauth_tokensecret` varchar(255) NOT NULL,\n\t\t `username` varchar(20) NOT NULL,\n\t\t `name` varchar(255) NOT NULL,\n\t\t `description` text NOT NULL,\n\t\t `followers` int(11) NOT NULL,\n\t\t `following` int(11) NOT NULL,\n\t\t `tweets` int(11) NOT NULL,\n\t\t `profilepic` text NOT NULL,\n\t\t `lasttweet_id` varchar(255) NOT NULL,\n\t\t `lasttweet_html` text NOT NULL,\n\t\t `showfeed` int(11) NOT NULL,\n\t\t `embedtweet` int(11) NOT NULL,\n\t\t `infocard` int(11) NOT NULL,\n\t\t `allowlogin` int(11) NOT NULL,\n\t\t `lastupdate` int(11) NOT NULL,\n\t\t `loginhash` varchar(32) NOT NULL,\n\t\t PRIMARY KEY (`twitter_id`)\n\t\t) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;\n\t\n\t\t"; if ($mysqli->query($sql)) { $jsonAPIKey = json_encode($arrAPIKeys); $pluginObj->addNew(array("name", "filepath", "dateinstalled", "apikey"), array($PLUGIN_NAME, $_POST['pluginDir'], time(), $jsonAPIKey)); $pluginID = $pluginObj->get_info("plugin_id"); $pluginObj->pluginPage->setCategoryKeyValue($pluginID); $pluginPageSortNum = $pluginObj->pluginPage->getHighestSortNum() + 1; $pluginObj->pluginPage->addNew(array("plugin_id", "page", "pagepath", "sortnum"), array($pluginID, "profile", "plugins/twitter/_profile.php", $pluginPageSortNum)); // Check if need to add new console category $result = $mysqli->query("SELECT consolecategory_id FROM " . $dbprefix . "consolecategory WHERE name = 'Social Media Connect'"); if ($result->num_rows == 0) { $consoleCatObj = new ConsoleCategory($mysqli); $newOrderNum = $consoleCatObj->getHighestOrderNum() + 1; $consoleCatObj->addNew(array("name", "ordernum"), array("Social Media Connect", $newOrderNum)); $consoleCatID = $consoleCatObj->get_info("consolecategory_id"); } else { $row = $result->fetch_assoc(); $consoleCatID = $row['consolecategory_id']; } $consoleObj->setCategoryKeyValue($consoleCatID); $newSortNum = $consoleObj->getHighestSortNum() + 1; $consoleObj->addNew(array("consolecategory_id", "pagetitle", "filename", "sortnum"), array($consoleCatID, $PLUGIN_NAME, "../plugins/twitter/twitterconnect.php", $newSortNum)); } else { $countErrors++; $dispError[] = "Unable to create plugin database table."; } } $arrReturn = array();
} $consoleCatObj->select($consoleCatInfo['consolecategory_id']); if ($consoleCatObj->update($updateColumns, $updateValues)) { echo "\n\t\t\t<div style='display: none' id='successBox'>\n\t\t\t<p align='center'>\n\t\t\tSuccessfully Edited Console Category!\n\t\t\t</p>\n\t\t\t</div>\n\t\n\t\t\t<script type='text/javascript'>\n\t\t\tpopupDialog('Edit Console Category', '" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "', 'successBox');\n\t\t\t</script>\n\t\t\t"; if ($resortOrder) { $consoleCatObj->resortOrder(); } } } else { $_POST = filterArray($_POST); $_POST['submit'] = false; } } if (!$_POST['submit']) { $countCategories = 0; $intHighestOrderNum = $consoleCatObj->getHighestOrderNum(); $afterSelected = ""; if ($consoleCatInfo['ordernum'] == 1) { $selectCat = $consoleCatInfo['ordernum'] + 1; $afterSelected = "selected"; } else { $selectCat = $consoleCatInfo['ordernum'] - 1; } $result = $mysqli->query("SELECT * FROM " . $dbprefix . "consolecategory WHERE adminoption = '0' AND consolecategory_id != '" . $consoleCatInfo['consolecategory_id'] . "' ORDER BY ordernum DESC"); while ($row = $result->fetch_assoc()) { $strSelected = ""; if ($selectCat == $row['ordernum']) { $strSelected = "selected"; } $catOrderOptions .= "<option value='" . $row['consolecategory_id'] . "' " . $strSelected . ">" . filterText($row['name']) . "</option>"; $countCategories++;