本文整理汇总了PHP中obj类的典型用法代码示例。如果您正苦于以下问题:PHP obj类的具体用法?PHP obj怎么用?PHP obj使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了obj类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1:
/**
* Exclude pages from search
*
* @param obj $query the query object
* @return obj the modified object
*/
function tz_exclude_pages($query)
{
if ($query->is_search) {
$query->set('post_type', 'post');
}
return $query;
}
开发者ID:fiftyandfiftyorg,项目名称:uww-toolkit,代码行数:13,代码来源:functions.php
示例2: showBrand
/**
* 单一品牌商品列表
*
*/
private function showBrand()
{
$brand_id = intval($this->_input['brandid']);
if ($brand_id == 0) {
header("Location:?action=index");
exit;
}
/*品牌信息*/
$brand_info = $this->obj_brand->getBrandInfo(array('brand_id' => $brand_id));
$this->output('brand_info', $brand_info);
/*创建分页对象*/
$view_list_num = $this->_viewinfo['websit']['other_brand_class'] == '1' ? (int) $this->_viewinfo['websit']['other_brand_class_num'] : 0;
if (intval($this->_input['goods_nums']) != 0) {
$view_list_num = intval($this->_input['goods_nums']);
}
require_once "commonpage.class.php";
$obj_page = new CommonPage();
$obj_page->pagebarnum($view_list_num);
$brand_product = $this->obj_brand->productBrandList(array('brand_id' => intval($this->_input['brandid'])), $obj_page, '*', $this->_input['goods_show']);
$product_brand_page = $obj_page->show(6);
$this->output('product_brand_page', $product_brand_page);
$this->output('brand_product', $brand_product);
/*该品牌热门商品*/
$hot_array = array();
$hot_array = array('brand_id' => intval($this->_input['brandid']), 'order_value' => 'goods_click', 'limit_num' => 8);
$brand_hot = $this->obj_brand->getBrandProduct($hot_array);
$this->output('brand_hot', $brand_hot);
/*推荐品牌,暂时无此字段*/
$brand_commend = $this->obj_brand->getBrandList(array('show_type' => 'class_show'));
$this->output('brand_commend', $brand_commend);
$this->showpage('product_brand_list');
}
开发者ID:jn7163,项目名称:ShopNC,代码行数:36,代码来源:product_brand.php
示例3: dispatch
/**
* 実行ファイル指定処理
*
* @access private
* @return
*/
public function dispatch()
{
// 実行ファイル
$controller = $this->request_obj->getController();
// 実行コントローラーファイル取得
$controller_file = $controller . '_controller.php';
// 実行コントローラーまでのパス取得
$controller_path = APP_CONTROLLERS_PATH . $controller_file;
// 実行コントローラー存在チェック
if (file_exists($controller_path) == false) {
$controller = 'error';
$controller_path = APP_CONTROLLERS_PATH . 'error_controller.php';
}
// 実行コントローラー名格納
$this->controller_name = $controller;
// 実行コントローラー読み込み
include_once $controller_path;
// クラス名にフォーマット
$controller_class = ucfirst($controller) . 'Controller';
// インスタンス生成
$this->con_obj = new $controller_class($this);
// 指定アクション名取得
$action = $this->request_obj->getAction();
// アクション名存在チェック
if (empty($action)) {
$action = 'index';
} elseif (!is_callable(array(&$this->con_obj, $action))) {
$action = 'error';
}
// 実行アクション名格納
$this->action_name = $action;
// 初期処理実行
$this->con_obj->startup();
}
开发者ID:nikitiki,项目名称:matching-system,代码行数:40,代码来源:controller_manager.php
示例4: showCart
/**
* 购物车信息
*
*/
function showCart()
{
$goods_count = $this->obj_shop_cart->GoodsCount();
$this->output('goods_count', $goods_count);
//购买商品数量
$this->showpage('cart_window');
}
开发者ID:jn7163,项目名称:ShopNC,代码行数:11,代码来源:cart_windows.php
示例5: process_site
/**
* Process a site and pull all it's posts
*
* @param int $site_id The ID of the site for which to pull it's posts
* @param obj $client The syndication client class instance
* @return array|bool Array of posts on success, false on failure
*/
public function process_site($site_id, $client)
{
global $site_manager, $client_manager;
// Fetch the site status
if (!in_array($site_manager->get_site_status($site_id), array('idle', ''))) {
return false;
}
// Mark site as in progress
$site_manager->update_site_status('pulling');
try {
// Fetch the site's posts by calling the class located at the
// namespace given during registration
$posts = $client->get_posts($site_id);
/**
* Filter the array of posts to be processed by a pull client.
*
* @param array $posts The array of Types\Post objects to be pulled.
* @param int $site_id The id of the site being processed.
* @param Pull_Client $client The pull client processing the posts.
*/
$posts = apply_filters('syn_pre_pull_posts', $posts, $site_id, $client);
// Process the posts we fetched
$this->process_posts($posts, $site_id, $client);
} catch (\Exception $e) {
Syndication_Logger::log_post_error($site_id, $status = 'error', $message = __('Exception processing site.', 'push-syndication'), $log_time = null, $extra = array('error' => $e));
}
// Update site status
$site_manager->update_site_status('idle');
if (is_array($posts) && !empty($posts)) {
return $posts;
} else {
return false;
}
}
开发者ID:gopinathshiva,项目名称:wordpress-vip-plugins,代码行数:41,代码来源:class-puller.php
示例6: _process
/**
* Process function
*
* @param obj $node
*/
private static function _process($node)
{
$occurance = [];
$result = [];
if ($node->childNodes != null) {
foreach ($node->childNodes as $key => $child) {
if (array_key_isset($child->nodeName, $occurance)) {
$occurance[$child->nodeName]++;
} else {
$occurance[$child->nodeName] = 1;
}
}
}
if ($node->nodeType == XML_TEXT_NODE) {
$result = html_entity_decode(htmlentities($node->nodeValue, ENT_COMPAT, 'UTF-8'), ENT_COMPAT, 'UTF-8');
} else {
if ($node->nodeType == XML_CDATA_SECTION_NODE) {
$result = html_entity_decode(htmlentities($node->nodeValue, ENT_COMPAT, 'UTF-8'), ENT_COMPAT, 'UTF-8');
} else {
if ($node->hasChildNodes()) {
$children = $node->childNodes;
for ($i = 0; $i < $children->length; $i++) {
$child = $children->item($i);
if ($child->nodeName != '#text' && $child->nodeName != '#cdata-section') {
if ($occurance[$child->nodeName] > 1) {
$result[$child->nodeName][] = self::_process($child);
} else {
$result[$child->nodeName] = self::_process($child);
}
} else {
if ($child->nodeName == '#cdata-section') {
$text = self::_process($child);
if (trim($text) != '') {
// $result[$child->nodeName] = self::_process($child);
$result['#text'] = (string) $text;
}
} else {
if ($child->nodeName == '#text') {
$text = self::_process($child);
if (trim($text) != '') {
// $result[$child->nodeName] = self::_process($child);
$result[$child->nodeName] = (string) $text;
}
}
}
}
}
}
if ($node->hasAttributes()) {
$attributes = $node->attributes;
if (!is_null($attributes)) {
foreach ($attributes as $key => $attr) {
$result['@' . $attr->name] = $attr->value;
}
}
}
}
}
return $result;
}
开发者ID:cruide,项目名称:wasp,代码行数:65,代码来源:wxml.php
示例7: slug_ensure_single_pod
/**
* Checks if given Pods object has the correct item fetch, and if not fetch it.
*
* @param obj|Pod $pod A Pod object to check
* @param int $id ID of item you want.
*
* @return Pods object
*/
function slug_ensure_single_pod($pod, $id)
{
if ($pod->id() !== $id || $pod->id === 0 || is_null($pod->id)) {
$pod->fetch($id);
}
return $pod;
}
开发者ID:logoscreative,项目名称:pods-code-library,代码行数:15,代码来源:conditonally-fetch.php
示例8: _getClassSourse
/**
* 获取源代码
*
* @param obj $class 反射类实例
* @return string
*/
private static function _getClassSourse($class)
{
$path = $class->getFileName();
$lines = @file($path);
$from = $class->getStartLine();
$to = $class->getEndLine();
$len = $to - $from + 1;
return implode(array_slice($lines, $from - 1, $len));
}
开发者ID:soft456,项目名称:php_tools,代码行数:15,代码来源:ApiDemo.php
示例9: addClass
/**
* function for adding class name
* @author Eleri<[email protected]>
* @param obj $elem element
* @param string $cls new probably additional class name
*/
function addClass($elem, $cls)
{
$a = explode(" ", $elem->getClassName());
//mixed array_search ( $needle , array $haystack [, bool $strict = false ] )
if (array_search($cls, $a, true) === false) {
$a[] = $cls;
}
$elem->setClassName(implode(" ", $a));
}
开发者ID:piiskop,项目名称:pstk,代码行数:15,代码来源:className.php
示例10: Update
/**
* Update data in Excel table
*
* @param obj $objPHPExcel PHP Excel object
* @param int $row Row id
* @param int $sum_old Sum of items
* @param string $currentDate Current date
*
* @return obj $objPHPExcel PHP Excel object.
*/
public function Update($objPHPExcel, $row, $sum_old, $currentDate)
{
$this->load->model('Database');
$sum_new = $this->db->count_all_results('exercises');
if ($sum_new > $sum_old) {
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('A' . $row, $currentDate)->setCellValue('B' . $row, $sum_new);
}
return $objPHPExcel;
}
开发者ID:peresadam,项目名称:zsebtanar_v4,代码行数:19,代码来源:Statistics.php
示例11: set_portfolio_post_type_admin_order
/**
* Set the default order on the portfolio posts page to display by
* menu order and not date
*
* @param obj $query The original query object
* @return void
*/
function set_portfolio_post_type_admin_order($query)
{
if (is_admin()) {
$post_type = $query->query['post_type'];
if ($post_type == 'portfolio' && empty($_GET['orderby'])) {
$query->set('orderby', 'menu_order');
$query->set('order', 'ASC');
}
}
}
开发者ID:TyRichards,项目名称:paradox,代码行数:17,代码来源:admin.php
示例12: showIndex
/**
* 友情链接
*
*/
private function showIndex()
{
/*友情链接*/
$link_image = $this->obj_shop_link->getLinkList(array('logo' => 1), '');
$this->output('link_image', $link_image);
$link_text = $this->obj_shop_link->getLinkList(array('logo' => 2), '');
$this->output('text_link_num', count($link_text));
$this->output('link_text', $link_text);
$this->shopshowpage("links");
}
开发者ID:jn7163,项目名称:ShopNC,代码行数:14,代码来源:shop_link.php
示例13: executeHook
/**
* Parser Hook
*
* The following method is assigned to a hook, which will be run whenever
* the user adds a <bugs /> tag in the main MediaWiki code.
*
* @param string $text
* @param array $args
* @param obj $parser
* @return str
*/
public static function executeHook($text, $args = array(), $parser)
{
$parser->disableCache();
// Set the page namespace
$namespace['dbKey'] = $parser->getTitle()->getPrefixedDBkey();
$namespace['text'] = $parser->getTitle()->getPrefixedText();
$isParserHook = true;
// Process request
$instance = self::_getInstance();
$output = $instance->_processActionRequest($namespace, $isParserHook, $args);
return $output;
}
开发者ID:eclecticdave,项目名称:issuetracker,代码行数:23,代码来源:IssueTracker.body.php
示例14: footer
private function footer()
{
$info_array = $this->obj_shopnc_info->getSystemList();
$this->output('info_array', $info_array);
$this->showpage('footer');
/*访问记录*/
//$input_param['ip'] = $this->agent_ip; //ip
//$input_param['ip_area'] = "null"; //来源地区
//$input_param['visit_url'] = $this->cur_url; //访问地址
//$input_param['source_url'] = $this->refer_url; //来源地址
//$input_param['visit_system'] = $this->obj_shop_visit->getOS($_SERVER['HTTP_USER_AGENT']);//访问系统
//$this->obj_shop_visit->addVisit($input_param);
}
开发者ID:jn7163,项目名称:ShopNC,代码行数:13,代码来源:footer.php
示例15: login
/**
* Login API
* @param string $email email of user
* @param string $password password of user
* @param obj $mysqli mysql connection
* @return bool success or not
*/
function login($email, $password, $mysqli)
{
// Using prepared statements means that SQL injection is not possible.
if ($stmt = $mysqli->prepare("SELECT id, username, password, salt\n FROM members\n WHERE email = ?\n LIMIT 1")) {
$stmt->bind_param('s', $email);
// Bind "$email" to parameter.
$stmt->execute();
// Execute the prepared query.
$stmt->store_result();
// get variables from result.
$stmt->bind_result($user_id, $username, $db_password, $salt);
$stmt->fetch();
// hash the password with the unique salt.
$password = hash('sha512', $password . $salt);
if ($stmt->num_rows == 1) {
// If the user exists we check if the account is locked
// from too many login attempts
if (checkbrute($user_id, $mysqli) == true) {
// Account is locked
// Send an email to user saying their account is locked
return false;
} else {
// Check if the password in the database matches
// the password the user submitted.
if ($db_password == $password) {
// Password is correct!
// Get the user-agent string of the user.
$user_browser = $_SERVER['HTTP_USER_AGENT'];
// XSS protection as we might print this value
$user_id = preg_replace("/[^0-9]+/", "", $user_id);
$_SESSION['user_id'] = $user_id;
// XSS protection as we might print this value
$username = preg_replace("/[^a-zA-Z0-9_\\-]+/", "", $username);
$_SESSION['username'] = $username;
$_SESSION['login_string'] = hash('sha512', $password . $user_browser);
// Login successful.
return true;
} else {
// Password is not correct
// We record this attempt in the database
$now = time();
$mysqli->query("INSERT INTO login_attempts(user_id, time)\n VALUES ('{$user_id}', '{$now}')");
return false;
}
}
} else {
// No user exists.
return false;
}
}
}
开发者ID:varatep,项目名称:comp484-final-lab-tmp,代码行数:58,代码来源:functions.php
示例16: showInfo
private function showInfo()
{
/*底部其他信息,侧边栏显示*/
$info_id = intval($this->_input['info_id']);
if ($info_id == 0) {
header("Location:?info_id=1");
exit;
}
$foot_array = $this->obj_shopnc_info->getSystemList();
$this->output('foot_array', $foot_array);
$info_array = $this->obj_shopnc_info->getSystemInfo(array('info_id' => intval($this->_input['info_id'])));
$this->output('article_array', $info_array);
$this->shopshowpage("shop_info");
}
开发者ID:jn7163,项目名称:ShopNC,代码行数:14,代码来源:shop_info.php
示例17: nc_header
private function nc_header()
{
/*在导航的商品分类*/
$header_product_class = $this->obj_product_class->getSpecificClass(array('show_type' => 'header'));
$this->output('header_product_class', $header_product_class);
/*在导航的文章分类*/
$header_article_class = $this->obj_article_class->getArticleClass(array('article_class_menu' => 1));
$this->output('header_article_class', $header_article_class);
/*语言包选择*/
require_once "moduleLanguage.class.php";
$module_language = new ModuleLanguageClass();
$conditon_array = array();
$language_array = $module_language->getLanguageList($conditon_array);
$this->output('language_array', $language_array);
/*判断选中的语言包类型*/
if ($_SESSION['language'] != '') {
$language_ver = $_SESSION['language'];
} else {
$language_ver = $this->_configinfo['websit']['versionarea'];
}
$this->output('language_ver', $language_ver);
/*购物车*/
require_once "shopCart.class.php";
$shop_cart = new ShopCartClass();
$this->output('cart_count', $shop_cart->GoodsCount());
/*导航菜单选中*/
$show_menu = '';
$show_product_menu = '';
$show_article_menu = '';
$menu_name = basename($_SERVER['PHP_SELF']);
if ($menu_name == 'index.php') {
$show_menu = 'index';
} elseif ($menu_name == 'product_subject.php') {
$show_menu = 'subject';
} elseif ($menu_name == 'product_brand.php') {
$show_menu = 'brand';
} elseif ($menu_name == 'article_class.php') {
$show_article_menu = $this->_input['id'];
if ($show_article_menu == '') {
$show_article_menu = 'article';
}
} elseif ($menu_name == 'product_class.php') {
$show_product_menu = $this->_input['classid'];
}
$this->output('show_menu', $show_menu);
$this->output('show_product_menu', $show_product_menu);
$this->output('show_article_menu', $show_article_menu);
$this->showpage('header');
}
开发者ID:jn7163,项目名称:ShopNC,代码行数:49,代码来源:header.php
示例18: mdjm_quote_post_order
/**
* Order posts.
*
* @since 1.3
* @param obj $query The WP_Query object
* @return void
*/
function mdjm_quote_post_order($query)
{
if (!is_admin() || 'mdjm-quotes' != $query->get('post_type')) {
return;
}
switch ($query->get('orderby')) {
case 'quote_view_date':
$query->set('meta_key', '_mdjm_quote_viewed_date');
$query->set('orderby', 'meta_value');
break;
case 'quote_value':
// TO DO
break;
}
}
开发者ID:mdjm,项目名称:mobile-dj-manager,代码行数:22,代码来源:quotes.php
示例19: showInfo
private function showInfo()
{
/*底部其他信息,侧边栏显示*/
$info_id = intval($this->_input['info_id']);
if ($info_id == 0) {
header("Location:?info_id=1");
exit;
}
require_once "system.class.php";
$footer_shopnc_info = new SystemClass();
$foot_array = $footer_shopnc_info->getSystemList();
$this->output('foot_array', $foot_array);
$info_array = $this->obj_shopnc_info->getSystemInfo(array('shop_id' => NC_SHOP_ID, 'info_id' => intval($this->_input['info_id'])));
$this->output('info_array', $info_array);
$this->showpage('shopnc_info');
}
开发者ID:jn7163,项目名称:ShopNC,代码行数:16,代码来源:shopnc_info.php
示例20: showArticleContent
/**
* 文章内容
*
*/
private function showArticleContent()
{
/*右侧文章列表*/
include "shopArticleClass.class.php";
$article_class = new ShopArticleClassClass();
$class_array = $article_class->getArticleClassList();
$article_array = $this->obj_article->getArticleList('', '');
foreach ($class_array as $k => $v) {
foreach ($article_array as $v1) {
if ($v['cid'] == $v1['arc_class']) {
if (count($class_array[$k]['body']) < 5) {
$class_array[$k]['body'][] = $v1;
}
}
}
}
$this->output('artclass_array', $class_array);
/*文章内容信息*/
$content_array = $this->obj_article->getArticleContent(array('aid' => intval($this->_input['id'])));
$this->output('article_array', $content_array[0]);
/*相关内容*/
/*热门店铺*/
$hot_shops_array = $this->obj_shopuser->getShopListType(array('shop_type' => 'hot_shop'), 5);
$this->output('hot_shops_array', $hot_shops_array);
$this->shopshowpage('article');
}
开发者ID:jn7163,项目名称:ShopNC,代码行数:30,代码来源:shop_article.php
注:本文中的obj类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论