$file = $feedIngester->downloadFeed();
            break;
        default:
    }
    $importParams = ['startDate' => $startDate, 'endDate' => $endDate];
    if (!empty($ingestionData['keyphrases'])) {
        $importParams['keyphrasesCategories'] = $ingestionData['keyphrases'];
    }
    $numCreated = $feedIngester->import($file, $importParams);
    $summary[$provider] = $feedIngester->getResultSummary();
    // show ingested videos by vertical
    displaySummary($showSummary, getContentIngestedVideosByCategory($feedIngester, $provider), 'vertical');
    print "\nCreated {$numCreated} articles!\n\n";
}
// show summary
displaySummary($showSummary, getContentSummary($summary));
function loadUser($userName)
{
    global $wgUser;
    $wgUser = User::newFromName($userName);
    if (!$wgUser) {
        die("Invalid username\n");
    }
    $wgUser->load();
}
function loadProviders($provider)
{
    if (empty($provider)) {
        // If no provider was specified, assume all active providers
        $providersVideoFeed = FeedIngesterFactory::getActiveProviders();
    } elseif (array_search($provider, FeedIngesterFactory::getAllProviders()) !== false) {
Exemple #2
0
function bookPage()
{
    $books = new Books();
    $id = (int) $_GET['book'] + 0;
    if (!isset($books[$id])) {
        notFound();
    }
    $book = $books[$id];
    global $tpl;
    $tpl->assign('page_title', $book['title']);
    $tpl->assign('menu_links', Path::menu('book'));
    $tpl->assign('menu_links_admin', Path::menuAdmin('book'));
    $tpl->assign('book', $book);
    $tpl->assign('id', $book['id']);
    $tpl->assign('displayStatus', displayStatus($book['status']));
    $tpl->assign('displayAuthors', displayAuthors($book['author']));
    $tpl->assign('displayNote', displayNote($book['note']));
    $tpl->assign('country', $book['country']);
    $tpl->assign('displayGenres', displayGenres($book['genre']));
    $tpl->assign('token', getToken());
    $tpl->assign('books_count', $books->count());
    $tpl->assign('book_next', $books->nextBook($book['id']));
    $tpl->assign('book_previous', $books->previousBook($book['id']));
    $social_url = str_replace('./', BASE_URL, Path::book($book['id']));
    $tpl->assign('social', ['title' => $book['title'], 'description' => ($book['status'] == Book::SEEN ? displaySimpleNote($book['note']) . ' — ' : '') . str_replace('<br />', '', displaySummary($book['summary'], 250)), 'image' => Books::CompleteImageURI($book), 'twitter' => urlencode(($book['status'] == Book::SEEN ? 'I’ve rated ' . $book['note'] . ' ' . String::pluralize('star', $book['note']) : 'I want to read') . ' “' . $book['title'] . '” from ' . $book['author'] . ' ' . $social_url), 'url' => $social_url]);
    $tpl->draw('book');
    exit;
}
Exemple #3
0
                processAddress();
            }
            autoStep(2);
            displayCarrier();
            break;
        case 3:
            if (Tools::isSubmit('processCarrier')) {
                processCarrier();
            }
            autoStep(3);
            checkFreeOrder();
            displayPayment();
            break;
        default:
            $smarty->assign('errors', $errors);
            displaySummary();
            break;
    }
} else {
    /* Default page */
    $smarty->assign('empty', 1);
    Tools::safePostVars();
    include_once dirname(__FILE__) . '/header.php';
    $smarty->display(_PS_THEME_DIR_ . 'shopping-cart.tpl');
}
include dirname(__FILE__) . '/footer.php';
/* Order process controller */
function autoStep($step)
{
    global $cart, $isVirtualCart;
    if ($step >= 2 and (!$cart->id_address_delivery or !$cart->id_address_invoice)) {