Cheetah
ChAdsExport.php
Go to the documentation of this file.
1 <?php
2 
8 ch_import('ChWsbExport');
9 ch_import('ChWsbInstallerUtils');
10 
11 class ChAdsExport extends ChWsbExport
12 {
13  protected function __construct($aSystem)
14  {
15  parent::__construct($aSystem);
16  $this->_aTables = array(
17  'ch_ads_cmts' => '`cmt_author_id` = {profile_id}',
18  'ch_ads_main' => '`IDProfile` = {profile_id}',
19  'ch_ads_main_media' => array(
20  'query' => "SELECT `f`.* FROM `ch_ads_main_media` AS `f` INNER JOIN `ch_ads_main` AS `m` ON (`m`.`Media` = `f`.`MediaID`) WHERE `m`.`IDProfile` = {profile_id}"),
21  'ch_ads_rating' => array(
22  'query' => "SELECT `r`.* FROM `ch_ads_rating` AS `r` INNER JOIN `ch_ads_main` AS `m` ON (`m`.`ID` = `r`.`ads_id`) WHERE `m`.`IDProfile` = {profile_id}"),
23  'ch_ads_views_track' => array(
24  'query' => "SELECT `t`.`id`, IF(`t`.`viewer` = {profile_id}, `t`.`viewer`, 0), IF(`t`.`viewer` = {profile_id}, `t`.`ip`, 0), `t`.`ts` FROM `ch_ads_views_track` AS `t` INNER JOIN `ch_ads_main` AS `m` ON (`m`.`ID` = `t`.`id`) WHERE `m`.`IDProfile` = {profile_id} OR `t`.`viewer` = {profile_id}"), // anonymize some data
25  'ch_ads_voting_track' => array(
26  'query' => "SELECT `t`.`ads_id`, 0, `t`.`ads_date` FROM `ch_ads_voting_track` AS `t` INNER JOIN `ch_ads_main` AS `m` ON (`m`.`ID` = `t`.`ads_id`) WHERE `m`.`IDProfile` = {profile_id}"), // anonymize some data
27  );
28  $this->_sFilesBaseDir = 'media/images/classifieds/';
29  $this->_aTablesWithFiles = array(
30  'ch_ads_main_media' => array( // table name
31  'MediaFile' => array ( // field name
32  // prefixes & extensions
33  'big_thumb_' => '',
34  'icon_' => '',
35  'img_' => '',
36  'thumb_' => ''),
37  ),
38  );
39 
41  $this->_aTables['ch_wmap_locations'] = array(
42  'query' => "SELECT `t`.* FROM `ch_wmap_locations` AS `t` INNER JOIN `ch_ads_main` AS `m` ON (`m`.`ID` = `t`.`id`) WHERE `m`.`IDProfile` = {profile_id} AND `part` = 'ads'");
43  }
44  }
45 }
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
ChWsbExport
Definition: ChWsbExport.php:29
php
ChAdsExport
Definition: ChAdsExport.php:12
ChAdsExport\__construct
__construct($aSystem)
Definition: ChAdsExport.php:13
ChWsbInstallerUtils\isModuleInstalled
static isModuleInstalled($sUri)
Definition: ChWsbInstallerUtils.php:38