function my_events()
{
    $query = mysql_query("SELECT DISTINCT * FROM events, users WHERE events.uid = users.uid AND events.event_time > UNIX_TIMESTAMP(NOW()) AND events.uid != '" . $_SESSION['uid'] . "' ORDER BY events.loc_zip ASC LIMIT 100 ");
    $counter = 0;
    while ($row = mysql_fetch_array($query)) {
        $tags = "";
        foreach (explode(',', $row['event_tags']) as $Characteristics) {
            $tags .= '<span class="label">' . $Characteristics . '</span> ';
        }
        echo '<table width="100%">
  			<tr>
    			<th>
    				<b>' . $row['event_name'] . '</b>
    				<table width="100%" style="border: solid 0px #dddddd">
						<tr>
							<th width="50px"><i class="fa fa-' . $row['event_category'] . ' fa-5x"></i></th>
							<th>' . $row['event_info'] . '<br> By: ' . $row['fname'] . ' ' . substr($row['lname'], 0, 1) . '.<br>' . $tags . '</th>
						</tr>
					</table>
				</th>
    			<th width="50px"><center><h5><b>' . $row['loc_zip'] . ' miles</b></h5><a href="#JoinEvent&id=' . $row['id'] . '" class="radius small button">Join Event</a>' . timeago($row[event_time]) . '</h5></center></th>
  			</tr>
		</table>';
        $counter++;
    }
    if ($counter == 0) {
        echo "</ul></div><hr><center><font color='red'>We found no results.</font><hr>";
    } elseif ($counter == 100) {
        echo "</ul></div><hr><center><font color='red'>Limited to 100 results....</font><center><hr>";
    }
}
Beispiel #2
0
 /**
  * 小工具的渲染方法,这里就是输出评论
  */
 function widget($args, $instance)
 {
     global $wpdb, $comments, $comment;
     $cache = wp_cache_get('f_comment', 'widget');
     if (!is_array($cache)) {
         $cache = array();
     }
     if (!isset($args['widget_id'])) {
         $args['widget_id'] = $this->id;
     }
     if (isset($cache[$args['widget_id']])) {
         echo $cache[$args['widget_id']];
         return;
     }
     extract($args, EXTR_SKIP);
     $output = '';
     $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Comments') : $instance['title'], $instance, $this->id_base);
     if (empty($instance['number']) || !($number = absint($instance['number']))) {
         $number = 5;
     }
     //获取评论,过滤掉管理员自己
     $comments = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE user_id !=1 and comment_approved = '1' and comment_type not in ('pingback','trackback') ORDER BY comment_date_gmt DESC LIMIT {$number}");
     $output .= $before_widget;
     if ($title) {
         $output .= $before_title . $title . $after_title;
     }
     $output .= '<div class="all-comments">';
     if ($comments) {
         // Prime cache for associated posts. (Prime post term cache if we need it for permalinks.)
         $post_ids = array_unique(wp_list_pluck($comments, 'comment_post_ID'));
         _prime_post_caches($post_ids, strpos(get_option('permalink_structure'), '%category%'), false);
         foreach ((array) $comments as $comment) {
             if ($comment->comment_author_email != $my_email) {
                 //头像
                 $avatar = get_avatar($comment, 36);
                 //作者名称
                 $author = get_comment_author();
                 //评论内容
                 $content = apply_filters('get_comment_text', $comment->comment_content);
                 $content = mb_strimwidth(strip_tags($content), 0, '65', '...', 'UTF-8');
                 $content = convert_smilies($content);
                 //评论的文章
                 $post = '<a href="' . esc_url(get_comment_link($comment->comment_ID)) . '">' . $avatar . $author . '<span class="muted">' . timeago($comment->comment_date_gmt) . ':<br>' . $content . '</span></a>';
                 //这里就是输出的html,可以根据需要自行修改
                 $output .= $post;
             }
         }
     }
     $output .= '</div>';
     $output .= $after_widget;
     echo $output;
     $cache[$args['widget_id']] = $output;
     wp_cache_set('my_widget_recent_comments', $cache, 'widget');
 }
Beispiel #3
0
 function terakhir_tunup($kendaraan_id)
 {
     $this->db->where('servis.kendaraan', $kendaraan_id);
     $this->db->where('servis_detail.komponen', 'KOM-28');
     $this->db->join('servis_detail', 'servis.nomor=servis_detail.servis', 'left');
     $this->db->order_by('servis.tanggal', 'desc');
     $this->db->limit(1);
     $result = $this->db->get('servis');
     if ($result->num_rows() > 0) {
         return timeago(strtotime($result->row()->tanggal));
     } else {
         return "Belum Pernah Tuneup";
     }
 }
Beispiel #4
0
 function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_name', $instance['title']);
     $limit = $instance['limit'];
     $outer = $instance['outer'];
     if (!$outer) {
         $outer = -1;
     }
     echo $before_widget;
     echo $before_title . $title . $after_title;
     echo '<ul>';
     global $wpdb;
     $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved,comment_author_email, comment_type,comment_author_url, SUBSTRING(comment_content,1,60) AS com_excerpt FROM {$wpdb->comments} LEFT OUTER JOIN {$wpdb->posts} ON ({$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID) WHERE user_id!='" . $outer . "' AND comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT {$limit}";
     $comments = $wpdb->get_results($sql);
     foreach ($comments as $comment) {
         $output .= $comment->user_id . '<li><a' . hui_target_blank() . ' href="' . get_permalink($comment->ID) . '#comment-' . $comment->comment_ID . '" title="' . $comment->post_title . __('上的评论', 'haoui') . '">' . hui_get_avatar($user_id = $comment->user_id, $user_email = $comment->comment_author_email) . strip_tags($comment->comment_author) . ' <span class="text-muted">' . timeago($comment->comment_date_gmt) . __('说:', 'haoui') . '<br>' . str_replace(' src=', ' data-original=', convert_smilies(strip_tags($comment->com_excerpt))) . '</span></a></li>';
     }
     echo $output;
     echo '</ul>';
     echo $after_widget;
 }
Beispiel #5
0
					
						<a href="#" class="activity-user-name"><?php 
        echo userdata(usuario_nombre, $muro[id_autor]);
        ?>
 </a>
						<?php 
        if ($muro[tipo] == 5) {
            echo $var;
        }
        ?>
						<span>
						
						
						</span>
						<span class="activity-time-ago"><?php 
        echo timeago(strtotime($muro['fecha']));
        ?>
</span>
					</div>
					<div class="activity-content-desc">
						<!-- Contenido de la actividad (descripcion) -->
						
						<?php 
        if ($muro[tipo] != 5 and $muro[tipo] != 6) {
            echo $muro["contenido"];
        }
        ?>
						
					</div>
					<!-- Descripcion de la actividad -->
					
Beispiel #6
0
        $rtimes[$b] = $mid;
        $mid = $rnames[$b - 1];
        $rnames[$b - 1] = $rnames[$b];
        $rnames[$b] = $mid;
        $b--;
    }
}
function xss($val)
{
    $val = str_replace("&", "&amp;", $val);
    $val = str_replace("<", "&lt;", $val);
    $val = str_replace(">", "&gt;", $val);
    $val = str_replace('"', "&quot;", $val);
    $val = str_replace("'", "&#x27;", $val);
    $val = str_replace("/", "&#x2F;", $val);
    return $val;
}
for ($j = count($rtimes) - 1; $j >= 0; $j--) {
    $cmp = json_decode(file_get_contents("./data/comps/" . $rnames[$j]));
    echo "<tr>";
    echo "<td><a href='./comp/?" . substr($rnames[$j], 0, -5) . "'>" . xss($cmp->name) . "</a></td>";
    echo "<td>" . count($cmp->rows) . "</td>";
    echo "<td>" . timeago($rtimes[$j]) . "</td>";
    echo "<td>" . xss($cmp->date) . "</td>";
    if (isset($cmp->region)) {
        echo "<td><a href='./region/?" . str_replace(" ", "", strtolower($cmp->region)) . "'>" . xss($cmp->region) . "</a></td>";
    } else {
        echo "<td></td>";
    }
    echo "</tr>";
}
function mod_newcomments($limit, $outpost, $outer)
{
    global $wpdb;
    $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved,comment_author_email, comment_type,comment_author_url, SUBSTRING(comment_content,1,40) AS com_excerpt FROM {$wpdb->comments} LEFT OUTER JOIN {$wpdb->posts} ON ({$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID) WHERE comment_post_ID!='" . $outpost . "' AND user_id!='" . $outer . "' AND comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT {$limit}";
    $comments = $wpdb->get_results($sql);
    foreach ($comments as $comment) {
        $output .= '<li><a href="' . get_permalink($comment->ID) . '#comment-' . $comment->comment_ID . '" title="' . $comment->post_title . '上的评论">' . str_replace(' src=', ' data-original=', get_avatar($comment->comment_author_email, $size = '36', deel_avatar_default())) . ' <div class="muted"><i>' . strip_tags($comment->comment_author) . '</i>' . timeago($comment->comment_date_gmt) . '说:' . str_replace(' src=', ' data-original=', convert_smilies(strip_tags($comment->com_excerpt))) . '</div></a></li>';
    }
    echo $output;
}
Beispiel #8
0
        ?>
                        <img height="50px" width="50px" src="<?php 
        echo $photo_unread_msg;
        ?>
" alt="">
                      </div>
                      <div class="thread-content">
                        <span class="author"><?php 
        echo getName($m->sender_id);
        ?>
</span>
                        <span class="preview"><?php 
        echo word_limiter($m->message, 30);
        ?>
</span>
                        <span class="time"> <?php 
        echo timeago($m->sent_on);
        ?>
</span>
                      </div>
                    </div>
                  </a>
                </li>
              <?php 
    }
} else {
    echo "<span>Tidak ada pesan baru</span>";
}
?>
              </ul>
            </div>
Beispiel #9
0
<ul id="mn-ls-messages" class="gadget-ct mn-ls-messages">
			<?php 
$result = mysql_query("SELECT * FROM mensajes WHERE (usuario_recibe = " . userinfo(usuario_id) . " and usuario_envia = " . $id . ") or (usuario_envia = " . userinfo(usuario_id) . " and usuario_recibe = " . $id . ")  ORDER BY fecha ASC") or die(mysql_error());
while ($msg = mysql_fetch_array($result)) {
    ?>
				<li>
					<a class="circle-picture mn-ls-user-profile" href="#"><img src="<?php 
    echo userdata(avatar, $msg["usuario_envia"]);
    ?>
" alt=""></a>
					<a class="mn-ls-content" href="#">
						<h5><?php 
    echo userdata(usuario_nombre, $msg["usuario_envia"]);
    ?>
 <span><?php 
    echo timeago(strtotime($msg["fecha"]));
    ?>
</span></h5>
						
						<p><?php 
    echo $msg["contenido"];
    ?>
</p>
					</a>
			
				</li>
				<?php 
}
?>
			</ul>
			</div>
Beispiel #10
0
" title="<?php 
        echo $value['log_title'];
        ?>
" target=_blank><?php 
        echo $value['log_title'];
        ?>
</a><?php 
        if ($value['top'] == 'y' || $value['sortop'] == 'y') {
            echo ' <i class="fa fa-arrow-up"></i>';
        }
        ?>
</h2>
				</header>
				<p class="article_exp_meta">
					<time class="article_exp_time"><i class="fa fa-clock-o"></i> <?php 
        echo timeago($value['date'], true);
        ?>
</time>
					<span class="article_exp_pv"><i class="fa fa-eye"></i> 阅读(<?php 
        echo $value['views'];
        ?>
)</span>
					<a href="<?php 
        echo $value['log_url'];
        ?>
#comments" class="article_exp_cmt"><i class="fa fa-comments-o"></i> 评论(<?php 
        echo $value['comnum'];
        ?>
)</a>
					<?php 
        editflg($value['logid'], $value['author']);
Beispiel #11
0
function fun_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
<li <?php 
    comment_class();
    ?>
 id="comment-<?php 
    comment_ID();
    ?>
">
	<div id="div-comment-<?php 
    comment_ID();
    ?>
" class="comment-body">
	<?php 
    echo fun_get_avatar($comment->user_id, '54', fun_get_avatar_type($comment->user_id));
    ?>
	<?php 
    $add_below = 'div-comment';
    ?>
	<div class="comment-main">
		<?php 
    if ($comment->comment_approved == '0') {
        ?>
			<span style="color:#C00; font-style:inherit; margin-top:5px; line-height:25px;"><?php 
        $cpid = $comment->comment_parent;
        if ($cpid != 0) {
            echo '@';
        }
        comment_author_link($cpid);
        _e('您的评论正在等待审核中...', 'tinection');
        ?>
</span>
			<br />			
		<?php 
    }
    ?>
		<?php 
    if ($comment->comment_approved == '1') {
        ?>
		<?php 
        comment_text();
        ?>
		<?php 
    }
    ?>
		<div class="comment-author">
			<div class="comment-info">
				<span class="comment_author_link"><?php 
    if ($comment->user_id != 0) {
        echo '<a href="' . get_author_posts_url($comment->user_id) . '" class="name">' . $comment->comment_author . '</a>';
    } else {
        comment_author_link();
    }
    ?>
</span>
				<?php 
    if (ot_get_option('comment_vip') == 'on') {
        get_author_class($comment->comment_author_email, $comment->user_id);
    }
    ?>
				<?php 
    if (ot_get_option('comment_ua') == 'on') {
        echo outputbrowser($comment->comment_agent);
    }
    ?>
				<?php 
    if (ot_get_option('comment_ip') == 'on') {
        ?>
<span class="comment_author_ip tooltip-trigger" title="<?php 
        echo sprintf(__('来自%1$s', 'tinection'), convertip(get_comment_author_ip()));
        ?>
"><img class="ip_img" src="<?php 
        echo THEME_URI . '/images/ua/ip.png';
        ?>
"></span><?php 
    }
    ?>
				<span class="datetime">
					<?php 
    echo timeago(get_gmt_from_date(get_comment_date('Y-m-d G:i:s')));
    ?>
				</span>
				<span class="reply">
					<?php 
    if (is_user_logged_in()) {
        comment_reply_link(array_merge($args, array('reply_text' => __('回复', 'tinection'), 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'])));
    } else {
        echo '<a rel="nofollow" class="comment-reply-login user-login" href="javascript:">' . __('登录以回复', 'tinection') . '</a>';
    }
    ?>
				</span>
				<span class="cmt-vote">
					<?php 
    $c_name = 'fun_comment_vote_' . $comment->comment_ID;
    $cookie = isset($_COOKIE[$c_name]) ? $_COOKIE[$c_name] : '';
    ?>
					<i class="fa fa-thumbs-o-up <?php 
    if ($cookie == 1) {
        echo 'voted';
    }
    ?>
" title="<?php 
    _e('顶一下', 'tinection');
    ?>
" data="<?php 
    echo $comment->comment_ID;
    ?>
" data-type="1" data-num="<?php 
    echo (int) get_comment_meta($comment->comment_ID, 'fun_comment_voteyes', true);
    ?>
"><?php 
    echo ' [' . (int) get_comment_meta($comment->comment_ID, 'fun_comment_voteyes', true) . ']';
    ?>
</i>
					<i class="fa fa-thumbs-o-down <?php 
    if ($cookie == 2) {
        echo 'voted';
    }
    ?>
" title="<?php 
    _e('踩一下', 'tinection');
    ?>
" data="<?php 
    echo $comment->comment_ID;
    ?>
" data-type="2" data-num="<?php 
    echo (int) get_comment_meta($comment->comment_ID, 'fun_comment_voteno', true);
    ?>
"><?php 
    echo ' [' . (int) get_comment_meta($comment->comment_ID, 'fun_comment_voteno', true) . ']';
    ?>
</i>
				</span>
				<!-- edit_comment_link(__('编辑','tinection'));--> 	
			</div>
		</div>
	<div class="clear"></div>
	</div>
</div>
  
<?php 
}
Beispiel #12
0
function blog_comments_children($comments, $children)
{
    $isGravatar = Option::get('isgravatar');
    foreach ($children as $child) {
        $comment = $comments[$child];
        $isNofollow = $comment['url'] && $comment['url'] != BLOG_URL ? 'rel="nofollow"' : '';
        $comment['poster'] = $comment['url'] ? '<a href="' . $comment['url'] . '" target="_blank" ' . $isNofollow . '>' . $comment['poster'] . '</a>' : $comment['poster'];
        ?>
	<div class="comment comment-children" id="comment-<?php 
        echo $comment['cid'];
        ?>
">
		<a name="<?php 
        echo $comment['cid'];
        ?>
"></a>
			<?php 
        if ($isGravatar == 'y') {
            echo '<div class="avatar"><img src="' . TEMPLATE_URL . 'images/0.gif" data-src="' . J_getGravatar($comment['mail']) . '" /></div>';
        } else {
            echo '<div class="avatar"><img src="' . TEMPLATE_URL . 'images/noAvator.jpg" /></div>';
        }
        ?>
		<div class="comment-info">
			<div class="comment-content"><?php 
        echo comment2emoji($comment['content']);
        ?>
</div>
			<div class="comment-meata">
				<span class="comment-poster"><?php 
        echo $comment['poster'];
        ?>
</span> 
				<span class="comment-time"><?php 
        if (strtotime($comment['date'])) {
            echo timeago(strtotime($comment['date']));
        } else {
            echo str_replace(' ', '', $comment['date']);
        }
        ?>
</span>
				<?php 
        if ($comment['level'] < 3) {
            echo '<a href="#comment-' . $comment['cid'] . '" onclick="commentReply(' . $comment['cid'] . ',this)" class="comment-reply-btn">回复</a>';
        }
        ?>
			</div>
		</div>
		<?php 
        blog_comments_children($comments, $comment['children']);
        ?>
	</div>
	<?php 
    }
}
Beispiel #13
0
 public function detail($id)
 {
     $xdata['breadcrumb'] = 'kendaraan' . $this->_filter();
     $xdata['kendaraan'] = $this->kendaraan_mdl->get_from_field('kendaraan.id', $id, 1)->row();
     //servis detail
     $this->table->set_template(tbl_tmp_servis());
     $this->table->set_heading('No', 'Tanggal', 'Lama', 'Komponen Mesin', 'Jenis Perlakuan');
     $servis_history = $this->general_mdl->get_servis_history($xdata['kendaraan']->kode)->result();
     $i = 1;
     foreach ($servis_history as $r) {
         $this->table->add_row($i++, format_dmy($r->tanggal), timeago(strtotime($r->tanggal)), $r->komponen_lain != '' ? $r->komponen_lain : $r->komponen_nama, $r->servis_aksi_nama);
     }
     $xdata['servis_history'] = $this->table->generate();
     $data['content'] = $this->load->view('kendaraan_detail', $xdata, true);
     $this->load->view('template', $data);
 }
Beispiel #14
0
function hui_comment_list($comment, $args, $depth)
{
    echo '<li ';
    comment_class();
    echo ' id="comment-' . get_comment_ID() . '">';
    echo '<div class="c-avatar">' . hui_get_avatar($comment->user_id, $comment->comment_author_email) . '</div>';
    echo '<div class="c-main" id="div-comment-' . get_comment_ID() . '">';
    echo '<span class="c-author">' . get_comment_author_link() . '</span>';
    echo str_replace(' src=', ' data-original=', convert_smilies(get_comment_text()));
    if ($comment->comment_approved == '0') {
        echo '<span class="c-approved">' . __('待审核', 'haoui') . '</span>';
    }
    echo '<time class="c-time">' . timeago($comment->comment_date) . '</time>';
    if ($comment->comment_approved !== '0') {
        echo comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
    }
    echo '</div>';
}
	<section>
		<h3>Latest changes to this page:</h3>
		<p>Tweets take 15-30 seconds to appear.</p>
		<ul><?php 
$i = 0;
$count = sizeof($results->statuses);
$style_array = [];
if ($count == 0) {
    echo "Nobody has tweeted to @css_tweet recently, but you still can!";
}
foreach ($results->statuses as $result) {
    $text = formattweet($result->text);
    $username = $result->user->name;
    $handle = $result->user->screen_name;
    $time = timeago($result->created_at);
    $handle = $result->user->screen_name;
    $image = $result->user->profile_image_url;
    $link = $result->id_str;
    $style = '<style style="display:none;" id="tweet-' . $link . '">' . $text . '</style>';
    echo '<li>';
    echo '<div style="display: block;">' . $text . '</div>';
    echo '<a href="http://twitter.com/' . $handle . '">' . $username . '</a> ';
    echo '<time><a href="http://twitter.com/' . $handle . '/status/' . $link . '">' . $time . '</a></time> ';
    echo '<button onclick="this.parentNode.remove();document.getElementById(\'tweet-' . $link . '\').remove();">Hide</button>';
    echo '</li>';
    array_unshift($style_array, $style);
    $i++;
    if ($i == $count) {
        foreach ($style_array as $style) {
            echo $style;
Beispiel #16
0
if (!isset($touserid)) {
    redirect("/");
}
if ($touserid == $userinfo["user_id"]) {
    redirect("/");
}
$selmes = dbquery("SELECT * FROM bg_messages WHERE (mes_userid='" . $userinfo["user_id"] . "' AND mes_touserid='" . $touserid . "') OR (mes_userid='" . $touserid . "' AND mes_touserid='" . $userinfo["user_id"] . "') ORDER BY mes_id ASC");
$pocet = dbrows($selmes);
if ($pocet >= 1) {
    while ($data = dbarray($selmes)) {
        if ($data["mes_userid"] == $userinfo["user_id"]) {
            $changepull = "pull-left";
        } else {
            $changepull = "pull-left";
        }
        echo '
<div class="media komentar">
  <a class="' . $changepull . '">
    <img class="media-object img-circle" src="' . (useravatar($data["mes_userid"]) != "/file/avatars/avatar.png" ? useravatar($data["mes_userid"]) : useravatar($data["mes_userid"])) . '" alt="avatar">
  </a>
  <div class="media-body">
    <h4 class="media-heading"><a class="profillink" data-target="65">' . username($data["mes_userid"]) . '</a> <span class="time pull-right">' . timeago($data["mes_time"]) . '</span></h4>
    ' . bbcode(badwords(smiley($data["mes_text"]))) . '
  </div>
</div>
';
    }
} else {
    echo "<div style='padding:15px'>Žiadne správy s užívateľom <b>" . username($touserid, 0) . "</b></div>";
}
dbquery("UPDATE bg_messages SET mes_read='1' WHERE mes_touserid='" . $userinfo["user_id"] . "' AND mes_userid='" . $touserid . "'");
Beispiel #17
0
				`rtime`,
			 	`path_source`,
			 	`context`
			 FROM `botnet_reports_{=:yymmdd}`
			 WHERE `bot_id` IN({s,:botId}) AND `type`={i:type}
			 ORDER BY `rtime` DESC
			 ', array('yymmdd' => $yymmdd, 'botId' => $blist, 'type' => BLT_COOKIES)));
                        $n = mysql_num_rows($R);
                        if (!$n) {
                            continue;
                        }
                        $found_n += $n;
                        echo '<table class="lined"><caption>', '20', implode('.', str_split($yymmdd, 2)), '</caption>';
                        echo '<TBODY>';
                        while (!is_bool($r = mysql_fetch_assoc($R))) {
                            echo '<tr>', '<th>', timeago(time() - $r['path_source']), '</th>', '<td>', htmlspecialchars($r['path_source']), '</td>', '<td><pre>', htmlspecialchars($r['context']), '</td>', '</tr>';
                        }
                        echo '</BODY></table>';
                    }
                    if (!$found_n) {
                        echo 'No results';
                    }
                    die;
                } else {
                    if (strcmp($ba, 'remove') === 0 || strcmp($ba, 'removeex') === 0) {
                        if (isset($_GET['yes']) || isset($_GET['no'])) {
                            $data = str_replace('{WIDTH}', 'auto', THEME_LIST_BEGIN) . str_replace(array('{COLUMNS_COUNT}', '{TEXT}'), array(2, LNG_BA_REMOVE_TITLE), THEME_LIST_TITLE);
                            if (isset($_GET['yes'])) {
                                //Удаление из botnet_list.
                                if (mysqlQueryEx('botnet_list', 'DELETE FROM `botnet_list` WHERE ' . $sqlBlist)) {
                                    $t = str_replace('{TEXT}', sprintf(LNG_BA_REMOVE_REMOVED, @mysql_affected_rows()), THEME_STRING_SUCCESS);
        echo '<li id="aside-report-favorite">', '<button>', LNG_REPORTS_ASIDE_FAVORITE1, '</button>', '<form action="?m=/reports_fav/ajaxAdd" method="POST">', '<input type="hidden" name="table" value="', $_GET['t'], '" />', '<input type="hidden" name="report_id" value="', $_GET['id'], '" />', '<textarea name="comment" rows="20" placeholder="comment">', htmlentities($report->favorite_comment), '</textarea>', '<input type="submit" value="', LNG_REPORTS_ASIDE_SAVE, '" />', '</form>', '</li>';
    }
    if (file_exists('system/botnet_vnc.php')) {
        echo '<li id="aside-vnc"><dl><dt class="collapsible collapsed" id="aside-vnc">VNC</dt>', '<dd>' . vncplugin_draw_connect_options($report->bot_id) . '</dd>';
    }
    if (file_exists('system/reports_hatkeeper.php')) {
        $rule_domain = parse_url($report->path_source, PHP_URL_HOST);
        if (strncasecmp($rule_domain, 'www.', 4) === 0) {
            $rule_domain = substr($rule_domain, 4);
        }
        $rule_urls = array('url' => "^{$report->path_source}", 'domain' => "^.+://(.+\\.|){$rule_domain}/.*", 'any' => '^.*');
        echo '<li id="aside-hatkeeper"><dl><dt class="collapsible collapsed">', LNG_REPORTS_ASIDE_HK, '</dt>', '<dd>', '<form ', ' action="?m=reports_hatkeeper/AjaxInsert&botId=', rawurlencode($report->bot_id), '&report=', rawurlencode($_GET['t'] . ':' . $report->id), '" ', ' method="POST"><ul>', '<li><dl>', '<dt>', LNG_REPORTS_ASIDE_HK_RULE_URL, '</dt>', '<dd>', '<input type="text" name="rule_url" value="', htmlentities($rule_urls['domain']), '" />', '<ul class="url-rule-presets">', '<li>', '<a href="#" data-url="', htmlentities($rule_urls['url']), '">URL</a>', '</li>', '<li>', '<a href="#" data-url="', htmlentities($rule_urls['domain']), '">Domain</a>', '</li>', '<li>', '<a href="#" data-url="', htmlentities($rule_urls['any']), '">Any</a>', '</li>', '</ul>', '</dd>', '<dt>', LNG_REPORTS_ASIDE_HK_RULE_POST, '</dt>', '<dd>', '<textarea name="rule_post" placeholder="a=b" rows=10></textarea>', '</dd>', '</dl>', '<li><label><input type="checkbox" name="mkenvironment" value="1" /> ' . LNG_REPORTS_ASIDE_HK_MKENVIRONMENT . '</label>', file_exists('system/botnet_vnc.php') ? '<li><label><input type="checkbox" name="bsocks" value="1" /> ' . LNG_REPORTS_ASIDE_HK_BSOCKS . '</label>' : '', '<li><input type="submit" value="', LNG_REPORTS_ASIDE_HK_CREATE, '" />', '<li id="hatkeeper-config-link">', '<a href="' . authTokenURL('reports_hatkeeper/xml') . '&botId=', rawurlencode($report->bot_id), '" target="_blank">', LNG_REPORTS_ASIDE_HK_CONFIGLINK, '</a>', '</ul></form>', '</dd>';
    }
    echo '</ul>', '</aside>';
    # Display
    echo '<table id="full-bot-report" class="bot-report zebra lined" ', 'data-table="', $_GET['t'], '" data-report="', $report->id, '" ', 'data-botid="', htmlentities($report->bot_id), '" data-ipv4="', htmlentities($report->ipv4), '"', '>', '<caption>', sprintf(LNG_REPORTS_VIEW_TITLE2, bltToLng($report->type), numberFormatAsInt(strlen($report->context))), ' ', gmdate(LNG_FORMAT_DT, $report->rtime), '</caption>', '<TBODY>', '<tr>', '<th>', LNG_REPORTS_VIEW_BOTID, '</th>', '<td>', '<img src="theme/images/icons/' . ($report->bot_online && $report->bot_online <= $GLOBALS['config']['botnet_timeout'] ? 'online' : 'offline') . '.png" /> ', botPopupMenu($report->bot_id, 'botmenu', $report->bot_comment), ' (', htmlentities($report->ip_c), ' — ', $report->ip_country, ')', ' ', htmlentities($report->botnet), '</td>', '</tr>', '<tr class="field-bot-comment">', '<th>', LNG_REPORTS_VIEW_COMMENT, '</th>', '<td>', '<form action="?', mkuri(1, 'm'), '&ajax=bot-comment&botId=', rawurlencode($report->bot_id), '" method="POST" class="ajax_form_update" data-title="Bot comment">', '<input type="text" name="comment" value="', htmlentities($report->bot_comment), '" />', '<input type="submit" value="', LNG_REPORTS_VIEW_COMMENT_SAVE, '" />', '</form>', '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_BOT_RTIME_LAST, '</th>', '<td>', timeago(time() - $report->bot_rtime_last), '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_VIEW_VERSION, '</th>', '<td>', intToVersion($report->bot_version), '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_VIEW_OS, '</th>', '<td>', osDataToString($report->os_version), ' (', htmlentities($report->language_id), ')', '</td>', '</tr>', '<tr class="field-ipv4">', '<th>', LNG_REPORTS_VIEW_IPV4, '</th>', '<td>', htmlentities($report->ipv4), '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_VIEW_TIME, '</th>', '<td>', gmdate(LNG_FORMAT_DT, $report->time_system + $report->time_localbias), ' (GMT', timeBiasToText($report->time_localbias), ')', '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_VIEW_TICK, '</th>', '<td>', tickCountToText($report->time_tick / 1000), '</td>', '</tr>', '</TBODY>', '<TBODY>', '<tr>', '<th>', LNG_REPORTS_VIEW_PROCUSER, '</th>', '<td>', htmlspecialchars($report->process_user), '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_VIEW_PROCNAME, '</th>', '<td>', htmlspecialchars($report->process_name), '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_VIEW_PROCINFO, '</th>', '<td>', htmlentities($report->process_info), '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_VIEW_SOURCE, file_exists('system/reports_neurostat.php') && ($report->type == BLT_HTTP_REQUEST || $report->type == BLT_HTTPS_REQUEST) ? ' <a href="?m=reports_neurostat/stat' . '&botId=' . rawurlencode($report->bot_id) . '&url=' . rawurlencode($report->path_source) . '" ' . ' target="_blank"> <img src="theme/images/icons/brain.png" /> </a> ' : '', '</th>', '<td>', htmlentities($report->path_source), '</td>', '</tr>', '<tr class="context">', '<td colspan="2">', '<a href="#" id="decode-context">[ Decode ]</a>', '<div class="context">', htmlentities($report->context), '</div>', '</td>', '</tr>', '</TBODY>', '</table>';
    echo <<<HTML
<script src="theme/js/page-reports_db-report.js"></script>
HTML;
    die;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
// Определяем данные для фильтра.
///////////////////////////////////////////////////////////////////////////////////////////////////
//При добавлении новых параметров нужно уничтожать не нужные для js:datelist.
$filter['date1'] = isset($_GET['date1']) ? intval($_GET['date1']) : 0;
$filter['date2'] = isset($_GET['date2']) ? intval($_GET['date2']) : 0;
if ($filter['date1'] > $filter['date2']) {
    $t = $filter['date1'];
    $filter['date1'] = $filter['date2'];
    $filter['date2'] = $t;
Beispiel #19
0
<div class="table">

<div class="left">
<img src="' . store_avatar($item->store_img) . '" alt="">
<span class="rating"><span style="width:' . $item->stars * 16 . 'px;"></span></span>
<a href="' . $item->store_reviews_link . '">' . $item->reviews . ' reviews</a>';
                echo !empty($item->cashback) ? '<span class="cashback-points" data-ttip="Great! Use it and you\'ll receive ' . $item->cashback . ' points.">' . $item->cashback . '</span> ' : '';
                echo '</div>

<div class="right">
<a href="' . $item->link . '" class="title">' . $item->title . '</a>
More coupons for <a href="' . $item->store_link . '">' . $item->store_name . '</a>
<div class="description">' . (!empty($item->description) ? nl2br($item->description) : 'no description') . '</div>

<ul class="details">
<li>Coupon Added: <b>' . timeago(strtotime($item->date), 'seconds') . ' ago</b></li>';
                if ($item->is_expired) {
                    echo '<li>Expired on: <span class="expired">' . date('m/d/y', strtotime($item->expiration_date)) . '</span></li>';
                } else {
                    if (!$item->is_started) {
                        echo '<li>Starts on: <span class="notstarted">' . date('m/d/y', strtotime($item->expiration_date)) . '</span></li>';
                    } else {
                        echo '<li>Expiration: <span class="active">' . date('m/d/y', strtotime($item->expiration_date)) . '</span></li>';
                    }
                }
                echo '</ul>

<div class="links">
<a href="' . $item->link . '" class="btn">View Code</a>
<a href="#" class="more_details">More details</a>
<a href="#" class="share">Share</a>
Beispiel #20
0
        echo $sender_photo;
        ?>
">
                  <span class="media-body block no-margin"> <?php 
        echo $n->judul;
        ?>
 
                  <small class="block text-black">No: <?php 
        echo $n->no;
        ?>
, <?php 
        echo getName($n->sender_id);
        ?>
</small>
                  <small class="block text-grey"><?php 
        echo timeago($n->sent_on);
        ?>
</small> 
                  </span>
                </a>
              <?php 
    }
    ?>
              </div>
            </div>
            </div>
          </li>
        <?php 
} else {
    ?>
          <li>
Beispiel #21
0
function tin_post_meta($special = 0)
{
    $thelayout = the_layout();
    if (is_singular()) {
        ?>
	<div id="single-meta">
		<span class="single-meta-author"><i class="fa fa-user">&nbsp;</i><?php 
        the_author_posts_link();
        ?>
</span>
		<span class="single-meta-time"><i class="fa fa-calendar">&nbsp;</i><?php 
        echo timeago(get_gmt_from_date(get_the_time('Y-m-d G:i:s')));
        ?>
</span>
		<?php 
        if (is_single()) {
            ?>
<span class="single-meta-category"><i class="fa fa-folder-open">&nbsp;</i><?php 
            the_category(' ', '');
            ?>
</span><?php 
        }
        ?>
		<?php 
        if (current_user_can('level_7')) {
            ?>
<span class="single-meta-edit"><i class="fa fa-edit">&nbsp;</i><?php 
            edit_post_link(__(' 编辑 ', 'tinection'));
            ?>
</span><?php 
        }
        ?>
		<span class="single-meta-comments"><?php 
        if (comments_open()) {
            ?>
|&nbsp;&nbsp;<i class="fa fa-comments"></i>&nbsp;<a href="#" class="commentbtn"><?php 
            comments_number(__('抢沙发', 'tinection'), __('1 条评论', 'tinection'), __('% 条评论', 'tinection'));
            ?>
</a><?php 
        } else {
            ?>
|&nbsp;<i class="fa fa-comments"></i><?php 
            _e(' 评论关闭', 'tinection');
        }
        ?>
</span>
		<span class="single-meta-views"><i class="fa fa-fire"></i>&nbsp;<?php 
        echo get_tin_traffic('single', get_the_ID());
        ?>
&nbsp;</span>
	</div>
	<?php 
    } elseif (is_search() || is_home() && $thelayout == 'blog' || is_category() && $special == 0 || is_tag() || is_date()) {
        ?>
	<div class="meta">
		<?php 
        if (!is_category()) {
            ?>
<span class="postlist-meta-cat"><i class="fa fa-bookmark"></i><?php 
            the_category(' ', false);
            ?>
</span><?php 
        }
        ?>
		<span class="postlist-meta-time"><i class="fa fa-calendar"></i><?php 
        echo timeago(get_gmt_from_date(get_the_time('Y-m-d G:i:s')));
        ?>
</span>
		<span class="postlist-meta-views"><i class="fa fa-fire"></i><?php 
        echo '浏览: ' . get_tin_traffic('single', get_the_ID());
        ?>
</span>
		<span class="postlist-meta-comments"><?php 
        if (comments_open()) {
            ?>
<i class="fa fa-comments"></i><a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number(__('<span>评论: </span>0', 'tinection'), __('<span>评论: </span>1', 'tinection'), __('<span>评论: </span>%', 'tinection'));
            ?>
</a><?php 
        }
        ?>
</span>
	</div>
	<?php 
    } elseif (is_home() || is_category() && $special == 1) {
        ?>
	<div class="postlist-meta">
		<div class="postlist-meta-time"><i class="fa fa-calendar"></i>&nbsp;<?php 
        echo date('Y-m-j', get_the_time('U'));
        ?>
</div>
		<div class="postlist-meta-views" style="float:right;"><i class="fa fa-fire"></i>&nbsp;<?php 
        echo get_tin_traffic('single', get_the_ID());
        ?>
</div>
		<?php 
        get_template_part('includes/like_collect_meta');
        ?>
	</div>
	<?php 
    } else {
        ?>
	<div id="single-meta">
		<span class="single-meta-author"><i class="fa fa-user">&nbsp;</i><?php 
        the_author_posts_link();
        ?>
</span>
		<span class="single-meta-edit"><?php 
        edit_post_link(__(' 编辑 ', 'tinection'));
        ?>
</span>
		<span class="single-meta-time"><i class="fa fa-calendar">&nbsp;</i><?php 
        echo timeago(get_gmt_from_date(get_the_time('Y-m-d G:i:s')));
        ?>
</span>
		<span class="single-meta-comments"><?php 
        if (comments_open()) {
            ?>
|&nbsp;&nbsp;<i class="fa fa-comments"></i>&nbsp;<a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number(__('0 条评论', 'tinection'), __('1 条评论', 'tinection'), __('% 条评论', 'tinection'));
            ?>
</a><?php 
        } else {
            ?>
|&nbsp;<i class="fa fa-comments"></i><?php 
            _e(' 评论关闭', 'tinection');
        }
        ?>
</span>
		<span class="single-meta-views"><i class="fa fa-fire"></i>&nbsp;<?php 
        echo get_tin_traffic('single', get_the_ID());
        ?>
&nbsp;</span>
	</div>
	<?php 
    }
}
Beispiel #22
0
			<div class="meta">
				<?php 
    $category = get_the_category();
    if ($category[0]) {
        echo '<span id="mute-category" class="muted"><i class="fa fa-list-alt"></i><a href="' . get_category_link($category[0]->term_id) . '"> ' . $category[0]->cat_name . '</a></span>';
    }
    ?>
				<span class="muted"><i class="fa fa-user"></i> <a href="<?php 
    echo get_author_posts_url(get_the_author_meta('ID'));
    ?>
"><?php 
    echo get_the_author();
    ?>
</a></span>
				<time class="muted"><i class="fa fa-clock-o"></i> <?php 
    echo timeago(get_gmt_from_date(get_the_time('Y-m-d G:i:s')));
    ?>
</time>
				<span class="muted"><i class="fa fa-eye"></i> <?php 
    deel_views('℃');
    ?>
</span>
				<?php 
    if (comments_open()) {
        echo '<span class="muted"><i class="fa fa-comments-o"></i> <a href="' . get_comments_link() . '">' . get_comments_number('去', '1', '%') . '评论</a></span>';
    }
    ?>
				<?php 
    edit_post_link('[编辑]');
    ?>
			</div>
    /** Execution logs list page
     * @param int $page
     */
    function actionExecLogs($page = 1)
    {
        ThemeBegin(LNG_MM_BOTNET_WEBINJECTS, 0, getBotJsMenu('botmenu'), 0);
        $PAGER = new Paginator($page, 50);
        $q_logs = $this->db->prepare('SELECT SQL_CALC_FOUND_ROWS
			    `b`.`bid`,
			    `b`.`name` AS `b_name`,
			    `b`.`mtime` AS `b_mtime`,
			    `h`.`botId`,
			    `h`.`etime`,
			    `h`.`exec_count`,
			    `h`.`exec_error`,
			    `h`.`debug_error`
			 FROM `botnet_webinjects_history` `h`
			    LEFT JOIN `botnet_webinjects_bundle` `b` USING(`bid`)
			 ORDER BY
			    `h`.`etime` IS NULL DESC,
			    `b`.`mtime` DESC,
			    `h`.`etime` DESC
			 LIMIT :limit, :perpage
			 ;');
        $PAGER->pdo_limit($q_logs, ':limit', ':perpage');
        $q_logs->execute();
        $PAGER->total($this->db->found_rows());
        echo '<table id="exec-logs" class="zebra lined">';
        echo '<THEAD>', '<tr>', '<th>', 'BotId', '</th>', '<th>', 'Bundle', '</th>', '<th>', 'State', '</th>', '<th>', 'Exec count', '</th>', '<th>', 'Exec time', '</th>', '<th>', 'Exec error', '</th>', '<th>', 'Debug error', '</th>', '</tr>', '</THEAD>';
        echo '<TBODY>';
        while ($log = $q_logs->fetchObject()) {
            $state = (int) is_null($log->etime) . (int) is_null($log->exec_error) . (int) is_null($log->debug_error);
            switch ($state) {
                case '111':
                    $state_text = 'pending';
                    break;
                case '011':
                    $state_text = 'success';
                    break;
                case '001':
                    $state_text = 'exec error';
                    break;
                case '010':
                    $state_text = 'bot error';
                    break;
                default:
                    $state_text = '???';
                    break;
            }
            echo '<tr class="state' . $state . '">';
            echo '<th>', htmlentities($log->botId), '</th>';
            echo '<td>', htmlentities($log->b_name), '</td>';
            echo '<td>', $state_text, '</td>';
            # Exec count
            echo '<td>', is_null($log->exec_count) ? '-' : $log->exec_count, '</td>';
            # Exec time
            echo '<td>', is_null($log->etime) ? date('H:i:s d.m.Y', $log->b_mtime) : timeago(time() - $log->etime), '</td>';
            # Exec error
            echo '<td>', is_null($log->exec_error) ? '' : '<div class="exec_error">' . htmlentities($log->exec_error) . '</div>', '</td>';
            # Debug error
            echo '<td>', is_null($log->debug_error) ? '' : '<div class="debug_error">' . htmlentities($log->debug_error) . '</div>', '</td>';
            echo '</tr>';
        }
        echo '</TBODY>';
        echo '</table>';
        echo $PAGER->jPager3k(mkuri(1, 'm') . '&page=%page%', null, 'paginator');
        echo <<<HTML
\t\t<script src="theme/js/jPager3k/jPager3k.js"></script>
\t\t<link rel="stylesheet" href="theme/js/jPager3k/jPager3k.css">
\t\t<link rel="stylesheet" href="theme/js/jPager3k/jPager3k-default.css">
HTML;
        ThemeEnd();
    }
Beispiel #24
0
	<?php 
$found = $db->query("SELECT * FROM youbulletin ORDER BY viewtime DESC LIMIT " . VIDEO_COUNT)->fetchAll(PDO::FETCH_ASSOC);
foreach ($found as $post) {
    ?>
	<div class="comment thread">
		<div class="info">
			<div class="title"><?php 
    echo htmlspecialchars($post["title"]);
    ?>
</div>
			<div class="postedby">posted by <span class="namefont"><?php 
    echo htmlspecialchars($post["name"]);
    ?>
</span></div>
			<div class="date"><?php 
    echo timeago($post["posttime"]);
    ?>
 ago</div>
			<div class="replylink"><a href="thread.php?id=<?php 
    echo $post["id"];
    ?>
">[ <?php 
    echo $post["comments"];
    ?>
 comment<?php 
    echo splural($post["comments"]);
    ?>
 ]</a></div>
			<div class="views"><?php 
    echo $post["views"];
    ?>
Beispiel #25
0
function blog_comments_children($comments, $children)
{
    if (!$children) {
        return '';
    }
    ?>
	<ul class="children">
		<?php 
    $isGravatar = Option::get('isgravatar');
    foreach ($children as $child) {
        $comment = $comments[$child];
        $isNofollow = isset($comment['url']) && false === strpos($comment['url'], rtrim(BLOG_URL, '/')) ? 'rel="external nofollow"' : '';
        $comment['poster'] = $comment['url'] ? '<a href="' . $comment['url'] . '" target="_blank" ' . $isNofollow . '>' . $comment['poster'] . '</a>' : $comment['poster'];
        ?>
		<li class="comment comment_children" id="comment-<?php 
        echo $comment['cid'];
        ?>
">
			<a name="<?php 
        echo $comment['cid'];
        ?>
"></a>
				<?php 
        if ($isGravatar == 'y') {
            echo '<div class="avatar"><img src="' . TEMPLATE_URL . 'images/noAvator.jpg" data-src="' . $comment['figure'] . '" /></div>';
        } else {
            echo '<div class="avatar"><img src="' . TEMPLATE_URL . 'images/noAvator.jpg" /></div>';
        }
        ?>
			<div class="comment-info">
				<div class="comment-content"><p><?php 
        echo comment2emoji($comment['content']);
        ?>
</p></div>
				<div class="comment-meata">
					<span class="comment-poster <?php 
        echo $comment['role'];
        ?>
" title="<?php 
        echo $comment['roledes'];
        ?>
"><?php 
        echo $comment['poster'];
        ?>
</span> 
					<span class="comment-time"><?php 
        if (strtotime($comment['date'])) {
            echo timeago(strtotime($comment['date']));
        } else {
            echo str_replace(' ', '', $comment['date']);
        }
        ?>
</span>
					<?php 
        if ($comment['level'] < 3) {
            echo '<a href="#comment-' . $comment['cid'] . '" onclick="commentReply(' . $comment['cid'] . ',this)" class="comment-reply-btn">回复</a>';
        }
        ?>
				</div>
			</div>
			<?php 
        blog_comments_children($comments, $comment['children']);
        ?>
		</li>
		<?php 
    }
    ?>
	</ul>
<?php 
}
Beispiel #26
0
function deel_comment_list($comment, $args, $depth)
{
    echo '<li ';
    comment_class();
    echo ' id="comment-' . get_comment_ID() . '">';
    //头像
    echo '<div class="c-avatar">';
    echo str_replace(' src=', ' data-original=', get_avatar($comment->comment_author_email, $size = '36', deel_avatar_default()));
    echo '</div>';
    //内容
    echo '<div class="c-main" id="div-comment-' . get_comment_ID() . '">';
    echo str_replace(' src=', ' data-original=', convert_smilies(get_comment_text()));
    if ($comment->comment_approved == '0') {
        echo '<span class="c-approved">您的评论正在排队审核中,请稍后!</span><br />';
    }
    //信息
    echo '<div class="c-meta">';
    echo '<span class="c-author">' . get_comment_author_link() . '</span>';
    echo timeago($comment->comment_date);
    if ($comment->comment_approved !== '0') {
        echo comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
        echo edit_comment_link(__('(编辑)'), ' - ', '');
    }
    echo '</div>';
    echo '</div>';
}
Beispiel #27
0
 /**
  * parse the state array into a format that we can easily display
  *
  * Parameters:
  *  $state  - the array of states from all nagios instances
  *  $filter - the regex to filter out hosts
  *  $api_cols - API column mapping from the nagios API
  *  $filter_select_last_state_change - A numeric string we'll use to filter by last state change
  *
  *  Returns [$host_summary, $service_summary, $down_hosts, $known_hosts, $known_services, $broken_services];
  */
 static function parse_nagios_host_data($state, $filter, $api_cols, $filter_select_last_state_change)
 {
     $host_summary = array();
     $service_summary = array();
     $down_hosts = array();
     $known_hosts = array();
     $known_services = array();
     $broken_services = array();
     // The user may filter by last state change, to limit how much output to review.
     $state_change_backstop = 0;
     # Default to all objects.
     if ($filter_select_last_state_change > 0) {
         $state_change_backstop = time() - $filter_select_last_state_change;
     }
     foreach ($state as $hostname => $host_detail) {
         // Check if the host matches the filter
         if (preg_match("/{$filter}/", $hostname)) {
             // If the host is NOT OK...
             if ($host_detail[$api_cols['state']] != 0) {
                 // Sort the host into the correct array. It's either a known issue or not.
                 if ($host_detail[$api_cols['ack']] > 0 || isset($host_detail['scheduled_downtime_depth']) && $host_detail['scheduled_downtime_depth'] > 0 || $host_detail['notifications_enabled'] == 0) {
                     $array_name = "known_hosts";
                 } else {
                     $array_name = "down_hosts";
                 }
                 // Populate the array.
                 if ($host_detail['last_state_change'] >= $state_change_backstop) {
                     array_push(${$array_name}, array("hostname" => $hostname, "host_state" => $host_detail[$api_cols['state']], "duration" => timeago($host_detail['last_state_change']), "detail" => $host_detail['plugin_output'], "current_attempt" => $host_detail['current_attempt'], "max_check_attempts" => $host_detail['max_check_attempts'], "tag" => $host_detail['tag'], "is_hard" => $host_detail['current_attempt'] >= $host_detail['max_check_attempts'] ? true : false, "is_downtime" => isset($host_detail['scheduled_downtime_depth']) && $host_detail['scheduled_downtime_depth'] > 0 ? true : false, "is_ack" => $host_detail[$api_cols['ack']] > 0 ? true : false, "is_enabled" => $host_detail['notifications_enabled'] > 0 ? true : false));
                 }
             }
             // In any case, increment the overall status counters.
             if (isset($host_summary[$host_detail[$api_cols['state']]])) {
                 $host_summary[$host_detail[$api_cols['state']]]++;
             } else {
                 $host_summary[$host_detail[$api_cols['state']]] = 1;
             }
             // Now parse the statuses for this host.
             foreach ($host_detail['services'] as $service_name => $service_detail) {
                 // If the host is OK, AND the service is NOT OK.
                 if ($service_detail[$api_cols['state']] != 0 && $host_detail[$api_cols['state']] == 0) {
                     // Sort the service into the correct array. It's either a known issue or not.
                     if ($service_detail[$api_cols['ack']] > 0 || $service_detail['scheduled_downtime_depth'] > 0 || $service_detail['notifications_enabled'] == 0 || isset($host_detail['scheduled_downtime_depth']) && $host_detail['scheduled_downtime_depth'] > 0) {
                         $array_name = "known_services";
                     } else {
                         $array_name = "broken_services";
                     }
                     $downtime_remaining = null;
                     $downtimes = array_merge($service_detail['downtimes'], $host_detail['downtimes']);
                     if (isset($host_detail['scheduled_downtime_depth']) && $host_detail['scheduled_downtime_depth'] > 0 || isset($service_detail['scheduled_downtime_depth']) && $service_detail['scheduled_downtime_depth'] > 0) {
                         if (count($downtimes) > 0) {
                             $downtime_info = array_pop($downtimes);
                             $downtime_remaining = "- " . timeago($downtime_info['end_time']) . " left";
                         }
                     }
                     if ($service_detail['last_state_change'] >= $state_change_backstop) {
                         array_push(${$array_name}, array("hostname" => $hostname, "service_name" => $service_name, "service_state" => $service_detail[$api_cols['state']], "duration" => timeago($service_detail['last_state_change']), "last_state_change" => $service_detail['last_state_change'], "detail" => $service_detail['plugin_output'], "current_attempt" => $service_detail['current_attempt'], "max_attempts" => $service_detail[$api_cols['max_attempts']], "tag" => $host_detail['tag'], "is_hard" => $service_detail['current_attempt'] >= $service_detail[$api_cols['max_attempts']] ? true : false, "is_downtime" => isset($service_detail['scheduled_downtime_depth']) && $service_detail['scheduled_downtime_depth'] > 0 || isset($host_detail['scheduled_downtime_depth']) && $host_detail['scheduled_downtime_depth'] > 0 ? true : false, "downtime_remaining" => $downtime_remaining, "is_ack" => $service_detail[$api_cols['ack']] > 0 ? true : false, "is_enabled" => $service_detail['notifications_enabled'] > 0 ? true : false));
                     }
                 }
                 if ($host_detail[$api_cols['state']] == 0) {
                     if (isset($service_summary[$service_detail[$api_cols['state']]])) {
                         $service_summary[$service_detail[$api_cols['state']]]++;
                     } else {
                         $service_summary[$service_detail[$api_cols['state']]] = 1;
                     }
                 }
             }
         }
     }
     ksort($host_summary);
     ksort($service_summary);
     return [$host_summary, $service_summary, $down_hosts, $known_hosts, $known_services, $broken_services];
 }
Beispiel #28
0
<?php

if (!defined('PERM')) {
    die;
}
?>


<div class="list-group">
<?php 
$result = dbquery("SELECT * FROM bg_forumtopicpost GROUP BY post_topicid ORDER BY post_time DESC LIMIT 0,5");
$rows1 = dbrows($result);
if ($rows1 >= "1") {
    while ($data = dbarray($result)) {
        $type = "/tema/" . $data["post_topicid"] . "/" . bezd(forumtopicname($data["post_topicid"]));
        echo '<a href="' . $type . '" class="list-group-item">' . forumtopicname($data["post_topicid"]) . '<br/><small>' . timeago($data["post_time"]) . ' od ' . username($data["post_userid"], 0) . '</small></a>';
    }
}
?>
</div>

<?php 
if (userperm("5")) {
    if (isset($_POST["editmod"])) {
        if ($_POST["modset"] == 1) {
            dbquery("DELETE FROM bg_forumtopicread WHERE forumr_tid='" . $dataf2["forumt_id"] . "'");
            dbquery("UPDATE bg_forumtopic SET forumt_locked='1',forumt_lockuserid='" . $userinfo["user_id"] . "' WHERE forumt_id='" . $dataf2["forumt_id"] . "'");
            redirect("/tema/" . $dataf2["forumt_id"] . "/" . bezd($dataf2["forumt_name"]));
        }
        if ($_POST["modset"] == 2) {
            dbquery("UPDATE bg_forumtopic SET forumt_locked='0' WHERE forumt_id='" . $dataf2["forumt_id"] . "'");
Beispiel #29
0
</div>
			<header class="article_header">
				<h1><a href="<?php 
echo Url::log($logid);
?>
"><?php 
echo $log_title;
?>
</a></h1>
				<div class="article_meta">
					<span><i class="fa fa-user"></i> <?php 
echo blog_author($author);
?>
</span>
					<span><i class="fa fa-clock-o"></i> <?php 
echo timeago($date, true);
?>
</span>
					<span><i class="fa fa-eye"></i> <?php 
echo $views;
?>
次浏览</span>
					<span><i class="fa fa fa-folder-open"></i> <?php 
blog_sort($logid);
?>
</span>
					<?php 
echo editflg($logid, $author);
?>
				</div>
			</header>
Beispiel #30
0
                echo $no;
                ?>
</td>
                    <td><?php 
                echo $data->info_detail_judul;
                ?>
</td>
                    <td><?php 
                echo $data->info_detail_keterangan;
                ?>
</td>
                    <td><?php 
                include_once 'selisihtime.php';
                date_default_timezone_set("asia/jakarta");
                $tglsekarang = date("Y/m/d h:i:s");
                $waktu = timeago($data->updated_at);
                echo $waktu;
                ?>
</td>
                     <td><a href='index.php?key=editinfodetail.php&id=<?php 
                echo $data->info_detail_id;
                ?>
&info=<?php 
                echo $id;
                ?>
' title='Ubah' class='btn  teal accent-4'><i class='fa fa-edit'></i></a>
            <a href='index.php?key=hapusinfodetail.php&id=<?php 
                echo $data->info_detail_id;
                ?>
&info=<?php 
                echo $id;