article default author: databot

This commit is contained in:
2015-07-09 20:51:08 +02:00
parent 6dcc0f54ff
commit b708f103dd

View File

@@ -1601,15 +1601,19 @@ class Databap extends PhpObject
//History Info //History Info
$asTables = $this->getTypeInfo('table'); $asTables = $this->getTypeInfo('table');
unset($asTables[self::ART_TYPE]); //Skip articles
foreach($asTables as $sType=>$sTableName) foreach($asTables as $sType=>$sTableName)
{ {
//skip articles for users
$bArticle = ($sType==self::ART_TYPE);
if($bArticle && $iUserId!= self::SYSTEM_USER_ID) continue;
//Add Text //Add Text
$sText = mb_strtolower($this->getPageTitles($this->getPagesFromHash($sType))); $sText = mb_strtolower($this->getPageTitles($this->getPagesFromHash($sType)));
if(!$sText) $this->addError('Pas de texte pour le type "'.$sType.'"'); if(!$sText) $this->addError('Pas de texte pour le type "'.$sType.'"');
//Loop through items //Loop through items
$asSqlInfo = array('select'=>MySqlManager::getId($sTableName), 'from'=>$sTableName, 'constraint'=>array(MySqlManager::getId(self::USER_TABLE)=>$iUserId)); $asSqlInfo = array('select'=>MySqlManager::getId($sTableName), 'from'=>$sTableName);
if(!$bArticle) $asSqlInfo['constraint'] = array(MySqlManager::getId(self::USER_TABLE)=>$iUserId);
$asHistory = $this->oMySql->selectRows($asSqlInfo); $asHistory = $this->oMySql->selectRows($asSqlInfo);
foreach($asHistory as $iItemId) foreach($asHistory as $iItemId)
{ {
@@ -1617,7 +1621,7 @@ class Databap extends PhpObject
$sKey = $asInfo['timestamp'].$sType.$iItemId; $sKey = $asInfo['timestamp'].$sType.$iItemId;
$asProfile['history'][$sKey]['type'] = $sType; $asProfile['history'][$sKey]['type'] = $sType;
$asProfile['history'][$sKey]['id'] = $iItemId; $asProfile['history'][$sKey]['id'] = $iItemId;
$asProfile['history'][$sKey]['action'] = (($asInfo['refer_id']==$iItemId)?'Création':'Modification').' de '.$sText; $asProfile['history'][$sKey]['action'] = (($bArticle || $asInfo['refer_id']==$iItemId)?'Création':'Modification').' de '.$sText;
$asProfile['history'][$sKey]['date'] = $asInfo['led']; $asProfile['history'][$sKey]['date'] = $asInfo['led'];
$asProfile['history'][$sKey]['title'] = $asInfo['title']; $asProfile['history'][$sKey]['title'] = $asInfo['title'];
} }