Example #1
0
<?php

global $xajax;
if ($module != 'admin') {
    /* Modify Comment Array */
    if (count($array_com) > 0) {
        foreach ($array_com as $array_com2) {
            for ($b = 0; $b < count($array_com2); $b++) {
                //convert date
                $array_com2[$b]['time'] = convert_date_comments($array_com2[$b]['time']);
                //replace url links
                $array_com2[$b]['comment'] = str_replace("www.", "http://www.", $array_com2[$b]['comment']);
                $array_com2[$b]['comment'] = str_replace("http://http://", "http://", $array_com2[$b]['comment']);
                $array_com2[$b]['comment'] = eregi_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" class='postedlink' target='_blank'>\\0</a>", $array_com2[$b]['comment']);
                //avoid layout damage
                $array_com2[$b]['comment'] = wordwrap($array_com2[$b]['comment'], 24, " ", 1);
                //line breaks
                $array_com2[$b]['comment_unformatted'] = $array_com2[$b]['comment'];
                $array_com2[$b]['comment'] = nl2br($array_com2[$b]['comment']);
            }
            $array_com3[] = $array_com2;
        }
    }
    /******************************************/
}
$tpl->assign("totalrows", $TotalRows);
$tpl->assign("com_perpage", $set[0]['perpage_comments']);
$tpl->assign('array_com', $array_com3);
$tpl->assign('array_pages_c', $array_pages_c);
$tpl->assign("form_title", true);
$tpl->assign("form_attach", true);
Example #2
0
<?php

define("MAGPIE_CACHE_DIR", "cache");
define("MAGPIE_CACHE_AGE", "1");
require_once "rss_fetch.inc";
if ($rss_url) {
    $rss = fetch_rss($rss_url);
    $rss_limit = 0;
    foreach ($rss->items as $item) {
        //   $item["title"] = substr($item["title"], 0, 32);
        $t_date = explode("T", $item["pubdate"]);
        $t_time = explode("+", $t_date[1]);
        $t = $t_date[0] . ' ' . $t_time[0];
        $t = convert_date_comments($t);
        $t = substr($t, 0, strlen($t) - 8);
        $ay_rss[] = array('title' => utf8_decode($item["title"]), 'href' => $item["link"], 'date' => $t);
        $rss_limit++;
        if ($rss_limit > $max_number) {
            break;
        }
    }
    $tpl->assign('title_rss', $rss->channel["title"]);
    $tpl->assign('ay_rss', $ay_rss);
    unset($ay_rss);
    // $tpl->display("rssfeed.tpl");
}
Example #3
0
$b_comments->cols = 'bid, COUNT(id), MAX(time)';
$b_comments->table = $tbl_blog_comments;
$b_comments->order = 'MAX(time) DESC';
$b_comments->group = 'bid';
$b_comments->condition = "deleted = '0'";
$b_comments->limit = '5';
$b_comments->multiSelect = '1';
$array_blog_comments = $b_comments->row();
unset($b_comments);
if ($array_blog_comments != "" && isset($array_blog_comments) && count($array_blog_comments) > 0) {
    for ($b = 0; $b < count($array_blog_comments); $b++) {
        $bid = $array_blog_comments[$b]['bid'];
        $single_array[] = $array_blog_comments[$b]['bid'];
        $array_comments[$b]['bid'] = $array_blog_comments[$b]['bid'];
        $array_comments[$b]['comment_numbers'] = $array_blog_comments[$b]['COUNT(id)'];
        $array_comments[$b]['comment_time'] = convert_date_comments($array_blog_comments[$b]['MAXtime']);
        $array_comments[$b]['comment_time'] = substr($array_comments[$b]['comment_time'], 0, strlen($array_comments[$b]['comment_time']) - 8);
    }
    $string_bids = implode(",", $single_array);
    $b_title = new SelectEntrys();
    $b_title->cols = 'id, title_DE, title_EN, date';
    $b_title->table = $tbl_blog;
    $b_title->condition = "id IN ({$string_bids})";
    $b_title->multiSelect = '1';
    $array_b_titles = $b_title->row();
    for ($b = 0; $b < count($array_b_titles); $b++) {
        $date = $array_b_titles[$b]['date'];
        $get_page = new CheckExist();
        $get_page->tableE = $tbl_blog;
        $get_page->conditionE = " date > '{$date}' ";
        $_page = $get_page->exist();