| 34 |
34 |
|
| 35 |
35 |
class m_news_Reorg {
|
| 36 |
36 |
|
| 37 |
|
private $_aSys = array();
|
|
37 |
private $_oReg = array();
|
| 38 |
38 |
/**
|
| 39 |
39 |
* Execute reorganisation
|
| 40 |
40 |
* @return string all occured messages
|
| ... | ... | |
| 43 |
43 |
{
|
| 44 |
44 |
$sOutput = null;
|
| 45 |
45 |
if(class_exists('WbAdaptor')) {
|
| 46 |
|
$this->_aSys['TablePrefix'] = WbAdaptor::getInstance()->TablePrefix;
|
| 47 |
|
$this->_aSys['AppPath'] = WbAdaptor::getInstance()->AppPath;
|
| 48 |
|
$this->_aSys['PagesDir'] = WbAdaptor::getInstance()->PagesDir;
|
| 49 |
|
$this->_aSys['PageExtension'] = WbAdaptor::getInstance()->PageExtension;
|
|
46 |
$this->_oReg = WbAdaptor::getInstance();
|
|
47 |
$sTmp = trim($this->_oReg->PagesDir, '/');
|
|
48 |
$sTmp = ($sTmp == '' ? '' : '/'.$sTmp);
|
|
49 |
$this->_oReg->PagesDir =$sTmp;
|
| 50 |
50 |
$sOutput = $this->createAccessFiles();
|
| 51 |
51 |
}
|
| 52 |
52 |
// add here the requests for additional reorg methods
|
| ... | ... | |
| 61 |
61 |
$count = 0;
|
| 62 |
62 |
$aReturnMsg = array();
|
| 63 |
63 |
$sql = 'SELECT `page_id`,`post_id`,`section_id`,`link` ';
|
| 64 |
|
$sql .= 'FROM `'.$this->_aSys['TablePrefix'].'mod_news_posts`';
|
|
64 |
$sql .= 'FROM `'.$this->_oReg->TablePrefix.'mod_news_posts`';
|
| 65 |
65 |
$sql .= 'WHERE `link` != \'\'';
|
| 66 |
66 |
if(($oPosts = WbDatabase::getInstance()->query($sql))) {
|
| 67 |
67 |
while($aPost = $oPosts->fetchRow(MYSQL_ASSOC))
|
| 68 |
68 |
{
|
| 69 |
|
$sAccessFile = $this->_aSys['AppPath'].$this->_aSys['PagesDir']
|
|
69 |
$sAccessFile = $this->_oReg->AppPath.$this->_oReg->PagesDir
|
| 70 |
70 |
. trim(str_replace('\\', '/', $aPost['link']), '/')
|
| 71 |
|
. $this->_aSys['PageExtension'];
|
|
71 |
. $this->_oReg->PageExtension;
|
| 72 |
72 |
$aOptionalCommand = array(
|
| 73 |
73 |
'$section_id = '.$aPost['section_id'].';',
|
| 74 |
74 |
'$post_section = '.$aPost['section_id'].';',
|
! fix news reorg.php to be backward compatible slash settings