本文整理汇总了PHP中category::get方法的典型用法代码示例。如果您正苦于以下问题:PHP category::get方法的具体用法?PHP category::get怎么用?PHP category::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类category
的用法示例。
在下文中一共展示了category::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: categoryEdit
function categoryEdit()
{
$page = new page();
$categ = new category();
if (isset($_GET['cid']) and $_GET['cid'] != 0) {
$id = $_GET['cid'];
} else {
$id = 0;
}
$editthis = $categ->get($id);
$msg = $page->processCategory();
$get_all_categories = $categ->getAlltree($editthis['par_id']);
$page->printCategoryForm($get_all_categories, $editthis['name'], $id, $msg);
}
示例2: categories
public function categories()
{
if (!$this->user->is_logged_in()) {
redirect("/user/main/userLogin", 'location');
} else {
$category = new category(-1);
$data['objects'] = $category->get();
$data['id_user'] = $this->user->get_id();
$this->show->set_user_backend();
$this->show->user_backend('show_category_objects', $data);
}
}
示例3: fix_shardAction
public function fix_shardAction()
{
$category = new category();
$categories = $category->select($count, array('filter' => array('shard' => true)));
echo 'Total categories: ' . $count . '<br>';
if (is_array($categories) && count($categories)) {
foreach ($categories as $category) {
echo 'Fix shard: ' . $category->get('category') . '<br>';
$category->fix_shard($category->get('id'));
//sleeup(1);
}
}
die('ok');
}
示例4: watch_cat
private function watch_cat($data)
{
if ($this->user['SiteRank'] >= 4) {
if (isset($data['cat'])) {
$watchingStatus = false;
$key = 0;
$watchersCSV = '';
// Get category data
$category = category::get($data['cat']);
// Parse watching
$watchers = explode(',', $category['watching']);
// Check array
if (($key = array_search($this->user['Username'], $watchers)) !== false) {
unset($watchers[$key]);
$watchersCSV = implode(',', $watchers);
} else {
// Add user to watching
$watchingStatus = true;
array_push($watchers, $this->user['Username']);
$watchersCSV = implode(',', $watchers);
}
// Update DB
category::watch($category['id'], $watchersCSV);
json::resp(array('success' => true, 'watching' => $watchingStatus));
}
}
}