Jump to content

nudl3s

Members
  • Posts

    13
  • Joined

  • Last visited

nudl3s's Achievements

Member

Member (2/5)

0

Reputation

  1. OMG little mistake here passthru("ffmpeg -i $tmp 2>&1"); replace ffmpeg with $ffmpeg (my path to ffmpeg) ....
  2. It returns me : "array(0) { } " I worked on that before weeks and It was working fine, I have some videos I added then and they have duration time. But now when I try to add some file it returns me duration 00:00:00.
  3. Hello all, I dont know why I'm getting this error with calculating the duration for the video, everything works fine with uploading, file is going in my database and folder, the duration of my video is ok. ​http://prnt.sc/e59i4f here is my code: // video duration ob_start(); passthru("ffmpeg -i $tmp 2>&1"); $duration = ob_get_contents(); ob_end_clean(); $search='/Duration: (.*?)[.]/'; $duration=preg_match($search, $duration, $matches, PREG_OFFSET_CAPTURE); //error is on this line botom $duration = $matches[1][0]; ​//error is on this line botom list($hours, $mins, $secs) = split('[:]', $duration); //echo "Hours: ".$hours." Minutes: ".$mins." Seconds: ".$secs; $duration=$hours.':'.$mins.':'.$secs;
  4. All done Thanks all for the help. The limit of 10 i made like: <?php foreach($sub_array as $break=>$row): ?> <?php if ($break == 10): ?> <?php break; ?> <?php endif ?> And the issue for the product from same category: This <?php $title_cat = stripslashes($row->CatTitle); ?> Replace with : <?php $title_cat = $sub_array[0]->CatTitle ?>
  5. How to make contact with you more private, you have skype or something
  6. Psycho thanks a lot for your comments I need more time to be a good php programmer, I tried with your code but the page cannot be open shows up. About mac_gyver I am trying with your code and it helps a lot. All I wanted is to show all categoryes that have products with "promo_page = 1" and the maximum for each category to be 10. Example: Category 1: maximum 10 products from each category - product from cat 1 - product from cat 1 - product from cat 1 Category 2: - product from cat 2 - product from cat 2 - product from cat 2 For the moment is this with little issues. Products from the third category have to be in category 1 and these from category 2 goes in category 3. How to repair that, and how to put limit of 10 to products in each category. The Code : <?php $this->view("common/header"); ?> <?php error_reporting(E_ALL); ?> <link rel="canonical" href="<? echo site_url() ?>" /> <!-- <link rel="stylesheet" href="/css/bx_styles/bx_styles.css" type="text/css" /> --> <!-- <script type="text/javascript" src="/js/jquery.bxSlider.js"></script> --> <!-- <script type="text/javascript" src="/js/jquery.bxslider.min.js"></script> --> <div class="inner"> <div class="inner shadow"> <?php $query = "SELECT p.id, p.title_".$this->config->config['language']." as Title, p.text_".$this->config->config['language']." as Text, c.title_".$this->config->config['language']." as CatTitle, b.title_".$this->config->config['language']." as BrandTitle, p.price, p.package, p.discount, img.id as FileID, img.ext FROM products as p LEFT JOIN products_pictures as img ON(img.object_id = p.id ) LEFT JOIN categories as c ON( c.id = p.category_id ) LEFT JOIN brands as b ON( p.brand_id = b.id) WHERE p.promo_page = 1 AND p.is_active = 1 AND b.is_active = 1 AND c.is_active = 1 ORDER BY c.id"; $result = $this->db->query($query); ?> <?php $data = array(); ?> <?php foreach($result->result() as $row) : ?> <?php $data[$row->CatTitle][] = $row; ?> <?php endforeach; ?> <!-- to produce the output - --> <?php foreach($data as $CatTitle=>$sub_array): ?> <!-- // use $CatTitle here to produce the category heading --> <?php $title_cat = stripslashes($row->CatTitle); ?> <div class="prod-sec"> <div class="prod-head"> <h2><?= $title_cat?></h2> </div> <?php foreach($sub_array as $row): ?> <!-- // use the elements in $row to produce the output for each product under the category --> <?php $img_src = site_url(); $img_formats = "jpg,jpeg,png,gif"; if(strstr($img_formats, $row->ext)) { $img_src .= "files/products/".$row->id."/".$row->FileID."_1.".$row->ext; } elseif($row->ext=="flv") { $img_src .= "images/video.png"; } else { $img_src .= "files/default.jpg"; } $title = character_limiter(stripslashes($row->Title), 55); $title_url = getLinkTitle($title); $link = site_url()."products/product/".$row->id."/{$title_url}"; ?> <div itemscope itemtype="http://schema.org/Product"> <div class="gall-products"> <div> <h2 itemprop="name"><a target="_blank" itemprop="url" href="<?=$link?>" title="<?=$title?>" rel="overdiv_hidden_1_<?=$row->id?>"><?=$title?></a></h2> </div> <div class="gall-img"> <a target="_blank" href="<?=$link?>" title="<?=$title?>" rel="overdiv_hidden_1_<?=$row->id?>"><img itemprop="image" src="<?=$img_src?>" alt="Съдържание » Цена » Прием » <?=$title?>" title="<?=$title?>" width="100%" /></a> </div> <div class="price"> <?=product_price($row, array('show_discount' => false, 'show_label' => false))?> </div> <div class="view-product"> <div><a href="javascript:to_basket(<?=$row->id?>);" class="btn-cart">Добави в количка</a></div> <div><button class="backcolr" onclick="parent.location='<?=$link?>';">Разгледай</button></div> №:<span itemprop="productID"><?=$row->id?></span> </div> </div> </div> <?php endforeach; ?> </div> <?php endforeach; ?> </div> <div class="clear"></div> <?php $this->view("common/footer"); ?>
  7. So how to do that, i think i tried everything but it didn't working
  8. Hello to all, Till now I made it like that. But as you can see, these two products are from the same category, but the category shows every time there is product from it. How to make it displays only one category and 10 products from it. Here is the code, do I have to make another for and how, where to put it, if anyone can help me: <?php $this->view("common/header"); ?> <link rel="canonical" href="<? echo site_url() ?>" /> <!-- <link rel="stylesheet" href="/css/bx_styles/bx_styles.css" type="text/css" /> --> <!-- <script type="text/javascript" src="/js/jquery.bxSlider.js"></script> --> <!-- <script type="text/javascript" src="/js/jquery.bxslider.min.js"></script> --> <div class="inner"> <div class="inner shadow"> <?php $query = "SELECT p.id, p.title_".$this->config->config['language']." as Title, p.text_".$this->config->config['language']." as Text, c.title_".$this->config->config['language']." as CatTitle, b.title_".$this->config->config['language']." as BrandTitle, p.price, p.package, p.discount, img.id as FileID, img.ext FROM products as p LEFT JOIN products_pictures as img ON(img.object_id = p.id ) LEFT JOIN categories as c ON( c.id = p.category_id ) LEFT JOIN brands as b ON( p.brand_id = b.id) WHERE (p.best_price = 1 OR c.best_price = 1 OR b.best_price = 1) AND p.promo_page = 1 AND p.is_active = 1 AND b.is_active = 1 AND c.is_active = 1 ORDER BY c.id LIMIT 10"; $result = $this->db->query($query); ?> <?php foreach($result->result() as $row) : ?> <?php $img_src = site_url(); $img_formats = "jpg,jpeg,png,gif"; if(strstr($img_formats, $row->ext)) { $img_src .= "files/products/".$row->id."/".$row->FileID."_1.".$row->ext; } elseif($row->ext=="flv") { $img_src .= "images/video.png"; } else { $img_src .= "files/default.jpg"; } $title = character_limiter(stripslashes($row->Title), 55); $title_url = getLinkTitle($title); $link = site_url()."products/product/".$row->id."/{$title_url}"; $title_cat = stripslashes($row->CatTitle); ?> <div class="prod-sec"> <div class="prod-head"> <h2><?= $title_cat?></h2> </div> <div class="gall-products"> <div> <h2 itemprop="name"><a target="_blank" itemprop="url" href="<?=$link?>" title="<?=$title?>" rel="overdiv_hidden_1_<?=$row->id?>"><?=$title?></a></h2> </div> <div class="gall-img"> <a target="_blank" href="<?=$link?>" title="<?=$title?>" rel="overdiv_hidden_1_<?=$row->id?>"><img itemprop="image" src="<?=$img_src?>" alt="Съдържание » Цена » Прием » <?=$title?>" title="<?=$title?>" width="100%" /></a> </div> <div class="price"> <?=product_price($row, array('show_discount' => false, 'show_label' => false))?> </div> <div class="view-product"> <div><a href="javascript:to_basket(<?=$row->id?>);" class="btn-cart">Добави в количка</a></div> <div><button class="backcolr" onclick="parent.location='<?=$link?>';">Разгледай</button></div> №:<span itemprop="productID"><?=$row->id?></span> </div> </div> </div> <?php endforeach; ?> </div> <div class="clear"></div> <?php $this->view("common/footer"); ?>
  9. So is there any way I can run the page without including it.
  10. Hello all, I am making promo page, but it's giving me this error "Fatal error: Using $this when not in object context in /home/fhlbg/public_html/application/views/promo_test.php on line 2" file is promo_test.php <?php $this->view("common/header"); ?> <link rel="canonical" href="<? echo site_url() ?>" /> <!-- <link rel="stylesheet" href="/css/bx_styles/bx_styles.css" type="text/css" /> --> <!-- <script type="text/javascript" src="/js/jquery.bxSlider.js"></script> --> <!-- <script type="text/javascript" src="/js/jquery.bxslider.min.js"></script> --> <div class="inner"> <div class="inner shadow"> <?php $query = 'SELECT id, title_bg AS `title_cat` FROM categories WHERE is_active = 1'; $result = $this->db->query($query); ?> <?php foreach ($result->result() as $row): ?> I can't understant how $this is working here, because in the already done page "home.php" is working, both are in the same directory. This is home.php: <?php $this->view("common/header"); ?> <link rel="canonical" href="<? echo site_url() ?>" /> <!-- <link rel="stylesheet" href="/css/bx_styles/bx_styles.css" type="text/css" /> --> <!-- <script type="text/javascript" src="/js/jquery.bxSlider.js"></script> --> <!-- <script type="text/javascript" src="/js/jquery.bxslider.min.js"></script> --> <script type="text/javascript"> jQuery(document).ready(function($) { $('#slider1').bxSlider({ slideSelector: 'div.slide', controls: false, pager: false, pause: 3000, auto: true, autoHover: true, moveSlides: 3, minSlides: 1, maxSlides: 3, slideWidth: 235 }); }); </script> <div class="inner inner-transparent"> <div class="slider-wrapper theme-default"> <div id="slider" class="nivoSlider"> <?PHP If anyone can help me solve this or to explane me how it works here.
  11. Okey here is my code till now I have done... <div class="inner shadow"> <?php $query = 'SELECT id, title_bg AS `title_cat` FROM categories'; $result = $this->db->query($query); ?> <?php foreach ($result->result() as $row): ?> <?php $title_cat = stripslashes($row->title_cat); ?> <?php $id = $row->id; ?> <div class="prod-sec"> <div class="prod-head"> <h2><?= $title_cat?></h2> </div> <?php $query1 = 'SELECT id, title_bg AS `Title`, text_bg AS `Text`, price, discount, category_id, promo_page FROM products ORDER BY id LIMIT 10'; ?> <?php $result1 = mysql_query($query1); ?> <?php $resultset = array(); while ($set = mysql_fetch_array($result1)) { $resultset[] = $set; } ?> <div id="classeslist2"> <ul class="home_middle_products"> <?php foreach ($resultset as $key): ?> <?php $title = $key['Title']; ?> <?php $text = $key['Text']; ?> <?php $price = $key['price']; ?> <?php $discount = $key['discount']; ?> <?php $prod_id = $key['id']; ?> <li style="width: 185px; height: 270px; margin-left: 3px; margin-top: 10px;"> <div class="thumb"> <a href=""><img src="" alt="<?=$id?>" width="182" /></a> <div class="price"> </div> </div> <h2></h2> <h2><a href=""><?=$title?></a></h2> </li> <?php endforeach; ?> <div class="clear"></div> </ul> </div> </div> <?php endforeach; ?> <div class="clear"></div> </div> And this is the screenshot The numbers are the ID of the product, but on each category they are the same, what I need to change or make to make them display only from that category are in. I tried to put WHERE clause in second SELECT (category_id = '$id') but it didnt help
  12. I want to display 10 products from each category from database, I started to display the categories but how to make displaying the products from each one. Here is the code I make so far. I'm not sure am I doing it right with doble sql select , or it can be done only with one. <div class="inner shadow"> <?php $query = 'SELECT id, title_bg AS `title_cat` FROM categories'; $result = $this->db->query($query); ?> <?php foreach ($result->result() as $row): ?> <?php $title_cat = stripslashes($row->title_cat); ?> <div class="prod-sec"> <div class="prod-head"> <h2><?= $title_cat?></h2> <div class="clear"></div> </div> <?php $query1 = 'SELECT t1.id, t1.title_bg AS `Title`, t1.text_bg AS `Text`, t1.price, t1.discount, t1.category_id, t1.promo_page, t2.id AS FileID, t2.ext, FROM products t1 LEFT JOIN products_pictures t2 ON t1.id = t2.object_id LEFT JOIN categories t3 ON t3.id = t1.category_id WHERE t1.promo_page = 0 AND t1.is_active = 1 AND t3.title_bg = '$title_cat' ORDER BY RAND() LIMIT 10'; $result1 = $this->db->query($query1); ?> <div id="classeslist2"> <ul class="home_middle_products"> <?PHP foreach($result1->result() as $row1) { $f = 'files/products_first_page/' . $row1->id . '.jpg'; if(is_file(dirname(__FILE__) . '/../../' . $f)) { $img = site_url() . "files/products_first_page/".$row1->id.".jpg"; } else { $img = site_url() . "files/products/".$row1->id."/".$row1->FileID."_2.".$row1->ext; } $title = stripslashes($row1->Title); $text = character_limiter(strip_tags(stripslashes($row1->Text)),250); $title_url = getLinkTitle($title); $link = site_url()."products/product/".$row1->id."/{$title_url}"; ?> <li style="width: 185px; height: 270px; margin-left: 3px; margin-top: 10px;"> <div class="thumb"> <a href="<?=$link?>"><img src="<?=$img?>" alt="<?=$title?>" width="182" /></a> <div class="price"><?PHP echo product_price($row1, array('show_discount' => false,"show_old_price"=>false, 'show_label' => false, 'view' => 'no')); ?> </div> </div> <h2></h2> <h2><a href="<?=$link?>"><?=$title?></a></h2> <? $text = substr($text, 0, 100); ?> <? if (strlen($text) == 100) $text .= '...' ; ?> <p><?=$text?></p> </li> <?php } ?> <div class="clear"></div> </ul> </div> </div> <?php endforeach; ?> <div class="clear"></div> </div>
×
×
  • 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.