*
* *
***************************************************************************
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; *
* *
***************************************************************************/
include( PREFIX_INCLUDE.'./template/'.$user['template'].'/theme/conf.php' );
$user['lien_expanded']='./template/'.$user['template'].'/theme/expanded.gif';
$user['lien_collapsed']='./template/'.$user['template'].'/theme/collapsed.gif';
include_once( PREFIX_INCLUDE.'./template/'.$user['template'].'/style.inc.php');
function get_icon( $date_comparaison )
{
global $user, $conf;
$difference = time() - $date_comparaison;
$jours = 24*60*60;
$output = '';
if ( $difference < $user['long_period'] * $jours )
{
$icon_url = './template/'.$user['template'].'/theme/';
if ( $difference < $user['short_period'] * $jours )
{
$icon_url.= 'new_short.gif';
}
else
{
$icon_url.= 'new_long.gif';
}
$size = getimagesize( $icon_url );
$output = '';
}
return $output;
}
function create_navigation_bar( $url, $nb_element, $start,
$nb_element_page, $link_class )
{
global $lang;
$navigation_bar = "";
// 0. détection de la page en cours
if( !isset( $start )
|| !is_numeric( $start )
|| ( is_numeric( $start ) && $start < 0 ) )
{
$start = 0;
}
// on n'affiche la bare de navigation que si on plus de 1 page
if ( $nb_element > $nb_element_page )
{
// 1.une page précédente ?
if ( $start != 0 )
{
$previous = $start - $nb_element_page;
$navigation_bar.= ''.$lang['previous_page'];
$navigation_bar.= '';
$navigation_bar.= ' | ';
}
// 2.liste des numéros de page
$maximum = ceil ( $nb_element / $nb_element_page );
for ( $i = 1; $i <= $maximum; $i++ )
{
$temp_start = ( $i - 1 ) * $nb_element_page;
if ( $temp_start == $start )
{
$navigation_bar.= ' '.$i.' ';
}
else
{
$navigation_bar.= ' '.$i.' ';
}
}
// 3.une page suivante ?
if ( $nb_element > $nb_element_page
&& $start + $nb_element_page < $nb_element )
{
$next = $start + $nb_element_page;
$navigation_bar.= ' | '.$lang['next_page'].'';
}
}
return $navigation_bar;
}
function get_frame_start()
{
return '
';
}
function get_frame_end()
{
return '
|
';
}
*/
function get_frame_begin()
{
global $user;
$path = './template/'.$user['template'].'/theme/';
$size_01 = getimagesize( $path.'01.gif' );
$size_02 = getimagesize( $path.'02.gif' );
$size_03 = getimagesize( $path.'03.gif' );
return ';">
|
|
|
|
';
}
function get_frame_end()
{
global $user;
$path = './template/'.$user['template'].'/theme/';
$size_08 = getimagesize( $path.'08.gif' );
return '
|
|
|
|
|
';
}
function initialize_template()
{
global $vtp, $handle, $user, $lang;
$vtp->setGlobalVar( $handle, 'charset', $lang['charset'] );
$vtp->setGlobalVar( $handle, 'style', $user['style'] );
$vtp->setGlobalVar( $handle, 'frame_start', get_frame_start() );
$vtp->setGlobalVar( $handle, 'frame_begin', get_frame_begin() );
$vtp->setGlobalVar( $handle, 'frame_end', get_frame_end() );
$vtp->setVarF( $handle, 'header',
'./template/'.$user['template'].'/header.htm' );
$vtp->setVarF( $handle, 'footer',
'./template/'.$user['template'].'/footer.htm' );
}
function display_category( $category, $indent, $handle )
{
global $user,$lang,$vtp;
$vtp->addSession( $handle, 'category' );
$vtp->setVar( $handle, 'category.indent', $indent );
if ( $user['expand'] or count( $category['subcats'] ) == 0 )
{
$vtp->addSession( $handle, 'bullet_wo_link' );
$vtp->setVar( $handle, 'bullet_wo_link.bullet_url',
$user['lien_collapsed'] );
$vtp->closeSession( $handle, 'bullet_wo_link' );
}
else
{
$vtp->addSession( $handle, 'bullet_w_link' );
$url = './category.php?cat='.$page['cat'];
$url.= '&expand='.$category['expand_string'];
if ( $page['cat'] == 'search' )
{
$url.= '&search='.$_GET['search'].'&mode='.$_GET['mode'];
}
$vtp->setVar( $handle, 'bullet_w_link.bullet_link', add_session_id($url) );
if ( $category['expanded'] )
{
$vtp->setVar( $handle, 'bullet_w_link.bullet_url',
$user['lien_expanded'] );
}
else
{
$vtp->setVar( $handle, 'bullet_w_link.bullet_url',
$user['lien_collapsed'] );
}
$vtp->closeSession( $handle, 'bullet_w_link' );
}
$url = './category.php?cat='.$category['id'];
$url.= '&expand='.$category['expand_string'];
$vtp->setVar( $handle, 'category.link_url', add_session_id( $url ) );
$name = $category['name'];
if ( $name == '' ) $name = str_replace( '_', ' ', $category['dir'] );
$vtp->setVar( $handle, 'category.link_name', $name );
if ( $category['id_uppercat'] == '' )
{
$vtp->setVar( $handle, 'category.name_style', 'font-weight:bold;' );
}
if ( count( $category['subcats'] ) > 0 )
{
$vtp->addSession( $handle, 'subcat' );
$vtp->setVar( $handle, 'subcat.nb_subcats', count($category['subcats']) );
$vtp->closeSession( $handle, 'subcat' );
}
$vtp->setVar( $handle, 'category.total_cat', $category['nb_images'] );
$vtp->setVar( $handle, 'category.cat_icon',get_icon($category['date_last']));
$vtp->closeSession( $handle, 'category' );
// recursive call
if ( $category['expanded'] )
{
foreach ( $category['subcats'] as $subcat ) {
display_category( $subcat, $indent.str_repeat( ' ', 2 ), $handle );
}
}
}
?>