if ($ds['window4']) { $window4_new = 'checked="checked"'; $window4_self = ''; } else { $window4_new = ''; $window4_self = 'checked="checked"'; } $comments = '<option value="0">' . $_language->module['no_comments'] . '</option><option value="1">' . $_language->module['user_comments'] . '</option><option value="2">' . $_language->module['visitor_comments'] . '</option>'; $comments = str_replace('value="' . $ds['comments'] . '"', 'value="' . $ds['comments'] . '" selected="selected"', $comments); $bg1 = BG_1; eval("\$addbbcode = \"" . gettemplate("addbbcode") . "\";"); eval("\$addflags = \"" . gettemplate("flags") . "\";"); eval("\$news_post = \"" . gettemplate("news_post") . "\";"); echo $news_post; } elseif (basename($_SERVER['PHP_SELF']) == "news.php") { generate_rss2(); header("Location: index.php?site=news"); } elseif ($action == "unpublished") { $_language->read_module('news'); eval("\$title_news = \"" . gettemplate("title_news") . "\";"); echo $title_news; if (isnewsadmin($userID)) { $post = '<input type="button" onclick="MM_openBrWindow(\'news.php?action=new\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\');" value="' . $_language->module['post_news'] . '" />'; } echo $post . ' <input type="button" onclick="MM_goToURL(\'parent\',\'index.php?site=news\');return document.MM_returnValue;" value="' . $_language->module['show_news'] . '" /><hr />'; $page = ''; // Not published News if (isnewsadmin($userID)) { $ergebnis = safe_query("SELECT * FROM " . PREFIX . "news WHERE published='0' AND saved='1' ORDER BY date ASC"); if (mysql_num_rows($ergebnis)) { echo $_language->module['title_unpublished_news'];
function rss_improve_relevance_s($rss, $threshold = 66.59999999999999) { // DEBUG // print_r ($rss->channel); // exit; // $threshold = 66.6; // 2/3 similarity is okay for (e.g.) parted movies, etc. // $threshold = 0.0; $a = array(); $a[0][] = (string) $rss->channel->item[0]->title; $a[1][] = (string) $rss->channel->item[0]->link; $a[2][] = (string) $rss->channel->item[0]->description; for ($i = 1; isset($rss->channel->item[$i]); $i++) { similar_text($rss->channel->item[0]->title, $rss->channel->item[$i]->title, $percent); if ($percent < $threshold) { // unset ($rss->channel->item[$i]); continue; } $a[0][] = (string) $rss->channel->item[$i]->title; $a[1][] = (string) $rss->channel->item[$i]->link; $a[2][] = (string) $rss->channel->item[$i]->description; } // print_r ($a[0][0]); // sort by title (useful for evtl. episodes/parts) array_multisort($a[0], SORT_ASC, SORT_STRING, $a[1], $a[2]); $item = array(); for ($i = 0; isset($a[0][$i]); $i++) { $item[] = array('title' => $a[0][$i], 'link' => $a[1][$i], 'description' => ''); } $channel = array('title' => (string) $rss->channel->title, 'link' => (string) $rss->channel->link, 'description' => (string) $rss->channel->description); // DEBUG // print_r ($channel); // print_r ($item); // exit; return generate_rss2($channel, $item, 0, 0); }
if (!file_exists($s)) { $output = NULL; $rsscache_xsl_trans = 0; $s = NULL; } } if ($rsscache_xsl_trans > 0 && in_array($output, array('html', 'cms'))) { // turn into XML for stupid browsers that ignore XSL inside RSS $t = '' . $rsscache_xsl_stylesheet_path . '/rsscache_xml.xsl'; $p = generate_rss2($a['channel'], $a['item'], 1, 1, $s); $original = $rsscache_xsl_trans; $rsscache_xsl_trans = 0; $p = rsscache_write_xsl($p, $t); $rsscache_xsl_trans = $original; } else { $p = generate_rss2($a['channel'], $a['item'], 1, 1, $s); } if ($s) { $p = rsscache_write_xsl($p, $s); } } $a = array('js' => 'Content-type: text/javascript', 'html' => 'Content-type: text/html', 'cms' => 'Content-type: text/html', 'json' => 'Content-type: application/json', 'rss' => 'Content-type: application/rss+xml', 'pls' => 'Content-type: text/plain', 'm3u' => 'Content-type: text/plain', 'ansisql' => 'Content-type: text/plain'); if (isset($a[$output])) { header($a[$output]); } else { // header ('Content-type: text/xml'); header('Content-type: application/xml'); } // header ('Content-type: text/plain'); // header('content-type: application/xml; charset=UTF-8'); // disable any caching by the browser