本文整理汇总了PHP中categories函数的典型用法代码示例。如果您正苦于以下问题:PHP categories函数的具体用法?PHP categories怎么用?PHP categories使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了categories函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: categories
/**
* menu - Visszaadja a menuspositions (menupos) id szerint
* a men�pontokat almen�ivel egy�tt.
*
* Amennyiben a $menupos param�ter �rt�ke 0,
* akkor a teljes men�szerkezetet k�rdezi le.
* Az $onlyactive param�terrel TRUE eset�n
* csak az akt�v men�pontok alszintjeit
* olvassa be, FALSE eset�n pedig azokat is,
* amelyek f� �ga nem lett kiv�lasztva, magyarul
* a menupozici�hoz tartoz� teljes fastrukt�r�t.
* $type vagy index vagy admin lehet, att�l f�gg�en,
* hogy melyik r�szen szeretn�nk a men�t lek�rdezni.
* ha nem adunk meg semmit, akkor a teljes men�t lek�rdezi.
*
* @param boolean $onlyactive
* @param int $parent
* @param mixed $lang
* @param int $active - csak az aktiv menuk (1) vagy az inaktivak is (0)
*
* @access public
*
* @return void
*/
function categories($onlyactive = TRUE, $parent = 0, $level = 1, $lang = NULL, $active = 1)
{
global $mdb2, $aktiv_categories;
//nyelvnel a lekerdezeshez szukseges mezo
if ($lang == NULL) {
$query_lang = " AND c.lang = '" . $_SESSION['site_lang'] . "'";
} elseif ($lang == "all") {
$query_lang = "";
} else {
$query_lang = " AND c.lang = '{$lang}'";
}
//aktiv meghatarozasa
if ($active == 1) {
$query_active = " AND c.is_active= 1 ";
} else {
$query_active = "";
}
$menuk = array();
$categories = array();
$i = 0;
$query = "\n\t\tSELECT c.category_id AS cid, c.category_name AS cname, c.category_desc AS cdesc, c.parent AS cparent, c.is_active AS isact, \n\t\t\tc.lang AS clang, u1.name AS adduser, c.add_date AS adddate, u2.name AS moduser, c.mod_date AS moddate \n\t\tFROM iShark_Shop_Category c \n\t\tLEFT JOIN iShark_Users u1 ON u1.user_id = c.add_user_id \n\t\tLEFT JOIN iShark_Users u2 ON u2.user_id = c.mod_user_id \n\t\tWHERE c.parent = {$parent} {$query_lang} {$query_active}\n\t";
//ha ABC szerint rendezzuk sorba
if ($_SESSION['site_shop_ordertype'] == 1) {
$query .= "\n\t\t\tORDER BY c.category_name, c.parent, c.lang\n\t\t";
}
//ha egyedi sorrend szerint rendezzuk
if ($_SESSION['site_shop_ordertype'] == 2) {
$query .= "\n\t\t\tORDER BY c.sortorder, c.parent, c.lang\n\t\t";
}
$result =& $mdb2->query($query);
while ($row = $result->fetchRow()) {
$query2 = "\n\t\t\tSELECT parent \n\t\t\tFROM iShark_Shop_Category \n\t\t\tWHERE parent = " . $row['cid'] . "\n\t\t";
$result2 = $mdb2->query($query2);
$aktiv = isset($aktiv_categories[$row['cid']]);
$almenuk = array();
if ($aktiv || !$onlyactive) {
$almenuk = categories($onlyactive, $row['cid'], $level + 1, $lang, $active);
}
if ($result2->numRows() > 0) {
$categories[$i]['is_sub'] = '1';
}
$categories[$i]['title'] = $row['cname'];
$categories[$i]['clang'] = $row['clang'];
$categories[$i]['level'] = $level;
$categories[$i]['cid'] = $row['cid'];
$categories[$i]['cparent'] = $row['cparent'];
$categories[$i]['isact'] = $row['isact'];
$categories[$i]['ausr'] = $row['adduser'];
$categories[$i]['adate'] = $row['adddate'];
$categories[$i]['musr'] = $row['moduser'];
$categories[$i]['mdate'] = $row['moddate'];
if (!empty($almenuk)) {
$categories[$i]['element'] = $almenuk;
}
$i++;
}
return $categories;
}
示例2: categories
function categories($parent_id)
{
global $db;
$categories = array();
foreach ($db->query("SELECT category_id, category_name FROM " . config_item('cart', 'table_categories') . " WHERE parent_id = '" . $parent_id . "' ORDER BY category_name ASC") as $value) {
$categories[] = array('category_id' => $value['category_id'], 'category_name' => get_path($value['category_id']));
$categories = array_merge($categories, categories($value['category_id']));
}
return $categories;
}
示例3: onzip
function onzip($zipcode)
{
global $zip;
$zip = $zipcode;
$categories = categories($channel);
if ($channel == 'TEXT') {
$sayZip = $zip;
} else {
$sayZip = "<say-as interpret-as='vxml:digits'>{$zip}</say-as>";
}
$event = ask("<speak>What are you looking for in {$sayZip}?</speak>", array("choices" => $categories, 'voice' => 'allison', "onChoice" => create_function('$event', 'onCategory($event->value);')));
}
示例4: gmdate
include_once('ressources/class.dansguardian.inc');
header("Pragma: no-cache");
header("Expires: 0");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
$user=new usersMenus();
if(!$user->AsSquidAdministrator){
$tpl=new templates();
echo "alert('".$tpl->javascript_parse_text("{ERROR_NO_PRIVS}").");";
exit;
}
if(isset($_GET["popup"])){popup();exit;}
if(isset($_GET["status"])){status();exit;}
if(isset($_GET["categories"])){categories();exit;}
if(isset($_GET["cat-search"])){categories_search();exit;}
js();
function status(){
$q=new mysql();
$page=CurrentPageName();
$tpl=new templates();
$total=FormatNumber($q->COUNT_ROWS("dansguardian_community_categories","artica_backup"),0,'.',' ',3);
$sql="SELECT count(*) as tcount FROM `dansguardian_sitesinfos` WHERE `dbpath` = ''";
$ligne=@mysql_fetch_array($q->QUERY_SQL($sql,'artica_backup'));
示例5: categories
public function categories()
{
$attributes = $this->attributes();
$attributes['_content'] = $this->content();
return categories($attributes);
}
示例6: categories
?>
</div>
</div>
</div>
<!-- on ne peut pas commenter si on n'est pas connecté -->
<?php
if (verifco($mdp, $id_utilisateur) == TRUE) {
?>
<div class="bandeaubas" style="height:175px;text-align:left;">
<div class="bandeauhaut" style="height:50%">
<div class="bandeauhaut" style="height:25%">
Catégorie d'événement:
</div>
<div class="bandeaubas" style="height:75%; margin-top:5px; font-weight:normal;">
<?php
categories($Event_id);
?>
</div>
</div>
<div class="bandeaubas" style="height:50%">
<div class="bleft" style="width:75%; height:100%">
<div class="bandeauhaut" style="height:25%;">
Ils y participent
</div>
<div class="bandeaubas" style="height:75%;">
<div class="carroussel">
<?php
carrousselprofiles();
?>
</div>
示例7: explode
<td class='block'> </td>
</tr>
<tr>
<td><input type='text' name='search' size='30' maxlength='50' value='<?php
$trova;
?>
'></td>
<td>
<?php
$category = !isset($_GET["category"]) ? 0 : explode(";", (int) $_GET["category"]);
if (is_array($category)) {
$category = array_map("intval", $category);
} else {
$category = 0;
}
categories($category[0]);
if (isset($_GET["active"])) {
$active = intval($_GET["active"]);
} else {
$active = 1;
}
// all
if ($active == 0) {
$where = " WHERE 1 = 1";
$addparam .= "active=0";
} elseif ($active == 1) {
$where = " WHERE leechers + seeds > 0";
$addparam .= "active=1";
} elseif ($active == 2) {
$where = " WHERE leechers + seeds = 0";
$addparam .= "active=2";
示例8: SetTime
Views <?php
echo $video['views'];
?>
<br />
Duration <?php
echo SetTime($video['duration']);
?>
</tr>
</table>
<hr size="1" noshade>
]]>
</description>
<category><?php
echo strip_tags(categories($video['category'], 'video'));
?>
</category>
<guid isPermaLink="true"><?php
echo video_link($video);
?>
</guid>
<pubDate><?php
echo $video['date_added'];
?>
</pubDate>
<media:player url="<?php
echo video_link($video);
?>
" />
<media:thumbnail url="<?php
示例9: Smarty
require $smarty_dir . '/libs/Smarty.class.php';
$smarty = new Smarty();
$smarty->template_dir = $smarty_dir . 'templates';
$smarty->compile_dir = $smarty_dir . 'templates_c';
$smarty->cache_dir = $smarty_dir . 'cache';
$smarty->config_dir = $smarty_dir . 'configs';
$str = file_get_contents('config.txt');
$config = parse_ini_string($str, true);
// возвращаем файл config.txt в виде массива
$hostName = $config['hostName'];
$userName = $config['userName'];
$dbPassword = $config['dbPassword'];
$dbName = $config['dbName'];
require_once 'functions.php';
$dbc = db_connect($hostName, $userName, $dbPassword, $dbName);
$categories = categories($dbc);
$cities = cities($dbc);
$formParams = prepareAD($data = null, $head = 'Страница добавления объявления', $button = 'Далее');
$adStore = adStore($dbc);
$id = isset($_GET['id']) ? $_GET['id'] : '';
if (isset($_GET['id'])) {
$ad = $adStore[$id];
$formParams = prepareAD($ad, $head = 'Страница редактирования', $button = 'Готово');
} else {
if (isset($_GET['del'])) {
$id_for_del = $_GET['del'];
del($id_for_del, $dbc);
header('Location: index.php');
}
if (isset($_POST['main_form_submit'])) {
$uns = isset($adStore) ? $adStore : array();
示例10: endOutput
function endOutput()
{
global $BASEURL, $user_id, $TRACKER_ANNOUNCEURLS;
?>
</center>
<?php
echo "<center>" . INSERT_DATA . "<br /><br />";
echo " " . ANNOUNCE_URL . "<br /><b>";
foreach ($TRACKER_ANNOUNCEURLS as $taurl) {
echo $taurl . '<br />';
}
echo "</b><br /></center>";
?>
<form name='upload' method='post' enctype='multipart/form-data'>
<table class='lista' align='center'>
<tr>
<td class='header'><?php
echo TORRENT_FILE;
?>
</td>
<td class='lista' align='left'>
<?php
if (function_exists("sha1")) {
echo "<input type='file' name='torrent'>";
} else {
echo "<i>" . NO_SHA_NO_UP . "</i>";
}
?>
</td>
</tr>
<?php
echo "<tr><td class='header'>" . CATEGORY_FULL . "</td><td class='lista' align='left'>";
categories($category[0]);
echo "</td></tr>";
?>
<tr>
<td class='header'><?php
echo FILE_NAME;
?>
</td>
<td class='lista' align='left'><input type='text' name='filename' size='50' maxlength='200' /></td>
</tr>
<tr>
<td class='header' valign='top'><?php
echo DESCRIPTION;
?>
</td>
<td class='lista' align='left'><?php
textbbcode("upload", "info");
?>
</td>
</tr>
<?php
print "<tr>\n <td colspan='2'><input type='hidden' name='user_id' size='50' value='" . $user_id . "' /></td>\n </tr>";
print "<tr>\n <td class='header'>" . TORRENT_ANONYMOUS . "</td>\n <td class='lista'> " . NO . "<input type='radio' name='anonymous' value='false' checked /> " . YES . "<input type='radio' name='anonymous' value='true' /></td>\n </tr>";
if (function_exists("sha1")) {
echo "<tr>\n <td class='lista' align='center' colspan='2'><input type='checkbox' name='autoset' value='enabled' disabled checked />" . TORRENT_CHECK . "</td>\n </tr>";
}
?>
<tr>
<td align='right'><input type='submit' value='<?php
echo FRM_SEND;
?>
' /></td>
<td align='left'><input type='reset' value='<?php
echo FRM_RESET;
?>
' /></td>
</tr>
</table>
</form>
<?php
print "</td></tr></table>";
block_end();
}
示例11: foreach
</a>
<?php
foreach (categories_nav() as $t) {
?>
<a href="<?php
echo $t['url'];
?>
" title="<?php
echo $t['catname'];
?>
"><?php
echo $t['catname'];
?>
</a>
<?php
foreach (categories($t['catid']) as $t1) {
?>
<a title="<?php
echo $t1['catname'];
?>
" href="<?php
echo $t1['url'];
?>
"><?php
echo $t1['catname'];
?>
</a>
<?php
}
}
?>
示例12: foreach
<span></span>
<li><a title="<?php
echo $t4['catname'];
?>
" href="<?php
echo $t4['url'];
?>
"><?php
echo $t4['catname'];
?>
</a>
<?php
if (count(categories($t4['catid']))) {
?>
<ul><?php
foreach (categories($t4['catid']) as $t5) {
?>
<span></span>
<li><a title="<?php
echo $t5['catname'];
?>
" href="<?php
echo $t5['url'];
?>
"><?php
echo $t5['catname'];
?>
</a></li>
<?php
}
?>
示例13: tr_date
olabilir.
</div>
<?php
}
?>
</div>
<div class="post post-info">
<span class="date">
<?php
echo tr_date('d F Y', $created_at->sec);
?>
</span>
<span class="category">
<?php
echo categories($categories);
?>
</span>
<span class="tags">
<?php
echo tags($tags);
?>
</span>
<span class="read">
<?php
echo $counter;
?>
kez okundu.
</span>
</div>
示例14: defined
defined('_JEXEC') or die('Restricted Access');
require_once JApplicationHelper::getPath('admin_html');
JTable::addIncludePath(JPATH_COMPONENT . DS . 'tables');
switch ($task) {
case 'conf':
conf($option);
break;
case 'saveconf':
saveconf($option, $task);
break;
case 'prune':
pruneclassified();
break;
case 'categories':
categories($option);
break;
case 'add':
case 'edit':
editClassified($option);
break;
case 'apply':
case 'save':
saveClassified($option, $task);
break;
case 'remove':
removeClassifieds($option);
break;
case 'addcategory':
case 'editcategory':
editCategory();
示例15: logger
//loggolas
logger($page . '_' . $sub_act);
//visszadobjuk a lista oldalra - ha keresesbol jon, akkor oda
if (isset($_REQUEST['s']) && is_numeric($_REQUEST['s']) && $_REQUEST['s'] == 1 && isset($_REQUEST['searchtext']) && isset($_REQUEST['searchtype'])) {
header('Location: admin.php?p=' . $module_name . '&act=sea&pageID=' . $page_id . '&searchtext=' . $_REQUEST['searchtext'] . '&searchtype=' . $_REQUEST['searchtype']);
exit;
} else {
header('Location: admin.php?p=' . $module_name . '&act=' . $page);
exit;
}
} else {
$acttpl = 'error';
$tpl->assign('errormsg', $locale->get('category_error_category_noexists'));
return;
}
}
//torles vege
/**
* ha a listat mutatjuk
*/
if ($sub_act == "lst") {
include_once $include_dir . '/function.classifieds.php';
if ($_SESSION['site_class_maxcat'] > $groupnums || $_SESSION['site_class_maxcat'] == 0) {
$add_new = array(array('link' => 'admin.php?p=' . $module_name . '&act=' . $page . '&sub_act=add', 'title' => $locale->get('category_title_category_add'), 'pic' => "add.jpg"));
$tpl->assign('add_new', $add_new);
}
//atadjuk a smarty-nak a kiirando cuccokat
$tpl->assign('category_list', categories(TRUE, 0, '', 0, 0));
//megadjuk a tpl file nevet, amit atadunk az admin.php-nek
$acttpl = "classifieds_categories_list";
}