Cheetah
ChPhotosExport.php
Go to the documentation of this file.
1 <?php
2 
8 ch_import('ChWsbExport');
9 
11 {
12  protected function __construct($aSystem)
13  {
14  parent::__construct($aSystem);
15  $this->_aTables = array(
16  'ch_photos_cmts' => '`cmt_author_id` = {profile_id}',
17  'ch_photos_cmts_albums' => '`cmt_author_id` = {profile_id}',
18  'ch_photos_favorites' => '`Profile` = {profile_id}',
19  'ch_photos_main' => '`Owner` = {profile_id}',
20  'ch_photos_rating' => array(
21  'query' => "SELECT `r`.* FROM `ch_photos_rating` AS `r` INNER JOIN `ch_photos_main` AS `m` ON (`m`.`ID` = `r`.`gal_id`) WHERE `m`.`Owner` = {profile_id}"),
22  'ch_photos_views_track' => array(
23  'query' => "SELECT `t`.`id`, IF(`t`.`viewer` = {profile_id}, `t`.`viewer`, 0), IF(`t`.`viewer` = {profile_id}, `t`.`ip`, 0), `t`.`ts` FROM `ch_photos_views_track` AS `t` INNER JOIN `ch_photos_main` AS `m` ON (`m`.`ID` = `t`.`id`) WHERE `m`.`Owner` = {profile_id} OR `t`.`viewer` = {profile_id}"), // anonymize some data
24  'ch_photos_voting_track' => array(
25  'query' => "SELECT `t`.`gal_id`, 0, `t`.`gal_date` FROM `ch_photos_voting_track` AS `t` INNER JOIN `ch_photos_main` AS `m` ON (`m`.`ID` = `t`.`gal_id`) WHERE `m`.`Owner` = {profile_id}"), // anonymize some data
26  );
27 
28  $this->_sFilesBaseDir = 'modules/cheetah/photos/data/files/';
29  $this->_aTablesWithFiles = array(
30  'ch_photos_main' => new ChPhotosExportFiles($this->_sFilesBaseDir),
31  );
32  }
33 }
34 
36 {
37  protected $_aPostfixes;
38 
39  public function __construct($sBaseDir)
40  {
41  parent::__construct($sBaseDir);
42 
43  $this->_aPostfixes = array('', '_m', '_ri', '_rt', '_t', '_t_2x');
44  }
45 
46  public function perform($aRow, &$aFiles)
47  {
48  foreach($this->_aPostfixes as $sPostfix) {
49  $sFile = $this->_sBaseDir . $aRow['ID'] . $sPostfix . '.' . $aRow['Ext'];
50  if(file_exists($sFile))
51  $aFiles[] = $sFile;
52  }
53  }
54 }
ChPhotosExport
Definition: ChPhotosExport.php:11
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
ChWsbExport
Definition: ChWsbExport.php:29
ChPhotosExportFiles
Definition: ChPhotosExport.php:36
php
ChPhotosExportFiles\__construct
__construct($sBaseDir)
Definition: ChPhotosExport.php:39
$sFile
$sFile
Definition: index.php:20
ChPhotosExportFiles\perform
perform($aRow, &$aFiles)
Definition: ChPhotosExport.php:46
ChPhotosExport\__construct
__construct($aSystem)
Definition: ChPhotosExport.php:12
ChWsbExportFiles
Definition: ChWsbExport.php:278
as
as
Definition: Filter.ExtractStyleBlocks.Escaping.txt:10
ChPhotosExportFiles\$_aPostfixes
$_aPostfixes
Definition: ChPhotosExport.php:37