From b708f103dd362cee3da1ddd9aed2d64c417cc063 Mon Sep 17 00:00:00 2001 From: franzz Date: Thu, 9 Jul 2015 20:51:08 +0200 Subject: [PATCH] article default author: databot --- inc/databap.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/inc/databap.php b/inc/databap.php index ae8ba03..a189906 100755 --- a/inc/databap.php +++ b/inc/databap.php @@ -1601,15 +1601,19 @@ class Databap extends PhpObject //History Info $asTables = $this->getTypeInfo('table'); - unset($asTables[self::ART_TYPE]); //Skip articles foreach($asTables as $sType=>$sTableName) { + //skip articles for users + $bArticle = ($sType==self::ART_TYPE); + if($bArticle && $iUserId!= self::SYSTEM_USER_ID) continue; + //Add Text $sText = mb_strtolower($this->getPageTitles($this->getPagesFromHash($sType))); if(!$sText) $this->addError('Pas de texte pour le type "'.$sType.'"'); //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); foreach($asHistory as $iItemId) { @@ -1617,7 +1621,7 @@ class Databap extends PhpObject $sKey = $asInfo['timestamp'].$sType.$iItemId; $asProfile['history'][$sKey]['type'] = $sType; $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]['title'] = $asInfo['title']; }