From 3fcb44298a10a1b13254d8f4c345e02a4d5c3efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Mon, 8 Mar 2010 03:53:45 +0000 Subject: [PATCH] adding who post the news formating date as french one merging news showing code between news.php and home.php --- css/default.css | 5 +++++ include/functions_sql.php | 2 +- include/home.php | 37 +------------------------------------ include/news.php | 3 +-- include/videos.php | 2 +- 5 files changed, 9 insertions(+), 40 deletions(-) diff --git a/css/default.css b/css/default.css index 4538282..7a675c7 100644 --- a/css/default.css +++ b/css/default.css @@ -270,6 +270,11 @@ div.rightbox h1 { padding: 0px 0px 0px 5px; } +.news_by { + color: #6D6C6C; + font-style: italic; +} + .news_separator { margin: 0px 0px 0px -15px; padding:0; diff --git a/include/functions_sql.php b/include/functions_sql.php index c8dca83..a7e0654 100644 --- a/include/functions_sql.php +++ b/include/functions_sql.php @@ -12,7 +12,7 @@ function getOneNews($news_id) { function getLastNews($tendu) { $tendu = mysql_real_escape_string($tendu); - $query = "SELECT * FROM $DB.news_db WHERE news_tendu<='$tendu' ORDER BY news_date desc, news_time desc"; + $query = "SELECT * FROM $DB.news_db INNER JOIN $DB.users_db ON news_db.news_user_id = users_db.user_id WHERE news_tendu<='$tendu' ORDER BY news_date desc, news_time desc"; return mysql_query($query); } diff --git a/include/home.php b/include/home.php index 182ab5c..aa6c7fa 100644 --- a/include/home.php +++ b/include/home.php @@ -14,7 +14,7 @@ $str = '

Dernières actualités

@@ -47,41 +47,6 @@ $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)) { - for ($cpt = 0; $cpt < 10 && ($news = mysql_fetch_array($result)); $cpt++) { - - // 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)) diff --git a/include/news.php b/include/news.php index 5d207be..2b50059 100644 --- a/include/news.php +++ b/include/news.php @@ -32,8 +32,7 @@ function dispNewsRows(){ // DISP NEWS CONTENT BY TENDU $str .= dispWhenTendu($news["news_tendu"]); - - $str .= ' - '.$news["news_date"].' + $str .= ' - Le '.date("d/m/Y", strtotime($news["news_date"])).' par '.$news["user_pseudo"].'

    '.$news["news_comment"].'



    '; diff --git a/include/videos.php b/include/videos.php index f0c11fb..81dc210 100644 --- a/include/videos.php +++ b/include/videos.php @@ -124,7 +124,7 @@ function dispVideosByType($result, $video_type) { if ($video["video_path_daily"]) $str .= ''; - $str .= ''.$video["video_date"].''.$video["video_size"].' Mo'; + $str .= ''.date("d/m/Y", strtotime($video["video_date"])).''.$video["video_size"].' Mo'; } $str .= ' -- GitLab