function profile_db_upgrade_1() { icms_loadLanguageFile('core', 'user'); icms_loadLanguageFile('core', 'notification'); addStep(_MI_PROFILE_CAT_BASEINFO, '', 1, 0); addStep(_MI_PROFILE_CAT_EXTINFO, '', 2, 1); addCategory(_MI_PROFILE_CAT_PERSONAL, 1); addCategory(_MI_PROFILE_CAT_MESSAGING, 3); addCategory(_MI_PROFILE_CAT_SETTINGS1, 4); addCategory(_MI_PROFILE_CAT_COMMUNITY, 2); include_once ICMS_ROOT_PATH . '/include/notification_constants.php'; $umode_options = array('nest' => _NESTED, 'flat' => _FLAT, 'thread' => _THREADED); $uorder_options = array(0 => _OLDESTFIRST, 1 => _NEWESTFIRST); $notify_mode_options = array(XOOPS_NOTIFICATION_MODE_SENDALWAYS => _NOT_MODE_SENDALWAYS, XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE => _NOT_MODE_SENDONCE, XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT => _NOT_MODE_SENDONCEPERLOGIN); $notify_method_options = array(XOOPS_NOTIFICATION_METHOD_DISABLE => _NOT_METHOD_DISABLE, XOOPS_NOTIFICATION_METHOD_PM => _NOT_METHOD_PM, XOOPS_NOTIFICATION_METHOD_EMAIL => _NOT_METHOD_EMAIL); $fieldid = addField('name', _US_REALNAME, '', 1, 'textbox', 1, 1, 1, array(), 1, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_from', _US_LOCATION, '', 1, 'location', 1, 2, 1, array(), 2, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_occ', _US_OCCUPATION, '', 1, 'textbox', 1, 3, 1, array(), 2, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_intrest', _US_INTEREST, '', 1, 'textbox', 1, 4, 1, array(), 2, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('bio', _US_EXTRAINFO, '', 1, 'textarea', 2, 5, 1, array(), 2, 0); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_aim', _US_AIM, '', 2, 'textbox', 1, 1, 1, array(), 2, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_icq', _US_ICQ, '', 2, 'textbox', 1, 2, 1, array(), 2, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_msnm', _US_MSNM, '', 2, 'textbox', 1, 3, 1, array(), 2, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_yim', _US_YIM, '', 2, 'textbox', 1, 4, 1, array(), 2, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_viewemail', _US_ALLOWVIEWEMAIL, '', 3, 'yesno', 3, 1, 1, array(), 1, 1); $fieldid = addField('attachsig', _US_SHOWSIG, '', 3, 'yesno', 3, 2, 1, array(), 0, 1); $fieldid = addField('user_mailok', _US_MAILOK, '', 3, 'yesno', 3, 3, 1, array(), 1, 1); $fieldid = addField('theme', _US_SELECT_THEME, '', 3, 'theme', 1, 4, 1, array(), 0, 0); $fieldid = addField('language', _US_SELECT_LANG, '', 3, 'language', 1, 5, 1, array(), 0, 0); $fieldid = addField('umode', _US_CDISPLAYMODE, '', 3, 'select', 3, 6, 1, $umode_options, 0, 0); $fieldid = addField('uorder', _US_CSORTORDER, '', 3, 'select', 3, 7, 1, $uorder_options, 0, 0); $fieldid = addField('notify_mode', _NOT_NOTIFYMODE, '', 3, 'select', 3, 8, 1, $notify_mode_options, 0, 0); $fieldid = addField('notify_method', _NOT_NOTIFYMETHOD, '', 3, 'select', 3, 9, 1, $notify_method_options, 0, 0); $fieldid = addField('timezone_offset', _US_TIMEZONE, '', 3, 'timezone', 1, 10, 1, array(), 2, 0); $fieldid = addField('user_viewoid', _US_ALLOWVIEWEMAILOPENID, '', 3, 'yesno', 3, 11, 0, array(), 1, 1); $fieldid = addField('url', _US_WEBSITE, '', 4, 'url', 1, 1, 1, array(), 1, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('posts', _US_POSTS, '', 4, 'textbox', 3, 2, 0, array(), 0, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('rank', _US_RANK, '', 4, 'rank', 3, 3, 1, array(), 0, 0); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_regdate', _US_MEMBERSINCE, '', 4, 'datetime', 3, 4, 0, array(), 0, 10); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('last_login', _US_LASTLOGIN, '', 4, 'datetime', 3, 5, 0, array(), 0, 10); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('openid', _US_OPENID_FORM_CAPTION, '', 4, 'textbox', 1, 6, 0, array(), 1, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN), 0); $fieldid = addField('user_sig', _US_SIGNATURE, '', 4, 'dhtml', 1, 7, 1, array(), 0, 0); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); return true; }
function load_ads($data) { $level = 1; $catid = 8; foreach ($data->category as $cat) { $catid = addCategory(['title' => ucfirst($cat), 'alias' => JFilterOutput::stringURLSafe(ucfirst($cat)), 'extension' => 'com_content', 'path' => JFilterOutput::stringURLSafe(ucfirst($cat)), 'published' => 1, 'created_time' => date('Y-m-d H:i:s'), 'created_user_id' => 657, 'language' => '*', 'level' => $level++, 'parent_id' => $catid]); } $ad = $data->ad; $ad->description = "<p>" . html_entity_decode($ad->description) . "</p>"; $dataMinicck = new stdClass(); $dataMinicck->ad = $ad; $dataMinicck->location = $data->location; $dataMinicck->person = $data->person; addArticle(array('id' => 0, 'title' => $ad->title, 'alias' => JFilterOutput::stringURLSafe($ad->title), 'catid' => $catid, 'state' => 1, 'introtext' => '', 'fulltext' => $ad->description, 'created' => date('Y-m-d H:i:s'), 'created_by' => 657, 'language' => '*'), $dataMinicck); }
$values = array("230", "220", "210", "200", "190", "180", "170", "160", "150", "140", "130", "120", "110", "100", "90", "80", "70", "60", "50"); $severities = array(3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3); $height = sizeof($severities) * CELL_HEIGHT; addCategory($name, $values, $severities, $height); // declare values and severities for the category // HEART RATE // $name = "HEART RATE"; $values = array(">140", "130", "120", "110", "100", "90", "80", "70", "60", "50", "40", "30"); $severities = array(3, 2, 2, 1, 1, 0, 0, 0, 0, 1, 3, 3); $height = sizeof($severities) * CELL_HEIGHT; addCategory($name, $values, $severities, $height); // declare values and severities for the category // CONSCIOUSNESS // $name = "Level of Consciousness"; $values = array("Alert", "V/P/U"); $severities = array(0, 3); $height = sizeof($severities) * CELL_HEIGHT; addCategory($name, $values, $severities, $height); ?> <!-- BLOOD SUGAR --> <?php echo '<div class="category" style="height:' . CELL_HEIGHT . 'px">'; ?> <table> <?php echo '<td class="titleContainer" bgcolor="' . BG_BLUE . '">'; ?> <table> <td class="bigTitle">BLOOD SUGAR</td> </table> </td>
<?php if ($_POST) { $name = post("name"); addCategory($name); } ?> <div class="row"> <div class="col-lg-12"> <h3 class="">Add Category</h3> <hr/> </div> <!-- /.col-lg-12 --> </div> <div class="row"> <div class="col-lg-6"> <form method="POST" action=""> <label>Category Name: </label> <input class="form-control" type="text" name="name" value="" /> <br/> <button class="btn btn-success btn-sm" type="submit">Create</button> <a href="<?php echo ADMIN_URL . '?view=categories'; ?> " class="btn btn-danger btn-sm">Cancel</a> </form> </div> <div class="col-lg-6"></div>
<?php if (LOGIN_FLG == 1) { $body = "カテゴリー追加<br/><br/>"; $name = isset($_POST['name']) ? $_POST['name'] : ''; $addSuccess = false; if (REQUEST_METHOD == 'POST') { if ($name == '') { setValidationMessage('name:nameは必ず入力してください'); } // 入力チェックエラーがなければ登録処理を行う if (!$globalValidationError) { $addSuccess = addCategory($name); } } // 入力チェックがあれば。もしくは登録失敗したら if ($globalValidationError || !$addSuccess) { // 失敗したら入力内容を表示 $aft = [$name]; $body .= categoryInputHtml($aft); $globalFormAction = WEB_ROOT . '/category_add'; $globalFormMethod = 'POST'; } else { if ($addSuccess) { $body .= '作成しました<br/>'; $body .= '<a href="' . WEB_ROOT . '/mgmt">メニューへ</a>'; } } } else { $body = 'file not found'; }
<?php include_once __DIR__ . '/templates/_libAdmin.php'; include_once __DIR__ . '/templates/_header.php'; include_once __DIR__ . '/templates/_top_menu.php'; echo "<div class='wr_cont'>"; if (isset($_GET['item_act'])) { if (isset($_GET['item_id'])) { $t_id = $_GET['item_id']; } switch ($_GET['item_act']) { case 'edit': editCategory($connection); echo "Категория с id='" . $t_id . "' успешно изменена<br/><br/>"; break; case 'del': deleteCategory($t_id, $connection); echo "Категория с id='" . $t_id . "' успешно удалена<br/><br/>"; break; case 'add': addCategory($connection); echo "Категория успешно добавлена<br/><br/>"; break; } } //вывод таблицы категорий на странице редактирования категорий showTableCategories($connection); echo "</div>"; include_once __DIR__ . '/templates/_footer.php';
break; case ACTION_DEL: $actionType = ACTION_DEL; checkNullwithRedirect(ADD_CATEGORY_PAGE, $_GET[CATEGORY_ID]); delCategory(); exit; break; case ACTION_ADD: default: break; } } checkNullwithRedirect(ADD_CATEGORY_PAGE, $_GET[CATEGORY_NAME]); checkNullwithRedirect(ADD_CATEGORY_PAGE, $_GET[SECTION_ID]); checkNullwithRedirect(ADD_CATEGORY_PAGE, $_GET[PARENT_CATEGORY_ID]); addCategory(); function addCategory() { // TODO : Escape String for SQL Statement $categoryName = $_GET[CATEGORY_NAME]; $sectionId = $_GET[SECTION_ID]; $parentCategoryId = $_GET[PARENT_CATEGORY_ID]; $redirectPage = CATEGORY_LIST_PAGE; $user = getUserInfo(); $role = $user->getRole(); $conn = DBConnection::getConnection($role); if ($conn) { $result = $conn->insertCategory($categoryName, $sectionId, $parentCategoryId); header("Location: {$redirectPage}"); exit; }
$entries = $_GET['entries']; } if (!empty($_POST['newCategory']) && Misc::isSpace($_POST['newCategory']) || !empty($_POST['modifyCategoryName']) && Misc::isSpace($_POST['modifyCategoryName'])) { $history = ''; $errorMessage = _t('공백문자는 카테고리 이름으로 사용할 수 없습니다'); } elseif (!empty($_POST['newCategory']) && strpos($_POST['newCategory'], '/') !== false || !empty($_POST['modifyCategoryName']) && strpos($_POST['modifyCategoryName'], '/') !== false) { $history = ''; $errorMessage = _t('슬래시가 들어간 카테고리 이름은 사용할 수 없습니다'); /*} elseif ((!empty($_POST['newCategory']) && strpos($_POST['newCategory'], '&') !== false) || (!empty($_POST['modifyCategoryName']) && strpos($_POST['modifyCategoryName'], '&') !== false)) { $history = ''; $errorMessage = _t('앰퍼샌드(&)가 들어간 카테고리 이름은 사용할 수 없습니다');*/ } elseif (!empty($_POST['newCategory']) && strpos($_POST['newCategory'], '?') !== false || !empty($_POST['modifyCategoryName']) && strpos($_POST['modifyCategoryName'], '?') !== false) { $history = ''; $errorMessage = _t('물음표가 들어간 카테고리 이름은 사용할 수 없습니다'); } elseif (!empty($_POST['newCategory'])) { $history = addCategory($blogid, $selected == 0 ? null : $_POST['id'], trim($_POST['newCategory'])) ? 'document.getElementById("newCategory").select();' : ''; if (empty($history)) { $errorMessage = _t('같은 이름의 카테고리가 이미 존재합니다'); } } else { if (!empty($_POST['modifyCategoryName']) || !empty($_POST['modifyCategoryBodyId'])) { $history = modifyCategory($blogid, $_POST['id'], trim($_POST['modifyCategoryName']), trim($_POST['modifyCategoryBodyId'])) ? 'document.getElementById("modifyCategoryName").select();' : ''; $tempParentId = POD::queryCell("SELECT `parent` FROM `{$database['prefix']}Categories` WHERE `id` = {$_POST['id']} AND `blogid` = " . getBlogId()); if (preg_match('/^[0-9]+$/', $tempParentId, $temp)) { $depth = 2; } else { $depth = 1; } } else { $history = ''; }
function checkRootCategoryExistence($blogid) { $pool = DBModel::getInstance(); $pool->reset('Categories'); $pool->setQualifier('blogid', 'eq', $blogid); $pool->setQualifier('id', 'eq', 0); $childCategories = $pool->getCount(); if (!$pool->getCount()) { $name = _text('전체'); $result = addCategory($blogid, null, $name, 0); return $result ? true : false; } return false; }
// Displaying the form to edit a category language info case "modtext": $categoryid = isset($_GET['categoryid']) ? intval($_GET['categoryid']) : 0; $languageid = isset($_GET['languageid']) ? $_GET['languageid'] : 'new'; xoops_cp_header(); editcat_text(true, $categoryid, $languageid); break; // Adding or editing a category in the db // Adding or editing a category in the db case "addcategory": addCategory(false); break; // Adding or editing a category language info in the db // Adding or editing a category language info in the db case "addcategory_text": addCategory(true); break; // deleting a category // deleting a category case "del": global $smartmedia_category_handler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $_GET; $module_id = $xoopsModule->getVar('mid'); $gperm_handler =& xoops_gethandler('groupperm'); $categoryid = isset($_POST['categoryid']) ? intval($_POST['categoryid']) : 0; $categoryid = isset($_GET['categoryid']) ? intval($_GET['categoryid']) : $categoryid; $categoryObj = $smartmedia_category_handler->get($categoryid); // Check to see if this item has children if ($categoryObj->hasChild()) { redirect_header("category.php", 3, _AM_SMEDIA_CATEGORY_CANNOT_DELETE_HAS_CHILD); exit; }
function addDefaultCategory($idProject) { return addCategory("Todo", $idProject); }
$myts =& MyTextSanitizer::getInstance(); $mytree = new XoopsTree($xoopsDB->prefix($mydirname . '_category'), 'cat_id', 'cat_pid'); $action = isset($_POST['action']) ? $_POST['action'] : ""; $action = isset($_GET['action']) ? $_GET['action'] : $action; switch ($action) { case "modCat": modifyCategory($_POST); break; case "modCatS": modifyCategoryS($_POST); break; case "modCatall": modifyCategoryAll(); break; case "addCat": addCategory($_POST); break; case "delCat": delCategory($_POST, $_GET); break; default: catManager(); break; } /* if (isset($_POST)) { foreach ($_POST as $k => $v) { ${$k} = $v; } }
/** * Queries the API by the input values from the user * * @param $term The search term to query * @param $location The location of the business to query */ function query_api($term, $location) { $response = json_decode(search($term, $location)); foreach ($response->businesses as $business) { $business_id = $business->id; $business_response = json_decode(get_business($business_id), true); $id = $business_response['id']; $name = $business_response['name']; $phone = $business_response['display_phone']; $address = $business_response['location']['address'][0]; $rating = $business_response['rating']; #$businessHours=$business_response[''] #$categories $reservationURL = $business_response['reservation_url']; $reviewCount = $business_response['review_count']; #$price $imageUrl = $business_response['image_url']; $city = $business_response['location']['city']; $postal_code = $business_response['location']['postal_code']; $snippet_text = $business_response['snippet_text']; $state = $business_response['location']['state_code']; $rating_img_url = $business_response['rating_img_url']; $rating_img_url_small = $business_response['rating_img_url_small']; $url = $business_response['url']; addRestaurant($id, $name, $phone, $address, $rating, $reservationURL, $reviewCount, $imageUrl, $city, $postal_code, $snippet_text, $state, $rating_img_url, $rating_img_url_small, $url); $categories = $business_response['categories']; foreach ($categories as $category) { $c1 = $category[0]; $c2 = $category[1]; //echo $c1 . ' ' . $c2; $cid = categoryID($c1, $c2); echo $cid; if ($cid < 0) { //category does not exist addCategory($c1, $c2); $cid = lastCategory(); } addRC($id, $cid); } } /* print sprintf( "%d businesses found, querying business info for the top result \"%s\"\n\n", count($response->businesses), $business_id ); $response = get_business($business_id); print sprintf("Result for business \"%s\" found:\n", $business_id); print "$response\n"; */ }
$size = sizeof($catNo); for ($i = 0; $i < $size; $i++) { updateCategory($catNo[$i], $catName[$i]); } } if (isset($newCatNo)) { $catNoTable = array(); foreach ($newCatNo as $i => $v) { if ($newCatNo[$i] == "") { continue; } $nCatParent = $newCatParent[$i]; if ($nCatParent[0] != 'C') { $nCatParent = $catNoTable[$nCatParent]; } $newIndex = addCategory($newCatName[$i], $nCatParent); $catNoTable[$newCatNo[$i]] = $newIndex; } } if (isset($dels)) { $size = sizeof($dels); for ($i = $size - 1; $i >= 0; $i--) { if ($dels[$i] == "") { continue; } if (!delOneCategory($dels[$i])) { //you cannot delete the category at this moment } } } $cats = getAllCategoriesNested();
<?php require_once 'config.php'; $session->requireAdmin(); if (!empty($_POST['lang'])) { addCategory(CATEGORY_LANGUAGE, $_POST['lang']); } require 'design_head.php'; ?> <h2>Add new language</h2> These languages already exist: <?php echo xhtmlSelectCategory(CATEGORY_LANGUAGE); ?> <br/><br/> <form method="post" action=""> language: <input type="text" name="lang"/> <input type="submit" class="button" value="Add"/> </form> <?php require 'design_foot.php';
function nzbmatrix($item, $nzbusername, $nzbapi, $saburl, $sabapikey) { $type = !empty($_GET['type']) ? "&catid=" . $_GET['type'] : ""; $search = "https://api.nzbmatrix.com/v1.1/search.php?search=" . urlencode($item) . $type . "&num=50&username="******"&apikey=" . $nzbapi; $content = file_get_contents($search); $itemArray = explode('|', $content); $table = ""; if ($itemArray["0"] != 'error:nothing_found') { foreach ($itemArray as &$x) { $item = explode(';', $x); if (isset($item[1])) { $id = "ID: " . substr($item[0], 6); $name = substr($item[1], 9); $link = "http://www." . substr($item[2], 6); $size = 0 + substr($item[3], 6); $size = $size; $cat = substr($item[6], 10); $addToSab = $saburl . "api?mode=addurl&name=http://www." . substr($link, 6) . "&nzbname=" . urlencode($name) . "&output=json&apikey=" . $sabapikey; $indexdate = "Index Date: " . substr($item[4], 12); $group = "Group: " . substr($item[7], 7); $comments = "Comments: " . substr($item[8], 10); $hits = "Hits: " . substr($item[9], 6); $nfo = "NFO: " . substr($item[10], 5); $weblink = substr($item[11], 9); $image = substr($item[13], 7); $item_desc = "<p>Name: " . $name . "</p><p>" . $id . "</p><p>" . $group . "</p><p>" . $comments . "</p><p>" . $hits . "</p><p>" . $nfo . "</p><p>" . $indexdate . "</p>"; $addToSab = addCategory($cat, $addToSab); if (strlen($name) != 0) { $table .= printTable($name, $cat, $size, $addToSab, $link, $item_desc, $image, $weblink); } } } } return $table; }
function checkRootCategoryExistence($blogid) { global $database; $sql = "SELECT count(*) FROM {$database['prefix']}Categories WHERE blogid = {$blogid} AND id = 0"; if (!POD::queryCell($sql)) { $name = _text('전체'); $result = addCategory($blogid, null, $name, 0); return $result ? true : false; } return false; }
<?php include_once "chart.php"; $chart = $_POST; if (!array_key_exists("chartId", $chart)) { $chart["chartId"] = "chart" . "-" . date("YmdHis") . str_pad(rand(0, 9999), 4, rand(0, 9), STR_PAD_LEFT); } echo addCategory($chart);
function parserss($xml, $rssCate) { global $DMC, $DBPrefix; $count_items = preg_match("/<pubDate>(.+?)<\\/pubDate>/is", $xml, $array_date); $count_items1 = preg_match("/<description>(.+?)<\\/description>/is", $xml, $array_desc); $count_items2 = preg_match("/<title>(.+?)<\\/title>/is", $xml, $array_title); $count_items3 = preg_match("/<category>(.+?)<\\/category>/is", $xml, $array_cate); if ($count_items != 0) { $title = addslashes($array_title[1]); if ($rssCate == "") { $catetitle = addslashes($array_cate[1]); $cateid = getFieldValue($DBPrefix . "categories", "name='{$catetitle}'", "id"); if ($cateid == "") { $cateid = addCategory($catetitle); } $category = $cateid; } else { $category = $rssCate; } if (preg_match("/[0-9]{4}-[0-9]{1,2}-[0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}/i", $array_date[1]) or strstr($array_date[1], "+0000")) { $posttime = str_to_time($array_date[1]); } else { $posttime = strtotime($array_date[1]); } $content = addslashes($array_desc[1]); //echo $array_date[1]." ===> ".format_time("L",$posttime)."<br>"; } return array('title' => $title, 'category' => $category, 'posttime' => $posttime, 'content' => $content); }
<?php session_start(); require_once "../inc/auth.php"; require_once "../inc/db.php"; require_once "../inc/utils.php"; require_once "../templates/topbar.php"; require_once "../templates/head.php"; require_once "../managers/category_manager.php"; $db = getDB(); if (isset($_GET["current_project_id"])) { $idProject = $_GET["current_project_id"]; } if (isset($_POST["category_name"]) && isset($_POST['id_project'])) { addCategory($_POST["category_name"], $_POST['id_project']); } ?> <div id="app"> <?php echo_head(); ?> <?php echo_topbar(); ?> <div><a href="../home.php">Retour</a></div> <div class="card-form">
if (isset($_GET['hitcounter'])) { XSRFdefender('hitcounter'); $x = $_zp_zenpage->getCategory(sanitize_numeric($_GET['id'])); $obj = new ZenpageCategory($x['titlelink']); $obj->set('hitcounter', 0); $obj->save(); } if (isset($_GET['publish'])) { XSRFdefender('update'); $obj = new ZenpageCategory(sanitize($_GET['titlelink'])); $obj->setShow(sanitize_numeric($_GET['publish'])); $obj->save(); } if (isset($_GET['save'])) { XSRFdefender('save_categories'); addCategory($reports); } if (isset($_GET['id'])) { $x = $_zp_zenpage->getCategory(sanitize_numeric($_GET['id'])); $result = new ZenpageCategory($x['titlelink']); } else { if (isset($_GET['update'])) { XSRFdefender('update_categories'); $result = updateCategory($reports); } else { $result = new ZenpageCategory(''); } } printAdminHeader('news', 'categories'); zp_apply_filter('texteditor_config', '', 'zenpage'); printSortableHead();
<?php chdir("../../database"); require_once "store_backoffice.php"; if (isset($_GET["storeId"]) and isset($_GET["category"]) and strlen($_GET["category"]) > 0) { $checkExists = checkCategory($_GET["category"], $_GET["storeId"]); if (!isset($checkExists[0]["id"])) { addCategory($_GET["category"], $_GET["storeId"], null); echo json_encode(array("result" => "ok")); } else { echo json_encode(array("result" => "category name in use")); } } else { echo json_encode(array("result" => "missingParams")); }
search($connection, "SELECT * FROM rating WHERE content LIKE '%{$textInput}%'", "rating"); break; case 34: search($connection, "SELECT * FROM rating WHERE title LIKE '%{$textInput}%'", "rating"); break; case 35: search($connection, "SELECT * FROM rating WHERE UserID LIKE '%{$textInput}%'", "rating"); break; case 40: delete($connection, "DELETE FROM categories WHERE ID='{$textInput}'", "categories", "ID", $textInput); break; case 41: search($connection, "SELECT * FROM categories WHERE type LIKE '%{$textInput}%'", "categories"); break; case 42: addCategory($connection, $textInput); break; case 511: check($connection, "SELECT username FROM users WHERE username='******'"); break; case 512: check($connection, "SELECT mail FROM users WHERE mail='{$textInput}'"); break; case 513: check($connection, "SELECT isActivated FROM users WHERE isActivated='\${$textInput}'"); break; case 514: check($connection, "SELECT isRetailer FROM users WHERE isRetailer='{$textInput}'"); break; case 521: check($connection, "SELECT isActivated FROM notice WHERE isActivated='{$textInput}'");
$category ); $result = $db->arrayQuery( $query ); if ( count($result) == 1 ) { // Category already exists // We add it to exisiting categories $availableCategories[$category] = $result[0]['id']; } else { // Category doesn't exist // Should we add it ? $response = addCategory($clusterIdentifier, $category); if ( $response !== false && is_numeric($response) ) { $availableCategories[$category] = $response; } } } $taxonomyToTreat = array(); foreach ( array_keys($taxonomies) as $taxonomyKey ) { $taxonomy = $taxonomies[$taxonomyKey]; if ( !isset( $availableCategories[$taxonomy['category']] ) )