Cheetah
ChFilesExport.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_files_cmts' => '`cmt_author_id` = {profile_id}',
17  'ch_files_cmts_albums' => '`cmt_author_id` = {profile_id}',
18  'ch_files_favorites' => '`Profile` = {profile_id}',
19  'ch_files_main' => '`Owner` = {profile_id}',
20  'ch_files_rating' => array(
21  'query' => "SELECT `r`.* FROM `ch_files_rating` AS `r` INNER JOIN `ch_files_main` AS `m` ON (`m`.`ID` = `r`.`gal_id`) WHERE `m`.`Owner` = {profile_id}"),
22  'ch_files_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_files_views_track` AS `t` INNER JOIN `ch_files_main` AS `m` ON (`m`.`ID` = `t`.`id`) WHERE `m`.`Owner` = {profile_id} OR `t`.`viewer` = {profile_id}"), // anonymize some data
24  'ch_files_voting_track' => array(
25  'query' => "SELECT `t`.`gal_id`, 0, `t`.`gal_date` FROM `ch_files_voting_track` AS `t` INNER JOIN `ch_files_main` AS `m` ON (`m`.`ID` = `t`.`gal_id`) WHERE `m`.`Owner` = {profile_id}"), // anonymize some data
26  );
27 
28  $this->_sFilesBaseDir = 'modules/cheetah/files/data/files/';
29  $this->_aTablesWithFiles = array(
30  'ch_files_main' => new ChFilesExportFiles($this->_sFilesBaseDir),
31  );
32  }
33 }
34 
36 {
37  public function perform($aRow, &$aFiles)
38  {
39  $sFile = $this->_sBaseDir . $aRow['ID'] . '_' . sha1($aRow['Date']);
40  if(file_exists($sFile))
41  $aFiles[] = $sFile;
42  }
43 }
ChFilesExportFiles
Definition: ChFilesExport.php:36
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
ChWsbExport
Definition: ChWsbExport.php:29
php
ChFilesExportFiles\perform
perform($aRow, &$aFiles)
Definition: ChFilesExport.php:37
ChFilesExport\__construct
__construct($aSystem)
Definition: ChFilesExport.php:12
$sFile
$sFile
Definition: index.php:20
ChFilesExport
Definition: ChFilesExport.php:11
ChWsbExportFiles
Definition: ChWsbExport.php:278