本文整理汇总了PHP中ps_DB::get_row方法的典型用法代码示例。如果您正苦于以下问题:PHP ps_DB::get_row方法的具体用法?PHP ps_DB::get_row怎么用?PHP ps_DB::get_row使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ps_DB
的用法示例。
在下文中一共展示了ps_DB::get_row方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: vmGet
//.........这里部分代码省略.........
$tpl->set('desc_width', $dw);
$tpl->set('attrib_width', $aw);
// End show Header Row
if ($ci % 2) {
$bgcolor = "vmRowOne";
} else {
$bgcolor = "vmRowTwo";
}
$products[$ci]['bgcolor'] = $bgcolor;
$products[$ci]['product_id'] = $db->f("product_id");
$products[$ci]["category_id"] = $category_id;
$products[$ci]["Itemid"] = $Itemid;
// If this is a child of a parent set the correct product_id for page return
if (@$child_id && $pp) {
$products[$ci]['parent_id'] = $db->f("product_id");
} else {
$master_id = $parent_id;
$products[$ci]['parent_id'] = $parent_id;
}
$flypage = $ps_product->get_flypage($products[$ci]['parent_id']);
$products[$ci]["flypage"] = $flypage;
// Images
// If it is item get parent:
$product_parent_id = $db->f("product_parent_id");
if ($product_parent_id != 0) {
$dbp = new PS_db();
$dbp->query("SELECT product_full_image,product_thumb_image,product_name,product_s_desc FROM #__{vm}_product WHERE product_id='{$product_parent_id}'");
$dbp->next_record();
}
$product_full_image = $parent_id != 0 && !$db->f("product_full_image") ? $dbp->f("product_full_image") : $db->f("product_full_image");
// Change
$product_thumb_image = $parent_id != 0 && !$db->f("product_thumb_image") ? $dbp->f("product_thumb_image") : $db->f("product_thumb_image");
// Change
$productData = $db->get_row();
$productArray = get_object_vars($productData);
$productArray["product_id"] = $db->f("product_id");
$productArray["product_full_image"] = $product_full_image;
// to display the full image on flypage
$productArray["product_thumb_image"] = $product_thumb_image;
$tpl->set('productArray', $productArray);
foreach ($productArray as $property => $value) {
$tpl->set($property, $value);
}
// Assemble the thumbnail image as a link to the full image
// This function is defined in the theme (theme.php)
$product_image = $tpl->vmBuildFullImageLink($productArray);
$products[$ci]['product_image'] = $product_image;
//Product Description
$link = "";
if ($child_link == "Y" && !@$child_id) {
$link = "<input type=\"hidden\" id=\"index_id" . $db->f("product_id") . "\" value=\"" . $db->f("product_id") . "\" />\n";
// If content plugins are enabled, reload the whole page; otherwise, use ajax
if (VM_CONTENT_PLUGINS_ENABLE == '1') {
$link .= "<a name=\"" . $db->f("product_name") . $db->f("product_id") . "\" onclick=\"var id = \$('index_id" . $db->f("product_id") . "').value; if(id != '') { document.location = '" . $mm_action_url . "index.php?option=com_virtuemart&page=shop.product_details&flypage={$flypage}&Itemid={$Itemid}&category_id={$category_id}&product_id=' + id; }\" >";
} else {
$link .= "<a name=\"" . $db->f("product_name") . $db->f("product_id") . "\" onclick=\"var id = \$('index_id" . $db->f("product_id") . "').value; if(id != '') { loadNewPage( 'vmMainPage', '" . $mm_action_url . "index2.php?option=com_virtuemart&page=shop.product_details&flypage={$flypage}&Itemid={$Itemid}&category_id={$category_id}&product_id=' + id ); }\" >";
}
$tpl->set('child_link', true);
} else {
$tpl->set('child_link', false);
}
$html1 = $db->f("product_name");
if ($child_link == "Y" && !@$child_id) {
$html1 .= "</a>";
}
$products[$ci]['product_title'] = $link . $html1;
示例2: array
$bgcolor = 'row1';
}
$t = $dbt->f("product_quantity") * $dbt->f("product_final_price");
// Check if it's a downloadable product
$downloadable = false;
$files = array();
$dbd->query('SELECT product_id, attribute_name
FROM `#__{vm}_product_attribute`
WHERE product_id=' . $dbt->f('product_id') . ' AND attribute_name=\'download\'');
if ($dbd->next_record()) {
$downloadable = true;
$dbd->query('SELECT product_id, end_date, download_max, download_id, file_name
FROM `#__{vm}_product_download`
WHERE product_id=' . $dbt->f('product_id') . ' AND order_id=\'' . $order_id . '\'');
while ($dbd->next_record()) {
$files[] = $dbd->get_row();
}
}
?>
<tr class="<?php
echo $bgcolor;
?>
" valign="top">
<?php
$ps_order_change_html->html_change_delete_item($dbt->f("order_item_id"));
?>
<?php
$ps_order_change_html->html_change_item_quantity($dbt->f("order_item_id"), $dbt->f("product_quantity"));
?>
<td width="30%" align="left">
<?php
示例3: getFilesForProduct
/**
* Returns an array holding all the files and images of the specified product
* $files['files'] holds all files as objects
* $files['images'] holds all images as objects
*
* @param unknown_type $pid
* @return unknown
*/
function getFilesForProduct($pid)
{
$db = new ps_DB();
$files['images'] = array();
$files['files'] = array();
$db->query("SELECT * FROM `#__{vm}_product_files` WHERE `file_product_id`=" . intval($pid) . " AND `file_published`=1");
while ($db->next_record()) {
switch ($db->f('file_is_image')) {
case 0:
$files['files'][] = $db->get_row();
break;
case 1:
$files['images'][] = $db->get_row();
break;
}
}
return $files;
}
示例4: shopMakeHtmlSafe
}
$recent_products = $ps_product->recentProducts($product_id, $tpl->get_cfg('showRecent', 5));
/**
* This has changed since VM 1.1.0
* Now we have a template object that can use all variables
* that we assign here.
*
* Example: If you run
* $tpl->set( "product_name", $product_name );
* The variable "product_name" will be available in the template under this name
* with the value of $product_name
*
* */
// This part allows us to copy ALL properties from the product table
// into the template
$productData = $db_product->get_row();
$productArray = get_object_vars($productData);
$productArray["product_id"] = $product_id;
$productArray["product_full_image"] = $product_full_image;
// to display the full image on flypage
$productArray["product_thumb_image"] = $product_thumb_image;
$productArray["product_name"] = shopMakeHtmlSafe($productArray["product_name"]);
$tpl->set('productArray', $productArray);
foreach ($productArray as $property => $value) {
$tpl->set($property, $value);
}
// Assemble the thumbnail image as a link to the full image
// This function is defined in the theme (theme.php)
$product_image = $tpl->vmBuildFullImageLink($productArray);
$tpl->set("product_id", $product_id);
$tpl->set("product_name", $product_name);
示例5: getFilesForProduct
/**
* Returns an array holding all the files and images of the specified product
* $files['files'] holds all files as objects
* $files['images'] holds all images as objects
* $files['product_id] holds the product_id of the child or parent that holds files as objects
* Query has to be done twice, because parent could old either/or files/images. Must allow inheritance of both
* @param unknown_type $pid
* @return unknown
*/
function getFilesForProduct($pid)
{
$db = new ps_DB();
$files['images'] = array();
$files['files'] = array();
// Query for images if child doesn't have them check for parents
$db->query("SELECT * FROM `#__{vm}_product_files` WHERE `file_product_id`=" . intval($pid) . " AND `file_is_image`=1 AND `file_published`=1");
if (!$db->next_record()) {
$db->query("SELECT product_parent_id FROM #__{vm}_product WHERE product_id=" . intval($pid));
$db->query("SELECT * FROM `#__{vm}_product_files` WHERE `file_product_id`=" . $db->f("product_parent_id") . " AND `file_is_image`=1 AND `file_published`=1");
}
$db->reset();
while ($db->next_record()) {
$files['images'][] = $db->get_row();
}
// Query for files if child doesn't have them check for parent
$files['product_id'] = intval($pid);
$db->query("SELECT * FROM `#__{vm}_product_files` WHERE `file_product_id`=" . intval($pid) . " AND `file_is_image`=0 AND `file_published`=1");
if (!$db->next_record()) {
$db->query("SELECT product_parent_id FROM #__{vm}_product WHERE product_id='{$pid}'");
// Parent has files so set files['product_id'] to parent id
$files['product_id'] = intval($db->f("product_parent_id"));
$db->query("SELECT * FROM `#__{vm}_product_files` WHERE `file_product_id`=" . $db->f("product_parent_id") . " AND `file_is_image`=0 AND `file_published`=1");
}
$db->reset();
while ($db->next_record()) {
$files['files'][] = $db->get_row();
}
return $files;
}