Пример #1
0
        $get_post = mysql_fetch_array(mysql_query("SELECT * FROM ava_posts WHERE id=" . $report['link_id']));
        $get_topic = mysql_fetch_array(mysql_query("SELECT * FROM ava_topics WHERE id=" . $get_post['topic']));
        $name = '<a href="' . TopicUrl($get_topic['id'], $get_topic['seo_url'], $get_topic['forum_id'], 1) . '#' . $get_post['id'] . '"/>' . $get_topic['title'] . '</a>';
        $get_post_user = mysql_fetch_array(mysql_query("SELECT * FROM ava_users WHERE id=" . $get_post['user_id']));
    } elseif ($report['type'] == 1) {
        $get_game = mysql_fetch_array(mysql_query("SELECT * FROM ava_games WHERE id=" . $report['link_id']));
        $game_url = GameUrl($get_game['id'], $get_game['seo_url'], $get_game['category_id']);
    } elseif ($report['type'] == 2 || $report['type'] == 3) {
        if ($report['type'] == 2) {
            $get_comment = mysql_fetch_array(mysql_query("SELECT * FROM ava_comments WHERE id=" . $report['link_id']));
            $get_game = mysql_fetch_array(mysql_query("SELECT * FROM ava_games WHERE id=" . $get_comment['link_id']));
            $name = '<a href="' . GameUrl($get_game['id'], $get_game['seo_url'], $get_game['category_id']) . '#comment' . $get_comment['id'] . '"/>' . $get_game['name'] . '</a>';
        } else {
            $get_comment = mysql_fetch_array(mysql_query("SELECT * FROM ava_news_comments WHERE id=" . $report['link_id']));
            $get_news = mysql_fetch_array(mysql_query("SELECT * FROM ava_news WHERE id=" . $get_comment['link_id']));
            $name = '<a href="' . NewsUrl($get_news['id'], $get_news['seo_url']) . '#comment' . $get_comment['id'] . '"/>' . $get_news['title'] . '</a>';
        }
        $get_comment_user = mysql_fetch_array(mysql_query("SELECT * FROM ava_users WHERE id=" . $get_comment['user']));
    } elseif ($report['type'] == 5) {
        $get_reported_user = mysql_fetch_array(mysql_query("SELECT * FROM ava_users WHERE id=" . $report['link_id']));
        $reported_user_url = ProfileUrl($get_reported_user['id'], $get_reported_user['seo_url']);
    } elseif ($report['type'] == 6) {
        $get_pm = mysql_fetch_array(mysql_query("SELECT * FROM ava_messages WHERE id=" . $report['link_id']));
        $get_pm_user = mysql_fetch_array(mysql_query("SELECT * FROM ava_users WHERE id=" . $get_pm['sender_id']));
    }
    include 'report_item.php';
}
if (isset($_GET['id'])) {
    $total_results = mysql_num_rows(mysql_query("SELECT * FROM ava_reported {$type} AND id <= {$_GET['id']}"));
} else {
    $total_results = mysql_num_rows(mysql_query("SELECT * FROM ava_reported {$type}"));
Пример #2
0
} else {
    if (isset($_GET['id'])) {
        $sql = mysql_query("SELECT * FROM ava_news WHERE id=" . $id . " LIMIT 1");
    } else {
        $name = mysql_secure($_GET['name']);
        $sql = mysql_query("SELECT * FROM ava_news WHERE seo_url= '{$name}' LIMIT 1");
    }
}
while ($row = mysql_fetch_array($sql)) {
    $id = $row['id'];
    $sql2 = mysql_query("SELECT * FROM ava_users WHERE id='" . $row['user'] . "' LIMIT 1");
    while ($row2 = mysql_fetch_array($sql2)) {
        // Assign items to 'news' array for use in the template
        $news = array('title' => $row['title'], 'author' => $row2['username'], 'date' => FormatDate($row['date'], 'time'), 'main' => $row['content']);
        $news['user_url'] = ProfileUrl($row2['id'], $row2['seo_url']);
        $news['news_url'] = NewsUrl($row['id'], $row['seo_url']);
        $news['comments'] = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM ava_news_comments WHERE link_id={$row['id']}"), 0);
        $news['image_url'] = $setting['site_url'] . '/uploads/news_icons/' . $row['image'];
        // Include the template for news items
        include '.' . $setting['template_url'] . '/' . $template['news_item'];
    }
}
if (!isset($_GET['id']) && !isset($_GET['name'])) {
    $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM ava_news"), 0);
    $total_pages = ceil($total_results / $npp);
    if ($total_pages > 1) {
        echo '<div class="category_pages">';
        if ($page > 1) {
            $prev = $page - 1;
            $url = NewsPagesUrl($prev);
            echo '<a href="' . $url . '">&laquo; ' . PREVIOUS . '</a> ';
Пример #3
0
<?php

if ($login_status != 1) {
    exit;
}
?>

<div class="category_add_item"><div class="add_child"><div class="add_text"><a href="?task=add_news">Add news</a></div><div class="add_icon" id="add_icon"><a href="?task=add_news"><img src="images/add.png" /></a></div></div></div><br />

<div class="manage_header"><div class="manage_header_column0">ID</div><div class="manage_header_column">news name</div><div class="manage_header_column3" id="load_image"></div></div>

<div id="news_container"><div id="thetop"></div>

<?php 
$query = mysql_query("SELECT * FROM ava_news ORDER BY id DESC");
while ($go = mysql_fetch_array($query)) {
    $url = NewsUrl($go['id'], $go['seo_url']);
    echo '
<div id="news-' . $go['id'] . '" class="manage_item"><div class="manage_column0">' . $go['id'] . '</div><div id="news-name-' . $go['id'] . '" class="manage_column"><a href="' . $url . '" class="manage_link">' . $go['title'] . '</a></div><div class="manage_column3" id="delete-image-' . $go['id'] . '"><img src="images/delete.png" width="24" height="24" onclick="DeleteAsk(' . $go['id'] . ');"></div><div class="manage_column3" id="edit-image-' . $go['id'] . '"><a href="?task=edit_news&id=' . $go['id'] . '"><img src="images/edit.png" width="24" height="24"></a></div>

<div class="manage_column3"  id="comments-image-' . $go['id'] . '"><img src="images/comments.gif" width="24" height="24" onclick="gotourl(\'index.php?task=manage_news_comments#page=1&id=' . $go['id'] . '\')"></div>

<div id="edit-news-' . $go['id'] . '" class="edit_game_container"></div>

</div>';
}
echo '</div>';
Пример #4
0
<div class="bottomBOXES">
	    <div class="cubeBOX">
	     <p class="cubeBOX_title">Latest News</p>
	       <ul>
	       <?php 
$sql = mysql_query("SELECT * FROM ava_news ORDER BY id desc LIMIT 5");
while ($row = mysql_fetch_array($sql)) {
    $url = NewsUrl($row['id'], $row['seo_url']);
    $title = shortenStr($row['title'], $template['module_max_chars']);
    if ($setting['module_thumbs'] == 1) {
        $image_url = $setting['site_url'] . '/uploads/news_icons/' . $row['image'];
        $image = '<img src="' . $image_url . '" width="25" height="25" style="vertical-align: middle;" />';
    } else {
        $image = '';
    }
    echo '<li class="news">' . $image . ' <a href="' . $url . '">' . $title . '</a></li>';
}
?>

	       </ul>
	    </div>
	    
	    <div class="cubeBOX">
	     <p class="cubeBOX_title">Newest Games</p>
	       <ul>
	         <?php 
include './includes/modules/newest.php';
?>
	       </ul>
	    </div>
}
$max_results = 30;
$from = $page * $max_results - $max_results;
if (isset($_GET['s'])) {
    $where = "comment like \"%" . $_GET['s'] . "%\" ";
} else {
    $where = "1 = 1 ";
}
if (isset($_GET['id']) && $_GET['id'] != 0) {
    $where .= "AND link_id = {$_GET['id']}";
}
$query = mysql_query("SELECT * FROM ava_news_comments WHERE {$where} ORDER BY id DESC LIMIT {$from}, {$max_results}");
while ($go = mysql_fetch_array($query)) {
    $get_user = mysql_fetch_array(mysql_query("SELECT * FROM ava_users WHERE id=" . $go['user']));
    $get_news = mysql_fetch_array(mysql_query("SELECT * FROM ava_news WHERE id=" . $go['link_id']));
    $news_url = NewsUrl($get_news['id'], $get_news['seo_url']);
    if (!isset($first_comment) && isset($_GET['id'])) {
        echo 'Showing comments for: ' . $get_news['title'] . ' (<a href="#page=1">Show all news comments</a>)';
        $first_comment = 1;
    }
    echo '
<div id="comment-' . $go['id'] . '" class="manage_user_item"><div id="tcomment_name' . $go['id'] . '" class="username_column"><a href="?task=manage_users#id=' . $go['user'] . '">' . $get_user['username'] . '</a> - <a href="' . $news_url . '">' . $get_news['title'] . '</a></div><div id="tcategory_name' . $go['id'] . '" class="manage_column2"></div><div class="manage_column3" id="delete-image-' . $go['id'] . '"><img src="images/delete.png" width="24" height="24" ondblclick="DeleteComment(' . $go['id'] . ');"></div><div class="manage_column3" id="edit-image-' . $go['id'] . '"></div>

<div class="clear"></div>

<div align="left"><div id="tcomment_name' . $go['id'] . '" class="manage_user_column">' . htmlspecialchars($go['comment']) . '</div></div>

</div>';
}
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM ava_news_comments WHERE {$where}"), 0);
$total_pages = ceil($total_results / $max_results);