".mysql_error()); // Display random content $random_querry = "SELECT product_id, product_name, category, sub_category, description, thumbnail, price, retail_price FROM $cfg[sass_prod_table] ORDER BY RAND() LIMIT 2"; $pages = 1; mysql_select_db($cfg['database'], $mydb); $radom_result = mysql_query($random_querry) or die (mysql_error()); $col=1; while ($random_row = mysql_fetch_assoc($radom_result)) { if ($cfg['seo']) { $temp = sanitize($random_row['product_name']); $random_row['int_link'] = "prod-$random_row[product_id]-$temp.html"; } else { $random_row['int_link'] = "prod.php?product_id=$random_row[product_id]&merchant_id=$merchant_id"; } $random_row['tr_start'] = ($col == 1 ? "" : ""); $random_row['tr_end'] = ($col == 4 ? "" : ""); $random_array[] = $random_row; $col++; if ($col > $cfg['columns_per_page']) {$col=1;} } // Display random content END $query = "SELECT product_id, product_name, merchant_id, merchant_name, link, thumbnail, image, price, retail_price, category, sub_category, category_text, sub_category_text, description FROM $cfg[sass_prod_table] WHERE product_id = '$product_id'"; mysql_select_db($cfg['database'], $mydb); $result = @mysql_query($query) or die (mysql_error()); $row = mysql_fetch_assoc($result); $row['formatted_price'] = '$'.number_format($row['price'], 2, '.', ','); if ($row['retail_price'] > 0) { $row['formatted_retail_price'] = '$'.number_format($row['retail_price'], 2, '.', ','); } else { $row['formatted_retail_price'] = ""; } $tpl->set('record', $row); // Display random content $tpl->set('random_record', $random_array); // Display random content $random_content = $tpl->fetch('templates/random.tpl'); $main_content = $tpl->fetch('templates/product_details.tpl'); if ($cfg['seo']) { $main_cat_link = "merchant_product_list-$merchant_id.html"; } else { $main_cat_link = "merchant_product_list.php?merchant_id=$merchant_id"; } // ************************************************************************************ // * * // * * // * * // ************************************************************************************ $tpl2 = & new Template(); $tpl2->set('merchant',get_merchant_list()); $tpl2->set('maincat',get_maincat_list($merchant_id)); $tpl2->set('site_name',get_site_name()); $tpl2->set('description','Online fishing best price for '.$row['product_name'].'. Get '.$row['product_name'].' fishing gear online.'); $tpl2->set('keywords',$row['product_name'].' '.get_site_keywords()); $tpl2->set('title',$row['product_name'].' by Online Fishing'); $tpl2->set('notice_message',get_notice_message()); $tpl2->set('main_content',$main_content); $x = $tpl2->fetch('templates/master.tpl'); echo $x; ?>