function dispHome(){
//echo 'test'.$_SESSION["WEEZ"]." CRYPTAGE MD5 : ".md5($_SESSION["WEEZ"]) ;
$str = '
Brèves
';
$str .=dispHomeNews();
$str .= '
Edito
';
$str .= dispHomeEdito();
$str .= '
Dernières vidéo
';
$str .= dispHomeLastVideos();
$str .='
Dernières photos
';
$str .= dispHomeLastPhotos();
$str .='
';
echo $str;
}
function dispHomeNews(){
$str = '';
if ($_SESSION["user_right"] >= $GLOBALS["PRIV_GUEST"] ) {
$result = getLastNews(2);
}
else if ($_SESSION["user_right"] >= $GLOBALS["GUEST"] ) {
$result = getLastNews(1);
}
else {
$result = getLastNews(0);
}
if (mysql_num_rows($result)){
while ($news = mysql_fetch_array($result)) {
// DISP NEWS TITLE BY TENDU
$str .= dispWhenTendu($news["news_tendu"]);
$str .= '
'.$news["news_title"].'
';
// DISP NEWS CONTENT BY TENDU
$str .= dispWhenTendu($news["news_tendu"]);
$str .= '
- '.$news["news_date"].'
'.$news["news_comment"].'
';
}
}
return ($str);
}
function dispHomeEdito(){
$result = getLastEdito();
if (mysql_num_rows($result)){
$edito = mysql_fetch_array($result);
}
$str = '
- '.$edito["edito_title"].'
- '.$edito["edito_comment"].'
';
return ($str);
}
function dispHomeLastVideos(){
if ($_SESSION["user_right"] >= $GLOBALS["PRIV_GUEST"] ) {
$result = getLastVideosByTendu(2);
}
else if ($_SESSION["user_right"] >= $GLOBALS["GUEST"] ) {
$result = getLastVideosByTendu(1);
}
else {
$result = getLastVideosByTendu(0);
}
$str = '';
if (mysql_num_rows($result)){
for ($cpt = 0; $cpt < 10 && ($video = mysql_fetch_array($result)); $cpt++) {
// DISP LAST VIDEOS BY TENDU
$str .= dispWhenTendu($video["video_tendu"]);
$str .= '
- '.$video["video_name"].'
';
if ($video["video_path_daily"]) {
$str .= '
';
}
$str .= ' '.$video["video_size"].' Mo';
}
$str .= '';
}
$str .= '
';
return ($str);
}
function dispHomeLastPhotos(){
if ($_SESSION["user_right"] >= $GLOBALS["PRIV_GUEST"] ) {
$result = getLastPhotosByTendu(2);
}
else if ($_SESSION["user_right"] >= $GLOBALS["GUEST"] ) {
$result = getLastPhotosByTendu(1);
}
else {
$result = getLastPhotosByTendu(0);
}
$str = '';
if (mysql_num_rows($result)){
for ($cpt = 0; $cpt < 10 && ($photo = mysql_fetch_array($result)); $cpt++) {
// DISP LAST PHOTOS BY TENDU
$str .= dispWhenTendu($photo["photo_tendu"]);
$str .= '- '.$photo["photo_comment"].'\', \'#d3d3df\')"';
}
$str .= '>'.$photo["photo_name"].' ';
if ($_SESSION["user_right"] >= $GLOBALS["PRIV_GUEST"] && photo_img_path != 0) {
$str .= '(zip)';
}
$str .= '';
$str .= ' '.$photo["photo_size"]. ' Img
';
}
$str .= ' ';
}
$str .= '
';
return ($str);
}
?>
|