Meerdere photo albums
Geplaatst: 26 apr 2005, 23:35
Ik heb een smartor photoalbum geinstalleerd bij mijn forum. Alleen zou ik er graag nog 2 bij willen hebben, in hetzelfde forum. Weet iemand of dit mogelijk is...
Code: Selecteer alles
#
#-----[ SQL ]------------------------------------------
# Please change phpbb_ with your table prefix
#
ALTER TABLE phpbb_sessions ADD session_style INT(11) DEFAULT '0' NOT NULL;
#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
// Initialise user settings on page load
#
#-----[ AFTER, ADD ]------------------------------------------
#
function get_style_id()
{
global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID, $db, $user_ip, $board_config;
$style = '';
$session_id = substr($SID, 4);
if ( !empty($HTTP_GET_VARS['s']) )
{
$style = $HTTP_GET_VARS['s'];
$sql = "SELECT themes_id
FROM " . THEMES_TABLE . "
WHERE themes_id = $style";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not query database for theme info');
}
if ( !($row = $db->sql_fetchrow($result)) )
{
$style = $board_config['default_style'];
}
$sql = "UPDATE " . SESSIONS_TABLE . "
SET session_style = $style
WHERE session_id = '" . $session_id . "'
AND session_ip = '$user_ip'";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error updating session_style', '', __LINE__, __FILE__, $sql);
}
}
else
{
$sql = "SELECT session_style
FROM " . SESSIONS_TABLE . "
WHERE session_id = '" . $session_id . "'
AND session_ip = '$user_ip'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Could not query database for theme info');
}
if ( $row = $db->sql_fetchrow($result) )
{
$style = $row['session_style'];
}
}
if ( $style == "" || $style == 0 )
{
$style = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_s']) ) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_s'] : $board_config['default_style'];
}
else
{
setcookie($board_config['cookie_name'] . '_s', $style, time()+3600);
}
return $style;
}
#
#-----[ FIND ]------------------------------------------
#
if ( !$board_config['override_user_style'] )
{
if ( $userdata['user_id'] != ANONYMOUS && $userdata['user_style'] > 0 )
{
if ( $theme = setup_style($userdata['user_style']) )
{
return;
}
}
}
$theme = setup_style($board_config['default_style']);
#
#-----[ REPLACE WITH ]------------------------------------------
#
$theme = setup_style(get_style_id());
#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
//
// Handle marking posts
//
#
#-----[ BEFORE, ADD ]------------------------------------------
# $style_cat[x], x = style_id
# array(y, z), y and z are the cat_id's what are visible
#
$style_id = get_style_id();
$style_cat[1] = array(1, 2);
$style_cat[2] = array(2);
#
#-----[ FIND ]------------------------------------------
#
if ( $display_forums )
#
#-----[ REPLACE WITH ]------------------------------------------
#
if ( $display_forums && in_array($cat_id, $style_cat[$style_id]) )
#
#-----[ SAVE/CLOSE ALLE FILES ]------------------------------------------
#
# EoMdat zijn dus 20 en geen 2 regelspaulus schreef:geef regel 40 - 60 eens van index.php?
Code: Selecteer alles
$style_id = get_style_id();
$style_cat[1] = array(1, 2);
$style_cat[2] = array(2); Ehh moest ik daar wat van makenLuuk schreef:Wat heb je vangemaakt?Code: Selecteer alles
$style_id = get_style_id(); $style_cat[1] = array(1, 2); $style_cat[2] = array(2);
Ja dus, kan moeilijk raden wat voor id's jij hebt.[code]# #-----[ BEFORE, ADD ]------------------------------------------ # $style_cat[x], x = style_id # array(y, z), y and z are the cat_id's what are visible # $style_id = get_style_id(); $style_cat[1] = array(1, 2); $style_cat[2] = array(2);[/code] schreef:# $style_cat[x], x = style_id
# array(y, z), y and z are the cat_id's what are visible