public function newCategory() { $validate = new Validate(); $validated = $validate->Validate_Category(); $nameToSlug = $this->nameToSlug($validated); if (\Auth::check()) { if ($validated->passes() && $nameToSlug === true) { $slug = \Input::get('name'); $slug = preg_replace('#[ -]+#', '-', $slug); $slug = strtolower($slug); \DB::beginTransaction(); try { $item = new \MenuCategory(); $item->menu_category_name = \Input::get('name'); $item->menu_category_slug = $slug; $item->save(); } catch (ValidationException $e) { DB::rollback(); throw $e; } \DB::commit(); return \Redirect::to('admin/category/edit/' . $slug)->with('message', '<div class="alert alert-dismissible alert-success alert-link"><button type="button" class="close" data-dismiss="alert">×</button>Saved!</p></div>'); } if ($nameToSlug === false) { return \View::make('categories.new')->withErrors($validated)->withInput(array('name'))->with('message', '<p class="alert alert-dismissible alert-danger alert-link">That category already exists!'); } return \View::make('categories.new')->withErrors($validated)->withInput(array('name')); } return \Redirect::to('admin'); }
/** * add the given menu item category to the repository * please note that this is a private method to be used only by the constructor * @param MenuCategory $category */ private function addMenuCategory(MenuCategory $category) { // obtain ID from the menu category object $id = $category->getMenuCategoryCode(); //add menu category object to the array, with index of the ID $this->categories[$id] = $category; }
function getDefault($menu_item_category_fk) { $results = \MenuCategory::where('menu_category_id', '=', $menu_item_category_fk)->get(array('menu_category_id')); foreach ($results as $result) { $category = $result->menu_category_id; } return $category; }
public function dashBoard() { $menu_items = \MenuItem::all(); $categories = \MenuCategory::all(); if (\Auth::check()) { return \View::make('admin.dashboard')->with('menu_items', $menu_items)->with('categories', $categories); } return \View::make('accounts.login'); }
public function getCategoryInfo($slug) { $results = \MenuCategory::where('menu_category_slug', '=', $slug)->get(); foreach ($results as $result) { $id = $result->menu_category_id; $menu_category_name = $result->menu_category_name; } return \View::make('categories.delete')->withSlug($slug)->withMenuCategoryName($menu_category_name); }
function getCategories() { $categories = \MenuCategory::get(); foreach ($categories as $cat) { $cat_name[] = $cat->menu_category_name; $cat_id[] = $cat->menu_category_id; $category = array($cat_id, $cat_name); } return $category; }
public function getCategories() { $category = array(); $categories = \MenuCategory::get(); foreach ($categories as $cat) { $cat_name = $cat->menu_category_name; $cat_id = $cat->menu_category_id; $category[$cat_id] = $cat_name; } return $category; }
public function checkLogin() { $username = \Input::get('username'); $password = \Input::get('password'); $validator = new Validate(); $validated = $validator->validateCreds(); $attempt = \Auth::attempt(array('username' => $username, 'password' => $password)); $menu_items = \MenuItem::all(); $categories = \MenuCategory::all(); if ($validated->passes()) { if (!\Auth::validate(array('username' => $username, 'password' => $password))) { return \View::make('accounts.login')->withErrors($validated)->withInput(\Input::only('username'))->with('message', '<p class="alert alert-dismissible alert-danger">Invalid username or password</p>'); } if ($attempt === true) { return \View::make('admin.dashboard')->with('menu_items', $menu_items)->with('categories', $categories); } } return \View::make('accounts.login')->withErrors($validated)->withInput(\Input::only('username')); }
public function checkNameMatch($slug) { $get_name = \MenuCategory::where('menu_category_slug', '=', $slug)->get(array('menu_category_name')); foreach ($get_name as $name) { $name = $name->menu_category_name; } //----------- $nameprep = \Input::get('name'); $nameprep = preg_replace('#[ -]+#', '-', $nameprep); $nameprep = strtolower($nameprep); //------------ $name_check = \MenuCategory::where('menu_category_slug', '=', $nameprep)->get(array('menu_category_name')); foreach ($name_check as $get_name) { $name_check = $get_name->menu_category_name; } $result = strcasecmp($name, $name_check); if ($result === 0) { return true; } return false; }
</ul> </div> <div class="row"> <div class="box col-md-12"> <div class="box-inner"> <div class="box-header well" data-original-title=""> <h2><i class="glyphicon glyphicon-edit"></i>Add/Edit Menu Category</h2> </div> <div class="box-content"> <?php $id = Request::get("id"); if (is_numeric($id) && $id > 0) { $menucategoryObj = new MenuCategory(); $menucategoryObj->set("menucategory_id", $id); $result = $menucategoryObj->getName(); if (count($result)) { $row = $result[0]; $menucategory_id = $row['id']; $menucategory_name = $row['name']; $menucategory_status = $row['active']; } } ?> <form action="" method="POST" name="menucategory_frm" id="menucategory_frm"> <table class="table table-striped table-bordered bootstrap-datatable datatable responsive"> <tr> <td><label class="control-label" for="selectError">Menu Category</label></td> <td><div class="input-group" >
* Copyright 2014 * * Author: Bluethrust Web Development * E-mail: support@bluethrust.com * Website: http://www.bluethrust.com * * License: http://www.bluethrust.com/license.php * */ if (!isset($menuXML)) { $prevFolder = "../../../../../"; include_once $prevFolder . "_setup.php"; $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $consoleObj = new ConsoleOption($mysqli); $menuCatObj = new MenuCategory($mysqli); if (trim($_SERVER['HTTPS']) == "" || $_SERVER['HTTPS'] == "off") { $dispHTTP = "http://"; } else { $dispHTTP = "https://"; } $siteDomain = $_SERVER['SERVER_NAME']; try { $menuXML = new SimpleXMLElement(BASE_DIRECTORY . "themes/" . $THEME . "/themeinfo.xml", NULL, true); } catch (Exception $e) { $menuXML = new SimpleXMLElement(BASE_DIRECTORY . "themes/" . $THEME . "/themeinfo.xml", NULL, true); } } $intAddMenuCatCID = $consoleObj->findConsoleIDByName("Add Menu Category"); $intEditMenuCatCID = $consoleObj->findConsoleIDByName("Manage Menu Categories"); $consoleObj->select($intAddMenuCatCID);
<a class="btn btn-info" href="add_menucategory.php"> <i class="glyphicon glyphicon-edit icon-white"></i> Add </a><br/><br/> <table class="table table-striped table-bordered bootstrap-datatable datatable responsive"> <thead> <tr> <th>Id</th> <th>Category Name </th> <th>Status</th> <th>Actions</th> </tr> </thead> <tbody> <?php $countryObj = new MenuCategory(); $rows = $countryObj->getAll(); foreach ($rows as $row) { ?> <tr> <td><?php echo $row['id']; ?> </td> <td class="center"><?php echo $row['name']; ?> </td> <td class="center"> <span class="label-success label label-default"><?php if ($row['active'] == 1) {
* Website: http://www.bluethrust.com * * License: http://www.bluethrust.com/license.php * */ $prevFolder = "../../../../"; include_once "../../../../_setup.php"; include_once "../../../../classes/member.php"; include_once "../../../../classes/rank.php"; include_once "../../../../classes/consoleoption.php"; include_once "../../../../classes/menucategory.php"; include_once "../../../../classes/menuitem.php"; $consoleObj = new ConsoleOption($mysqli); $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $menuCatObj = new MenuCategory($mysqli); $menuItemObj = new MenuItem($mysqli); $cID = $consoleObj->findConsoleIDByName("Manage Menu Items"); $consoleObj->select($cID); $_GET['cID'] = $cID; if ($member->authorizeLogin($_SESSION['btPassword'])) { $memberInfo = $member->get_info_filtered(); if ($member->hasAccess($consoleObj) && $menuItemObj->select($_POST['itemID'])) { $menuItemInfo = $menuItemObj->get_info_filtered(); if ($_POST['confirm'] == "1") { $menuCatObj->select($menuItemInfo['menucategory_id']); $refreshSection = $menuCatObj->get_info("section"); $menuItemObj->delete(); $menuItemObj->resortOrder(); include "include/menuitemlist.php"; /*
* Author: Bluethrust Web Development * E-mail: support@bluethrust.com * Website: http://www.bluethrust.com * * License: http://www.bluethrust.com/license.php * */ if (!isset($member)) { include_once "../../../../../_setup.php"; include_once "../../../../../classes/member.php"; include_once "../../../../../classes/menucategory.php"; include_once "../../../../../classes/menuitem.php"; $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $consoleObj = new ConsoleOption($mysqli); $menuCatObj = new MenuCategory($mysqli); $menuItemObj = new MenuItem($mysqli); } if (!isset($intAddNewMenuItemID)) { $intAddNewMenuItemID = $consoleObj->findConsoleIDByName("Add Menu Item"); } if ($member->authorizeLogin($_SESSION['btPassword'])) { if (isset($_POST['menuCatID']) && $menuCatObj->select($_POST['menuCatID'])) { $orderoptions = ""; $menuCatInfo = $menuCatObj->get_info_filtered(); $selectItemID = ""; if (!isset($_POST['itemID'])) { $_POST['itemID'] = ""; } else { $menuItemObj->select($_POST['itemID']); $selectItemID = $menuItemObj->findBeforeAfter();
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = MenuCategory::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
/** * @return string the category text display for the current menu */ public function getCategoryText() { $categoryOptions = CHtml::listData(MenuCategory::model()->findAll(), 'id', 'name'); return isset($categoryOptions[$this->category]) ? $categoryOptions[$this->category] : "-"; }
* Bluethrust Clan Scripts v4 * Copyright 2014 * * Author: Bluethrust Web Development * E-mail: support@bluethrust.com * Website: http://www.bluethrust.com * * License: http://www.bluethrust.com/license.php * */ if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") { exit; } else { $memberInfo = $member->get_info(); $consoleObj->select($_GET['cID']); if (!$member->hasAccess($consoleObj)) { exit; } } $cID = $_GET['cID']; include_once $prevFolder . "classes/btupload.php"; $menuCatObj = new MenuCategory($mysqli); $intAddNewMenuCatID = $consoleObj->findConsoleIDByName("Add Menu Category"); if (isset($_GET['action']) && $_GET['action'] == "edit" && $menuCatObj->select($_GET['mcID'])) { include "managemenu/edit_category.php"; } elseif (!isset($_GET['action']) || isset($_GET['action']) && !$menuCatObj->select($_GET['mcID'])) { echo "\n\t\t<table class='formTable'>\n\t\t\t<tr>\n\t\t\t\t<td class='main' colspan='2' align='right'>\n\t\t\t\t\t» <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $intAddNewMenuCatID . "'>Add New Menu Category</a> «<br><br>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='formTitle' style='width: 76%'>Menu Category:</td>\n\t\t\t\t<td class='formTitle' style='width: 24%'>Actions:</td>\n\t\t\t</tr>\n\t\t</table>\n\n\t\t<div id='loadingSpiral' class='loadingSpiral'>\n\t\t\t<p align='center'>\n\t\t\t\t<img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/loading-spiral.gif'><br>Loading\n\t\t\t</p>\n\t\t</div>\n\t\t\n\t\t<div id='menuCategoryDiv'>\n\t\t"; $_POST['manage'] = 1; include "include/admin/managemenu/include/menucategorylist.php"; echo "\n\t\t</div>\n\t\t\n\t\t<div id='deleteMessage' style='display: none'></div>\n\t\t\n\t\t\n\t\t<script type='text/javascript'>\n\t\t\n\t\t\tfunction refreshCategoryList() {\n\t\t\t\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\$('#menuCategoryDiv').fadeOut(250);\n\t\t\t\t\t\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/admin/managemenu/include/menucategorylist.php', { manage: 1 }, function(data) {\n\t\t\t\t\t\n\t\t\t\t\t\t\$('#menuCategoryDiv').html(data);\n\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\$('#menuCategoryDiv').fadeIn(250);\n\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tfunction moveCat(strDir, intCatID) {\n\t\t\t\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\$('#menuCategoryDiv').fadeOut(250);\n\t\t\t\t\t\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/admin/managemenu/move_category.php', { manage: 1, cDir: strDir, mcID: intCatID }, function(data) {\n\t\t\t\t\t\n\t\t\t\t\t\t\$('#menuCategoryDiv').html(data);\n\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\$('#menuCategoryDiv').fadeIn(250);\n\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfunction deleteCat(intCatID) {\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/admin/managemenu/delete_category.php', { manage: 1, mcID: intCatID }, function(data) {\n\t\t\t\t\t\n\t\t\t\t\t\t\$('#deleteMessage').html(data);\n\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t</script>\n\t"; }
public function showMenuCategory($slug) { $result = \MenuCategory::where('menu_category_slug', '=', $slug)->first(); $menu_category_name = $result->menu_category_name; return \View::make('categories.edit')->withMenuCategoryName($menu_category_name)->withSlug($slug); }
* * License: http://www.bluethrust.com/license.php * */ if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") { exit; } else { $memberInfo = $member->get_info(); $consoleObj->select($_GET['cID']); if (!$member->hasAccess($consoleObj)) { exit; } } $cID = $_GET['cID']; include_once $prevFolder . "classes/btupload.php"; $menuCatObj = new MenuCategory($mysqli); $dispError = ""; $countErrors = 0; $arrCheckType = array("image", "customcode", "customformat"); if ($_POST['submit']) { // Check Name if (trim($_POST['categoryname']) == "") { $countErrors++; $dispError .= " <b>·</b> You may not enter a blank category name.<br>"; } // Check Section if (!is_numeric($_POST['section']) || $_POST['section'] >= $menuXML->info->section->count() || $_POST['section'] < 0) { $countErrors++; $dispError .= " <b>·</b> You selected an invalid menu section.<br>"; } // Check Header Type
/** * Remove the specified menu categories from storage. * * @param int $id * @return Response */ public function destroy($id) { $menu_cat = \MenuCategory::findOrFail($id); if ($menu_cat->menus->count() > 0) { return \Redirect::to('backend/menu-categories')->with('error_message', 'The menu category can\'t be deleted because one or more menu belong to this category. <br> Either change the menu category in those menu(s) or delete the menu(s) first to delete this menu.'); } if ($menu_cat && $menu_cat->delete()) { if (\Request::ajax()) { return \Response::json('The menu category was deleted.', 200); } return \Redirect::to('backend/menu-categories')->with('success_message', 'The menu category was deleted.'); } else { if (\Request::ajax()) { return \Response::json('The menu category wasn\'t deleted.', 400); } return \Redirect::to('backend/menu-categories')->with('error_message', 'The menu category was not deleted.'); } }
/** * Remove the specified menu categories from storage. * * @param int $id * @return Response */ public function destroy($id) { $menu_cat = \MenuCategory::findOrFail($id); if ($menu_cat->menus->count() > 0) { return \Redirect::to('backend/menu-categories')->with('error_message', trans('error_messages.menu_cat_delete_assoc')); } if ($menu_cat && $menu_cat->delete()) { if (\Request::ajax()) { return \Response::json(trans('success_messages.menu_cat_delete'), 200); } return \Redirect::to('backend/menu-categories')->with('success_message', trans('success_messages.menu_cat_delete')); } else { if (\Request::ajax()) { return \Response::json(trans('error_messages.menu_cat_delete'), 400); } return \Redirect::to('backend/menu-categories')->with('error_message', trans('error_messages.menu_cat_delete')); } }
echo $menu_name; ?> " class="form-control" placeholder="Menu Name" required="required"> </div> </td> </tr> <tr> <td ><label class="control-label" for="selectError">Menu Category</label> </td> <td> <div class="input-group" style="width: 50%"> <span class="input-group-addon"></span> <select required="" name="category_id" class="form-control"> <option value="">--Select Category--</option> <?php $menuObj = new MenuCategory(); $rows = $menuObj->getAll(); foreach ($rows as $row) { $selected = ""; if ($row['id'] == $category_id) { $selected = 'selected="selected"'; } ?> <option value="<?php echo $row['id']; ?> " <?php echo $selected; ?> ><?php echo $row['name'];
* Bluethrust Clan Scripts v4 * Copyright 2014 * * Author: Bluethrust Web Development * E-mail: support@bluethrust.com * Website: http://www.bluethrust.com * * License: http://www.bluethrust.com/license.php * */ $prevFolder = "../../../../"; include_once "../../../../_setup.php"; $consoleObj = new ConsoleOption($mysqli); $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $menuCatObj = new MenuCategory($mysqli); $cID = $consoleObj->findConsoleIDByName("Manage Menu Categories"); $consoleObj->select($cID); if ($member->authorizeLogin($_SESSION['btPassword'])) { $memberInfo = $member->get_info_filtered(); if ($member->hasAccess($consoleObj) && $menuCatObj->select($_POST['mcID'])) { $menuCatObj->move($_POST['cDir']); include "include/menucategorylist.php"; /* $menuCatObj->select($_POST['mcID']); echo " <script type='text/javascript'> $(document).ready(function() {
* License: http://www.bluethrust.com/license.php * */ if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") { exit; } else { $memberInfo = $member->get_info(); $consoleObj->select($_GET['cID']); if (!$member->hasAccess($consoleObj)) { exit; } } $cID = $_GET['cID']; define("MANAGEMENU_FUNCTIONS", true); include BASE_DIRECTORY . "members/include/admin/managemenu/_functions.php"; $menuCatObj = new MenuCategory($mysqli); $menuItemObj = new MenuItem($mysqli); $dispError = ""; $countErrors = 0; $itemTypeOptions = array("link" => "Link", "image" => "Image", "custompage" => "Custom Page", "customform" => "Custom Form Page", "downloads" => "Download Page", "top-players" => "Top Players", "shoutbox" => "Shoutbox", "forumactivity" => "Latest Forum Activity", "newestmembers" => "Newest Members", "poll" => "Poll", "login" => "Default Login", "customcode" => "Custom Block - Code Editor", "customformat" => "Custom Block - WYSIWYG Editor"); $textAlignOptions = array("left" => "Left", "center" => "Center", "right" => "Right"); $menuCatOptions = array(); $arrMenuCats = $menuCatObj->get_entries(array(), "sortnum"); foreach ($arrMenuCats as $menuCatInfo) { $menuCatOptions[$menuCatInfo['menucategory_id']] = $menuCatInfo['name']; } if (count($arrMenuCats) == 0) { echo "\n\t<div style='display: none' id='errorBox'>\n\t\t<p align='center'>\n\t\t\tYou must add a menu category before adding any items!\n\t\t</p>\n\t</div>\n\t\n\t<script type='text/javascript'>\n\t\tpopupDialog('Add New Menu Item', '" . $MAIN_ROOT . "members', 'errorBox');\n\t</script>\n\t"; exit; } $selectMenuCat = isset($_GET['mcID']) ? $_GET['mcID'] : "";
<?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'menu-form', 'enableAjaxValidation' => false, 'type' => 'horizontal')); ?> <p class="note">Fields with <span class="required">*</span> are required.</p> <?php echo $form->errorSummary($model); ?> <?php echo $form->hiddenField($model, 'business_id'); ?> <?php echo $form->dropDownListRow($model, 'category', CHtml::listData(MenuCategory::model()->findAll(), 'id', 'name'), array('empty' => 'Select a type')); ?> <?php echo $form->textFieldRow($model, 'name', array('class' => 'span5', 'size' => 60, 'maxlength' => 100)); ?> <?php echo $form->textAreaRow($model, 'description', array('class' => 'span6', 'rows' => 5)); ?> <?php echo $form->textFieldRow($model, 'price', array('class' => 'span2', 'prepend' => '$', 'maxlength' => 6)); ?> <div class="row buttons"> <?php //echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
function dispMenu($intSectionNum) { global $MAIN_ROOT, $LOGGED_IN, $mysqli, $shoutBoxPostLink, $shoutBoxDeleteLink, $shoutBoxEditLink, $arrShoutBoxIDs, $websiteInfo, $arrLoginInfo; echo "<div id='menuSection_" . $intSectionNum . "'>"; $menuCatObj = new MenuCategory($mysqli); $menuItemObj = new MenuItem($mysqli); $customPageObj = new Basic($mysqli, "custompages", "custompage_id"); $customFormObj = new CustomForm($mysqli); $downloadCatObj = new Basic($mysqli, "downloadcategory", "downloadcategory_id"); $memberObj = new Member($mysqli); $pollObj = new Poll($mysqli); if ($LOGGED_IN) { $intMenuAccessType = 1; } else { $intMenuAccessType = 2; } $arrMenuCategories = $menuCatObj->getCategories($intSectionNum, $intMenuAccessType); foreach ($arrMenuCategories as $menuCatID) { $menuCatObj->select($menuCatID); $menuCatInfo = $menuCatObj->get_info(); $arrMenuItems = $menuItemObj->getItems($menuCatInfo['menucategory_id'], $intMenuAccessType); if ($menuCatInfo['headertype'] == "image") { echo "<img src='" . $MAIN_ROOT . $menuCatInfo['headercode'] . "' class='menuHeaderImg'><br>"; } else { $menuCatInfo['headercode'] = str_replace("[MAIN_ROOT]", $MAIN_ROOT, $menuCatInfo['headercode']); $menuCatInfo['headercode'] = str_replace("[MEMBER_ID]", $arrLoginInfo['memberID'], $menuCatInfo['headercode']); $menuCatInfo['headercode'] = str_replace("[MEMBERUSERNAME]", $arrLoginInfo['memberUsername'], $menuCatInfo['headercode']); $menuCatInfo['headercode'] = str_replace("[MEMBERRANK]", $arrLoginInfo['memberRank'], $menuCatInfo['headercode']); $menuCatInfo['headercode'] = str_replace("[PMLINK]", $arrLoginInfo['pmLink'], $menuCatInfo['headercode']); echo $menuCatInfo['headercode']; } foreach ($arrMenuItems as $menuItemID) { $menuItemObj->select($menuItemID); $menuItemInfo = $menuItemObj->get_info(); $menuItemInfo['itemtype'] = $menuItemInfo['itemtype'] == "customcode" || $menuItemInfo['itemtype'] == "customformat" ? "customblock" : $menuItemInfo['itemtype']; switch ($menuItemInfo['itemtype']) { case "link": $menuItemObj->objLink->select($menuItemInfo['itemtype_id']); $menuLinkInfo = $menuItemObj->objLink->get_info(); $checkURL = parse_url($menuLinkInfo['link']); if (!isset($checkURL['scheme']) || ($checkURL['scheme'] = "")) { $menuLinkInfo['link'] = $MAIN_ROOT . $menuLinkInfo['link']; } echo "<div style='text-align: " . $menuLinkInfo['textalign'] . "'> " . $menuLinkInfo['prefix'] . "<a href='" . $menuLinkInfo['link'] . "' target='" . $menuLinkInfo['linktarget'] . "'>" . $menuItemInfo['name'] . "</a></div>"; break; case "top-players": $dispTopPlayers = unserialize(SPECIAL_MENU_ITEM); echo $dispTopPlayers['top-players']; break; case "customform": $menuItemObj->objCustomPage->select($menuItemInfo['itemtype_id']); $menuCustomFormInfo = $menuItemObj->objCustomPage->get_info(); $customFormObj->select($menuCustomFormInfo['custompage_id']); echo "<div style='text-align: " . $menuCustomFormInfo['textalign'] . "'> " . $menuCustomFormInfo['prefix'] . "<a href='" . $MAIN_ROOT . "customform.php?pID=" . $menuCustomFormInfo['custompage_id'] . "' target='" . $menuCustomFormInfo['linktarget'] . "'>" . $customFormObj->get_info_filtered("name") . "</a></div>"; break; case "custompage": $menuItemObj->objCustomPage->select($menuItemInfo['itemtype_id']); $menuCustomPageInfo = $menuItemObj->objCustomPage->get_info(); $customPageObj->select($menuCustomPageInfo['custompage_id']); echo "<div style='text-align: " . $menuCustomPageInfo['textalign'] . "'> " . $menuCustomPageInfo['prefix'] . "<a href='" . $MAIN_ROOT . "custompage.php?pID=" . $menuCustomPageInfo['custompage_id'] . "' target='" . $menuCustomPageInfo['linktarget'] . "'>" . $customPageObj->get_info_filtered("pagename") . "</a></div>"; break; case "downloads": $menuItemObj->objCustomPage->select($menuItemInfo['itemtype_id']); $menuDownloadLinkInfo = $menuItemObj->objCustomPage->get_info(); $downloadCatObj->select($menuDownloadLinkInfo['custompage_id']); echo "<div style='text-align: " . $menuDownloadLinkInfo['textalign'] . "'> " . $menuDownloadLinkInfo['prefix'] . "<a href='" . $MAIN_ROOT . "downloads/index.php?catID=" . $menuDownloadLinkInfo['custompage_id'] . "' target='" . $menuDownloadLinkInfo['linktarget'] . "'>" . $downloadCatObj->get_info_filtered("name") . "</a></div>"; break; case "customblock": $menuItemObj->objCustomBlock->select($menuItemInfo['itemtype_id']); $menuCustomBlockInfo = $menuItemObj->objCustomBlock->get_info(); $menuCustomBlockInfo['code'] = str_replace("[MAIN_ROOT]", $MAIN_ROOT, $menuCustomBlockInfo['code']); $menuCustomBlockInfo['code'] = str_replace("[MEMBER_ID]", $arrLoginInfo['memberID'], $menuCustomBlockInfo['code']); $menuCustomBlockInfo['code'] = str_replace("[MEMBERUSERNAME]", $arrLoginInfo['memberUsername'], $menuCustomBlockInfo['code']); $menuCustomBlockInfo['code'] = str_replace("[MEMBERRANK]", $arrLoginInfo['memberRank'], $menuCustomBlockInfo['code']); $menuCustomBlockInfo['code'] = str_replace("[PMLINK]", $arrLoginInfo['pmLink'], $menuCustomBlockInfo['code']); echo $menuCustomBlockInfo['code']; break; case "image": $menuItemObj->objImage->select($menuItemInfo['itemtype_id']); $menuImageInfo = $menuItemObj->objImage->get_info(); $checkURL = parse_url($menuItemInfo['imageurl']); if (!isset($checkURL['scheme']) || ($checkURL['scheme'] = "")) { $menuImageInfo['imageurl'] = $MAIN_ROOT . $menuImageInfo['imageurl']; } $dispSetWidth = ""; if ($menuImageInfo['width'] != 0) { $dispSetWidth = "width: " . $menuImageInfo['width'] . "px; "; } $dispSetHeight = ""; if ($menuImageInfo['height'] != 0) { $dispSetHeight = "height: " . $menuImageInfo['height'] . "px; "; } echo "<div style='text-align: " . $menuImageInfo['imagealign'] . "; margin-top: 15px; margin-bottom: 15px'>"; if ($menuImageInfo['link'] != "") { $checkURL = parse_url($menuImageInfo['link']); if (!isset($checkURL['scheme']) || ($checkURL['scheme'] = "")) { $menuImageInfo['link'] = $MAIN_ROOT . $menuImageInfo['link']; } echo "<a href='" . $menuImageInfo['link'] . "' target='" . $menuImageInfo['linktarget'] . "'><img src='" . $menuImageInfo['imageurl'] . "' style='" . $dispSetWidth . $dispSetHeight . "' title='" . $menuItemInfo['name'] . "'></a>"; } else { echo "<img src='" . $menuImageInfo['imageurl'] . "' title='" . $menuItemInfo['name'] . "' style='" . $dispSetWidth . $dispSetHeight . "'>"; } echo "</div>"; break; case "shoutbox": $menuItemObj->objShoutbox->select($menuItemInfo['itemtype_id']); $menuShoutboxInfo = $menuItemObj->objShoutbox->get_info(); if ($menuShoutboxInfo['width'] == 0) { $menuShoutboxInfo['width'] = "145"; } $blnShoutboxWidthPercent = false; if ($menuShoutboxInfo['percentwidth'] == 1) { $blnShoutboxWidthPercent = true; } if ($menuShoutboxInfo['height'] == 0) { $menuShoutboxInfo['height'] = "300"; } $blnShoutboxHeightPercent = false; if ($menuShoutboxInfo['percentheight'] == 1) { $blnShoutboxHeightPercent = true; } $mainShoutboxObj = new Shoutbox($mysqli, "news", "news_id"); $newShoutBoxID = uniqid("mainShoutBox_"); $arrShoutBoxIDs[] = $newShoutBoxID; $mainShoutboxObj->strDivID = $newShoutBoxID; $mainShoutboxObj->intDispWidth = $setShoutBoxWidth; $mainShoutboxObj->intDispHeight = $setShoutBoxHeight; $mainShoutboxObj->strEditLink = $shoutBoxEditLink; $mainShoutboxObj->strDeleteLink = $shoutBoxDeleteLink; $mainShoutboxObj->strPostLink = $shoutBoxPostLink; echo $mainShoutboxObj->dispShoutbox($menuShoutboxInfo['width'], $menuShoutboxInfo['height'], $blnShoutboxWidthPercent, $menuShoutboxInfo['textboxwidth'], $blnShoutboxHeightPercent); echo "\n\t\t\t\t\t\n\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\t\t\t\$('#" . $newShoutBoxID . "').animate({\n\t\t\t\t\t\t\t\t\t\tscrollTop:\$('#" . $newShoutBoxID . "')[0].scrollHeight\n\t\t\t\t\t\t\t\t\t}, 1000);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\$('#" . $newShoutBoxID . "_message').keypress(function(eventObj) {\n\t\t\t\t\t\t\t\t\tif(eventObj.which == 13) {\n\t\t\t\t\t\t\t\t\t\tif(\$('#" . $newShoutBoxID . "_message').val() != \"\") {\n\t\t\t\t\t\t\t\t\t\t\t\$('#" . $newShoutBoxID . "_postShoutbox input[type=button]').click();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t</script>\n\t\t\t\t\t\n\t\t\t\t\t"; break; case "newestmembers": $dispNewMembers = unserialize(SPECIAL_MENU_ITEM); echo $dispNewMembers['newmembers']; break; case "forumactivity": $dispNewMembers = unserialize(SPECIAL_MENU_ITEM); echo $dispNewMembers['forumactivity']; break; case "login": echo constant("LOGIN_BOX"); break; case "poll": $pollObj->select($menuItemInfo['itemtype_id']); $memberObj->select($_SESSION['btUsername']); $pollObj->dispPollMenu($memberObj); break; } } echo "<br>"; } echo "</div>"; }
* Bluethrust Clan Scripts v4 * Copyright 2014 * * Author: Bluethrust Web Development * E-mail: support@bluethrust.com * Website: http://www.bluethrust.com * * License: http://www.bluethrust.com/license.php * */ $prevFolder = "../../../../"; include_once "../../../../_setup.php"; $consoleObj = new ConsoleOption($mysqli); $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $menuCatObj = new MenuCategory($mysqli); $cID = $consoleObj->findConsoleIDByName("Manage Menu Categories"); $consoleObj->select($cID); $_GET['cID'] = $cID; if ($member->authorizeLogin($_SESSION['btPassword'])) { $memberInfo = $member->get_info_filtered(); if ($member->hasAccess($consoleObj) && $menuCatObj->select($_POST['mcID'])) { $menuCatInfo = $menuCatObj->get_info_filtered(); $result = $mysqli->query("SELECT menuitem_id FROM " . $dbprefix . "menu_item WHERE menucategory_id = '" . $menuCatInfo['menucategory_id'] . "'"); if ($result->num_rows > 0) { echo "<div id='newDeleteMessage' style='display: none'><p align='center'>There are currently menu items under the menu category <b>" . $menuCatInfo['name'] . "</b>. Please move all menu items out of this category before deleting it.</p></div>"; echo "\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\$('#deleteMessage').dialog('close');\n\t\t\t\t\t\t\$('#newDeleteMessage').dialog({\n\t\t\t\t\t\t\n\t\t\t\t\t\t\ttitle: 'Manage Menu Categories - Delete',\n\t\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\t\tzIndex: 9999,\n\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t\t'OK': function() {\n\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t"; } elseif ($_POST['confirm'] == "1") { $refreshSection = $menuCatObj->get_info("section"); $menuCatObj->delete(); $menuCatObj->resortOrder();