Versión phpBB: phpBB3 (8)
MODs Instalados: Print Topic, Advanced BBcode Box 3
Plantilla(s) usada(s): prosilver
Servidor: ni idea
Actualización desde otra versión:
Conversión desde otro sistema de foros:
Hola de nuevo y de nuevo gracias por la atención. Estoy tratando de instalar el MOD MSSTI RSS Feed 2.0 with ACP.
Creo que he seguido todas las instrucciones al pie de la letra, pero no veo que aparezca ningún iconillo de RSS por lado alguno.
Tuve una duda durante la instalación. En includes/functions.php se dice que hay que añadir esto:
Spoiler
/**
* Find out in which forums ( and all it's child's ) the user is not allowed to view
*
* @return array $rss_excluded_forums_ary with forum id to exclude
**/
function rss_filters()
{
global $auth, $db, $config, $phpbb_root_path, $phpEx, $rss_excluded_forums_ary;
// Do not run twice if it has already been executed earlier.
if ( isset($rss_excluded_forums_ary) && is_array($rss_excluded_forums_ary) )
{
return $rss_excluded_forums_ary;
}
$rss_excluded_forums_ary = array();
// Which forums should be directly excluded ?
if ( $config['rss_exclude_id'] != '' )
{
if (!is_array( $config['rss_exclude_id'] ))
{
$forums_id = explode(",", $config['rss_exclude_id'] );
}
foreach ( $forums_id as $fid )
{
if ( $fid )
{
$rss_excluded_forums_ary[] = (int) $fid;
}
}
}
// Start with a list of forums without initial exclusions id's
$not_in_fid = ( sizeof($rss_excluded_forums_ary) ) ? 'WHERE (' . $db->sql_in_set('forum_id', $rss_excluded_forums_ary, true) . ") OR (forum_password <> '' )" : '';
$sql = "SELECT forum_id, parent_id, forum_password, forum_parents, left_id, right_id
FROM " . FORUMS_TABLE . "
$not_in_fid
ORDER BY forum_id";
$rss_filters_result = $db->sql_query($sql);
while ( $forum_data = $db->sql_fetchrow($rss_filters_result) )
{
// Exclude passworded forum completely ( for some reason the (forum_password <> '' ) in SQL query doesn't work

if ( $forum_data['forum_password'] != '' )
{
$rss_excluded_forums_ary[] = (int) $forum_data['forum_id'];
continue;
}
// Exclude forums the user is not able to read
if ( !$auth->acl_get('f_list', $forum_data['forum_id']) )
{
$rss_excluded_forums_ary[] = (int) $forum_data['forum_id'];
continue;
}
// Skip direct child of a excluded forum
if ( in_array($forum_data['parent_id'], $rss_excluded_forums_ary) )
{
$rss_excluded_forums_ary[] = (int) $forum_data['forum_id'];
continue;
}
if ( $forum_data['parent_id'] > 0 )
{
// Needed for some pages, like login

require_once( $phpbb_root_path . 'includes/functions_display.' . $phpEx );
// Get forum parents
$forum_parents = get_forum_parents( $forum_data );
// Search for subforums
if ( !empty( $forum_parents ) )
{
foreach ( $forum_parents as $parent_forum_id => $parent_data )
{
// Skip this parent if the user does not have the permission to view it
if ( !$auth->acl_get('f_list', $parent_forum_id) )
{
$rss_excluded_forums_ary[] = $parent_forum_id;
continue;
}
// Skip this forum if it's the child of a excluded forum
if ( in_array($parent_forum_id, $rss_excluded_forums_ary) )
{
$rss_excluded_forums_ary[] = (int) $forum_data['forum_id'];
continue;
}
}
}
}
}
$db->sql_freeresult($rss_filters_result);
return $rss_excluded_forums_ary;
}
// MOD : MSSTI RSS Feeds (V1.2.1) - End
Código: Seleccionar todo
?>
Spoiler
return array(
'#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#',
'#<!\-\- l \-\-><a (?:class="[\w-]+" )?href="(.*?)(?:(&|\?)sid=[0-9a-f]{32})?">.*?</a><!\-\- l \-\->#',
'#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" )?href="(.*?)">.*?</a><!\-\- \1 \-\->#',
'#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#',
'#<!\-\- .*? \-\->#s',
'#<.*?>#s',
);
break;
Spoiler
/**
* Find out in which forums ( and all it's child's ) the user is not allowed to view
*
* @return array $rss_excluded_forums_ary with forum id to exclude
**/
function rss_filters()
{
global $auth, $db, $config, $phpbb_root_path, $phpEx, $rss_excluded_forums_ary;
// Do not run twice if it has already been executed earlier.
if ( isset($rss_excluded_forums_ary) && is_array($rss_excluded_forums_ary) )
{
return $rss_excluded_forums_ary;
}
$rss_excluded_forums_ary = array();
// Which forums should be directly excluded ?
if ( $config['rss_exclude_id'] != '' )
{
if (!is_array( $config['rss_exclude_id'] ))
{
$forums_id = explode(",", $config['rss_exclude_id'] );
}
foreach ( $forums_id as $fid )
{
if ( $fid )
{
$rss_excluded_forums_ary[] = (int) $fid;
}
}
}
// Start with a list of forums without initial exclusions id's
$not_in_fid = ( sizeof($rss_excluded_forums_ary) ) ? 'WHERE (' . $db->sql_in_set('forum_id', $rss_excluded_forums_ary, true) . ") OR (forum_password <> '' )" : '';
$sql = "SELECT forum_id, parent_id, forum_password, forum_parents, left_id, right_id
FROM " . FORUMS_TABLE . "
$not_in_fid
ORDER BY forum_id";
$rss_filters_result = $db->sql_query($sql);
while ( $forum_data = $db->sql_fetchrow($rss_filters_result) )
{
// Exclude passworded forum completely ( for some reason the (forum_password <> '' ) in SQL query doesn't work

if ( $forum_data['forum_password'] != '' )
{
$rss_excluded_forums_ary[] = (int) $forum_data['forum_id'];
continue;
}
// Exclude forums the user is not able to read
if ( !$auth->acl_get('f_list', $forum_data['forum_id']) )
{
$rss_excluded_forums_ary[] = (int) $forum_data['forum_id'];
continue;
}
// Skip direct child of a excluded forum
if ( in_array($forum_data['parent_id'], $rss_excluded_forums_ary) )
{
$rss_excluded_forums_ary[] = (int) $forum_data['forum_id'];
continue;
}
if ( $forum_data['parent_id'] > 0 )
{
// Needed for some pages, like login

require_once( $phpbb_root_path . 'includes/functions_display.' . $phpEx );
// Get forum parents
$forum_parents = get_forum_parents( $forum_data );
// Search for subforums
if ( !empty( $forum_parents ) )
{
foreach ( $forum_parents as $parent_forum_id => $parent_data )
{
// Skip this parent if the user does not have the permission to view it
if ( !$auth->acl_get('f_list', $parent_forum_id) )
{
$rss_excluded_forums_ary[] = $parent_forum_id;
continue;
}
// Skip this forum if it's the child of a excluded forum
if ( in_array($parent_forum_id, $rss_excluded_forums_ary) )
{
$rss_excluded_forums_ary[] = (int) $forum_data['forum_id'];
continue;
}
}
}
}
}
$db->sql_freeresult($rss_filters_result);
return $rss_excluded_forums_ary;
}
// MOD : MSSTI RSS Feeds (V1.2.1) - End
?>