*is optimistic*
Streams.php
Code: Select all
<?php
/**
*
* @package - Board3portal
* @version $Id: streams.php 589 2009-12-04 21:11:16Z marc1706 $
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB') || !defined('IN_PORTAL'))
{
exit;
}
//
// Exclude forums
//
$sql_where = '';
if ($portal_config['portal_streams_forum'] > 0)
{
$exclude_forums = explode(',', $portal_config['portal_streams_forum']);
$sql_where = ' AND ' . $db->sql_in_set('forum_id', $exclude_forums, ($portal_config['portal_exclude_forums']) ? true : false);
}
// Get a list of forums the user cannot read
$forum_ary = array_unique(array_keys($auth->acl_getf('!f_read', true)));
// Determine first forum the user is able to read (must not be a category)
$sql = 'SELECT forum_id
FROM ' . FORUMS_TABLE . '
WHERE forum_type = ' . FORUM_POST;
$forum_sql = '';
if (sizeof($forum_ary))
{
$sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true);
$forum_sql = ' AND ' . $db->sql_in_set('t.forum_id', $forum_ary, true);
}
$result = $db->sql_query_limit($sql, 1);
$g_forum_id = (int) $db->sql_fetchfield('forum_id');
//
// Streams announcements
//
$sql = 'SELECT topic_title, forum_id, topic_id
FROM ' . TOPICS_TABLE . ' t
WHERE topic_status <> ' . FORUM_LINK . '
AND topic_approved = 1
AND (topic_type = ' . POST_ANNOUNCE . ' OR topic_type = ' . POST_GLOBAL . ')
AND topic_moved_id = 0
' . $sql_where . '' . $forum_sql . '
ORDER BY topic_time DESC';
$result = $db->sql_query_limit($sql, $portal_config['portal_max_topics']);
while(($row = $db->sql_fetchrow($result)) && ($row['topic_title']))
{
// auto auth
if (($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
{
$template->assign_block_vars('latest_announcements', array(
'TITLE' => character_limit($row['topic_title'], $portal_config['portal_streams_title_limit']),
'FULL_TITLE' => censor_text($row['topic_title']),
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id'] == 0) ? $g_forum_id : $row['forum_id']) . '&t=' . $row['topic_id'])
));
}
}
$db->sql_freeresult($result);
//
// Streams hot topics
//
$sql = 'SELECT topic_title, forum_id, topic_id
FROM ' . TOPICS_TABLE . ' t
WHERE topic_approved = 1
AND topic_replies >=' . $config['hot_threshold'] . '
AND topic_moved_id = 0
' . $sql_where . '' . $forum_sql . '
ORDER BY topic_time DESC';
$result = $db->sql_query_limit($sql, $portal_config['portal_max_topics']);
while(($row = $db->sql_fetchrow($result)) && ($row['topic_title']))
{
// auto auth
if (($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
{
$template->assign_block_vars('latest_hot_topics', array(
'TITLE' => character_limit($row['topic_title'], $portal_config['portal_streams_title_limit']),
'FULL_TITLE' => censor_text($row['topic_title']),
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id'] == 0) ? $g_forum_id : $row['forum_id']) . '&t=' . $row['topic_id'])
));
}
}
$db->sql_freeresult($result);
//
// Streams topic (only show normal topic)
//
$sql = 'SELECT topic_title, forum_id, topic_id
FROM ' . TOPICS_TABLE . ' t
WHERE topic_status <> ' . ITEM_MOVED . '
AND topic_approved = 1
AND topic_type = ' . POST_NORMAL . '
AND topic_moved_id = 0
' . $sql_where . '' . $forum_sql . '
ORDER BY topic_time DESC';
$result = $db->sql_query_limit($sql, $portal_config['portal_max_topics']);
while(($row = $db->sql_fetchrow($result)) && ($row['topic_title']))
{
// auto auth
if (($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
{
$template->assign_block_vars('latest_topics', array(
'TITLE' => character_limit($row['topic_title'], $portal_config['portal_streams_title_limit']),
'FULL_TITLE' => censor_text($row['topic_title']),
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'])
));
}
}
$db->sql_freeresult($result);
$template->assign_var('S_DISPLAY_STREAMS', true);
?>
Videos.php
Code: Select all
<?php
/**
*
* @package - Board3portal
* @version $Id: videos.php 589 2009-12-04 21:11:16Z marc1706 $
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB') || !defined('IN_PORTAL'))
{
exit;
}
//
// Exclude forums
//
$sql_where = '';
if ($portal_config['portal_videos_forum'] > 0)
{
$exclude_forums = explode(',', $portal_config['portal_videos_forum']);
$sql_where = ' AND ' . $db->sql_in_set('forum_id', $exclude_forums, ($portal_config['portal_exclude_forums']) ? true : false);
}
// Get a list of forums the user cannot read
$forum_ary = array_unique(array_keys($auth->acl_getf('!f_read', true)));
// Determine first forum the user is able to read (must not be a category)
$sql = 'SELECT forum_id
FROM ' . FORUMS_TABLE . '
WHERE forum_type = ' . FORUM_POST;
$forum_sql = '';
if (sizeof($forum_ary))
{
$sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true);
$forum_sql = ' AND ' . $db->sql_in_set('t.forum_id', $forum_ary, true);
}
$result = $db->sql_query_limit($sql, 1);
$g_forum_id = (int) $db->sql_fetchfield('forum_id');
//
// Videos announcements
//
$sql = 'SELECT topic_title, forum_id, topic_id
FROM ' . TOPICS_TABLE . ' t
WHERE topic_status <> ' . FORUM_LINK . '
AND topic_approved = 1
AND (topic_type = ' . POST_ANNOUNCE . ' OR topic_type = ' . POST_GLOBAL . ')
AND topic_moved_id = 0
' . $sql_where . '' . $forum_sql . '
ORDER BY topic_time DESC';
$result = $db->sql_query_limit($sql, $portal_config['portal_max_topics']);
while(($row = $db->sql_fetchrow($result)) && ($row['topic_title']))
{
// auto auth
if (($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
{
$template->assign_block_vars('latest_announcements', array(
'TITLE' => character_limit($row['topic_title'], $portal_config['portal_videos_title_limit']),
'FULL_TITLE' => censor_text($row['topic_title']),
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id'] == 0) ? $g_forum_id : $row['forum_id']) . '&t=' . $row['topic_id'])
));
}
}
$db->sql_freeresult($result);
//
// Videos hot topics
//
$sql = 'SELECT topic_title, forum_id, topic_id
FROM ' . TOPICS_TABLE . ' t
WHERE topic_approved = 1
AND topic_replies >=' . $config['hot_threshold'] . '
AND topic_moved_id = 0
' . $sql_where . '' . $forum_sql . '
ORDER BY topic_time DESC';
$result = $db->sql_query_limit($sql, $portal_config['portal_max_topics']);
while(($row = $db->sql_fetchrow($result)) && ($row['topic_title']))
{
// auto auth
if (($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
{
$template->assign_block_vars('latest_hot_topics', array(
'TITLE' => character_limit($row['topic_title'], $portal_config['portal_videos_title_limit']),
'FULL_TITLE' => censor_text($row['topic_title']),
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id'] == 0) ? $g_forum_id : $row['forum_id']) . '&t=' . $row['topic_id'])
));
}
}
$db->sql_freeresult($result);
//
// Videos topic (only show normal topic)
//
$sql = 'SELECT topic_title, forum_id, topic_id
FROM ' . TOPICS_TABLE . ' t
WHERE topic_status <> ' . ITEM_MOVED . '
AND topic_approved = 1
AND topic_type = ' . POST_NORMAL . '
AND topic_moved_id = 0
' . $sql_where . '' . $forum_sql . '
ORDER BY topic_time DESC';
$result = $db->sql_query_limit($sql, $portal_config['portal_max_topics']);
while(($row = $db->sql_fetchrow($result)) && ($row['topic_title']))
{
// auto auth
if (($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
{
$template->assign_block_vars('latest_topics', array(
'TITLE' => character_limit($row['topic_title'], $portal_config['portal_videos_title_limit']),
'FULL_TITLE' => censor_text($row['topic_title']),
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'])
));
}
}
$db->sql_freeresult($result);
$template->assign_var('S_DISPLAY_VIDEOS', true);
?>
Streams.html
Code: Select all
<!--version $Id: streams.html 503 2009-04-20 18:34:29Z kevin74 $ //-->
<!-- IF .latest_announcements or .latest_hot_topics or .latest_topics -->
{$LR_BLOCK_H_L}<!-- IF $S_BLOCK_ICON --><img src="{T_THEME_PATH}/images/portal/portal_stats.png" width="16" height="16" alt="" /> <!-- ENDIF -->Streams{$LR_BLOCK_H_R}
<table class="tablebg" cellspacing="1" width="100%">
<tr class="row1">
<td class="row1" width="100%" valign="top">
<!-- IF .latest_announcements -->
<!-- BEGIN latest_announcements -->
<a href="{latest_announcements.U_VIEW_TOPIC}" title="{latest_announcements.FULL_TITLE}">{latest_announcements.TITLE}</a><br />
<!-- END latest_announcements -->
<!-- ENDIF -->
<!-- IF .latest_hot_topics -->
<!-- BEGIN latest_hot_topics -->
<a href="{latest_hot_topics.U_VIEW_TOPIC}" title="{latest_hot_topics.FULL_TITLE}">{latest_hot_topics.TITLE}</a><br />
<!-- END latest_hot_topics -->
<!-- ENDIF -->
<!-- IF .latest_topics -->
<!-- BEGIN latest_topics -->
<a href="{latest_topics.U_VIEW_TOPIC}" title="{latest_topics.FULL_TITLE}">{latest_topics.TITLE}</a><br />
<!-- END latest_topics -->
</td>
<!-- ENDIF -->
</tr>
</table>
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}
<!-- ENDIF -->
videos.html
Code: Select all
<!--version $Id: videos.html 503 2009-04-20 18:34:29Z kevin74 $ //-->
<!-- IF .latest_announcements or .latest_hot_topics or .latest_topics -->
{$LR_BLOCK_H_L}<!-- IF $S_BLOCK_ICON --><img src="{T_THEME_PATH}/images/portal/portal_stats.png" width="16" height="16" alt="" /> <!-- ENDIF -->Recent videos{$LR_BLOCK_H_R}
<table class="tablebg" cellspacing="1" width="100%">
<tr class="row1">
<td class="row1" width="100%" valign="top">
<!-- IF .latest_announcements -->
<!-- BEGIN latest_announcements -->
<a href="{latest_announcements.U_VIEW_TOPIC}" title="{latest_announcements.FULL_TITLE}">{latest_announcements.TITLE}</a><br />
<!-- END latest_announcements -->
<!-- ENDIF -->
<!-- IF .latest_hot_topics -->
<!-- BEGIN latest_hot_topics -->
<a href="{latest_hot_topics.U_VIEW_TOPIC}" title="{latest_hot_topics.FULL_TITLE}">{latest_hot_topics.TITLE}</a><br />
<!-- END latest_hot_topics -->
<!-- ENDIF -->
<!-- IF .latest_topics -->
<!-- BEGIN latest_topics -->
<a href="{latest_topics.U_VIEW_TOPIC}" title="{latest_topics.FULL_TITLE}">{latest_topics.TITLE}</a><br />
<!-- END latest_topics -->
</td>
<!-- ENDIF -->
</tr>
</table>
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}
<!-- ENDIF -->
Really appreciate this, I will have to buy you a drink for all the help you give to everyone