当前位置: 首页>>代码示例>>PHP>>正文


PHP category类代码示例

本文整理汇总了PHP中category的典型用法代码示例。如果您正苦于以下问题:PHP category类的具体用法?PHP category怎么用?PHP category使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了category类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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&amp;data[category]=' . $catid;
        if (isset($data['quantity']) && $data['quantity']) {
            $link .= '&amp;data[quantity]=' . $data['quantity'];
        }
        if (isset($data['priority']) && $data['priority']) {
            $link .= '&amp;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


注:本文中的category类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。