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


PHP ShopFunctions::get_url方法代码示例

本文整理汇总了PHP中ShopFunctions::get_url方法的典型用法代码示例。如果您正苦于以下问题:PHP ShopFunctions::get_url方法的具体用法?PHP ShopFunctions::get_url怎么用?PHP ShopFunctions::get_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ShopFunctions的用法示例。


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

示例1: permalink

 /**
  * Obtiene el enlace a la categor?a
  */
 public function permalink()
 {
     $mc = RMUtilities::module_config('shop');
     $link = ShopFunctions::get_url();
     $link .= $mc['urlmode'] == 0 ? '?cat=' . $this->id() : 'category/' . $this->path();
     return $link;
 }
开发者ID:laiello,项目名称:bitcero-modules,代码行数:10,代码来源:shopcategory.class.php

示例2: ShopProduct

// Author: Eduardo Cortés <i.bitcero@gmail.com>
// Email: i.bitcero@gmail.com
// License: GPL 2.0
// --------------------------------------------------------------
$product = new ShopProduct($id);
if ($product->isNew()) {
    ShopFunctions::error404();
}
$xoopsOption['template_main'] = 'shop_product.html';
include 'header.php';
$tf = new RMTimeFormatter(0, '%d%/%T%/%Y%');
$sf = new ShopFunctions();
// Product data
$xoopsTpl->assign('product', array('name' => $product->getVar('name'), 'description' => $product->getVar('description'), 'price' => $product->getVar('price') > 0 ? sprintf(__('Price: <strong>%s</strong>', 'shop'), sprintf($xoopsModuleConfig['format'], number_format($product->getVar('price'), 2))) : '', 'buy' => $sf->get_buy_link($product), 'type' => $product->getVar('type'), 'stock' => $product->getVar('available'), 'image' => $product->getVar('image'), 'created' => sprintf(__('Since: <strong>%s</strong>', 'shop'), $tf->format($product->getVar('created'))), 'updated' => $product->getVar('modified') > 0 ? sprintf(__("Updated: <strong>%s</strong>", 'shop'), $tf->format($product->getVar('modified'))) : '', 'link' => $product->permalink(), 'metas' => $product->get_meta(), 'images' => $product->get_images()));
$product->setVar('hits', $product->getVar('hits') + 1);
$product->save();
$options = array('<a href="' . ShopFunctions::get_url() . ($xoopsModuleConfig['urlmode'] ? 'contact/' . $product->getVar('nameid') . '/' : '?contact=' . $product->id()) . '">' . __('Request Information', 'shop') . '</a>');
$options = RMEvents::get()->run_event('shop.product.options', $options);
$xoopsTpl->assign('options', $options);
$xoopsTpl->assign('product_details', 1);
$xoopsTpl->assign('xoops_pagetitle', $product->getVar('name') . ' &raquo; ' . $xoopsModuleConfig['modtitle']);
$xoopsTpl->assign('lang_instock', __('In stock', 'shop'));
$xoopsTpl->assign('lang_outstock', __('Out of stock', 'shop'));
$xoopsTpl->assign('lang_buy', __('Buy Now!', 'shop'));
RMTemplate::get()->add_style('main.css', 'shop');
// Now minishop will use lightbox plugin for Common Utilities
if (RMFunctions::plugin_installed('lightbox')) {
    RMLightbox::get()->add_element('.prod_thumbs a');
    RMLightbox::get()->render();
}
include 'footer.php';
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:product.php

示例3: define

<?php

// $Id$
// --------------------------------------------------------------
// MiniShop 3
// Module for catalogs
// Author: Eduardo Cortés <i.bitcero@gmail.com>
// Email: i.bitcero@gmail.com
// License: GPL 2.0
// --------------------------------------------------------------
require_once XOOPS_ROOT_PATH . '/header.php';
define('SHOP_PATH', XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname());
define('SHOP_URL', XOOPS_URL . '/modules/' . $xoopsModule->dirname());
define('SHOP_UPPATH', XOOPS_UPLOAD_PATH . '/minishop');
define('SHOP_UPURL', XOOPS_UPLOAD_URL . '/minishop');
$xoopsTpl->assign('shopConfig', $xoopsModuleConfig);
$xoopsTpl->assign('shop_url', ShopFunctions::get_url());
开发者ID:laiello,项目名称:bitcero-modules,代码行数:17,代码来源:header.php

示例4: COUNT

// Author: Eduardo Cortés <i.bitcero@gmail.com>
// Email: i.bitcero@gmail.com
// License: GPL 2.0
// --------------------------------------------------------------
$xoopsOption['template_main'] = 'shop_index.html';
include 'header.php';
$db = XoopsDatabaseFactory::getDatabaseConnection();
$sql = "SELECT COUNT(*) FROM " . $db->prefix("shop_products");
list($num) = $db->fetchRow($db->query($sql));
$limit = $xoopsModuleConfig['numxpage'];
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$p = $page > 0 ? $page - 1 : $page;
$start = $num <= 0 ? 0 : $p * $limit;
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url(ShopFunctions::get_url() . ($xoopsModuleConfig['urlmode'] ? 'page/{PAGE_NUM}/' : '?page={PAGE_NUM}'));
$xoopsTpl->assign('pagenav', $nav->render(false));
$result = $db->query("SELECT * FROM " . $db->prefix("shop_products") . " ORDER BY id_product DESC LIMIT {$start}," . $xoopsModuleConfig['recents']);
$var = 'recents';
include 'include/product-data.php';
$result = $db->query("SELECT * FROM " . $db->prefix("shop_products") . " ORDER BY hits DESC LIMIT {$start}," . $xoopsModuleConfig['populars']);
$var = 'popular';
include 'include/product-data.php';
$result = $db->query("SELECT * FROM " . $db->prefix("shop_products") . " ORDER BY RAND() LIMIT {$start}," . $xoopsModuleConfig['random']);
$var = 'random';
include 'include/product-data.php';
$categories = array();
ShopFunctions::categos_list($categories);
array_walk($categories, 'shop_dashed');
$xoopsTpl->assign('categories_list', $categories);
$xoopsTpl->assign('columns', $xoopsModuleConfig['columns']);
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:main.php

示例5: get_categories_names

 /**
  * Devuelve los nombres de las categorías a las que pertenece
  * el post actual
  * @param bool $asList Detemina si se muestra en forma de lista o de array
  * @param string $delimiter Delimitador para la lista
  * @param bool Get names with links. Only works when $asList equal true
  * @param string Section for link. It can be front or admin. Only works when $asList equal true
  * @return string or array
  */
 public function get_categories_names($asList = true, $delimiter = ',', $links = true, $section = 'front')
 {
     if (empty($this->lcats)) {
         $this->get_categos('data');
     }
     $rtn = $asList ? '' : array();
     $url = ShopFunctions::get_url();
     foreach ($this->lcats as $cat) {
         if ($asList) {
             if ($links) {
                 $category = new ShopCategory();
                 $category->assignVars($cat);
                 $rtn .= $rtn == '' ? '' : "{$delimiter}";
                 $rtn .= '<a href="' . ($section == 'front' ? $category->permalink() : 'products.php?cat=' . $cat['id_cat']) . '">' . $cat['name'] . '</a>';
             } else {
                 $rtn .= $rtn == '' ? $cat['name'] : "{$delimiter} {$cat['name']}";
             }
         } else {
             $rtn[] = $row['nombre'];
         }
     }
     return $rtn;
 }
开发者ID:laiello,项目名称:bitcero-modules,代码行数:32,代码来源:shopproduct.class.php

示例6: redirect_header

    if (!RMEvents::get()->run_event('rmcommon.captcha.check', true)) {
        redirect_header($url, 1, __('Please check the security words and write it correctly!', 'shop'));
        die;
    }
    $xoopsMailer =& getMailer();
    $xoopsMailer->useMail();
    $xoopsMailer->setBody(sprintf(__('A user has requested more information about the product %s. User message below.', 'shop'), $product->getVar('name')) . "\n---------------\n" . $message . "\n--------------\n" . __('Message sent with MiniShop', 'shop') . "\n" . ShopFunctions::get_url());
    $xoopsMailer->setToEmails($xoopsModuleConfig['email']);
    $xoopsMailer->setFromEmail($email);
    $xoopsMailer->setFromName($name);
    $xoopsMailer->setSubject(sprintf(__('Information request about product %s', 'shop'), $product->getVar('name')));
    if (!$xoopsMailer->send(true)) {
        redirect_header($url, 1, __('Message could not be delivered. Please try again.', 'shop'));
        die;
    }
    redirect_header(ShopFunctions::get_url(), 1, __('Your message has been sent successfully!', 'shop'));
} else {
    $xoopsOption['template_main'] = 'shop_contact.html';
    include 'header.php';
    $tf = new RMTimeFormatter(0, '%d%/%M%/%Y%');
    // Product data
    $xoopsTpl->assign('product', array('name' => $product->getVar('name'), 'description' => $product->getVar('description'), 'price' => sprintf(__('Price: <strong>%s</strong>', 'shop'), sprintf($xoopsModuleConfig['format'], number_format($product->getVar('price'), 2))), 'type' => $product->getVar('type'), 'stock' => $product->getVar('available'), 'image' => $product->getVar('image'), 'created' => sprintf(__('Since: <strong>%s</strong>', 'shop'), $tf->format($product->getVar('created'))), 'updated' => $product->getVar('modified') > 0 ? sprintf(__("Updated: <strong>%s</strong>", 'shop'), $tf->format($product->getVar('modified'))) : '', 'link' => $product->permalink(), 'metas' => $product->get_meta(), 'images' => $product->get_images()));
    $categories = array();
    ShopFunctions::categos_list($categories);
    array_walk($categories, 'shop_dashed');
    $xoopsTpl->assign('categories_list', $categories);
    $xoopsTpl->assign('lang_selcat', __('Select category...', 'shop'));
    $xoopsTpl->assign('xoops_pagetitle', sprintf(__('Requesting information about %s', 'shop'), $product->getVar('name')) . ' &raquo; ' . $xoopsModuleConfig['modtitle']);
    $xoopsTpl->assign('lang_requesting_info', sprintf(__('Request Information for %s', 'shop'), $product->getVar('name')));
    $xoopsTpl->assign('lang_yname', __('Your Name:', 'shop'));
    $xoopsTpl->assign('lang_ymail', __('Your Email:', 'shop'));
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:contact.php

示例7: explode

    $path = explode("/", $category);
    foreach ($path as $k) {
        if ($k == '') {
            continue;
        }
        $sql = "SELECT id_cat FROM {$tbl1} WHERE shortname='{$k}' AND parent='{$idp}'";
        $result = $db->query($sql);
        if ($db->getRowsNum($result) > 0) {
            list($idp) = $db->fetchRow($result);
        }
    }
    $category = $idp;
}
$catego = new ShopCategory($category);
if ($catego->isNew()) {
    redirect_header(ShopFunctions::get_url(), 1, __('Specified category could not be found', 'shop'));
    die;
}
// Category data
$xoopsTpl->assign('category', array('id' => $catego->id(), 'name' => $catego->getVar('name')));
$xoopsTpl->assign('lang_prodsincat', sprintf(__('Products in &#8216;%s&#8217; Category', 'shop'), $catego->getVar('name')));
$limit = $xoopsModuleConfig['numxpage'];
list($num) = $db->fetchRow($db->query("SELECT COUNT({$tbl2}.product) FROM {$tbl2}, {$tbl3} WHERE {$tbl2}.cat='{$category}' \n        AND {$tbl3}.id_product={$tbl2}.product"));
$page = isset($page) && $page > 0 ? $page : 1;
$tpages = ceil($num / $limit);
$page = $page > $tpages ? $tpages : $page;
$p = $page > 0 ? $page - 1 : $page;
$start = $num <= 0 ? 0 : $p * $limit;
$xoopsTpl->assign('page', $page);
$nav = new RMPageNav($num, $limit, $page, 5);
$nav->target_url($catego->permalink() . ($xoopsModuleConfig['urlmode'] ? 'page/{PAGE_NUM}/' : '&page={PAGE_NUM}'));
开发者ID:laiello,项目名称:bitcero-modules,代码行数:31,代码来源:category.php


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