本文整理汇总了PHP中ps_DB::sf方法的典型用法代码示例。如果您正苦于以下问题:PHP ps_DB::sf方法的具体用法?PHP ps_DB::sf怎么用?PHP ps_DB::sf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ps_DB
的用法示例。
在下文中一共展示了ps_DB::sf方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
?>
:
</td>
<td><input type="text" class="inputbox" onkeyup="updateNet();"
name="product_price_incl_tax" size="10" /></td>
</tr>
<tr>
<td class="labelcell">
<?php
echo $VM_LANG->_('PHPSHOP_PRICE_FORM_CURRENCY');
?>
:
</td>
<td>
<?php
$ps_html->list_currency("product_currency", $db->sf("product_currency"));
?>
</td>
</tr>
<tr>
<td class="labelcell"> <?php
echo $VM_LANG->_('PHPSHOP_PRICE_FORM_GROUP');
?>
:
</td>
<td><?php
echo ps_shopper_group::list_shopper_groups("shopper_group_id", $db->sf("shopper_group_id"));
?>
</td>
</tr>
<tr>
示例2: recentProducts
function recentProducts($product_id, $maxitems)
{
global $db, $VM_LANG, $sess;
if ($maxitems == 0) {
return;
}
$recentproducts = $_SESSION['recent'];
//No recent products so return empty
if ($recentproducts['idx'] == 0) {
//return "";
}
$tpl = new $GLOBALS['VM_THEMECLASS']();
$db = new ps_DB();
$dbp = new ps_DB();
$k = 0;
$recent = array();
// Iterate through loop backwards (newest to oldest)
for ($i = $recentproducts['idx'] - 1; $i >= 0; $i--) {
//Check if on current product and don't display
if ($recentproducts[$i]['product_id'] == $product_id) {
continue;
}
// If we have not reached max products add the next product
if ($k < $maxitems) {
$prod_id = $recentproducts[$i]['product_id'];
$category_id = $recentproducts[$i]['category_id'];
$q = "SELECT product_name, category_name, c.category_flypage,product_s_desc,product_thumb_image ";
$q .= "FROM #__{vm}_product as p,#__{vm}_category as c,#__{vm}_product_category_xref as cx ";
$q .= "WHERE p.product_id = '{$prod_id}' ";
$q .= "AND c.category_id = '{$category_id}' ";
$q .= "AND p.product_id = cx.product_id ";
$q .= "AND c.category_id=cx.category_id ";
$q .= "AND p.product_publish='Y' ";
$q .= "AND c.category_publish='Y' ";
$q .= "LIMIT 0,1";
$db->query($q);
if (!$db->next_record()) {
continue;
}
if (!$this->is_product($prod_id)) {
$prod_id_p = $this->get_field($prod_id, "product_parent_id");
$q = "SELECT product_name,category_name, c.category_flypage,product_s_desc,product_thumb_image ";
$q .= "FROM #__{vm}_product as p,#__{vm}_category as c,#__{vm}_product_category_xref as cx ";
$q .= "WHERE p.product_id = '{$prod_id_p}' ";
$q .= "AND c.category_id = '{$category_id}' ";
$q .= "AND p.product_id = cx.product_id ";
$q .= "AND c.category_id=cx.category_id LIMIT 0,1";
$dbp->query($q);
}
$recent[$k]['product_s_desc'] = $db->f("product_s_desc");
if ($recent[$k]['product_s_desc'] == "" && !empty($prod_id_p)) {
$recent[$k]['product_s_desc'] = $dbp->f("product_s_desc");
}
$flypage = $db->f("category_flypage");
if (empty($flypage) && !empty($prod_id_p)) {
$flypage = $dbp->sf("category_flypage");
}
if (empty($flypage)) {
$flypage = FLYPAGE;
}
$flypage = str_replace('shop.', '', $flypage);
$flypage = stristr($flypage, '.tpl') ? $flypage : $flypage . '.tpl';
$recent[$k]['product_url'] = $sess->url("page=shop.product_details&product_id={$prod_id}&category_id={$category_id}&flypage={$flypage}");
$recent[$k]['category_url'] = $sess->url("page=shop.browse&category_id={$category_id}");
$recent[$k]['product_name'] = $db->f("product_name");
if ($recent[$k]['product_name'] == "" && !empty($prod_id_p)) {
$recent[$k]['product_name'] = $dbp->f("product_name");
}
$recent[$k]['product_name'] = shopMakeHtmlSafe($recent[$k]['product_name']);
$recent[$k]['category_name'] = $db->f("category_name");
if ($recent[$k]['category_name'] == "" && !empty($prod_id_p)) {
$recent[$k]['category_name'] = $dbp->f("category_name");
}
$recent[$k]['product_thumb_image'] = $db->f("product_thumb_image");
if ($recent[$k]['product_thumb_image'] == "" && !empty($prod_id_p)) {
$recent[$k]['product_thumb_image'] = $dbp->f("product_thumb_image");
}
$k++;
}
}
if ($k == 0) {
return "";
}
$tpl->set("recent_products", $recent);
return $tpl->fetch('common/recent.tpl.php');
}
示例3: listUserFields
//.........这里部分代码省略.........
}
// a delimiter marks the beginning of a new fieldset and
// the end of a previous fieldset
if ($field->type == 'delimiter') {
if ($delimiter > 0) {
echo "</fieldset>\n";
}
if (VM_REGISTRATION_TYPE == 'SILENT_REGISTRATION' && $field->title == $VM_LANG->_('PHPSHOP_ORDER_PRINT_CUST_INFO_LBL') && $page == 'checkout.index') {
continue;
}
echo '<fieldset>
<legend class="sectiontableheader">' . $field->title . '</legend>
';
$delimiter++;
continue;
}
echo '<div id="' . $field->name . '_div" class="formLabel ';
if (stristr($missing, $field->name)) {
echo 'missing';
}
echo '">';
echo '<label for="' . $field->name . '_field">' . $field->title . '</label>';
if (isset($required_fields[$field->name])) {
echo '<strong>* </strong>';
}
echo ' </div>
<div class="formField" id="' . $field->name . '_input">' . "\n";
/**
* This is the most important part of this file
* Here we print the field & its contents!
*/
switch ($field->name) {
case 'title':
$ps_html->list_user_title($db->sf('title'), "id=\"title_field\"");
break;
case 'country':
if (in_array('state', $allfields)) {
$onchange = "onchange=\"changeStateList();\"";
} else {
$onchange = "";
}
$ps_html->list_country("country", $db->sf('country'), "id=\"country_field\" {$onchange}");
break;
case 'state':
echo $ps_html->dynamic_state_lists("country", "state", $db->sf('country'), $db->sf('state'));
echo "<noscript>\n";
$ps_html->list_states("state", $db->sf('state'), "", "id=\"state_field\"");
echo "</noscript>\n";
break;
case 'agreed':
echo '<input type="checkbox" id="agreed_field" name="agreed" value="1" class="inputbox" />';
break;
case 'password':
case 'password2':
echo '<input type="password" id="' . $field->name . '_field" name="' . $field->name . '" size="30" class="inputbox" />' . "\n";
break;
default:
switch ($field->type) {
case 'date':
echo vmCommonHTML::scriptTag($mosConfig_live_site . '/includes/js/calendar/calendar.js');
if (vmIsJoomla('1.5', '>=')) {
// in Joomla 1.5, the name of calendar lang file is changed...
echo vmCommonHTML::scriptTag($mosConfig_live_site . '/includes/js/calendar/lang/calendar-en-GB.js');
} else {
echo vmCommonHTML::scriptTag($mosConfig_live_site . '/includes/js/calendar/lang/calendar-en.js');
}
示例4: substr
$mainframe->setPageTitle($db->f("category_name"));
$desc = $ps_product_category->get_description($category_id);
$desc = vmCommonHTML::ParseContentByPlugins($desc);
/* Prepend Product Short Description Meta Tag "description" when applicable */
$mainframe->prependMetaTag("description", substr(strip_tags($desc), 0, 255));
}
// when nothing has been found we tell this here and say goodbye
if ($num_rows == 0 && (!empty($keyword) || !empty($keyword1))) {
echo $VM_LANG->_('PHPSHOP_NO_SEARCH_RESULT');
} elseif ($num_rows == 0 && empty($product_type_id) && !empty($child_list)) {
echo $VM_LANG->_('EMPTY_CATEGORY');
} elseif ($num_rows == 1 && (!empty($keyword) || !empty($keyword1))) {
// If just one product has been found, we directly show the details page of it
$db_browse->query($list);
$db_browse->next_record();
$flypage = $db_browse->sf("category_flypage") ? $db_browse->sf("category_flypage") : FLYPAGE;
$url_parameters = "page=shop.product_details&flypage={$flypage}&product_id=" . $db_browse->f("product_id") . "&category_id=" . $db_browse->f("category_id");
vmRedirect($sess->url($url_parameters, true, false));
} else {
// NOW START THE PRODUCT LIST
$tpl = vmTemplate::getInstance();
if ($category_id) {
/**
* CATEGORY DESCRIPTION
*/
$browsepage_lbl = $category_name;
$tpl->set('browsepage_lbl', $browsepage_lbl);
$tpl->set('desc', $desc);
$category_childs = $ps_product_category->get_child_list($category_id);
$tpl->set('categories', $category_childs);
$navigation_childlist = $tpl->fetch('common/categoryChildlist.tpl.php');
示例5:
// Date & Time
// Date & Time
case "A":
// Date
// Date
case "M":
// Time
echo " <input type=\"text\" class=\"inputbox\" name=\"product_type_" . $product_type_id . "_" . $dbpt->f("parameter_name") . "\" value=\"" . $dbp->f($dbpt->f("parameter_name")) . "\" size=\"20\" />";
break;
case "T":
// Text
// Text
case "S":
// Short Text
echo "<textarea class=\"inputbox\" name=\"product_type_" . $product_type_id . "_" . $dbpt->f("parameter_name") . "\" cols=\"35\" rows=\"6\" >";
echo $dbp->sf($dbpt->f("parameter_name")) . "</textarea>";
break;
case "C":
// Char
echo " <input type=\"text\" class=\"inputbox\" name=\"product_type_" . $product_type_id . "_" . $dbpt->f("parameter_name") . "\" value=\"" . $dbp->f($dbpt->f("parameter_name")) . "\" size=\"5\" />";
break;
case "V":
// Multiple Values
echo " <input type=\"text\" class=\"inputbox\" name=\"product_type_" . $product_type_id . "_" . $dbpt->f("parameter_name") . "\" value=\"" . $dbp->f($dbpt->f("parameter_name")) . "\" size=\"20\" />";
// $fields=explode(";",$parameter_values);
// echo "<select class=\"inputbox\" name=\"product_type_".$product_type_id."_".$dbpt->f("parameter_name");
// if ($db->f("parameter_multiselect")=="Y") {
// $size = min(count($fields),6);
// echo "[]\" multiple size=\"$size\">\n";
// $selected_value = array();
// $get_item_value = explode(",",$dbp->sf($dbpt->f("parameter_name")));