include_once('include/class.database.php');
include_once('include/func.forum.php');
// Set local (swedish)
setlocale(LC_ALL, 'sv_SE');
// Create database connection (from setup.php)
$db = new db_connection('gameplayer.cj8k3z0nnjqq.eu-west-1.rds.amazonaws.com', 'gameplayer', 'gameplayer', 'yAUxekkai7UG7Z');
// Set session data
$_SESSION['user_id'] = 0;
$_SESSION['access_level'] = 0;
$type = @strtolower($_REQUEST['type']);
if ($type == 'forum')
generate_forum_rss();
else if ($type == 'blogg')
generate_blogg_rss();
else if ($type == 'news')
generate_news_rss();
else if ($type == 'files')
generate_download_rss();
else if ($type == 'latest')
generate_latest_rss();
//
function num_text($count, $one, $many)
{
return $count . ' ' . ($count == 1 ? $one : $many);
}
function generate_download_rss()
{
global $db;
// Create XML
header("Content-Type: application/xml");
echo '
casino-utan-licens.biz - Filarkiv
http://'.$_SERVER['HTTP_HOST'].'/
Nya filer
sv-se
casino-utan-licens.biz - Filarkivhttp://'.$_SERVER['HTTP_HOST'].'/gfx/static_gfx/site_logo_small.pnghttp://'.$_SERVER['HTTP_HOST'].'/14446';
$query = "select gi.game_console_id as console_id, gi.cover_thumb, gi.game_info_id, uf.*, uft.type_name, uft.color_code from upload_file uf
inner join upload_file_type uft on uft.upload_file_type_id = uf.file_type
left outer join game_info gi on gi.game_title_id = uf.game_title_id and gi.game_console_id = uf.game_console_id
inner join game_title gt on gt.game_title_id = gi.game_title_id
left outer join publication_text pt on pt.publication_id = uf.publication_id
where if(pt.publication_id is not null, is_published=1, true) order by uf.uploaded_at desc limit 50";
$count = 0;
$res = $db->query($query);
while ($row = $res->fetch_array())
{
$date_str = date('r', strtotime($row['created_at']));
if (!$count++)
{
echo '' . $date_str . '';
echo '' . $date_str . '';
}
$blogg_str = '[ ' . htmlspecialchars($row['description'], ENT_QUOTES) . ' ]';
echo '- ';
echo '' . htmlspecialchars(convert_text_subject(unquote_string($row['topic']), false), ENT_QUOTES) . '';
echo '' . $date_str . '';
echo 'http://'.$_SERVER['HTTP_HOST'].'/game_info.php?game_id=' . $row['game_info_id'] . '§ion=5&file_id=' . $row['upload_file_id'] . '';
echo 'http://'.$_SERVER['HTTP_HOST'].'/game_info.php?game_id=' . $row['game_info_id'] . '§ion=5&file_id=' . $row['upload_file_id'] . '';
echo '';
print htmlspecialchars($blogg_str, ENT_QUOTES);
print htmlspecialchars('
', ENT_QUOTES);
print htmlspecialchars(convert_text_message(unquote_string(cut_string($row['message'], 250)), '', '', false, false, 0), ENT_QUOTES);
echo '';
echo '' . htmlspecialchars($row['nickname'], ENT_QUOTES) . '';
echo ' ';
}
echo '';
}
function generate_forum_rss()
{
// Create XML
header("Content-Type: application/xml");
echo '
casino-utan-licens.biz - Tr�dar i forumet
http://'.$_SERVER['HTTP_HOST'].'/
Nya tr�dar i forumet
sv-se
casino-utan-licens.biz - Tr�dar i forumethttp://'.$_SERVER['HTTP_HOST'].'/gfx/static_gfx/site_logo_small.pnghttp://'.$_SERVER['HTTP_HOST'].'/14446';
$thread_list = get_category_thread_list(0, 0, 50, $order_by = 2);
$count = 0;
if (!empty($thread_list))
{
foreach ($thread_list as $thread_id => $thread_data)
{
$date_str = date('r', strtotime($thread_data['created_at']));
if (!$count++)
{
echo '' . $date_str . '';
echo '' . $date_str . '';
}
$forum_str = '[ Forum: ' . $thread_data['forum_name'] . ($thread_data['poll_id'] ? ', har unders�kning' : '') . ($thread_data['num_attachments'] ? ', har ' . num_text($thread_data['num_attachments'], 'bifogad bild', 'bifogade bilder') : '') . ' ]';
echo '- ';
echo '' . htmlspecialchars(convert_text_subject(unquote_string($thread_data['subject']), false), ENT_QUOTES) . '';
echo '' . $date_str . '';
echo 'http://'.$_SERVER['HTTP_HOST'].'/forum.php?thread_id=' . $thread_data['thread_id'] . '';
echo 'http://'.$_SERVER['HTTP_HOST'].'/forum.php?thread_id=' . $thread_data['thread_id'] . '';
echo '';
print htmlspecialchars($forum_str, ENT_QUOTES);
print htmlspecialchars('
', ENT_QUOTES);
print htmlspecialchars(convert_text_message(unquote_string(cut_string($thread_data['message'], 250)), '', '', false, false, 0), ENT_QUOTES);
echo '';
echo '' . htmlspecialchars($thread_data['cre_nickname'], ENT_QUOTES) . '';
echo ' ';
}
}
echo '';
}
function generate_blogg_rss()
{
global $db;
// Create XML
header("Content-Type: application/xml");
echo '
casino-utan-licens.biz - Bloggar
http://'.$_SERVER['HTTP_HOST'].'/
Nya bloggar
sv-se
casino-utan-licens.biz - Bloggarhttp://'.$_SERVER['HTTP_HOST'].'/gfx/static_gfx/site_logo_small.pnghttp://'.$_SERVER['HTTP_HOST'].'/14446';
$query = "select bt.blogg_id, bt.user_id, bt.created_at, bt.subject, substring(message,1,300) as message, ud.nickname
from blogg_text bt
left outer join user_data ud on bt.user_id = ud.user_id
where is_public=1
order by blogg_id desc limit 50";
$count = 0;
$res = $db->query($query);
while ($row = $res->fetch_array())
{
$date_str = date('r', strtotime($row['created_at']));
if (!$count++)
{
echo '' . $date_str . '';
echo '' . $date_str . '';
}
$blogg_str = '[ Blogg: ' . htmlspecialchars($row['nickname'], ENT_QUOTES) . ' ]';
echo '- ';
echo '' . htmlspecialchars(convert_text_subject(unquote_string($row['subject']), false), ENT_QUOTES) . '';
echo '' . $date_str . '';
echo 'http://'.$_SERVER['HTTP_HOST'].'/blogg.php?user_id=' . $row['user_id'] . '&blogg_id=' . $row['blogg_id'] . '';
echo 'http://'.$_SERVER['HTTP_HOST'].'/blogg.php?user_id=' . $row['user_id'] . '&blogg_id=' . $row['blogg_id'] . '';
echo '';
print htmlspecialchars($blogg_str, ENT_QUOTES);
print htmlspecialchars('
', ENT_QUOTES);
print htmlspecialchars(convert_text_message(unquote_string(cut_string($row['message'], 250)), '', '', false, false, 0), ENT_QUOTES);
echo '';
echo '' . htmlspecialchars($row['nickname'], ENT_QUOTES) . '';
echo ' ';
}
echo '';
}
function generate_news_rss()
{
global $db;
// Create XML
header("Content-Type: application/xml");
echo '
casino-utan-licens.biz - Nyheter & Texter
http://'.$_SERVER['HTTP_HOST'].'/
Senaste nytt
sv-se
casino-utan-licens.biz - Nyheter & Texterhttp://'.$_SERVER['HTTP_HOST'].'/gfx/static_gfx/site_logo_small.pnghttp://'.$_SERVER['HTTP_HOST'].'/14446';
$query = "select pt.*, pty.pubtype_name, gt.title as game_title, gc.console_name, gi.cover_small
from publication_text pt
inner join publication_type pty on pty.pubtype_id=pt.pub_type and pty.pubcat_id=1 and pt.pub_type<>22
left outer join game_title gt on gt.game_title_id=pt.game_title_id
left outer join game_console gc on gc.game_console_id=pt.game_console_id
left outer join game_info gi on gi.game_title_id=pt.game_title_id and gi.game_console_id=pt.game_console_id
where is_published=1
and author<>'Redaktionen'
order by pub_date desc
limit 50";
$count = 0;
$res = $db->query($query);
while ($row = $res->fetch_array())
{
$date_str = date('r', strtotime($row['pub_date']));
if (strlen($row['title']))
{
$subject = $row['title'];
}
else
{
$subject = $row['pubtype_name'];
if (strlen($row['game_title'])) $subject .= ' ' . $row['game_title'];
if (strlen($row['console_name'])) $subject .= ' till ' . $row['console_name'];
}
if (!$count++)
{
echo '' . $date_str . '';
echo '' . $date_str . '';
}
$image = '';
if (strlen($row['image_normal'])) $image = 'images/'.$row['image_normal'];
if (!strlen($image) && strlen($row['image_thumb'])) $image = 'thumbs/'.$row['image_thumb'];
if (!strlen($image) && strlen($row['cover_small'])) $image = 'images/'.$row['cover_small'];
$message = '';
if (strlen($image)) $message .= '
';
$message .= cut_string(convert_text_message(unquote_string($row['message']), '', '', false, false, 0), 500);
echo '- ';
echo '' . htmlspecialchars(convert_text_subject(unquote_string($subject), false), ENT_QUOTES) . '';
echo '' . $date_str . '';
echo 'http://'.$_SERVER['HTTP_HOST'].'/pub_text.php?pub_id=' . $row['publication_id'] . '';
echo 'http://'.$_SERVER['HTTP_HOST'].'/pub_text.php?pub_id=' . $row['publication_id'] . '';
echo '';
print htmlspecialchars($message, ENT_QUOTES);
echo '';
echo '' . htmlspecialchars($row['author'], ENT_QUOTES) . '';
echo '
';
}
echo '';
}
function generate_latest_rss()
{
global $db;
// Create XML
header("Content-Type: application/xml");
echo '
casino-utan-licens.biz - Senaste Nytt
http://'.$_SERVER['HTTP_HOST'].'/
Senaste nytt
sv-se
casino-utan-licens.biz - Nyheter & Texterhttp://'.$_SERVER['HTTP_HOST'].'/gfx/static_gfx/site_logo_small.pnghttp://'.$_SERVER['HTTP_HOST'].'/14446';
/*$query = "select pt.*, pty.pubtype_name, gt.title as game_title, gc.console_name, gi.cover_small
from publication_text pt
inner join publication_type pty on pty.pubtype_id=pt.pub_type and pty.pubcat_id=1 and pt.pub_type<>22
left outer join game_title gt on gt.game_title_id=pt.game_title_id
left outer join game_console gc on gc.game_console_id=pt.game_console_id
left outer join game_info gi on gi.game_title_id=pt.game_title_id and gi.game_console_id=pt.game_console_id
where is_published=1
and author<>'Redaktionen'
order by pub_date desc
limit 50";*/
// Get data for "Hett"
$query = "select hl.*, pt.*, gi.cover_small, gt.title as game_title, pty.*, gc.*
from hot_list hl
inner join publication_text pt
on pt.publication_id = hl.publication_id
left outer join game_title gt
on gt.game_title_id=pt.game_title_id
left outer join game_console gc
on gc.game_console_id=pt.game_console_id
inner join publication_type pty
on pty.pubtype_id=pt.pub_type
left outer join game_info gi on gi.game_title_id = gt.game_title_id and gi.game_console_id = gc.game_console_id
where pt.is_published = 1 and pt.publication_id = hl.publication_id
order by hl.hot_id desc
limit 50";
$count = 0;
$res = $db->query($query);
while ($row = $res->fetch_array())
{
$date_str = date('r', strtotime($row['pub_date']));
if (strlen($row['title']))
{
$subject = $row['title'];
}
else
{
$subject = $row['pubtype_name'];
if (strlen($row['game_title'])) $subject .= ' ' . $row['game_title'];
if (strlen($row['console_name'])) $subject .= ' till ' . $row['console_name'];
}
if (!$count++)
{
echo '' . $date_str . '';
echo '' . $date_str . '';
}
$image = '';
if (strlen($row['image_normal'])) $image = 'images/'.$row['image_normal'];
if (!strlen($image) && strlen($row['image_thumb'])) $image = 'thumbs/'.$row['image_thumb'];
if (!strlen($image) && strlen($row['cover_small'])) $image = 'images/'.$row['cover_small'];
$message = '';
if (strlen($image)) $message .= '
';
$message .= cut_string(convert_text_message(unquote_string($row['message']), '', '', false, false, 0), 500);
echo '- ';
echo '' . htmlspecialchars(convert_text_subject(unquote_string($subject), false), ENT_QUOTES) . '';
echo '' . $date_str . '';
echo 'http://'.$_SERVER['HTTP_HOST'].'/pub_text.php?pub_id=' . $row['publication_id'] . '';
echo 'http://'.$_SERVER['HTTP_HOST'].'/pub_text.php?pub_id=' . $row['publication_id'] . '';
echo '';
print htmlspecialchars($message, ENT_QUOTES);
echo '';
echo '' . htmlspecialchars($row['author'], ENT_QUOTES) . '';
echo '
';
}
echo '';
}