本文整理汇总了PHP中category类的典型用法代码示例。如果您正苦于以下问题:PHP category类的具体用法?PHP category怎么用?PHP category使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了category类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: parent_link
function parent_link($categ_id, $categ_see)
{
global $charset;
global $base_path;
global $thesaurus_categories_show_empty_categ;
if ($categ_see) {
$categ = $categ_see;
} else {
$categ = $categ_id;
}
$tcateg = new category($categ);
if ($thesaurus_categories_show_empty_categ) {
$visible = true;
} else {
$visible = false;
}
if ($_SESSION["session_history"][$_SESSION["CURRENT"]]["QUERY"]["SEARCH_TYPE"] != "term_search" && $_SESSION["CURRENT"]) {
$no_rec_history = 1;
} else {
$no_rec_history = 0;
}
if ($tcateg->has_notices()) {
$link = "<a href='" . $base_path . "/catalog.php?categ=search&mode=1&aut_id={$categ}&etat=aut_search&aut_type=categ&no_rec_history={$no_rec_history}' target=_top><img src='{$base_path}/images/search.gif' border=0 align='absmiddle'></a>";
$visible = true;
}
$r = array("VISIBLE" => $visible, "LINK" => $link);
return $r;
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:28,代码来源:term_show.php
示例2: categoryList
function categoryList()
{
$page = new page();
$categ = new category();
$get_list = $categ->getAllList();
$page->printCategories($get_list);
}
开发者ID:nesoman,项目名称:zadaca1,代码行数:7,代码来源:categories.php
示例3: create
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
$cat = new category();
$cat->category = \Input::get('categoryname');
$cat->save();
return \Redirect::route('catesite')->with('alert', 'Category created successfully!');
}
开发者ID:devasanibharath,项目名称:Laravel-Complete-blog,代码行数:12,代码来源:CategoryController.php
示例4: list_all
function list_all()
{
$c = new category();
$all = $c->get_all_categories();
foreach ($all as $cc) {
echo $cc->get_cname() . "<BR/>";
}
}
开发者ID:shsirk,项目名称:htf,代码行数:8,代码来源:ctest.php
示例5: save
/**
* Saves an category into the database.
*
* @param \GamyGoody\Domain\category $category The category to save
*/
public function save(category $category)
{
$categoryData = array('cat_title' => $category->getTitle());
if ($category->getId()) {
// The category has already been saved : update it
$this->getDb()->update('category', $categoryData, array('cat_id' => $category->getId()));
} else {
// The category has never been saved : insert it
$this->getDb()->insert('category', $categoryData);
// Get the id of the newly created category and set it on the entity.
$id = $this->getDb()->lastInsertId();
$category->setId($id);
}
}
开发者ID:polytechlyon-isi2,项目名称:GamyGoody,代码行数:19,代码来源:CategoryDAO.php
示例6: getAllCategories
public function getAllCategories()
{
$aCategories = array();
$oConnection = new connection();
$sSQL = "SELECT TypeID\n\t\tFROM tbproducttype";
$oResult = $oConnection->query($sSQL);
while ($aRow = $oConnection->fetch_array($oResult)) {
$oCategory = new category();
$oCategory->load($aRow["TypeID"]);
$aCategories[] = $oCategory;
}
$oConnection->close_connection();
return $aCategories;
}
开发者ID:jfortes,项目名称:isotope,代码行数:14,代码来源:model_collection.php
示例7: 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);
}
开发者ID:nesoman,项目名称:zadaca1,代码行数:14,代码来源:edit_category.php
示例8: show_action
function show_action() {
$this->view->page=front::get('page')?front::get('page'):1;
$this->pagesize=config::get('list_pagesize');
$limit=(($this->view->page-1)*$this->pagesize).','.$this->pagesize;
$special=new special();
$this->view->special=$special->getrow('spid='.front::get('spid'));
$this->view->archive['title'] = $this->view->special['title'];
$this->view->pages=true;
$archive=new archive();
$archives=$archive->getrows('spid='.front::get('spid'),$limit);
foreach($archives as $order=>$arc) {
$archives[$order]['url']=archive::url($arc);
$archives[$order]['catname']=category::name($arc['catid']);
$archives[$order]['caturl']=category::url($arc['catid']);
$archives[$order]['adddate']= sdate($arc['adddate']);
$archives[$order]['stitle']= strip_tags($arc['title']);
}
$this->view->archives=$archives;
$this->view->record_count=$archive->rec_count('spid='.front::get('spid'));
front::$record_count=$this->view->record_count;
$this->view->spid=front::get('spid');
if (front::get('t') == 'wap') {
$this->out('wap/special_show.html');
return;
}
}
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:26,代码来源:special_act.php
示例9: getInstance
public static function getInstance()
{
if (is_null(category::$instance)) {
category::$instance = new category();
}
return category::$instance;
}
开发者ID:Ashaan,项目名称:phpgallery,代码行数:7,代码来源:category.php
示例10: select
static function select($name,$value,$data,$option=null) {
$select="<select id=\"$name\" name=\"$name\" $option>";
if (!isset($data[0]) &&@$data[0] != null) {
$select.="<option value=\"0\">请选择...</option>";
}
if (@$data[0] == null ||(isset($data[0]) &&!$data[0]))
unset($data[0]);
if($_GET['table'] == 'category'){
$category = category::getInstance();
$subids = $category->sons($_GET['id']);
}
if($_GET['table'] == 'type'){
$category = type::getInstance();
$subids = $category->sons($_GET['id']);
}
foreach ($data as $k=>$d) {
$select .= "<option value=\"$k\"";
if($k == $value){
$select .= ' selected ';
}else if(isset($_GET['id']) && ($_GET['table'] == 'category' || $_GET['table'] == 'type') && !preg_match('/htmlrule/is', $name)){
if($_GET['id'] == $k || in_array($k,$subids)){
$select .= ' disabled ';
}
}
$select .= ">$d</option>";
//$select.="<option value=\"$k\" ".($k == $value ?'selected': '').">$d</option>";
}
$select.="</select>";
return $select;
}
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:30,代码来源:form.php
示例11: parent_link
function parent_link($categ_id, $categ_see)
{
global $charset;
global $base_path;
global $opac_show_empty_categ;
global $css;
global $msg;
if ($categ_see) {
$categ = $categ_see;
} else {
$categ = $categ_id;
}
//$tcateg = new category($categ);
if ($opac_show_empty_categ) {
$visible = true;
} else {
$visible = false;
}
if (category::has_notices($categ)) {
$link = "<a href='#' onClick=\"parent.parent.document.term_search_form.action='" . $base_path . "/index.php?lvl=categ_see&id={$categ}&rec_history=1'; parent.parent.document.term_search_form.submit(); return false;\" title='" . $msg["categ_see_alt"] . "'><img src='./images/search.gif' border=0 align='absmiddle'></a>";
$visible = true;
}
$r = array("VISIBLE" => $visible, "LINK" => $link);
return $r;
}
开发者ID:noble82,项目名称:proyectos-ULS,代码行数:25,代码来源:term_show.php
示例12: upload_thumb_action
function upload_thumb_action() {
$res=array();
$uploads=array();
if (is_array($_FILES)) {
$upload=new upload();
foreach ($_FILES as $name=>$file) {
if (!$file['name'] ||!preg_match('/\.(jpg|gif|png|bmp)$/',$file['name'])) {
continue;
}
$uploads[$name]=$upload->run($file);
if (empty($uploads[$name])) {
$res['error']=$name.lang('上传失败!');
break;
}
$res[$name]['name']=$uploads[$name];
$path=$upload->save_path;
chmod($path,0644);
$thumb=new thumb();
$thumb->set($path,'file');
$catid=get('catid');
$type=get('type');
if ($catid)
$thumb->create($path,category::getwidthofthumb($catid),category::getheightofthumb($catid));
else
$thumb->create($path,config::get('thumb_width'),config::get('thumb_height'));
$_name=str_replace('_upload','',$name);
$res[$name]['code']="
document.form1.$_name.value=data[key].name;
image_preview('$_name',data[key].name);
";
}
}
echo json::encode($res);
}
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:34,代码来源:tool_act.php
示例13: Index
public function Index()
{
$nva = M('category')->select();
$cate = category::zifenleis($nva);
$this->assign('cate', $cate);
S('index', $cate, 10);
$this->display('Widget:Cate');
}
开发者ID:joker2580136,项目名称:KyoMiniBlog,代码行数:8,代码来源:CateWidget.class.php
示例14: ctsitemap_action
function ctsitemap_action(){
$category = category::getInstance();
$category->sitemap();
front::flash('生成网站地图成功');
front::redirect(front::$from);
/*echo "<script>alert('生成网站地图成功!');window.close();</script>";
exit;*/
}
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:8,代码来源:cache_act.php
示例15: categories_list
function categories_list($data = '')
{
$output = '
<table bgcolor="' . COLOR_TABLE_GENERAL . '">
';
$query = "SELECT * FROM `categories` WHERE `deleted`='0' ORDER BY id ASC";
$res = common_query($query, __FILE__, __LINE__);
if (!$res) {
return '';
}
$i = 0;
while ($arr = mysql_fetch_array($res)) {
$i++;
$catid = $arr['id'];
$cat = new category($catid);
$name = ucfirst($cat->name($_SESSION['language']));
$backcommand = "order_create1";
$bgcolor = get_db_data(__FILE__, __LINE__, $_SESSION['common_db'], 'categories', 'htmlcolor', $catid);
$link = 'orders.php?command=dish_list&data[category]=' . $catid;
if (isset($data['quantity']) && $data['quantity']) {
$link .= '&data[quantity]=' . $data['quantity'];
}
if (isset($data['priority']) && $data['priority']) {
$link .= '&data[priority]=' . $data['priority'];
}
if ($i % 2) {
$output .= '
<tr>';
}
$output .= '
<td bgcolor="' . $bgcolor . '" onclick="redir(\'' . $link . '\');return(false);">
<a href="' . $link . '">
<strong>' . $name . '</strong>
</a>
</td>';
if (($i + 1) % 2) {
$output .= '
</tr>';
}
}
$output .= '
</tbody>
</table>';
return $output;
}
开发者ID:jaimeivan,项目名称:smart-restaurant,代码行数:45,代码来源:categories_waiter.php
示例16: getCategoriesByGroup
/**
* Liefert ein array aller Kategorien, auf welche die angegebene Gruppe zugreifen darf
* @param int $groupId
* @return array
*/
public function getCategoriesByGroup($groupId)
{
$where = "groups = ? OR groups " . $this->dbcon->dbLike() . " ? OR groups " . $this->dbcon->dbLike() . " ? OR groups " . $this->dbcon->dbLike() . " ?";
$valueParams = array();
$valueParams[] = "{$groupId}";
$valueParams[] = "%;{$groupId};%";
$valueParams[] = "{$groupId};%";
$valueParams[] = "%;{$groupId}";
$list = $this->dbcon->fetch($this->dbcon->select($this->table, '*', $where, $valueParams), true);
$res = array();
foreach ($list as $listItem) {
$object = new category();
if ($object->createFromDbObject($listItem)) {
$res[$object->getId()] = $object;
}
}
return $res;
}
开发者ID:sea75300,项目名称:fanpresscm3,代码行数:23,代码来源:categoryList.php
示例17: __construct
function __construct($appid = null)
{
$this->cid = (int) $_GET['cid'];
$this->appid = iCMS_APP_ARTICLE;
$appid && ($this->appid = $appid);
$_GET['appid'] && ($this->appid = (int) $_GET['appid']);
$this->category_uri .= '&appid=' . $this->appid;
$this->category_furi .= '&appid=' . $this->appid;
parent::__construct($this->appid);
}
开发者ID:World3D,项目名称:iCMS,代码行数:10,代码来源:category.app.php
示例18: get_all_categories
public function get_all_categories()
{
$db = new Database();
if (!$db->connect()) {
return array();
}
if (!$db->select('categories', 'c_id,c_name')) {
return array();
}
$result = $db->getResult();
$categories = array();
foreach ($result as $output) {
$c = new category();
$c->set_category($output['c_id'], $output['c_name']);
array_push($categories, $c);
}
$db->disconnect();
return $categories;
}
开发者ID:shsirk,项目名称:htf,代码行数:19,代码来源:category.php
示例19: mod
function mod()
{
$clang = Yii::app()->lang;
if (!Permission::model()->hasGlobalPermission('panellist', 'update')) {
Yii::app()->setFlashMessage($clang->gT("You do not have sufficient rights to access this page."), 'error');
$this->getController()->redirect(array("admin/index"));
}
$clang = Yii::app()->lang;
$action = isset($_POST['action']) ? $_POST['action'] : '';
$aData = array();
$aViewUrls = array();
if (Permission::model()->hasGlobalPermission('', 'create')) {
if ($action == "editcategory") {
// Project details
$category_id = (int) Yii::app()->request->getPost("category_id");
$category_title = flattenText($_POST['category_title'], false, true, 'UTF-8', true);
$sort_order = flattenText($_POST['sort_order'], false, true, 'UTF-8', true);
$IsActive = flattenText(Yii::app()->request->getPost("IsActive"));
$is_Active = 0;
if ($IsActive) {
$is_Active = 1;
}
if ($category_title == '') {
$aViewUrls['message'] = array('title' => $clang->gT("Failed to add Category"), 'message' => $clang->gT("Category Name is invalid."), 'class' => 'warningheader');
} else {
$oUser = category::model()->findByPk($category_id);
$oUser->title = $category_title;
$oUser->sorder = $sort_order;
$oUser->IsActive = $is_Active;
$oUser->modified_date = Date('y-m-d h:i:s');
$NewCategory = $oUser->save();
if ($NewCategory) {
Yii::app()->setFlashMessage($clang->gT("Profile Category Updated successfully"));
$this->getController()->redirect(array("admin/profilecategory/index"));
}
}
} else {
if (isset($_POST['category_id'])) {
$aData['row'] = 0;
$aData['usr_arr'] = array();
// Project detail
$category_id = (int) Yii::app()->request->getPost("category_id");
$action = Yii::app()->request->getPost("action");
$sresult = profilecategoryview($category_id);
// only use in view_editcompany
$aData['category_id'] = $category_id;
$aData['mur'] = $sresult;
$this->_renderWrappedTemplate('panellist/category', 'editcategory_view', $aData);
return;
}
}
}
Yii::app()->setFlashMessage(Yii::app()->lang->gT("You do not have sufficient rights to access this page."), 'error');
$this->getController()->redirect(array("admin/profilecategory/index"));
}
开发者ID:jdbaltazar,项目名称:survey-office,代码行数:55,代码来源:profilecategory.php
示例20: search
public function search($params)
{
$query = Category::find();
$dataProvider = new ActiveDataProvider(['query' => $query]);
$query->andFilterWhere([Category::tableName() . '.status' => '0']);
$dataProvider->setSort(['defaultOrder' => ['Id' => SORT_DESC, 'name' => SORT_ASC]]);
$query->andFilterWhere([category::tableName() . '.status' => '0']);
if (!($this->load($params) && $this->validate())) {
return $dataProvider;
}
$query->andFilterWhere(['Id' => $this->Id, 'createdBy' => $this->createdBy, 'updatedBy' => $this->updatedBy, 'createdOn' => $this->createdOn, 'updatedOn' => $this->updatedOn, 'status' => $this->status, 'parentId' => $this->parentId, 'is_fg' => $this->is_fg, 'is_event' => $this->is_event]);
$query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'ip', $this->ip]);
return $dataProvider;
}
开发者ID:rajanishtimes,项目名称:partnerapi,代码行数:14,代码来源:CategoryTrashSearch.php
注:本文中的category类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论