本文整理汇总了PHP中CTag::load方法的典型用法代码示例。如果您正苦于以下问题:PHP CTag::load方法的具体用法?PHP CTag::load怎么用?PHP CTag::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTag
的用法示例。
在下文中一共展示了CTag::load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CTag
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
* @link http://www.mediboard.org
*/
$tag_name = CValue::get("name");
$no_item = CValue::get("no_item");
$parent_id = CValue::get("parent_id");
$is_child = CValue::get("is_child");
$page = CValue::get("page", "0");
$object_class = CValue::get("object_class");
$limit = 15;
$tag_parent = new CTag();
if ($parent_id) {
$tag_parent->load($parent_id);
}
// $tag
$tag = new CTag();
$tag->canDo();
$order = "name";
$where = array();
$where["object_class"] = " = '{$object_class}'";
if ($is_child) {
$where["parent_id"] = " IS NOT NULL";
$order = "parent_id, name";
}
if ($parent_id) {
$where["parent_id"] = " = '{$parent_id}'";
}
if ($tag_name) {
示例2: elseif
}
$count_children = $object->_totalSeek;
} elseif (strpos($tag_id, "none") === 0) {
$parts = explode("-", $tag_id);
$object_class = $parts[1];
$tag->object_class = $object_class;
$object = new $object_class();
$where["tag_item_id"] = "IS NULL";
$ljoin = array("tag_item" => "tag_item.object_id = {$object->_spec->table}.{$object->_spec->key} AND tag_item.object_class = '{$object_class}'");
if (!$keywords) {
$keywords = "%";
}
$objects = $object->seek($keywords, $where, 10000, true, $ljoin);
$count_children = $object->_totalSeek;
} else {
$tag->load($tag_id);
$count_children = $tag->countChildren();
$objects = $tag->getObjects($keywords);
// filter by group_id
if ($group_id) {
foreach ($objects as $_id => $_object) {
if ($_object->group_id && $_object->group_id != $group_id) {
unset($objects[$_id]);
}
}
}
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("objects", $objects);
$smarty->assign("columns", $columns);
示例3: CTag
<?php
/**
* $Id$
*
* @package Mediboard
* @subpackage System
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
*/
$object_class = CValue::get("object_class");
$parent_tag_id = CValue::get("parent_tag_id");
$columns = CValue::get("col");
$group_id = CValue::get("group_id");
$parent_tag = new CTag();
$parent_tag->load($parent_tag_id);
$tree = CTag::getTree($object_class, $parent_tag);
$smarty = new CSmartyDP();
$smarty->assign("tree", $tree);
$smarty->assign("object_class", $object_class);
$smarty->assign("parent_tag", $parent_tag);
$smarty->assign("root", !$parent_tag->_id);
$smarty->assign("columns", $columns);
$smarty->assign("group_id", $group_id);
$smarty->display("inc_object_tag_tree.tpl");