';
}
-
+
return $str;
diff --git a/include/functions_sql.php b/include/functions_sql.php
index 41438fe02bf10a82e08bd0f7ea40af24c5fb4e53..de4193044e22f68de31c9e351468d20f08844225 100644
--- a/include/functions_sql.php
+++ b/include/functions_sql.php
@@ -5,14 +5,14 @@
################################
function getOneNews($news_id){
-
+
$query = "select * from $DB.news_db WHERE news_id = '$news_id'";
return $result = mysql_query($query);
}
function getLastNews($tendu){
- $query = "SELECT * FROM $DB.news_db
+ $query = "SELECT * FROM $DB.news_db
WHERE news_tendu<='$tendu'
ORDER BY news_date desc, news_time desc";
return $result = mysql_query($query);
@@ -24,20 +24,20 @@ function getLastNews($tendu){
################################
function getOneEdito($edito_id){
-
+
$query = "select * from $DB.editos_db WHERE edito_id = '$edito_id'";
return $result = mysql_query($query);
}
function getLastEdito(){
-
+
$query = "select * from $DB.editos_db ORDER BY edito_date DESC";
return $result = mysql_query($query);
}
function getAllEdito(){
-
+
$query = "select * from $DB.editos_db ORDER BY edito_date DESC";
return $result = mysql_query($query);
}
@@ -48,7 +48,7 @@ function getAllEdito(){
function getOnePhoto($vid_id){
-
+
$query = "select * from $DB.photos_db WHERE photo_id = '$vid_id'";
return $result = mysql_query($query);
}
@@ -67,7 +67,7 @@ function getLastPhotos(){
function getPhotosByType( $type){
- $query = "select * from $DB.photos_db
+ $query = "select * from $DB.photos_db
WHERE photo_type='$type'
ORDER BY photo_date desc";
return $result = mysql_query($query);
@@ -76,12 +76,12 @@ function getPhotosByType( $type){
function getPhotosByYearAndTypeAndTendu($year, $type, $tendu){
if ($year == 2000) {
- $query = "select * from $DB.photos_db
+ $query = "select * from $DB.photos_db
WHERE photo_type='$type' AND photo_tendu<='$tendu' AND YEAR(photo_date)<='$year'
ORDER BY photo_date desc";
}
else {
- $query = "select * from $DB.photos_db
+ $query = "select * from $DB.photos_db
WHERE photo_type='$type' AND photo_tendu<='$tendu' AND YEAR(photo_date)='$year'
ORDER BY photo_date desc";
}
@@ -92,11 +92,11 @@ function getPhotosByYearAndTypeAndTendu($year, $type, $tendu){
function getLastPhotosByTendu($tendu){
-
- $query = "select * from $DB.photos_db
+
+ $query = "select * from $DB.photos_db
WHERE photo_tendu<='$tendu'
ORDER BY photo_id desc";
-
+
return $result = mysql_query($query);
}
@@ -107,7 +107,7 @@ function getLastPhotosByTendu($tendu){
function getOneVideo($vid_id){
-
+
$query = "select * from $DB.videos_db WHERE video_id = '$vid_id'";
return $result = mysql_query($query);
}
@@ -126,7 +126,7 @@ function getLastVideos(){
function getVideosByType( $type){
- $query = "select * from $DB.videos_db
+ $query = "select * from $DB.videos_db
WHERE video_type='$type'
ORDER BY video_date desc";
return $result = mysql_query($query);
@@ -135,12 +135,12 @@ function getVideosByType( $type){
function getVideosByYearAndTypeAndTendu($year, $type, $tendu){
if ($year == 2000) {
- $query = "select * from $DB.videos_db
+ $query = "select * from $DB.videos_db
WHERE video_type='$type' AND video_tendu<='$tendu' AND YEAR(video_date)<='$year'
ORDER BY video_date desc";
}
else {
- $query = "select * from $DB.videos_db
+ $query = "select * from $DB.videos_db
WHERE video_type='$type' AND video_tendu<='$tendu' AND YEAR(video_date)='$year'
ORDER BY video_date desc";
}
@@ -151,11 +151,11 @@ function getVideosByYearAndTypeAndTendu($year, $type, $tendu){
function getLastVideosByTendu($tendu){
-
- $query = "select * from $DB.videos_db
+
+ $query = "select * from $DB.videos_db
WHERE video_tendu<='$tendu'
ORDER BY video_id desc";
-
+
return $result = mysql_query($query);
}
diff --git a/public/home.php b/include/home.php
similarity index 55%
rename from public/home.php
rename to include/home.php
index 00ee67980f2e05dba110d16557cbc84f9b08352d..0c32500058d45f504cc45f71efd9eaf001339e9b 100644
--- a/public/home.php
+++ b/include/home.php
@@ -2,8 +2,6 @@
function dispHome(){
-//echo 'test'.$_SESSION["WEEZ"]." CRYPTAGE MD5 : ".md5($_SESSION["WEEZ"]) ;
-
$str = '
@@ -13,9 +11,9 @@ $str = '
- Brèves
+ Dernières actualités
';
-
+
$str .=dispHomeNews();
$str .= '
@@ -26,24 +24,16 @@ $str = '
Edito
';
-
- $str .= dispHomeEdito();
+
+ $str .= dispHomeEdito();
$str .= '
Dernières vidéo
';
-
- $str .= dispHomeLastVideos();
- $str .='
-
-
- Dernières photos
- ';
-
- $str .= dispHomeLastPhotos();
+ $str .= dispHomeLastVideos();
$str .='
@@ -62,53 +52,46 @@ echo $str;
function dispHomeNews(){
- $str = '';
+ $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)) {
+ 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)) {
+ for ($cpt = 0; $cpt < 10 && ($news = mysql_fetch_array($result)); $cpt++) {
-// DISP NEWS TITLE BY TENDU
- $str .= dispWhenTendu($news["news_tendu"]);
-
- $str .= '
+ // 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 .= '
+ // DISP NEWS CONTENT BY TENDU
+ $str .= dispWhenTendu($news["news_tendu"]);
+ $str .= '
- '.$news["news_date"].'
'.$news["news_comment"].'
';
- }
- }
-
- return ($str);
+ }
+ }
+ return ($str);
}
function dispHomeEdito(){
$result = getLastEdito();
if (mysql_num_rows($result)){
- $edito = mysql_fetch_array($result);
+ $edito = mysql_fetch_array($result);
}
-
+
$str = '
- '.$edito["edito_title"].'
@@ -121,10 +104,10 @@ function dispHomeEdito(){
function dispHomeLastVideos(){
- if ($_SESSION["user_right"] >= $GLOBALS["PRIV_GUEST"] ) {
+ if ($_SESSION["user_right"] >= $GLOBALS["PRIV_GUEST"] ) {
$result = getLastVideosByTendu(2);
}
- else if ($_SESSION["user_right"] >= $GLOBALS["GUEST"] ) {
+ else if ($_SESSION["user_right"] >= $GLOBALS["GUEST"] ) {
$result = getLastVideosByTendu(1);
}
else {
@@ -135,22 +118,21 @@ function dispHomeLastVideos(){
if (mysql_num_rows($result)){
- for ($cpt = 0; $cpt < 10 && ($video = mysql_fetch_array($result)); $cpt++) {
-
+ for ($cpt = 0; $cpt < 20 && ($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 .= '';
@@ -163,51 +145,4 @@ function dispHomeLastVideos(){
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);
-}
-
?>
diff --git a/public/jukebox.php b/include/jukebox.php
similarity index 100%
rename from public/jukebox.php
rename to include/jukebox.php
diff --git a/public/members.php b/include/members.php
similarity index 100%
rename from public/members.php
rename to include/members.php
diff --git a/include/menu.php b/include/menu.php
index dacd7ccac0edce5eeaeebda20ddf9eb2edcb9b0f..9df97e84fb51aaa64d0b686a648e29dd388b5b06 100644
--- a/include/menu.php
+++ b/include/menu.php
@@ -4,8 +4,10 @@ function dispMenu() {
$str = ' |