skip to the 2nd pic in a gallery

Discussion in 'PHP' started by Arteweb, Dec 29, 2009.

  1. #1
    Hi to all,
    I have embed a mini slideshow gallery (Phatfusion) after the product details of a Virtuemart store (v.1.1.4) in a Joomla website (v.1.5.14)

    I would like skip the first thumb and the first fullview image to the second pic.
    In fact the first image ("101 Film di fantascienza", he has also a bad resize) is identical to the main one at the top-left of the page.

    In other words it's possible delete from gallery the first pic and let begin the slideshow from second?

    I spended many hours last night on the code triyng with (LIMIT 1,5) and something other (I'm not a PHPer), but without results (first image disappear but the second don't load)

    Any help will be appreciated!

    The website

    The code:

    // Custom code for phatfusion slideshow
    $path = 'components/com_virtuemart/shop_image/product/';
    $db_k= new ps_DB();
    $db_k->query( "SELECT * FROM `#__{vm}_product` WHERE `product_id`=".intval($product_id));
    $full = $path . $db_k->f('product_full_image');
    $thumb = $path . $db_k->f('product_thumb_image');
    $db_jk = new ps_DB();
    $more='';
    $db_jk->query( "SELECT * FROM `#__{vm}_product_files` WHERE `file_product_id`=".intval($product_id). " AND `file_is_image`=1 AND `file_published`=1 ORDER BY file_id ASC");
    while( $db_jk->next_record() ) {
    		$mfull = ltrim($db_jk->f('file_name'),'/');
    		$mthumb = ereg_replace('product','product/resized',ltrim($db_jk->f('file_name'),'/'));
    		$mext = '_'. $db_jk->f('file_image_thumb_height'). 'x'. $db_jk->f('file_image_thumb_width'). '.'.$db_jk->f('file_extension');
    		$ereg = '.'. $db_jk->f('file_extension');
    		$mthumb = ereg_replace($ereg, $mext, $mthumb);
    		$more .= ';'. $mfull . ',' . $mthumb;
    }
    $product_image = '{phatfusionslideshow '. $full .','. $thumb . $more .'}';
    $product_image = vmCommonHTML::ParseContentByPlugins( $product_image );// Custom code for phatfusion slideshow
    $path = 'components/com_virtuemart/shop_image/product/';
    $db_k= new ps_DB();
    $db_k->query( "SELECT * FROM `#__{vm}_product` WHERE `product_id`=".intval($product_id));
    $full = $path . $db_k->f('product_full_image');
    $thumb = $path . $db_k->f('product_thumb_image');
    $db_jk = new ps_DB();
    $more='';
    $db_jk->query( "SELECT * FROM `#__{vm}_product_files` WHERE `file_product_id`=".intval($product_id). " AND `file_is_image`=1 AND `file_published`=1 ORDER BY file_id ASC");
    while( $db_jk->next_record() ) {
    		$mfull = ltrim($db_jk->f('file_name'),'/');
    		$mthumb = ereg_replace('product','product/resized',ltrim($db_jk->f('file_name'),'/'));
    		$mext = '_'. $db_jk->f('file_image_thumb_height'). 'x'. $db_jk->f('file_image_thumb_width'). '.'.$db_jk->f('file_extension');
    		$ereg = '.'. $db_jk->f('file_extension');
    		$mthumb = ereg_replace($ereg, $mext, $mthumb);
    		$more .= ';'. $mfull . ',' . $mthumb;
    }
    $product_image = '{phatfusionslideshow '. $full .','. $thumb . $more .'}';
    $product_image = vmCommonHTML::ParseContentByPlugins( $product_image );
    Code (markup):
     
    Arteweb, Dec 29, 2009 IP
  2. Arteweb

    Arteweb Well-Known Member

    Messages:
    56
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    103
    #2
    Anyone? UP!
     
    Arteweb, Jan 3, 2010 IP
  3. Pudge1

    Pudge1 Well-Known Member

    Messages:
    912
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    140
    Digital Goods:
    1
    #3
    This is using custom classes, you aren't showing us where the classes are being created.
     
    Pudge1, Jan 3, 2010 IP
  4. Arteweb

    Arteweb Well-Known Member

    Messages:
    56
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    103
    #4
    Hi Pudge1,
    thank you for the reply. Can you tell me what are the name of classes that are interested for you?
    The only one class in the plugin is "plgContentPhatfusionSlideshow" in a file called phatfusionslideshow.php.
    Other classes are inside Virtuemart component, you can see here a sample (not mine) of a Virtuemart installation on Joomla. The folders of Virtuemart are in these paths: /components/com_virtuemart/ and /administrator/components/com_virtuemart/.
    I can pay you trough Paypal for your help, let me know, it's urgent!!!
     
    Arteweb, Jan 3, 2010 IP