Cheetah
ChForumExport.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_forum_actions_log' => array(
17  'query' => "SELECT `f`.* FROM `ch_forum_actions_log` AS `f` INNER JOIN `Profiles` AS `p` ON (`p`.`NickName` = `f`.`user_name`) WHERE `p`.`ID` = {profile_id}"),
18  'ch_forum_attachments' => array(
19  'query' => "SELECT `f`.* FROM `ch_forum_attachments` AS `f` INNER JOIN `ch_forum_post` AS `m` ON (`m`.`post_id` = `f`.`post_id`) INNER JOIN `Profiles` AS `p` ON (`p`.`NickName` = `m`.`user`) WHERE `p`.`ID` = {profile_id}"),
20  'ch_forum_flag' => array(
21  'query' => "SELECT `f`.* FROM `ch_forum_flag` AS `f` INNER JOIN `Profiles` AS `p` ON (`p`.`NickName` = `f`.`user`) WHERE `p`.`ID` = {profile_id}"),
22  'ch_forum_post' => array(
23  'query' => "SELECT `f`.* FROM `ch_forum_post` AS `f` INNER JOIN `Profiles` AS `p` ON (`p`.`NickName` = `f`.`user`) WHERE `p`.`ID` = {profile_id}"),
24  'ch_forum_signatures' => array(
25  'query' => "SELECT `f`.* FROM `ch_forum_signatures` AS `f` INNER JOIN `Profiles` AS `p` ON (`p`.`NickName` = `f`.`user`) WHERE `p`.`ID` = {profile_id}"),
26  'ch_forum_topic' => array(
27  'query' => "SELECT `f`.* FROM `ch_forum_topic` AS `f` INNER JOIN `Profiles` AS `p` ON (`p`.`NickName` = `f`.`first_post_user`) WHERE `p`.`ID` = {profile_id}"),
28  'ch_forum_user_activity' => array(
29  'query' => "SELECT `f`.* FROM `ch_forum_user_activity` AS `f` INNER JOIN `Profiles` AS `p` ON (`p`.`NickName` = `f`.`user`) WHERE `p`.`ID` = {profile_id}"),
30  'ch_forum_user_stat' => array(
31  'query' => "SELECT `f`.* FROM `ch_forum_user_stat` AS `f` INNER JOIN `Profiles` AS `p` ON (`p`.`NickName` = `f`.`user`) WHERE `p`.`ID` = {profile_id}"),
32  'ch_forum_vote' => array(
33  'query' => "SELECT `f`.* FROM `ch_forum_vote` AS `f` INNER JOIN `Profiles` AS `p` ON (`p`.`NickName` = `f`.`user_name`) WHERE `p`.`ID` = {profile_id}"),
34  );
35  $this->_sFilesBaseDir = 'modules/cheetah/forum/data/attachments/';
36  $this->_aTablesWithFiles = array(
37  'ch_forum_attachments' => array( // table name
38  'att_hash' => array ( // field name
39  '', // prefixes & extensions
40  ),
41  ),
42  );
43  }
44 
45  protected function _getFilePath($sTableName, $sField, $sFileName, $sPrefix, $sExt)
46  {
47  $s = $sFileName;
48  return $this->_sFilesBaseDir . substr($s, 0, 1) . '/' . substr($s, 0, 2) . '/' . substr($s, 0, 3) . '/' . $s;
49  }
50 }
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
ChWsbExport
Definition: ChWsbExport.php:29
php
$sExt
$sExt
Definition: get_file.php:14
ChForumExport\__construct
__construct($aSystem)
Definition: ChForumExport.php:12
ChForumExport
Definition: ChForumExport.php:11
ChForumExport\_getFilePath
_getFilePath($sTableName, $sField, $sFileName, $sPrefix, $sExt)
Definition: ChForumExport.php:45
$s
$s
Definition: embed.php:13