Jump to content

feri_soft

Members
  • Posts

    147
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

feri_soft's Achievements

Member

Member (2/5)

0

Reputation

  1. Well yes, but even if not if they are ordered by place the first image will be the one with lowest place value. And if there are no images for the certain product i will just link to a local no-image.gif for example. Thats all. Remember it has to be done in one query, here is where it gets tricky
  2. Well its a list with all products and i want to show next to each product the first image for this product given its place not its id. I get to the point of joining the images but how to show only the 1st one by image.place. Thanks!
  3. Hi all, I am trying to do something with symfony, but first i should know how its done in mysql. I have 2 tables: products and images. Each product can have multiple images. And joining these two tables is very easy. But that way i recieve the images as array which i have to order by the field place (as i dont know how to order them by a field during the join). and then show the 1st. Which is a lot of phpcode for nothing. Another way is that what i am using now. During the loop of products call a simple query for the first image. But that can produce 1000s of queries. So my question is how to join only 1 image (the firs image not by PK but by another field place) to the product. Someone has proposed group by ... but i just dont have the knowledge or the idea on how to do it. I am opened to suggestions. Thanks!
  4. Hi all, I am using Codeigniter here but thats not the problem 100% i just need some php/mysql advice. I have a recursive function for getting all products in the cat and in its subcats and its working fine: function getAllProducts($catID, $limit, $offset){ $query = $this->db->getwhere('products',array('category' => $catID), $limit, $offset); if($query->num_rows() > 0){ foreach($query->result_array() as $product){ $this->products[] = $product; } } if($this->getSubCats($catID)){ foreach ($this->getSubCats($catID) as $subcat) { $this->getAllProducts($subcat['id'], $limit, $offset); } } return $this->products; } Now i can put the total_results, the url and so on in the pagination config, but when i try to manipulate the limit and offset in this function i get errors. $this->db->getAllproducts($cat_info['$id'], $config['per_page'], $this->uri->segment(3)); How am i supposed to change the function so that the correct articles are get. Now i get all on the first page and nothing on the rest... uri->segment is identical to $_GET[].... in a way
  5. Hello, i am having problems to do unlimited multiple level categories. I have managed to create them in a tree menu and i have also managed to get them work in unlimited chained selects via jQuery but i want them to be just like xcart: Please go to http://www.x-cart.com/demo/admin/home.php click login and try add a new product for example. You will see a multiple select box like: parent parent::child parent::child::child1 parent::child1::child2 or: parent::child parent::child::child1 parent::child::child1::child2 but i suppose the second will provide too long values. I have the following code now: http://pastebin.com/f66a1fb90 with the following db structure: CREATE TABLE `category` ( `id` int(11) NOT NULL auto_increment, `name` varchar(100) character set cp1251 collate cp1251_bulgarian_ci NOT NULL, `parent` int(11) NOT NULL, `place` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=cp1251 AUTO_INCREMENT=7 ; -- -- Dumping data for table `category` -- INSERT INTO `category` VALUES (1, 'asdasd', 0, 1); INSERT INTO `category` VALUES (2, 'asdasd1', 1, 2); INSERT INTO `category` VALUES (3, 'rrrrrr', 2, 3); INSERT INTO `category` VALUES (4, 'eeeeee', 3, 4); INSERT INTO `category` VALUES (5, 'ssss', 2, 5); INSERT INTO `category` VALUES (6, 'eeee', 2, 6); this is modified code i found on the net. Please help me with this because i just keep getting different errors. Now the output of the code is: which is pretty close to what i need but i also need in front of rrrrr to have asdasd1 again. I need it this way so i can specify more than one cat for a product and i like this structure more than the one i first created - the old fashioned tree menu style within the select. I will be glad to hear any suggestions!
  6. Maybe a lot of you know the site eyespot.com .It is possible to upload your own video and then mix it the way you want. Is there available a php library for modifying flv videos to mix them and add effects just like in eyespot. I know for flvtool 2 but i am not sure it will do the thing and i couldnt find any documentation for it. Thanks!
  7. That way i dont have the subcats ids and again i am not prettu sure how its going to be done even with the new data structure. So has anyone an idea of doing this?
  8. Hello, I am searching a way to make a tree menu for categories using php and smarty but as i am not very familiar with smarty syntax i cant do it with the functions i know. So here is what i have done: <ul > {section name=cats loop=$cats_list} <li><a href="index.php?cat={$cats_list[cats].cid}" tabindex="1">{$cats_list[cats].cname}</a></li> {if isset($scats_list) } {section name=scats loop=$scats_list} <li><a href="index.php?cat={$scats_list[scats].scid}" tabindex="1">{$scats_list[scats].scname}</a></li> {/section}{/if} {/section} </ul> And as of the php side: if(isset($_GET['cat']) && is_numeric($_GET['cat'])){ $cat_id = (int)$_GET['cat']; $subcats = mysql_query("SELECT * from cats where subof=$cat_id order by place"); $scats_ids = array(); $scats_names = array(); while($row1 = mysql_fetch_array($subcats)){ $scats_ids[] = $row1['id']; $scats_names[] = $row1['name']; $scats_list[] = array( "scname" => $row1["name"], "scid" => $row1["id"], ); } $tuts -> smarty -> assign("scats_ids", $scats_ids); $tuts -> smarty -> assign("scats_names", $scats_names); $tuts -> smarty -> assign("scats_list", $scats_list); } $cats = mysql_query("SELECT * from cats where subof=0 order by place"); $cats_ids = array(); $cats_names = array(); while($row = mysql_fetch_array($cats)){ $cats_ids[] = $row['id']; $cats_names[] = $row['name']; $cats_list[] = array( "cname" => $row["name"], "cid" => $row["id"], ); } $tuts -> smarty -> assign("cats_ids", $cats_ids); $tuts -> smarty -> assign("cats_names", $cats_names); $tuts -> smarty -> assign("cats_list", $cats_list); So all is working great but instead of getting the subcats under the desired category when set in the query string i get the subcats under all the categories. So please tell me some way to do this using php and smarty. I am looking for something like the categories on pixel2life excluding the ajax stuff just the basic function. Its not needed to be done with lists i can use divs as well but i want help on the smarty functions needed for doing this. Thanks all!
  9. <Cell ss:Index="2"><Data ss:Type="String">не</Data></Cell> не is actually the correct thing. but i am getting characters like: РіСЂ. Банско I am using office 2002 and just did save as --> xml spreadsheet Thanks!
  10. here it is [attachment deleted by admin]
  11. Yes here is the xml: <?xml version="1.0" encoding="UTF-8" ?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> <Author>Ilonka</Author> <LastAuthor>asdasd</LastAuthor> <LastPrinted>2005-06-27T07:18:10Z</LastPrinted> <Created>2003-06-10T11:09:22Z</Created> <LastSaved>2007-03-01T13:33:54Z</LastSaved> <Company>Fenix</Company> <Version>10.2625</Version> </DocumentProperties> <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office"> <DownloadComponents/> <LocationOfComponents HRef="file:///I:\Microsoft.Office.XP.Pro\"/> </OfficeDocumentSettings> <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> <WindowHeight>7320</WindowHeight> <WindowWidth>9720</WindowWidth> <WindowTopX>120</WindowTopX> <WindowTopY>120</WindowTopY> <AcceptLabelsInFormulas/> <ProtectStructure>False</ProtectStructure> <ProtectWindows>False</ProtectWindows> </ExcelWorkbook> <Styles> <Style ss:ID="Default" ss:Name="Normal"> <Alignment ss:Vertical="Bottom"/> <Borders/> <Font x:CharSet="1251"/> <Interior/> <NumberFormat/> <Protection/> </Style> <Style ss:ID="s21"> <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> <Borders> <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> </Borders> <Font ss:FontName="Times New Roman" x:CharSet="1251" x:Family="Roman" ss:Color="#800080"/> <Interior/> </Style> <Style ss:ID="s22"> <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> <Borders> <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> </Borders> <Font ss:FontName="Times New Roman" x:CharSet="1251" x:Family="Roman" ss:Color="#800080"/> <Interior/> <NumberFormat ss:Format="0%"/> </Style> <Style ss:ID="s23"> <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> <Borders> <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> </Borders> <Font ss:FontName="Times New Roman" x:CharSet="1251" x:Family="Roman" ss:Color="#800080" ss:Italic="1"/> <Interior/> </Style> <Style ss:ID="s24"> <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> <Borders> <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/> <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/> </Borders> <Font ss:FontName="Times New Roman" x:CharSet="1251" x:Family="Roman" ss:Color="#800080"/> <Interior ss:Color="#FFFF00" ss:Pattern="Solid"/> </Style> </Styles> <Worksheet ss:Name="9305858"> <Table ss:ExpandedColumnCount="12" ss:ExpandedRowCount="12" x:FullColumns="1" x:FullRows="1" ss:StyleID="s21"> <Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="37.5"/> <Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="20.25"/> <Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="41.25"/> <Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="28.5"/> <Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="33"/> <Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="100.5"/> <Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="19.5"/> <Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="21"/> <Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="22.5"/> <Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="64.5"/> <Column ss:Index="12" ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="27.75"/> <Row> <Cell ss:Index="2"><Data ss:Type="String">не</Data></Cell> <Cell><Data ss:Type="Number">38000</Data></Cell> <Cell><Data ss:Type="Number">38</Data></Cell> <Cell><Data ss:Type="String">1-ст.</Data></Cell> <Cell><Data ss:Type="String">бул. В.Левски</Data></Cell> <Cell><Data ss:Type="String">+</Data></Cell> <Cell><Data ss:Type="String">+</Data></Cell> <Cell><Data ss:Type="Number">2</Data></Cell> <Cell><Data ss:Type="String">отл</Data></Cell> <Cell><Data ss:Type="String">Златина</Data></Cell> <Cell><Data ss:Type="Number">56</Data></Cell> </Row> <Row> <Cell ss:Index="2"><Data ss:Type="String">не</Data></Cell> <Cell ss:Index="6"><Data ss:Type="String">гр. Банско</Data></Cell> <Cell ss:Index="10"><Data ss:Type="String">комплекс</Data></Cell> <Cell ss:Index="12"><Data ss:Type="Number">54</Data></Cell> </Row> <Row> <Cell ss:Index="3"><Data ss:Type="Number">23700</Data></Cell> <Cell><Data ss:Type="Number">39</Data></Cell> <Cell><Data ss:Type="String">1-ст.</Data></Cell> <Cell><Data ss:Type="String">гр. Несебър</Data></Cell> <Cell ss:Index="8"><Data ss:Type="String">ло</Data></Cell> <Cell><Data ss:Type="Number">2</Data></Cell> <Cell><Data ss:Type="String">лукс</Data></Cell> <Cell ss:Index="12"><Data ss:Type="Number">68</Data></Cell> </Row> <Row> <Cell ss:Index="3"><Data ss:Type="Number">31900</Data></Cell> <Cell><Data ss:Type="Number">38</Data></Cell> <Cell><Data ss:Type="String">1-ст.</Data></Cell> <Cell><Data ss:Type="String">гр. Несебър</Data></Cell> <Cell ss:Index="9"><Data ss:Type="Number">2</Data></Cell> <Cell><Data ss:Type="String">шп/зам</Data></Cell> <Cell ss:StyleID="s22"><Data ss:Type="String">Данчо</Data></Cell> <Cell><Data ss:Type="Number">65</Data></Cell> </Row> <Row> <Cell ss:Index="2"><Data ss:Type="String">не</Data></Cell> <Cell><Data ss:Type="String">E 62000</Data></Cell> <Cell><Data ss:Type="Number">40</Data></Cell> <Cell><Data ss:Type="String">1-ст.</Data></Cell> <Cell><Data ss:Type="String">к.к. Слънчев бряг</Data></Cell> <Cell><Data ss:Type="String">+</Data></Cell> <Cell><Data ss:Type="String">+</Data></Cell> <Cell ss:Index="10"><Data ss:Type="String">обз/лукс</Data></Cell> <Cell ss:Index="12"><Data ss:Type="Number">46</Data></Cell> </Row> <Row> <Cell ss:Index="2"><Data ss:Type="String">не</Data></Cell> <Cell ss:Index="6"><Data ss:Type="String">к.к. Слънчев бряг</Data></Cell> <Cell ss:Index="10"><Data ss:Type="String">комплекс</Data></Cell> <Cell ss:Index="12"><Data ss:Type="Number">55</Data></Cell> </Row> <Row> <Cell ss:Index="3"><Data ss:Type="Number">45500</Data></Cell> <Cell><Data ss:Type="Number">48</Data></Cell> <Cell><Data ss:Type="String">1-ст.</Data></Cell> <Cell><Data ss:Type="String">Лозенец</Data></Cell> <Cell><Data ss:Type="String">+</Data></Cell> <Cell><Data ss:Type="String">+</Data></Cell> <Cell><Data ss:Type="Number">10</Data></Cell> <Cell><Data ss:Type="String">с трапез.</Data></Cell> <Cell><Data ss:Type="String">Злати</Data></Cell> <Cell><Data ss:Type="Number">67</Data></Cell> </Row> <Row> <Cell ss:Index="2"><Data ss:Type="String">не</Data></Cell> <Cell><Data ss:Type="Number">29000</Data></Cell> <Cell><Data ss:Type="Number">48</Data></Cell> <Cell><Data ss:Type="String">1-ст.</Data></Cell> <Cell><Data ss:Type="String">Надежда 5</Data></Cell> <Cell><Data ss:Type="String">+</Data></Cell> <Cell><Data ss:Type="String">+</Data></Cell> <Cell><Data ss:Type="Number">6</Data></Cell> <Cell><Data ss:Type="String">преустр.</Data></Cell> <Cell ss:Index="12"><Data ss:Type="Number">61</Data></Cell> </Row> <Row> <Cell ss:Index="3"><Data ss:Type="Number">46600</Data></Cell> <Cell><Data ss:Type="Number">60</Data></Cell> <Cell><Data ss:Type="String">1-ст.</Data></Cell> <Cell><Data ss:Type="String">Овча купел 1</Data></Cell> <Cell ss:Index="8"><Data ss:Type="String">пр</Data></Cell> <Cell><Data ss:Type="Number">7</Data></Cell> <Cell><Data ss:Type="String">в строеж</Data></Cell> <Cell ss:Index="12"><Data ss:Type="Number">70</Data></Cell> </Row> <Row> <Cell ss:Index="2"><Data ss:Type="String">не</Data></Cell> <Cell><Data ss:Type="Number">13500</Data></Cell> <Cell><Data ss:Type="Number">32</Data></Cell> <Cell><Data ss:Type="String">1-ст.</Data></Cell> <Cell><Data ss:Type="String">с. Кранево</Data></Cell> <Cell><Data ss:Type="String">-</Data></Cell> <Cell ss:Index="9"><Data ss:Type="Number">1</Data></Cell> <Cell><Data ss:Type="String">до плажа</Data></Cell> <Cell ss:StyleID="s23"/> <Cell ss:StyleID="s23"><Data ss:Type="Number">37</Data></Cell> </Row> <Row> <Cell ss:Index="2"><Data ss:Type="String">не</Data></Cell> <Cell><Data ss:Type="String">Е 26000</Data></Cell> <Cell><Data ss:Type="Number">48</Data></Cell> <Cell><Data ss:Type="String">1-ст.</Data></Cell> <Cell><Data ss:Type="String">Х.Димитър</Data></Cell> <Cell><Data ss:Type="String">+</Data></Cell> <Cell><Data ss:Type="String">+</Data></Cell> <Cell><Data ss:Type="Number">7</Data></Cell> <Cell><Data ss:Type="String">чист</Data></Cell> <Cell><Data ss:Type="String">Вили</Data></Cell> <Cell><Data ss:Type="Number">51</Data></Cell> </Row> <Row ss:StyleID="s24"> <Cell ss:Index="3"><Data ss:Type="Number">90600</Data></Cell> <Cell><Data ss:Type="Number">60</Data></Cell> <Cell><Data ss:Type="String">1-ст.</Data></Cell> <Cell><Data ss:Type="String">ул. Л.Каравелов</Data></Cell> <Cell><Data ss:Type="String">+</Data></Cell> <Cell><Data ss:Type="String">+</Data></Cell> <Cell><Data ss:Type="Number">1</Data></Cell> <Cell><Data ss:Type="String">южен</Data></Cell> <Cell><Data ss:Type="String">Велислава</Data></Cell> <Cell><Data ss:Type="Number">71</Data></Cell> </Row> </Table> <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"> <Print> <ValidPrinterInfo/> <HorizontalResolution>600</HorizontalResolution> <VerticalResolution>0</VerticalResolution> </Print> <Selected/> <Panes> <Pane> <Number>3</Number> <ActiveRow>7</ActiveRow> <ActiveCol>5</ActiveCol> </Pane> </Panes> <ProtectObjects>False</ProtectObjects> <ProtectScenarios>False</ProtectScenarios> </WorksheetOptions> <Sorting xmlns="urn:schemas-microsoft-com:office:excel"> <Sort>Column F</Sort> <Sort>Column C</Sort> </Sorting> </Worksheet> </Workbook> Those are real estate listings. Every non latin character is listed wrong.
×
×
  • 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.