Ignore:
Timestamp:
Apr 27, 2014, 1:30:00 AM (10 years ago)
Author:
mistic100
Message:

allow to add any video with direct embed code + add batch manager filter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/gvideo/include/events.inc.php

    r26524 r28268  
    2323      $template->assign(array(
    2424        'GVIDEO_PATH' => GVIDEO_PATH,
    25         'U_GVIDEO_EDIT' => GVIDEO_ADMIN.'-photo&image_id='.$picture['current']['id'],
     25        'U_GVIDEO_EDIT' => get_root_url().GVIDEO_ADMIN.'-photo&image_id='.$picture['current']['id'],
    2626        ));
    2727
     
    105105  }
    106106
    107   $template->set_filename('gvideo_content', realpath(GVIDEO_PATH . 'template/video_'.$video['type'].'.tpl'));
    108   return $template->parse('gvideo_content', true);
     107  if ($video['type'] == 'embed')
     108  {
     109    return $video['embed'];
     110  }
     111  else
     112  {
     113    $template->set_filename('gvideo_content', realpath(GVIDEO_PATH . 'template/video_'.$video['type'].'.tpl'));
     114    return $template->parse('gvideo_content', true);
     115  }
    109116}
    110117
     
    120127  pwg_query($query);
    121128}
     129
     130/**
     131 * add a prefilter to the Batch Downloader
     132 */
     133function gvideo_add_prefilter($prefilters)
     134{
     135        $prefilters[] = array(
     136    'ID' => 'gvideo',
     137    'NAME' => l10n('Videos'),
     138  );
     139 
     140        return $prefilters;
     141}
     142
     143/**
     144 * perform added prefilter
     145 */
     146function gvideo_apply_prefilter($filter_sets, $prefilter)
     147{
     148  if ($prefilter == 'gvideo')
     149  {
     150    $query = 'SELECT picture_id FROM '.GVIDEO_TABLE.';';
     151    $filter_sets[] = query2array($query, null, 'picture_id');
     152  }
     153 
     154        return $filter_sets;
     155}
Note: See TracChangeset for help on using the changeset viewer.