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


PHP getCats函数代码示例

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


在下文中一共展示了getCats函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getTagsFilter

function getTagsFilter($catid)
{
    $items = getCats($catid);
    $catTags = array();
    $allTags = array();
    $tags = array();
    if (count($items)) {
        require_once JPATH_BASE . '/components/com_k2/models/item.php';
        $K2ModelItem = new K2ModelItem();
        foreach ($items as $item) {
            $catTags[] = $K2ModelItem->getItemTags($item->id);
        }
        if (!empty($catTags)) {
            foreach ($catTags as $catTag) {
                if (!empty($catTag)) {
                    foreach ($catTag as $tag) {
                        $allTags[] = $tag->name;
                    }
                }
            }
        }
        $tags = array_unique($allTags);
    }
    return $tags;
}
开发者ID:sankam-nikolya,项目名称:lptt,代码行数:25,代码来源:category.php

示例2: getCats

<input type="submit" name"search" value="Search"/>
</form>

</div>

</div>
<!-- navigation end!-->

<!--content wrapper start!-->
<div class="content_wrapper">
<!--sidebar!-->
<div class="sidebar">
<div class="sidebar_title">Categories</div>
<ul id="cats">
<?php 
getCats();
?>

</ul>

<div class="sidebar_title">Brands</div>
<ul id="cats">
<?php 
getBrands();
?>
</ul>
</div>

<div id="content_area">
<div id="shopping_cart">
 <span style=" font-size:10px;padding:10;" ><h1><center>
开发者ID:jain15506,项目名称:eco,代码行数:31,代码来源:all_products.php

示例3: getCats

<label>Post Content<span class="small">Enter the content</span> </label>
<textarea name="txtPostContent" cols="1" rows="1"></textarea>
<label>Post Status<span class="small">Select appropriate</span> </label>
<div class="selectchk">
	<div class="chk">
		<input name="radStatus" type="radio" value="1" /> Enable
	</div>
	<div class="chk">
		<input name="radStatus" type="radio" value="0" /> Disable
	</div>
</div>
<div class="clear"></div>
<label>Post Categories<span class="small">Unselect the categories</span> </label>
<div class="selectchk">
<?php 
        $all_cats = getCats();
        while ($row = mysql_fetch_assoc($all_cats)) {
            ?>
	<div class="chk">
		<input name="chkPostCats[]" type="checkbox" value="<?php 
            echo $row['cat_id'];
            ?>
" /><?php 
            echo $row['cat_name'];
            ?>
	</div>
<?php 
        }
        ?>
</div>
<div class="clear"></div>
开发者ID:Satan1301,项目名称:phpoopcms,代码行数:31,代码来源:post.php

示例4: edit_feature

function edit_feature($params)
{
    global $tpl, $template, $config, $mysql, $lang, $twig;
    $tpath = locatePluginTemplates(array('config/main', 'config/add_feature'), 'eshop', 1);
    $id = intval($_REQUEST['id']);
    $row = $mysql->record('SELECT * FROM ' . prefix . '_eshop_features WHERE id = ' . db_squote($id) . ' LIMIT 1');
    if (isset($_REQUEST['submit'])) {
        $name = input_filter_com(convert($_REQUEST['name']));
        if (empty($name)) {
            $error_text[] = 'Название свойства не задано';
        }
        $position = intval($_REQUEST['position']);
        if (empty($position)) {
            $position = 0;
        }
        $in_filter = "1";
        if (empty($error_text)) {
            $mysql->query('UPDATE ' . prefix . '_eshop_features SET  
                name = ' . db_squote($name) . ',
                position = ' . db_squote($position) . ', 
                in_filter = ' . intval($in_filter) . '
                WHERE id = ' . $id . '
            ');
            $mysql->query("delete from " . prefix . "_eshop_categories_features where feature_id in ({$id})");
            $ids = $_REQUEST['feature_categories'];
            foreach ($ids as $id_x) {
                $mysql->query('INSERT INTO ' . prefix . '_eshop_categories_features (category_id, feature_id) 
                VALUES 
                (' . db_squote($id_x) . ',
                 ' . db_squote($id) . '
                )
               ');
            }
            redirect_eshop('?mod=extra-config&plugin=eshop&action=list_feature');
        }
    }
    if (!empty($error_text)) {
        foreach ($error_text as $error) {
            $error_input .= msg(array("type" => "error", "text" => $error));
        }
    } else {
        $error_input = '';
    }
    $res = mysql_query("SELECT * FROM " . prefix . "_eshop_categories ORDER BY id");
    $cats = getCats($res);
    $cat_ids = array();
    foreach ($mysql->select("SELECT * FROM " . prefix . "_eshop_categories_features WHERE feature_id = " . db_squote($id) . "") as $frow) {
        $cat_ids[] = $frow['category_id'];
    }
    $tEntry = array('name' => $row['name'], 'position' => $row['position'], 'in_filter' => $row['in_filter'], 'error' => $error_input, 'catz' => getMultiTree($cats, $cat_ids, 0));
    $xt = $twig->loadTemplate($tpath['config/add_feature'] . 'config/' . 'add_feature.tpl');
    $tVars = array('entries' => isset($tEntry) ? $tEntry : '');
    $xg = $twig->loadTemplate($tpath['config/main'] . 'config/' . 'main.tpl');
    $tVars = array('entries' => $xt->render($tVars), 'php_self' => $PHP_SELF, 'plugin_url' => admin_url . '/admin.php?mod=extra-config&plugin=eshop', 'skins_url' => skins_url, 'admin_url' => admin_url, 'home' => home, 'current_title' => 'Категории: Редактирование свойства');
    print $xg->render($tVars);
}
开发者ID:irbees2008,项目名称:ngcms_eshop,代码行数:56,代码来源:config.php

示例5: getCats

            </div>




            <div class="content_wrapper">

                <!-- Barra Lateral -->
                <div id="sidebar">

                    <div id="sidebar_title">Produtos</div>
                    <div id="cats">

                        <ul>
                            <?php 
getCats($con);
?>


                        </ul>
                    </div>


                    <div id="sidebar_title">Tipo</div>
                        <!-- Brand-->
                        <div id="cats">
                            <ul>

                                <?php 
getBrands($con);
?>
开发者ID:ViniciusMesquita94,项目名称:ecommerce,代码行数:31,代码来源:details.php

示例6: search

    case "search":
        search($option);
        break;
    case "searchby":
        searchby($option);
        break;
    case "advsearch":
        advsearch($option);
        break;
    case "advsearch2":
        advsearch2($option);
        break;
        /* Ajax Category */
    /* Ajax Category */
    case "getcats":
        getCats($cat_id);
        break;
        /* Default Main Index */
    /* Default Main Index */
    case "listcats":
    default:
        showTree($cat_id, $limitstart, $option, $my);
        break;
}
// Append CSS file to Head
if ($mtconf->get('load_css') && $document->getType() == 'html') {
    if (file_exists($savantConf['template_path'] . 'template.css')) {
        $document->addCustomTag("<link href=\"" . str_replace(DS, '/', str_replace($mtconf->getjconf('absolute_path'), $mtconf->getjconf('live_site'), $savantConf['template_path'] . 'template.css')) . "\" rel=\"stylesheet\" type=\"text/css\"/>");
    } elseif (file_exists($mtconf->getjconf('absolute_path') . '/components/com_mtree/templates/' . $mtconf->get('template') . '/template.css')) {
        $document->addCustomTag("<link href=\"" . $mtconf->getjconf('live_site') . "/components/com_mtree/templates/" . $mtconf->get('template') . "/template.css\" rel=\"stylesheet\" type=\"text/css\"/>");
    } else {
开发者ID:rsemedo,项目名称:Apply-Within,代码行数:31,代码来源:mtree.php

示例7: getCats

				</div>


				<!-- Navigation Bar ends here -->
			</div>


			<!-- Content wrapper starts here -->
			<div class="content_wrapper">
				
				<div id="sidebar">
            <div id="sidebar_title">Categories</div>

            <ul id="cats">

		<?php getCats($DBConn);
		
  		?>	

            </ul>


        <div id="sidebar_title">Manufacturers</div>

            <ul id="cats">

               <?php getManu($DBConn);
               ?>
               
            </ul>
开发者ID:arielrossanigo,项目名称:trabajo_final,代码行数:30,代码来源:0sh17tXN.PHP

示例8: getCats

?>
	
<!--content-->
<!---->
		<div class="product">
			<div class="container">
				<div class="col-md-3 product-price">
					  
				<div class=" rsidebar span_1_of_left">
					<div class="of-left">
						<h3 class="cate">Categories</h3>
					</div>
					<ul class="menu">
						<!-- /added********************************* -->
					    <?php 
$cats = getCats();
foreach ($cats as $key => $value) {
    ?>
					 	<li><a class="color1" href="#"><?php 
    echo $value["name"];
    ?>
</a>
					 	<?php 
}
?>
					</ul>
				</div>
				<!--initiate accordion-->
		<script type="text/javascript">
			$(function() {
			    var menu_ul = $('.menu > li > ul'),
开发者ID:ElsayedAhmed,项目名称:php-proj,代码行数:31,代码来源:products.php

示例9: edit_feature

function edit_feature($params)
{
    global $tpl, $template, $config, $mysql, $lang, $twig;
    $tpath = locatePluginTemplates(array('config/main', 'config/add_feature'), 'eshop', 1);
    $id = intval($_REQUEST['id']);
    $row = $mysql->record('SELECT * FROM ' . prefix . '_eshop_features WHERE id = ' . db_squote($id) . ' LIMIT 1');
    if (isset($_REQUEST['submit'])) {
        $SQL['name'] = input_filter_com(convert($_REQUEST['name']));
        if (empty($SQL['name'])) {
            $error_text[] = 'Название свойства не задано';
        }
        $SQL['position'] = intval($_REQUEST['position']);
        if (empty($SQL['position'])) {
            $SQL['position'] = 0;
        }
        $SQL['in_filter'] = intval($_REQUEST['in_filter']);
        if (empty($SQL['in_filter'])) {
            $SQL['in_filter'] = 0;
        }
        $ftype = input_filter_com(convert($_REQUEST['ftype']));
        switch ($ftype) {
            case 'text':
                $SQL['ftype'] = '0';
                $SQL['fdefault'] = input_filter_com(convert($_REQUEST['text_default']));
                break;
            case 'checkbox':
                $SQL['ftype'] = '1';
                $SQL['fdefault'] = intval($_REQUEST['checkbox_default']);
                break;
            case 'select':
                $SQL['ftype'] = '2';
                $SQL['fdefault'] = input_filter_com(convert($_REQUEST['select_default']));
                $optlist = array();
                if (isset($_REQUEST['so_data']) && is_array($_REQUEST['so_data'])) {
                    foreach ($_REQUEST['so_data'] as $k => $v) {
                        if (is_array($v) && isset($v[0]) && isset($v[1]) && ($v[0] != '' || $v[1] != '')) {
                            if ($v[0] != '') {
                                $optlist[$v[0]] = iconv("windows-1251", "utf-8", $v[1]);
                            } else {
                                $optlist[] = iconv("windows-1251", "utf-8", $v[1]);
                            }
                        }
                    }
                }
                $SQL['foptions'] = json_encode($optlist);
                break;
            case 'html':
                $SQL['ftype'] = '3';
                $SQL['fdefault'] = $_REQUEST['html_default'];
                break;
        }
        if (empty($error_text)) {
            $vnames = array();
            foreach ($SQL as $k => $v) {
                $vnames[] = $k . ' = ' . db_squote($v);
            }
            $mysql->query('UPDATE ' . prefix . '_eshop_features SET ' . implode(', ', $vnames) . ' WHERE id = \'' . intval($id) . '\' ');
            $mysql->query("delete from " . prefix . "_eshop_categories_features where feature_id in ({$id})");
            $ids = $_REQUEST['feature_categories'];
            foreach ($ids as $id_x) {
                $mysql->query('INSERT INTO ' . prefix . '_eshop_categories_features (category_id, feature_id) 
                VALUES 
                (' . db_squote($id_x) . ',
                 ' . db_squote($id) . '
                )
               ');
            }
            generate_features_cache(true);
            generate_categories_features_cache(true);
            redirect_eshop('?mod=extra-config&plugin=eshop&action=list_feature');
        }
    }
    if (!empty($error_text)) {
        foreach ($error_text as $error) {
            $error_input .= msg(array("type" => "error", "text" => $error));
        }
    } else {
        $error_input = '';
    }
    $res = mysql_query("SELECT * FROM " . prefix . "_eshop_categories ORDER BY id");
    $cats = getCats($res);
    $cat_ids = array();
    foreach ($mysql->select("SELECT * FROM " . prefix . "_eshop_categories_features WHERE feature_id = " . db_squote($id) . "") as $frow) {
        $cat_ids[] = $frow['category_id'];
    }
    foreach ($row as $k => $v) {
        $tEntry[$k] = $v;
    }
    $tEntry['error'] = $error_input;
    $tEntry['catz'] = getMultiTree($cats, $cat_ids, 0);
    $tEntry['foptions'] = json_decode($tEntry['foptions'], true);
    $sOpts = array();
    $fNum = 1;
    if ($tEntry['ftype'] == '2') {
        if (is_array($tEntry['foptions'])) {
            foreach ($tEntry['foptions'] as $k => $v) {
                array_push($sOpts, '<tr><td><input size="12" name="so_data[' . $fNum . '][0]" type="text" value="' . ($tEntry['foptions'] ? htmlspecialchars($k, ENT_COMPAT | ENT_HTML401, 'cp1251') : '') . '"/></td><td><input type="text" size="55" name="so_data[' . $fNum . '][1]" value="' . iconv("utf-8", "windows-1251", $v) . '"/></td><td><a href="#" onclick="return false;"><img src="' . skins_url . '/images/delete.gif" alt="DEL" width="12" height="12" /></a></td></tr>');
                $fNum++;
            }
        }
//.........这里部分代码省略.........
开发者ID:stdex,项目名称:ngcms_eshop,代码行数:101,代码来源:config.php

示例10: db_connect

<?php

//Configure DATABASE
require_once 'blip_4815162342_108.php';
$conn = db_connect();
//Start Script
$categories = getCats();
function getCats()
{
    $resultsArray;
    global $conn;
    $search = mysqli_query($conn, "CALL GetCategories()") or die("Query fail: " . mysqli_error($conn));
    while ($row = $search->fetch_array(MYSQL_ASSOC)) {
        $resultsArray[] = $row;
    }
    $results = json_encode($resultsArray, true);
    return $results;
}
//Return Query Result to Frontend
echo $categories;
mysqli_close($conn);
开发者ID:BlipProject,项目名称:Blip,代码行数:21,代码来源:get_categories.php

示例11: HttpConnection

include "../functions/crawler_functions.php";
$url = $_POST['url'];
$script = $_POST['script'];
echo $url . '   ' . $script;
$http = new HttpConnection();
//$http->setCookiePath("cookies/");
$http->init();
/*$registration = array('email'=>'info@ayudasmayores.es','passwd'=>"Ayudasmayores",'back'=>"my-account","SubmitLogin"=>"");
	$http->post("http://cosmomedica.com/shop/autenticacion",$registration,true,true);*/
$http->get($url, true);
echo "<p>registrandose en la aplicacion</p>";
$DOM = new DOMDocument();
get_dom($url, $DOM, $http);
$count_success = 0;
include "../mainscripts/cat/" . $script;
getCats($DOM);
//echo "<br />";
//opcciones finales
$http->close();
echo "<p>Se han procesado {$count_success} urls correctamente</p>";
echo "<a href='getProducts.php?parser=" . $script . "' class='btn-type'>Obtener Productos</a>";
/*	$configuracion['variables']['ref_count'] = $reference_count;
	$achivo_contenido = ";<?php die(); ?>".PHP_EOL.put_ini_file(null,$configuracion);
	file_put_contents('crawler.conf.php', $achivo_contenido);

	echo "<p>Se han procesado $count_success urls correctamente</p>";
	echo "<p>".$count_failed." urls han fallado.</p>";
	echo "<a class='btn-type' href='./actualproccesview.php'>Ver Resultados</a>";
	echo "<a class='btn-type' href='./pageCrawler.php'>Seguir procesando</a>";*/
?>
开发者ID:hesselek,项目名称:parser,代码行数:30,代码来源:catcrawlerParser.php


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