本文整理汇总了PHP中category函数的典型用法代码示例。如果您正苦于以下问题:PHP category函数的具体用法?PHP category怎么用?PHP category使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了category函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: category
<?php
$cats = category()->loadAllArray();
?>
<style>
.row .code {
background-color:#f0f0f0;
}
.row .icon {
display:inline-block;
width:60px;
height:60px;
}
.row .icon img {
width:100%;
}
</style>
<h1>Company category list</h1>
<div class="list">
<?php
foreach ($cats as $cat) {
?>
<div class="row" rid="<?php
echo $cat['id'];
?>
">
<div class="content">
<span class="icon"><?php
$file = data()->load("gid='company-category' AND code='{$cat['id']}'");
if ($file) {
示例2: form_mercado_pago
function form_mercado_pago()
{
if (get_option('mercadopago_url_sucess') != '') {
$url_sucess = get_option('mercadopago_url_sucess');
} else {
$url_sucess = get_site_url();
}
if (get_option('mercadopago_url_pending') != '') {
$url_pending = get_option('mercadopago_url_pending');
} else {
$url_pending = get_site_url();
}
$output = '<br /><tr><td>';
$output .= 'Client Id</td>';
$output .= '<td><input name="mercadopago_client_id" type="text" value="' . get_option('mercadopago_client_id') . '"/></td></tr>';
$output .= '<tr><td>Client Secret</td>';
$output .= '<td><input name="mercadopago_client_secret" type="text" value="' . get_option('mercadopago_client_secret') . '"/></td></tr>';
$output .= '<tr><td></td><td><small>To get fields above, follow:
<a href="https://www.mercadopago.com/mla/herramientas/aplicaciones" target="_blank">Argentina</a> or
<a href="https://www.mercadopago.com/mlb/ferramentas/aplicacoes" target="_blank">Brasil</a> or <a href="https://www.mercadopago.com/mlm/herramientas/aplicaciones" target="_blank">Mexico</a> or <a href="https://www.mercadopago.com/mlv/herramientas/aplicaciones" target="_blank">Venezuela</a> <br /><br /></small></td></tr>';
$output .= '<tr><td>Store Category</td>';
$output .= '<td>' . category() . '</td></tr>';
$output .= '<tr><td>Type Checkout</td>';
$output .= '<td>' . type_checkout() . '</td></tr>';
$output .= '<tr><td>Sandbox</td>';
$output .= '<td>' . sandbox() . '</td></tr>';
$output .= '<tr><td>Url Sucess Payment</td>';
$output .= '<td><input name="mercadopago_url_sucess" type="text" value="' . $url_sucess . '"/></td></tr>';
$output .= '<tr><td>Url Peding Payment</td>';
$output .= '<td><input name="mercadopago_url_pending" type="text" value="' . $url_pending . '"/></td></tr>';
$output .= '<tr><td></td><td><small>This is just the url where the custumer is redirect after his payment is done, you can set in both fields above any url of your site, but needs to be a <b>valid URL.</b>.<br /><br /> Please set your <b>instant payment notification</b> to receive your automatic order status changes at:
<a href="https://www.mercadopago.com/mla/herramientas/notificaciones" target="_blank">Argentina</a> or
<a href="https://www.mercadopago.com/mlb/ferramentas/notificacoes" target="_blank">Brasil</a> or <a href="https://www.mercadopago.com/mlm/herramientas/notificaciones" target="_blank">Mexico</a> or <a href="https://www.mercadopago.com/mlv/herramientas/notificaciones" target="_blank">Venezuela</a><br />
Set your url follwing this exemple: http://yourstore.com</b></small></td></tr>';
$output .= '<tr><td>Store Country</td>';
$output .= '<td>' . country() . '</td></tr>';
$output .= '<tr><td>Currency</td>';
$output .= '<td>' . currency() . '</td></tr>';
$output .= '<tr><td></td><td><small>Select Real to Brasil, or Pesos or Dollar to Argentina</small></td></tr>';
$output .= '<tr><td>Excluded methods</td>';
$output .= '<td>' . methods(get_option('mercadopago_country')) . '</td></tr>';
$output .= '<tr><td></td><td><small>SELECT only the methods that you <b>DO NOT</b>want to accept by MercadoPago<br />
<br /><b>Attention: </b> Payment methods depends on what country your account was created, if you change the country,<b> save the module first</b> and just after that select the Exclude Payment Methods!
<br /><br /><b>DO NOT</b> exclude All methods<br /><br /></small></td></tr>';
$output .= '<tr><td>Limit Payments</td>';
$output .= '<td>' . instalments() . '</td></tr>';
$output .= '<tr><td></td><td><small>This option allow you to limit the maximum number of instalments of MercadoPago</small></td></tr>';
$output .= '<tr><td>Debug mode</td>';
$output .= '<td>' . debugs() . '</td></tr>';
$output .= '<tr><td></td><td><small>Turn debug mode on to see erro log with your getting error on checkout</small></td></tr>';
return $output;
}
示例3: apply
function apply()
{
global $cart;
global $rawSequence;
global $discount;
global $couponExclude;
$coupons = array_values(array_merge($cart['coupons']['pre'], $cart['coupons']['post']));
for ($j = 0; $j < count($rawSequence); $j++) {
for ($i = 0; $i < count($coupons); $i++) {
if ($coupons[$i]['raw_type'] != $rawSequence[$j]) {
continue;
}
switch ($coupons[$i]['type']) {
case $discount['STORE_WIDE']:
store($cart, json_decode($coupons[$i]['params'], true), $coupons[$i]['raw_type'], $discount['STORE_WIDE']);
break;
case $discount['CATEGORY_WIDE']:
category($cart, json_decode($coupons[$i]['params'], true), $discount['CATEGORY_WIDE']);
break;
case $discount['BOGO']:
bogo($cart, json_decode($coupons[$i]['params'], true), $discount['BOGO'] | $discount['CATEGORY_WIDE']);
break;
case $discount['GROUP_WISE']:
break;
default:
}
array_splice($coupons, $i, 1);
$exclude = $couponExclude[$rawSequence[$j]];
for ($k = 0; $k < count($exclude); $k++) {
for ($l = 0; $l < count($coupons); $l++) {
if ($coupons[$l]['raw_type'] != $exclude[$k]) {
continue;
}
array_splice($coupons, $i, 1);
$l--;
}
}
$i = -1;
}
}
return $cart;
}
示例4: isset
echo isset($_POST['siteUrl']) ? $_POST['siteUrl'] : '';
?>
" placeholder="http://www.domain.com" required>
</div>
<div class="form-group">
<label for="siteDescription">Site Description</label>
<textarea id="siteDescription" name="siteDescription" maxlength="255" class="form-control" rows="5" required><?php
echo isset($_POST['siteUrl']) ? $_POST['siteUrl'] : '';
?>
</textarea>
<div class="pull-right" id="textarea_feedback"></div>
</div>
<label for="disabledInput">Category</label>
<fieldset disabled>
<input type="text" name="category" id="category" class="form-control" value='<?php
echo categoryName(category());
?>
' required><br>
<div class="alert alert-info">Navigate to your chosen category to submit your site</div>
</fieldset>
<div class="form-group text-center">
<?php
if (isset($warning)) {
echo $warning;
}
?>
<center><img id="captcha" src="securimage/securimage_show.php" alt="CAPTCHA Image" /></center><br>
<input type="text" class="form-control" id="captcha_code" name="captcha_code" placeholder="Enter Captcha Code Here" size="10" maxlength="6" /><br>
<a href="#" style="color:#3a87ad" class="alert alert-info btn-block" onclick="document.getElementById('captcha').src = 'securimage/securimage_show.php?' + Math.random(); return false">[ Different Image ]</a>
</div>
<br>
示例5: category
$src .= "<br><center><a href=\"index.php?page=video_page&action=new\"><font color=steelblue><b>" . $language['VID_NEW'] . "</b></a></font></center><br>";
for ($i = 0; $i < category(count); $i++) {
$c = 0;
$src .= "<center><span style=\"font-size:20pt;line-height:100%\">" . category(cat_not_eng, $i) . "</span></center><br>";
$query2 = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM {$TABLE_PREFIX}videos where category='" . category(cat_eng, $i) . "' ORDER BY `number` DESC");
$src .= "<center><table border=\"1\"><tr>";
if ($query2) {
while ($elementi = mysqli_fetch_object($query2)) {
$c++;
$z = $c - 1;
if ($z % 6 == 0) {
$src .= "</tr>";
}
$imgarray = array("1", "2", "3", "default");
$img = $imgarray[rand(0, count($imgarray) - 1)];
$src .= "<td><center>" . substr($elementi->title, 0, 22) . "...</center><br><center><a href=\"index.php?page=video_page&id=" . $elementi->id . "\"><img title=\"{$elementi->title} (" . category(cat_not_eng, $i) . ")\" alt=\"{$elementi->title} (" . category(cat_not_eng, $i) . ")\" border=\"0\" src=\"https://img.youtube.com/vi/" . $elementi->id . "/" . $img . ".jpg\"></a><center><br></td>";
}
}
if ($z % 6 == 0) {
$src .= "<tr>";
}
$src .= "</tr></table></center>";
if (!$c) {
$src .= "<center><font color = red>" . $language['VID_EMPTY'] . "</font></center>";
}
$src .= "<hr>";
}
}
$video_pagetpl = new bTemplate();
$video_pagetpl->set("language", $language);
$video_pagetpl->set("src", $src);
示例6: block_show
function block_show($bid)
{
global $prefix, $db;
include "header.php";
GraphicAdmin();
title("" . _BLOCKSADMIN . "");
OpenTable2();
$bid = intval($bid);
$row = $db->sql_fetchrow($db->sql_query("select bid, bkey, title, content, url, bposition, blockfile from " . $prefix . "_blocks where bid='{$bid}'"));
$bid = intval($row['bid']);
$bkey = $row['bkey'];
$title = $row['title'];
$content = $row['content'];
$url = $row['url'];
$bposition = $row['bposition'];
$blockfile = $row['blockfile'];
if ($bkey == main) {
mainblock();
} elseif ($bkey == admin) {
adminblock();
} elseif ($bkey == modules) {
modules_block();
} elseif ($bkey == category) {
category();
} elseif ($bkey == userbox) {
userblock();
} elseif ($bkey == "") {
if ($url == "") {
if ($blockfile == "") {
if ($bposition == "c") {
themecenterbox($title, $content);
} else {
themesidebox($title, $content);
}
} else {
if ($bposition == "c") {
blockfileinc($title, $blockfile, 1);
} else {
blockfileinc($title, $blockfile);
}
}
} else {
headlines($bid);
}
}
CloseTable2();
echo "<br>";
OpenTable();
echo "<center><font class=\"option\"><b>" . _BLOCKSADMIN . ": " . _FUNCTIONS . "</b></font><br><br>" . "[ <a href=\"admin.php?op=ChangeStatus&bid={$bid}\">" . _ACTIVATE . "</a> | <a href=\"admin.php?op=BlocksEdit&bid={$bid}\">" . _EDIT . "</a> | ";
if ($bkey == "") {
echo "<a href=\"admin.php?op=BlocksDelete&bid={$bid}\">" . _DELETE . "</a> | ";
} else {
echo "" . _DELETE . " | ";
}
echo "<a href=\"admin.php?op=BlocksAdmin\">" . _BLOCKSADMIN . "</a> ]</center>";
CloseTable();
include "footer.php";
}
示例7: get_markup_icon
console.log(re);
}
});
$filebox.val('');
}
function get_markup_icon( id, url ) {
return "<img width='100%' fid='"+id+"' src='"+url+"'><span class='button delete-uploaded-file'>삭제</span>";
}
</script>
<?php
$location = new model\philocation\PhiLocation();
//print_r($location->eng_to_ko);
//print_r($location->ko_to_eng);
$cats = category()->search(['order_by' => 'code ASC', 'limit' => 9999, 'return' => 'array']);
function val($k)
{
global $company;
if (!$company) {
return null;
}
return $company->get($k);
}
?>
<style>
form.company-edit input {
display:block;
}
</style>
<form class="company-edit">
示例8: parent
function parent()
{
global $conn;
$query = "SELECT parent_cat, cat_name FROM Categories WHERE cat_id = ?";
$stm = $conn->prepare($query);
$stm->execute(array(category()));
$par_cat = $stm->fetch();
return "<li class='active'><a href='category.php?cat=" . $par_cat['parent_cat'] . "'>" . $par_cat['cat_name'] . "</a></li>";
}
示例9: ini_set
<?php
ini_set('max_execution_time', 2000);
require_once '../../../wp-load.php';
global $wpdb;
$feed_url = get_option('helios_feed_url');
if (!empty($feed_url)) {
$stream = file_get_contents(get_option('helios_feed_url'));
$stream = preg_replace("/<([a-z][a-z0-9]*)[^>]*?(\\/?)>/i", '<$1$2>', $stream);
$x = toArray($stream);
foreach ($x['Row'] as $entry) {
$entry = $entry['Column'];
$overview = formatText($entry[3]) != '' ? '<h3 class="heading overview">Overview:</h3>' : '';
$responsibilities = formatText($entry[4]) != '' ? '<h3 class="heading responsibilities">Responsibilities:</h3>' : '';
$qualifications = formatText($entry[5]) != '' ? '<h3 class="heading qualifications">Qualifications:</h3>' : '';
$wpdb->insert($wpdb->prefix . HELIOS_TABLE, array('title' => $entry[0], 'location' => !empty($entry[1]) ? $entry[1] . ', ' . $entry[2] : '', 'description' => $overview . formatText($entry[3]) . $responsibilities . formatText($entry[4]) . $qualifications . formatText($entry[5]), 'category' => category($entry[6]), 'pubDate' => date("Y-m-d H:i:s", strtotime($entry[7])), 'locationCountry' => '', 'locationState' => !empty($entry[2]) ? $entry[2] : '', 'locationCity' => !empty($entry[1]) ? $entry[1] : '', 'reqId' => $entry[8], 'publishedStatus' => 'Y'));
}
echo '[{"msg":"Sync was successful."}]';
} else {
echo '[{"msg":"An error occurred."}]';
}
function formatText($string)
{
$string = str_replace('<h1>', '<p><strong>', $string);
$string = str_replace('<h2>', '<p><strong>', $string);
$string = str_replace('<h3>', '<p><strong>', $string);
$string = str_replace('<h4>', '<p><strong>', $string);
$string = str_replace('<h5>', '<p><strong>', $string);
$string = str_replace('<h6>', '<p><strong>', $string);
$string = str_replace('</h1>', '</strong></p>', $string);
$string = str_replace('</h2>', '</strong></p>', $string);
示例10: category
<div class="col-md-3">
<div class="dropdown">
<button class="btn btn-danger dropdown-toggle change-drop" type="button" data-toggle="dropdown">Catatories
<span class="caret"></span></button>
<ul class="dropdown-menu">
<?php
category();
?>
</ul>
</div>
</div>
<div class="col-md-9">
<!---slider start-->
<div id="carousel-example-generic" class="carousel slide change-slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="images/iphone6.jpg" alt="Sorry not found">
<div class="carousel-caption">
示例11: setPhilgoCategory
private function setPhilgoCategory($old_category, $new_category)
{
$c = category($new_category);
if (empty($c)) {
die("\nERROR: THIS ERROR MUST BE FIXED.\nNo category : {$new_category}");
}
$category_id = $c->getID();
$companies = $this->loadQuery("category == 0 AND source='philgo' AND etc='{$old_category}'");
if ($companies) {
foreach ($companies as $com) {
$com->put('category', $category_id);
}
}
}
示例12: substru
$status = "";
$list = "";
// Trim subject
$subject = substru(trim(htmlspecialchars($row['subject'], ENT_QUOTES, 'UTF-8')), 0, $config['max_length']) . "…";
// Build topic url
$topic_url = "{$config['url_path']}/read.php?id={$row['id']}";
// Topic starter data
$topic_author = user_data($row['starter_id']);
// Topic status
if ($row['closed']) {
$status = 'closed, ';
}
if ($row['sticky']) {
$status .= 'sticky';
}
$categories = category();
// Create the delete list
foreach ($categories as $acat) {
if ($acat['id'] == $row['category']) {
continue;
}
if ($page) {
$apage = "&page={$page}";
}
$list .= "<a href='{$config['url_path']}/admin.php?a=topics&update={$row['id']}&cat={$acat['id']}{$apage}'>{$acat['name']}</a>";
if (end($categories) != $acat) {
$list .= ", ";
}
}
if (substr($list, -2) == ", ") {
$list = substr($list, 0, -2);
示例13: file_get_contents
<?php
require_once '../config.php';
require_once '../functions.php';
// HEADER
include 'inc/header.php';
// INDEX_BOX
$index_box = file_get_contents('../templates/' . $path . '/index_box.php');
$categoriesObj = json_decode(file_get_contents('data/categories.json'));
$forumsObj = json_decode(file_get_contents('data/forums.json'));
$forumsArr;
$index_box = preg_replace_callback('/<\\!\\-\\-\\sBEGIN\\scatrow\\s\\-\\->([\\s\\S]+)<\\!\\-\\-\\sEND\\scatrow\\s\\-\\->/', function ($arg) {
global $categoriesObj, $forumsArr;
$catrow = $arg[1];
$txt = '';
foreach ($categoriesObj as $key => $value) {
$forumsArr = $value->{'forums'};
$row = str_replace('{catrow.tablehead.L_FORUM}', $value->{'name'}, $catrow);
$row = preg_replace_callback('/<\\!\\-\\-\\sBEGIN\\sforumrow\\s\\-\\->([\\s\\S]+)<\\!\\-\\-\\sEND\\sforumrow\\s\\-\\->/', function ($ar) {
global $forumsArr;
$forumrow = $ar[1];
return category($forumrow, $forumsArr);
}, $row);
$txt .= $row;
}
return $txt;
}, $index_box);
echo $index_box;
// FOOTER
include 'inc/footer.php';
示例14: block_show
function block_show($bid)
{
global $prefix, $db, $admin_file;
include "header.php";
GraphicAdmin();
title("" . _BLOCKSADMIN . "");
OpenTable();
echo "<br><center>";
$bid = intval($bid);
$row = $db->sql_fetchrow($db->sql_query("select bid, bkey, title, content, url, active, bposition, blockfile from " . $prefix . "_blocks where bid='{$bid}'"));
$bid = intval($row['bid']);
$bkey = filter($row['bkey'], "nohtml");
$title = filter($row['title'], "nohtml");
$content = filter($row['content']);
$url = filter($row['url'], "nohtml");
$active = intval($row['active']);
$bposition = filter($row['bposition'], "nohtml");
$blockfile = filter($row['blockfile'], "nohtml");
if ($bkey == "main") {
mainblock();
} elseif ($bkey == "admin") {
adminblock();
} elseif ($bkey == "modules") {
modules_block();
} elseif ($bkey == "category") {
category();
} elseif ($bkey == "userbox") {
userblock();
} elseif (empty($bkey)) {
if (empty($url)) {
if (empty($blockfile)) {
if ($bposition == "c") {
themecenterbox($title, $content);
} else {
themesidebox($title, $content);
}
} else {
if ($bposition == "c") {
blockfileinc($title, $blockfile, 1);
} else {
blockfileinc($title, $blockfile);
}
}
} else {
headlines($bid);
}
}
echo "</center>";
CloseTable();
echo "<br>";
OpenTable();
if ($active == 1) {
$act_chg = _DEACTIVATE;
} elseif ($active == 0) {
$act_chg = _ACTIVATE;
}
echo "<center><font class=\"option\"><b>" . _BLOCKSADMIN . ": " . _FUNCTIONS . "</b></font><br><br>" . "[ <a href=\"" . $admin_file . ".php?op=ChangeStatus&bid={$bid}\">{$act_chg}</a> | <a href=\"" . $admin_file . ".php?op=BlocksEdit&bid={$bid}\">" . _EDIT . "</a> | ";
if (empty($bkey)) {
echo "<a href=\"" . $admin_file . ".php?op=BlocksDelete&bid={$bid}\">" . _DELETE . "</a> | ";
} else {
echo "" . _DELETE . " | ";
}
echo "<a href=\"" . $admin_file . ".php?op=BlocksAdmin\">" . _BLOCKSADMIN . "</a> ]</center>";
CloseTable();
include "footer.php";
}
示例15: categoryDelete
public function categoryDelete()
{
$id = hi('id');
if (empty($id)) {
return ERROR(-457, 'Input category id');
}
$c = category()->load($id);
if (empty($c)) {
return ERROR(-458, "Category by that id - {$id} does not exists.");
}
category()->load($id)->delete();
return SUCCESS();
}