adding blogs RSS feed
This commit is contained in:
@@ -537,6 +537,25 @@ class Databap extends PhpObject
|
|||||||
$iLinkId -= 1;
|
$iLinkId -= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elseif($sCat=='blogs')
|
||||||
|
{
|
||||||
|
$asArticles = $this->getArticlesInfo();
|
||||||
|
foreach($asArticles as $asArticle)
|
||||||
|
{
|
||||||
|
$iArtId = $asArticle[MySqlManager::getId(self::ART_TABLE)];
|
||||||
|
$asItem = array
|
||||||
|
(
|
||||||
|
'title' => 'Article #'.$iArtId,
|
||||||
|
'category' => $sCat,
|
||||||
|
'description' => $asArticle['description'],
|
||||||
|
'author' => $asArticle['name'],
|
||||||
|
'link' => $asArticle['link_art'],
|
||||||
|
'pubDate' => $asArticle['art_date'],
|
||||||
|
'guid' => $this->getInternalLink('article', $iArtId)
|
||||||
|
);
|
||||||
|
$oFeed->addItem($asItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch($sCat)
|
switch($sCat)
|
||||||
@@ -1296,21 +1315,37 @@ class Databap extends PhpObject
|
|||||||
|
|
||||||
private function getArticleInfo($iArtId)
|
private function getArticleInfo($iArtId)
|
||||||
{
|
{
|
||||||
$asArt = $this->oMySql->selectRow(self::ART_TABLE, $iArtId);
|
$asArticle = $this->getArticlesInfo($iArtId);
|
||||||
$asTransferredInfo = array('link_art'=>$asArt['link'], 'art_title'=>$asArt['title'], 'link_auth'=>$asArt['email']);
|
return array_shift($asArticle);
|
||||||
$asTransferredInfo['art_date'] = self::getDateFormat($asArt['date'], self::DATE_FORMAT);
|
}
|
||||||
$asTransferredInfo['name'] = self::getNameFormat($asArt['first_name'], $asArt['last_name']);
|
|
||||||
$asTransferredInfo['title'] = self::getDescriptionFormat($asArt['title']);
|
private function getArticlesInfo($iArtId=0)
|
||||||
$asTransferredInfo['description'] = self::getDescriptionFormat($asArt['title']);
|
{
|
||||||
$asTransferredInfo['timestamp'] = strtotime($asArt['led']);
|
$sIdCol = MySqlManager::getId(self::ART_TABLE);
|
||||||
$asTransferredInfo['led'] = self::getDateFormat($asArt['led']);
|
$asInfo = array('from'=>self::ART_TABLE, 'ordrBy'=>array('date', 'desc'));
|
||||||
|
if($iArtId > 0) $asInfo['constraint'] = array($sIdCol => $iArtId);
|
||||||
|
$asArticles = $this->oMySql->selectRows($asInfo);
|
||||||
|
|
||||||
//Domain
|
$asTransferredArticles = array();
|
||||||
$asParsedUrl = parse_url($asArt['link']);
|
foreach($asArticles as $asArt)
|
||||||
$asTransferredInfo['domain'] = $asParsedUrl['host'];
|
{
|
||||||
$asTransferredInfo['company'] = $asTransferredInfo['domain'];
|
$asTransferredInfo = array($sIdCol=>$asArt[$sIdCol], 'link_art'=>$asArt['link'], 'art_title'=>$asArt['title'], 'link_auth'=>$asArt['email']);
|
||||||
|
$asTransferredInfo['art_date'] = self::getDateFormat($asArt['date'], self::DATE_FORMAT);
|
||||||
|
$asTransferredInfo['name'] = self::getNameFormat($asArt['first_name'], $asArt['last_name']);
|
||||||
|
$asTransferredInfo['title'] = self::getDescriptionFormat($asArt['title']);
|
||||||
|
$asTransferredInfo['description'] = self::getDescriptionFormat($asArt['title']);
|
||||||
|
$asTransferredInfo['timestamp'] = strtotime($asArt['led']);
|
||||||
|
$asTransferredInfo['led'] = self::getDateFormat($asArt['led']);
|
||||||
|
|
||||||
|
//Domain
|
||||||
|
$asParsedUrl = parse_url($asArt['link']);
|
||||||
|
$asTransferredInfo['domain'] = $asParsedUrl['host'];
|
||||||
|
$asTransferredInfo['company'] = $asTransferredInfo['domain'];
|
||||||
|
|
||||||
|
$asTransferredArticles[] = $asTransferredInfo;
|
||||||
|
}
|
||||||
|
|
||||||
return $asTransferredInfo;
|
return $asTransferredArticles;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUserInfo($iUserId=-1, $bJson=false)
|
public function getUserInfo($iUserId=-1, $bJson=false)
|
||||||
|
|||||||
Reference in New Issue
Block a user