$properties = array(); $properties["description"] = "New programmes at StreamOnTheFly"; $properties["link"] = $config['rootUrl'] . ""; $properties["title"] = "StreamOnTheFly"; //$properties["language"]="en"; $properties["dc:date"] = getW3CDate(); $rss_writer_object->addchannel($properties); // If your channel has a logo, before adding any channel items, specify the logo details this way. $properties = array(); $properties["url"] = $config['rootUrl'] . "/static/sotflogosmall.gif"; $properties["link"] = $config['rootUrl'] . ""; $properties["title"] = "StreamOnTheFly logo"; $properties["description"] = "World wide network of radio archives"; $rss_writer_object->addimage($properties); // Then add your channel items one by one. $newProgs = sotf_Programme::getNewProgrammes($fromDay, $count); if (!empty($newProgs)) { foreach ($newProgs as $prog) { $properties = array(); $properties["description"] = $prog['abstract']; $properties["link"] = $config['rootUrl'] . "/get.php?id=" . $prog['id']; $properties["title"] = $prog['title']; $properties["dc:date"] = $prog['production_date']; $rss_writer_object->additem($properties); } } else { $properties = array(); $properties["description"] = ''; $properties["link"] = $config['rootUrl']; $properties["title"] = "no new items"; //$properties["dc:date"]= ;
// check if user has default query $advsearch = new sotf_AdvSearch(); $prefs = $user->getPreferences(); $defQuery = $prefs->getDefaultQuery(); } // show default query or new programmes $maxItemsIndexPage = $sotfVars->get("maxItemsIndexPage", 10); if ($defQuery) { $smarty->assign("DEF_QUERY", 1); debug("default query", $defQuery); $advsearch->Deserialize($defQuery); $query = $advsearch->GetSQLCommand(); debug("query", $query); //get the number of results $max = $db->getOne("SELECT count(*) FROM ( {$query} ) as foo "); $smarty->assign("DEF_QUERY_MAX", $max); $res = $db->limitQuery($query, 0, $maxItemsIndexPage); $hits = ''; while (DB_OK === $res->fetchInto($row)) { $row['icon'] = sotf_Blob::cacheIcon2($row); $hits[] = $row; } $smarty->assign("NEWS", $hits); } else { // get new programmes $smarty->assign('NEWS', sotf_Programme::getNewProgrammes($fromDay, $maxItemsIndexPage)); } // get topics with most content $smarty->assign('TOPICS', $vocabularies->getTopTopics(5)); $db->commit(); $page->send();
while (DB_OK === $res->fetchInto($row)) { $row['icon'] = sotf_Blob::cacheIcon2($row); $hits[] = $row; } $smarty->assign("NEWS", $hits); } else { // get new programmes if (nodeConfig('payableMode')) { $mode = 'free'; } else { $mode = 'all'; } $smarty->assign('NEWS', sotf_Programme::getNewProgrammes($fromDay, $maxItemsIndexPage, $mode)); } if (nodeConfig('payableMode')) { $fromDayPremium = date('Y-m-d', time() - 60 * 60 * 24 * 90); $maxItemsPremium = 7; $smarty->assign('PREMIUM', sotf_Programme::getNewProgrammes($fromDayPremium, $maxItemsPremium, 'premium')); $smarty->assign('PROMOTED', sotf_Programme::getPromotedProgrammes()); } // get topics with most content $smarty->assign('TOPICS', $vocabularies->getTopTopics(5)); // online counter for statistics if ($config['counterMode']) { $chCounter_status = 'active'; $chCounter_visible = 0; $chCounter_page_title = 'Hauptseite - index.php'; include $config['counterURL']; } $db->commit(); $page->send();
<?php require "init.inc.php"; if ($_REQUEST['select_station']) { $page->redirect("listStation.php?station=" . $_POST['station']); } /* defaults for main "index" page */ define("MAX_ITEMS_IN_INDEX", 10); $data['numNodes'] = sotf_Node::numNodes(); if ($data['numNodes'] == 0) { $data['numNodes'] = 1; } $data['numStations'] = sotf_Station::numStations(); $data['numProgs'] = sotf_Programme::numProgrammes(); $smarty->assign($data); $smarty->assign('STATIONS', sotf_Station::listStationNames()); $searchLangs = $languages; array_unshift($searchLangs, "any_language"); for ($i = 0; $i < count($searchLangs); $i++) { $langNames[$i] = $page->getlocalized($searchLangs[$i]); } $smarty->assign('searchLangs', $searchLangs); $smarty->assign('langNames', $langNames); $now = getDate(); $yesterday = mktime(0, 0, 0, $now['mon'], $now['mday'] - 2, $now['year']); $fromDay = date('Y-m-d', $yesterday); $smarty->assign(array('LOCAL_NEWS' => sotf_Programme::getNewProgrammes(true, $fromDay, MAX_ITEMS_IN_INDEX), 'OTHER_NEWS' => sotf_Programme::getNewProgrammes(false, $fromDay, MAX_ITEMS_IN_INDEX))); $page->send();
$playlist = new sotf_Playlist(); $smarty->assign('PLAYLIST', $playlist->load()); // check if user has default query $advsearch = new sotf_AdvSearch(); $prefs = $user->getPreferences(); $defQuery = $prefs->getDefaultQuery(); } // show default query instead of new programmes if ($defQuery) { $smarty->assign("DEF_QUERY", 1); debug("default query", $defQuery); $advsearch->Deserialize($defQuery); $query = $advsearch->GetSQLCommand(); debug("query", $query); //get the number of results $max = $db->getOne("SELECT count(*) FROM ( {$query} ) as foo "); $smarty->assign("DEF_QUERY_MAX", $max); $res = $db->limitQuery($query, 0, MAX_ITEMS_IN_INDEX); $hits = ''; while (DB_OK === $res->fetchInto($row)) { $row['icon'] = sotf_Blob::cacheIcon($row['id']); $hits[] = $row; } $smarty->assign("NEWS", $hits); } else { // get new programmes $smarty->assign('NEWS', sotf_Programme::getNewProgrammes($fromDay, MAX_ITEMS_IN_INDEX)); } // get topics with most content $smarty->assign('TOPICS', $repository->getTopTopics(5)); $page->send();
$properties["description"] = "New programmes at StreamOnTheFly"; $properties["link"] = $config['rootUrl'] . ""; $properties["title"] = "StreamOnTheFly"; //$properties["language"]="en"; $properties["dc:date"] = date("Y-m-d H:i:s"); // "2002-05-06T00:00:00Z"; $rss_writer_object->addchannel($properties); // If your channel has a logo, before adding any channel items, specify the logo details this way. $properties = array(); $properties["url"] = $config['rootUrl'] . "/static/sotflogosmall.gif"; $properties["link"] = $config['rootUrl'] . ""; $properties["title"] = "StreamOnTheFly logo"; $properties["description"] = "World wide network of radio archives"; $rss_writer_object->addimage($properties); // Then add your channel items one by one. $newProgs = sotf_Programme::getNewProgrammes($fromDay, ITEMS_IN_RSS); foreach ($newProgs as $prog) { $properties = array(); $properties["description"] = $prog['abstract']; $properties["link"] = $config['rootUrl'] . "/get.php?id=" . $prog['id']; $properties["title"] = $prog['title']; $properties["dc:date"] = $prog['production_date']; $rss_writer_object->additem($properties); } // If your channel has a search page, after adding the channel items, specify a search form details this way. $properties = array(); // The name property if the name of the text input form field $properties["name"] = "pattern"; $properties["link"] = $config['rootUrl'] . "/search.php?language=any_language"; $properties["title"] = "Search for:"; $properties["description"] = "Search in StreamOnTheFly";