本文整理汇总了PHP中MG::textMore方法的典型用法代码示例。如果您正苦于以下问题:PHP MG::textMore方法的具体用法?PHP MG::textMore怎么用?PHP MG::textMore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MG
的用法示例。
在下文中一共展示了MG::textMore方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
</div>
<?php
}
?>
<div class="order-total">
<ul class="total-list">
<?php
if ($coupon) {
?>
<li>Купон: <span title="<?php
echo $coupon;
?>
"><?php
echo MG::textMore($coupon, 20);
?>
</span></li>
<?php
}
?>
<li>Итого: <span><?php
echo MG::numberFormat($order['summ']) . ' ' . $perCurrencyShort;
?>
</span></li>
<?php
if ($order['description']) {
?>
<li>Доставка: <span><?php
echo $order['description'];
?>
示例2: isset
echo SITE;
?>
/<?php
echo isset($item["category_url"]) ? $item["category_url"] : 'catalog';
?>
/<?php
echo $item["product_url"];
?>
"><?php
echo $item["title"];
?>
</a>
</div>
<div class="product-description">
<?php
echo MG::textMore($item["description"], 240);
?>
</div>
<div class="product-footer">
<div class="product-price">
<span class="product-old-price" <?php
echo !$item['old_price'] ? 'style="display:none"' : 'style="display:block"';
?>
>
<?php
echo $item["old_price"];
?>
<?php
echo $data['currency'];
?>
</span>
示例3: exportToYml
//.........这里部分代码省略.........
$xml->startElement("currency");
$xml->writeAttribute("id", $currencyShopIso);
$xml->writeAttribute("rate", $currencyRate);
$xml->endElement();
//currency
$xml->endElement();
//currencies
$xml->startElement("categories");
// получаем id категорий и id их родителей
$sql = '
SELECT id, parent, title
FROM `' . PREFIX . 'category`
ORDER BY id';
$res = DB::query($sql);
while ($row = DB::fetchAssoc($res)) {
$xml->startElement("category");
$xml->writeAttribute("id", $row['id']);
if ($row['parent'] > 0) {
$xml->writeAttribute("parentId", $row['parent']);
}
$xml->text($row['title']);
$xml->endElement();
//category
}
$xml->endElement();
//categories
$costDelivery = "0";
$sql = 'SELECT `cost` FROM `' . PREFIX . 'delivery` WHERE `ymarket` = 1';
$res = DB::query($sql);
while ($row = DB::fetchAssoc($res)) {
$costDelivery = $row['cost'];
}
if ($costDelivery == 0) {
$costDelivery = "0";
}
$xml->writeElement("local_delivery_cost", $costDelivery);
$xml->startElement("offers");
$where = ' 1=1';
if (YML_ONLY_AVAILABLE == '1') {
$where = ' p.count <> 0 ';
}
if (!empty($listProductId)) {
$where = ' p.id IN (' . DB::quote(implode(',', $listProductId), 1) . ')';
}
$sql = '
SELECT
c.title as category_title,
CONCAT(c.parent_url,c.url) as category_url,
p.url as product_url,
p.*, rate,(p.price_course + p.price_course * (IFNULL(rate,0))) as `price_course`
FROM `' . PREFIX . 'product` p
LEFT JOIN `' . PREFIX . 'category` c
ON c.id = p.cat_id
WHERE ' . $where . '
ORDER BY c.id
';
$res = DB::query($sql);
$currencyShopIso = MG::getSetting('currencyShopIso');
while ($row = DB::fetchAssoc($res)) {
if ($row['price'] > 0 && $row['activity'] == 1) {
$row['currency_iso'] = $row['currency_iso'] ? $row['currency_iso'] : $currencyShopIso;
$available = $row['count'] == 0 ? "false" : "true";
$xml->startElement("offer");
$xml->writeAttribute("id", $row['id']);
$xml->writeAttribute("available", $available);
$xml->writeElement("url", SITE . '/' . $row['category_url'] . '/' . $row['url']);
$xml->writeElement("price", $row['price_course']);
$xml->writeElement("currencyId", $currencyShopIso);
$xml->writeElement("categoryId", $row['cat_id']);
$arrayImages = explode("|", $row['image_url']);
if (!empty($arrayImages)) {
$row['image_url'] = $arrayImages[0];
}
$xml->writeElement("picture", SITE . '/uploads/' . urlencode($row['image_url']));
$xml->writeElement("local_delivery_cost", $costDelivery);
$xml->writeElement("name", $row['title']);
$xml->writeElement("description", MG::textMore($row['description'], 500));
$xml->writeElement("sales_notes", $row['yml_sales_notes']);
$xml->writeElement("manufacturer_warranty", "true");
$xml->endElement();
}
}
$xml->endElement();
//offers
$xml->endElement();
//shop
$xml->endElement();
//yml_catalog
$nXML .= $xml->outputMemory();
$nXML = mb_convert_encoding($nXML, "WINDOWS-1251", "UTF-8");
if (empty($listProductId)) {
echo $nXML;
exit;
} else {
$date = date('m_d_Y_h_i_s');
file_put_contents('data_yml_' . $date . '.xml', $nXML);
$msg = 'data_yml_' . $date . '.xml';
}
return $msg;
}
示例4: newCategory
/**
* Создание новой категории.
* @param $category - категория.
*/
function newCategory($category)
{
$url = URL::prepareUrl(MG::translitIt($category['name'], 1));
$parent_url = MG::get('category')->getParentUrl($category['parent_id']);
$parent = URL::prepareUrl(MG::translitIt($category['parentname'], 1));
$data = array('title' => $category['name'], 'url' => str_replace(array('/', '\\'), '-', $url), 'parent' => $category['parent_id'], 'html_content' => $category['description'], 'meta_title' => $category['name'], 'meta_keywords' => $category['name'], 'meta_desc' => MG::textMore($category['description'], 157), 'invisible' => 0, 'parent_url' => $parent_url, '1c_id' => $category['1c_id']);
$res = DB::query('SELECT *
FROM `' . PREFIX . 'category`
WHERE `1c_id`=' . DB::quote($category['1c_id']));
if ($row = DB::fetchAssoc($res)) {
DB::query('
UPDATE `' . PREFIX . 'category`
SET ' . DB::buildPartQuery($data) . '
WHERE `1c_id`=' . DB::quote($category['1c_id']));
return $row['id'];
} else {
$data = MG::get('category')->addCategory($data);
return $data['id'];
}
return 0;
}