1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
|
<?php
/***************************************************************************
* htmlfunctions.inc.php is a part of PhpWebGallery *
* ------------------- *
* last update : Wednesday, 25 December 2002 *
* email : pierrick@z0rglub.com *
* *
***************************************************************************
***************************************************************************
* *
* 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; *
* *
***************************************************************************/
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 = './theme/'.$user['theme'].'/';
if ( $difference < $user['short_period'] * $jours )
{
$icon_url.= 'new_short.gif';
}
else
{
$icon_url.= 'new_long.gif';
}
$size = getimagesize( $icon_url );
$output = '<img src="'.$icon_url.'" style="border:0;';
$output.= 'height:'.$size[1].'px;width:'.$size[0].'px" alt="" />';
}
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.= '<a href="';
$navigation_bar.= add_session_id( $url.'&start='.$previous );
$navigation_bar.= '" class="'.$link_class.'">'.$lang['previous_page'];
$navigation_bar.= '</a>';
$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.= ' <span style="font-weight:bold;">'.$i.'</span> ';
}
else
{
$navigation_bar.= ' <a href="';
$navigation_bar.= add_session_id( $url.'&start='.$temp_start );
$navigation_bar.= '" class="'.$link_class.'">'.$i.'</a> ';
}
}
// 3.une page suivante ?
if ( $nb_element > $nb_element_page
&& $start + $nb_element_page < $nb_element )
{
$next = $start + $nb_element_page;
$navigation_bar.= ' | <a href="';
$navigation_bar.= add_session_id( $url.'&start='.$next );
$navigation_bar.= '" class="'.$link_class.'">'.$lang['next_page'].'</a>';
}
}
return $navigation_bar;
}
function get_frame_start()
{
return '<table style="width:';
}
function get_frame_begin()
{
return ';">
<tr>
<td style="border:1px dashed gray;width:100%;padding:5px;background-color:white;">';
}
function get_frame_end()
{
return '
</td>
</tr>
</table>';
}
/*
function get_frame_begin()
{
global $user;
$path = './theme/'.$user['theme'].'/';
$size_01 = getimagesize( $path.'01.gif' );
$size_02 = getimagesize( $path.'02.gif' );
$size_03 = getimagesize( $path.'03.gif' );
return ';">
<tr>
<td><img src="'.$path.'01.gif" style="width:'.$size_01[0].'px;display:box;" alt="" /></td>
<td><img src="'.$path.'02.gif" style="display:box;width:100%;height:'.$size_02[1].'px;" alt="" /></td>
<td><img src="'.$path.'03.gif" style="display:box;width:'.$size_03[0].'px;" alt="" /></td>
</tr>
<tr>
<td style="background:url('.$path.'04.gif);"></td>
<td style="background:url('.$path.'05.gif);width:100%;">';
}
function get_frame_end()
{
global $user;
$path = './theme/'.$user['theme'].'/';
$size_08 = getimagesize( $path.'08.gif' );
return '
</td>
<td style="background:url('.$path.'06.gif);"></td>
</tr>
<tr>
<td><img src="'.$path.'07.gif" alt="" /></td>
<td><img src="'.$path.'08.gif" style="width:100%;height:'.$size_08[1].'px;" alt="" /></td>
<td><img src="'.$path.'09.gif" alt="" /></td>
</tr>
</table>';
}
*/
function initialize_template()
{
global $vtp, $handle, $user;
$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' );
}
?>
|