HTML;
*/
// Edit this line
$cutepath = "ajfork"; // path where AJ-Fork located
$lcomments_number = 15; // number of comments to show
$title_site = "Comments RSS Feed dgk.or.id"; // title of your site
$link_site = "http://dgk.or.id"; // URL of your site
$desc_site = "Imagination is more important than knowledge"; // Description of your rss
$site_url = 'http://dgk.or.id'; // Main site, you should change this URL if you're not using {furl}
// do not edit this line
require_once("$cutepath/inc/functions.inc.php");
require("$cutepath/data/config.php");
require_once("$cutepath/inc/version.php");
//edit header rss comments
$lctemplate = <<
By {name} On: {title}
{comid}
{category}
$site_url/{furl}#write
{name}
{date}
HTML;
header("Content-type:text/xml;charset=utf-8");
echo"
$title_site
$link_site
en-en
$desc_site
$aj_version ($aj_buildid)
\n\n
";
setlocale (LC_ALL, $config_locale_active);
$latest_comments = array_fill(1, $lcomments_number, array('newsid'=>'0','comid'=>'0','name'=>'','mail'=>'','ip'=>'','comment'=>''));
if (eregi("\?", $site_url)) { $modifier = "&"; } else { $modifier = "?"; }
function check_latest_comment($lcomment_line, $newsid) {
global $latest_comments;
$tmp_latest_comments = $latest_comments;
$lcomment_arr = explode("|", $lcomment_line);
foreach($latest_comments as $key=>$latest_comment) {
if($latest_comment['comid'] < $lcomment_arr[0]) {
$previous = $latest_comments[$key];
foreach($latest_comments as $my_key=>$latest_comment_arr) {
if($key < $my_key){
$current = $latest_comments[$my_key];
$latest_comments[$my_key] = $previous;
$previous = $current;
}
}
$latest_comments[$key] = array(
'newsid' => trim($newsid),
'comid' => trim($lcomment_arr[0]),
'name' => trim($lcomment_arr[1]),
'mail' => trim($lcomment_arr[2]),
'ip' => trim($lcomment_arr[3]),
'comment' => trim($lcomment_arr[4]),);
}
}
}
$all_comments = file("$cutepath/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);
}
}
$cc = 1;
foreach($latest_comments as $null => $lcomment) {
// linkelements
$parententry = aj_PostInfo($lcomment["newsid"], "$cutepath/data/news.txt");
$latesttitle = aj_prepareTitle($parententry["title"]);
$urldate = date("Y/m/d/", $parententry["date"]);
$latestcat = aj_getCat($parententry["category"]);
$flink = "$urldate$latestcat/$latesttitle.html";
if ($lcomment['name'] == "") { continue; }
$output = $lctemplate;
$output = str_replace("{furl}", $flink, $output);
$output = str_replace("{url}", "?aj_go=more&id=$lcomment[newsid]&ucat=$parententry[category]", $output);
$output = str_replace("{name}", $lcomment['name'], $output);
$output = str_replace("{category}", $latestcat, $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']);
$output = str_replace("{comment}", $lcomment['comment'], $output);
$output = str_replace("{title}", $parententry["title"], $output);
$output = str_replace("{date}", date("r", $lcomment['comid']), $output);
$output = str_replace("{date-local}", trim(strftime($config_timestamp_local_active, $lcomment['comid'])), $output);
$output = str_replace("{newsid}", $lcomment['newsid'], $output);
$output = str_replace("{comid}", $lcomment['comid'], $output);
if ($cc%2 == 0) { $output = str_replace("{alternating}", "cn_comment_odd", $output); }
else { $output = str_replace("{alternating}", "cn_comment_even", $output); }
echo "$output\n";
if ($cc == $lcomments_number) { break 1; }
$cc++;
}
echo "\n\n ";
unset($cutepath);
?>