コード例 #1
0
ファイル: publish.php プロジェクト: bgarrels/textpattern
function article_custom($atts)
{
    return parseArticles($atts, '1');
}
コード例 #2
0
ファイル: publish.php プロジェクト: ClaireBrione/textpattern
function article_custom($atts, $thing = null)
{
    return parseArticles($atts, '1', $thing);
}
コード例 #3
0
$script->initialize();

$cli->output( 'Process update tags' );

try
{
    if (!isset($options['tags']) || $options['tags'] == '')
    {
        throw new Exception('Tags must be setted');
    }

    //connect to merck model
    $db = MMSynchDb::instance();

    //get all articles
    $articlesTags = parseArticles($options['tags']);

    $selectArticleQuery = 'SELECT id, language FROM article WHERE publisher_internal_id = "%s"';
    $updateArticleQuery = 'UPDATE article SET tags = "%s" WHERE id = %d';
    $selectImportStatusQuery = 'SELECT id FROM import_status WHERE article_id = %d ORDER BY version DESC LIMIT 1';
    $updateImportStatusQuery = 'UPDATE import_status SET status_mdd_ez = 0 WHERE id = %d';

    foreach ($articlesTags as $publisher_internal_id => $tags)
    {
        $cli->output( '[' . $publisher_internal_id . '] : ' . $tags );

        //get all articles with publisher_internal_id
        $articles = $db->arrayQuery(sprintf($selectArticleQuery, $publisher_internal_id));

        if(count($articles) > 0)
        {