function prev_next($output, $hook) { global $all_active_news, $active_news, $news_arr, $category, $ucat, $aj_plugins, $archive; $PN = new PluginSettings('Previous-Next'); $catrestrict = $PN->settings['prevnext']; if (empty($catrestrict)) { $catrestrict = STAY_IN_CATEGORIES; } $prevnum = 1; $nextnum = 1; $thisnews = explode("|", $active_news); $thiscat = $thisnews[6]; $all_active_news = array_reverse($all_active_news); $index = array_search($active_news, $all_active_news); if ($catrestrict == 'true') { do { $prev = explode("|", $all_active_news[$index - $prevnum]); if (empty($prev[6])) { break; } $prevnum++; } while ($thiscat != $prev[6]); do { $next = explode("|", $all_active_news[$index + $nextnum]); if (empty($next[6])) { break; } $nextnum++; } while ($thiscat != $next[6]); } else { $next = explode("|", $all_active_news[$index + 1]); $prev = explode("|", $all_active_news[$index - 1]); } # humanfriendly stuff if (!$ucat && $category) { $ucat = $category; } $nid = aj_prepareTitle($next[2]); if ($nid == "") { $nid = $next[0]; } $pid = aj_prepareTitle($prev[2]); if ($pid == "") { $pid = $prev[0]; } // Friendly urls w/ archive recognition if (isset($GLOBALS['aj_plugins']['friendlyurls'])) { $kat = aj_getCat($ucat); if (!$archive) { $next_link = "<a href=\"" . date("Y/m/d/", $next[0]) . "{$kat}/{$nid}.html\">{$next['2']}</a>"; $prev_link = "<a href=\"" . date("Y/m/d/", $prev[0]) . "{$kat}/{$pid}.html\">{$prev['2']}</a>"; } else { $furls = new PluginSettings('Userfriendly_URLs'); $linkdata = $furls->settings['text']['0']; $next_link = "<a href=\"{$linkdata['AR']}/{$archive}/" . date("Y/m/d/", $next[0]) . "{$kat}/{$nid}.html\">{$next['2']}</a>"; $prev_link = "<a href=\"{$linkdata['AR']}/{$archive}/" . date("Y/m/d/", $prev[0]) . "{$kat}/{$pid}.html\">{$prev['2']}</a>"; } } else { $next_link = "<a href='{$PHP_SELF}?aj_go=more&id={$next['0']}&archive={$archive}&start_from={$start_from}&ucat={$ucat}&{$user_query}'>{$next['2']}</a>"; $prev_link = "<a href='{$PHP_SELF}?aj_go=more&id={$prev['0']}&archive={$archive}&start_from={$start_from}&ucat={$ucat}&{$user_query}'>{$prev['2']}</a>"; } if (!empty($next[0])) { $output = str_replace("{nextlink}", $next_link, $output); } else { $output = str_replace("{nextlink}", "", $output); } if (!empty($prev[0])) { $output = str_replace("{prevlink}", $prev_link, $output); } else { $output = str_replace("{prevlink}", "", $output); } return $output; }
function furls_monthlyarchive($output, $hook) { global $cutepath, $date, $info, $lang_article_linktext; $furls = new PluginSettings('Userfriendly_URLs'); $linkdata = $furls->settings['text']['0']; $title = aj_prepareTitle($info[title]); $category = aj_getCat($info[category]); $output = "<a title=\"{$info['title']}\"href=\"{$linkdata['AR']}/{$info['home']}/" . date("Y/m/d", $date) . "/{$category}/{$title}.html\">{$info['title']}</a>"; return $output; }
<?php include "./inc/functions.inc.php"; header("Content-Type: text/xml;"); $host = $_SERVER['REMOTE_ADDR']; $id = $_GET['id']; $furls_date = $_GET['furls_date']; /* ID STUFF */ if (preg_match('/[a-z]/', $id) == 0) { $all_active_news = file("./data/news.txt"); foreach ($all_active_news as $null => $active_news) { $news_arr = explode("|", $active_news); if (aj_prepareTitle($id) == aj_prepareTitle($news_arr[2]) and $furls_date == date("Y/m/d", $news_arr[0])) { $id = $news_arr[0]; } } } /* END ID */ $tb_title = strip_tags($_POST['title']); $tb_excerpt = strip_tags($_POST['excerpt']); $tb_url = strip_tags($_POST['url']); $tb_url = str_replace("&", "&", $tb_url); $tb_blog_name = strip_tags($_POST['blog_name']); if (empty($id) || empty($tb_title) || empty($tb_excerpt) || empty($tb_url) || empty($tb_blog_name)) { trackback_response(1, 'At least one of the required fields is missing.'); } include 'inc/plugins.php'; $xfclass = new XFieldsData(); $disabled = $xfclass->fetch($id, 'tbs_disabled'); if ($disabled == "yes") { trackback_response(1, "Trackbacks have been disabled for this post");
} $all_comments = file("{$blogpath}/data/comments.txt"); foreach ($all_comments as $null => $lcomment_line) { $lcomment_line_arr = explode("|>|", $lcomment_line); $newsid = $lcomment_line_arr[0]; $lcomment_arr = explode("||", $lcomment_line_arr[1]); foreach ($lcomment_arr as $null => $lsingle_comment) { check_latest_comment($lsingle_comment, $newsid); } } echo "<!-- Latest {$lcomments_number} comments from any article displayed here -->\n"; $cc = 1; foreach ($latest_comments as $null => $lcomment) { // linkelements $parententry = aj_PostInfo($lcomment["newsid"], "{$blogpath}/data/news.txt"); $title = aj_prepareTitle($parententry["title"]); $urldate = date("Y/m/d/", $parententry["date"]); $flink = "{$urldate}{$title}"; if ($lcomment['name'] == "") { continue; } $output = $lctemplate; $output = str_replace("{url}", $flink, $output); $output = str_replace("{name}", $lcomment['name'], $output); $output = str_replace("{mail}", $lcomment['mail'], $output); $output = str_replace("{ip}", $lcomment['ip'], $output); $lcomment['comment'] = stripslashes(strip_tags($lcomment['comment'])); $lcomment['comment'] = preg_replace("'\\[(.*?)\\](.*?)\\[/(.*?)\\]'i", "\\2", $lcomment['comment']); $lcomment_length = strlen($lcomment['comment']); $maxlenminusnavn = $maxlen - strlen($lcomment['name']); if ($lcomment_length > $maxlen) {