Commit 995007d1 authored by Seblu's avatar Seblu

merging public directory and include

fix some photos persistent links and sql request
cleaning mysql db (this is not seen in svn commit)
number of last videos displayed is now 20
limit to 10 number of news on home page
create a dedicated page for actu (section News)
starting work about fan page (create fan menu button)
remove old rss api in videos page
some pagination work (delete trailing and better indent)
fix dead link to eptv.epitech.net in mysql database
fix css bad margin in newsbox
parent 24481841
......@@ -11,20 +11,20 @@ body
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
}
* {
margin: 0;
padding: 0;
margin: 0px;
padding: 0px;
font-family: Tahoma,'Trebuchet MS',Verdana,Arial,"Lucida-Grande",Sans-serif;
}
ul, li {
list-style-type: none;
padding: 0;
margin: 0;
padding: 0px;
margin: 0px;
}
li {
display: inline;
}
li a {
display:inline;
display: inline;
}
img {
margin: 0 auto;
......@@ -104,7 +104,7 @@ div.top_box
position: absolute;
height: 22px;
/*width: 334px;*/
left: 270px;
left: 200px;
top: 101px;
}
#menu li {
......@@ -169,8 +169,8 @@ div.top_box
*/
div#newsbox {
width: 530px;
margin: 0px 0px 20px 15px;
/*width: 530px;*/
margin: 0px 15px 20px 15px;
}
div#newsbox ul {
......@@ -231,6 +231,13 @@ div.rightbox h1 {
border-bottom: 1px solid #303030;
}
#all_side {
float: left;
padding: 0px;
margin: 0px;
background: #303030;
}
#left_side {
float: left;
width: 550px;
......
......@@ -13,7 +13,7 @@ function dispTableBegin($table_title, $table_percent_size, $table_center) {
$str .= '<table width="'.$table_percent_size.'%" border="0" cellspacing="0" cellpadding="0">';
if ($table_title != "") {
$str .=
$str .=
'<tr><td bgcolor="#111111">
<table width="100%" cellspacing="1" cellpadding="2">
<tr><td><b><font color="#666666">'.$table_title.'</font></b></td></tr>';
......@@ -64,7 +64,7 @@ function dispWhenTendu($tendu)
// valeur chelou pour bien afficher le texte
$str = ' <TR><TD>';
}
return $str;
......@@ -87,7 +87,7 @@ function dispAdminWhenTendu($tendu)
// valeur chelou pour bien afficher le texte
$str = ' <TR><TD>';
}
return $str;
......
......@@ -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);
}
......
......@@ -2,8 +2,6 @@
function dispHome(){
//echo 'test'.$_SESSION["WEEZ"]." CRYPTAGE MD5 : ".md5($_SESSION["WEEZ"]) ;
$str = '
<div id="main_body">
......@@ -13,9 +11,9 @@ $str = '
<!-- main body -->
<div id="left_side">
<div id="newsbox">
<h1><img alt="" src="images/puce.png" /> <strong>Br&egrave;ves</strong></h1>
<h1><img alt="" src="images/puce.png" /> <strong>Derni&egrave;res actualit&eacute;s</strong></h1>
<ul>';
$str .=dispHomeNews();
$str .= '
......@@ -26,24 +24,16 @@ $str = '
<div class="rightbox">
<h1><img alt="" src="images/puce.png" /><strong>Edito</strong></h1>
';
$str .= dispHomeEdito();
$str .= dispHomeEdito();
$str .= '
</div>
<div class="rightbox">
<h1><img alt="" src="images/puce.png" /> <strong>Derni&egrave;res vid&eacute;o</strong></h1>
';
$str .= dispHomeLastVideos();
$str .='
</div>
<div class="rightbox">
<h1><img alt="" src="images/puce.png" /> <strong>Derni&egrave;res photos</strong></h1>
';
$str .= dispHomeLastPhotos();
$str .= dispHomeLastVideos();
$str .='
</div>
......@@ -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 .= '
<li>
<h2><strong>
'.$news["news_title"].'
</strong>';
// DISP NEWS CONTENT BY TENDU
$str .= dispWhenTendu($news["news_tendu"]);
$str .= '
// DISP NEWS CONTENT BY TENDU
$str .= dispWhenTendu($news["news_tendu"]);
$str .= '
<span class="news_date"> - '.$news["news_date"].'</span></h2>
<p class="news_text">'.$news["news_comment"].'</p>
<p class="news_separator"><br /><img alt="" src="images/corner_20.png" /><br /></p>
</li>';
}
}
return ($str);
}
}
return ($str);
}
function dispHomeEdito(){
$result = getLastEdito();
if (mysql_num_rows($result)){
$edito = mysql_fetch_array($result);
$edito = mysql_fetch_array($result);
}
$str = '
<ul>
<li>'.$edito["edito_title"].'</li>
......@@ -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 .= '
&nbsp;<li><a href="' . $video["video_path"] . ' " class="texte_link"' . '>'.$video["video_name"].'</a>
</TD>
<TD>';
if ($video["video_path_daily"]) {
$str .= '&nbsp;&nbsp;&nbsp;<a href=\'public/dailymotion.php?q='.$video["video_path_daily"].'\' onclick="return popitup(this, \'EPTV\')" >
<img class="daily_preview" src=\'../images/daily.png\' height="18" border=0></a>';
}
}
$str .= '&nbsp;&nbsp;&nbsp;<strong>'.$video["video_size"].' Mo</strong>';
}
$str .= '</ul>';
......@@ -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 = '<ul>';
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 .= '<li><a href="index.php?section=PhotosShow&action='.$photo["photo_path"].'" class="texte_link"';
if ($photo["photo_comment"]) {
$str .= 'ONMOUSECLICK="popitup(\'<font>'.$photo["photo_comment"].'</font>\', \'#d3d3df\')"';
}
$str .= '>'.$photo["photo_name"].'</a>&nbsp;';
if ($_SESSION["user_right"] >= $GLOBALS["PRIV_GUEST"] && photo_img_path != 0) {
$str .= '<a href="http://www.eptv.fr/"'.$photo["photo_img_path"].'" class="texte_link" >(zip)</a>';
}
$str .= '';
$str .= '&nbsp;&nbsp;&nbsp;<strong>'.$photo["photo_size"]. ' Img</strong>
</li>
';
}
$str .= '</ul>';
}
$str .= '
</small>
';
return ($str);
}
?>
......@@ -4,8 +4,10 @@ function dispMenu() {
$str = '<div id="menu"><ul>';
$str .= '<li><a href="index.php?section=Home" id="tabs_home" title="Accueil du site"><strong>Home</strong></a></li>';
$str .= '<li><a href="index.php?section=Videos" id="tabs_members" title="Nos videos"><strong>Vid&eacute;os</strong></a></li>';
$str .= '<li><a href="index.php?section=News" id="tabs_members" title="Toute l\'actualit&eacute;s"><strong>Actualit&eacute;s</strong></a></li>';
$str .= '<li><a href="index.php?section=Videos" id="tabs_members" title="Toutes nos videos"><strong>Vid&eacute;os</strong></a></li>';
$str .= '<li><a href="index.php?section=Members" id="tabs_cours" title="Nos Membres"><strong>Membres</strong></a></li>';
$str .= '<li><a id="tabs_cours" title="Fan"><strong>Fans</strong></a></li>';
if ($_SESSION["user_right"] >= 5)
$str .= '<li><a href="index.php?section=AdminHome" id="tabs_cours" title="Toutes nos realisations"><strong>Admin</strong></a></li>';
$str .= '<li><a href="index.php?section=Contacts" id="tabs_releases" title="Contactez nous"><strong>Contact</strong></a></li>';
......
<?
function dispNews(){
$str = '<div id="main_body"><div id="all_side">';
$str .= '<div id="newsbox">';
$str .= '<ul>' . dispNewsRows() . '</ul>';
$str .= '</div></div>';
$str .= '<div class="clr">&nbsp;</div>';
$str .= '</div>';
echo $str;
}
function dispNewsRows(){
$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 .= '<li><h2><strong>'.$news["news_title"].'</strong>';
// DISP NEWS CONTENT BY TENDU
$str .= dispWhenTendu($news["news_tendu"]);
$str .= '<span class="news_date"> - '.$news["news_date"].'</span></h2>
<p class="news_text">'.$news["news_comment"].'</p>
<p class="news_separator"><br /><img alt="" src="images/corner_20.png" /><br /></p>
</li>';
}
}
return ($str);
}
?>
......@@ -4,8 +4,10 @@ $tab_section = array();
$tab_section["Home"] = dispHome;
//$tab_section["Webcam"] = dispWebcam;
//$tab_section["Player"] = dispPlayer;
$tab_section["News"] = dispNews;
$tab_section["Videos"] = dispVideos;
$tab_section["Members"] = dispMembers;
$tab_section["Fans"] = dispFans;
$tab_section["Contacts"] = dispContacts;
$tab_section["AdminHome"] = dispAdminHome;
$tab_section["Connection"] = dispConnection;
......
<?
#require_once('lib/magpierss/rss_fetch.inc');
#define('MAGPIE_CACHE_DIR', 'tmp/magpie_cache');
define('DEFAULT_YEAR', '2010');
function dispVideos() {
......@@ -16,7 +13,7 @@ $str = '
<div id="newsbox">
<h1><img alt="" src="images/puce.png" /> <strong>Videos'. $curyear .'</strong></h1>
<ul>';
$str .= dispVideosYear();
$str .= '
......@@ -27,8 +24,8 @@ $str = '
<div class="rightbox">
<h1><img alt="" src="images/puce.png" /> <strong>Ann&eacute;es</strong></h1>
';
$str .= dispVideosMenu();
$str .= dispVideosMenu();
$str .= '
</div>
......@@ -61,7 +58,7 @@ function dispVideosMenu(){
<li><a href="index.php?section=Videos&year_page=2000" class="texte_link">avant</a></li>
';
$str .= '
<li><p>Pour visualiser nos videos: Click-droit, telecharger...</p>
<p>Nous vous conseillons le lecteur <a href="http://www.videolan.org/vlc" target="blank">VLC</a> disponible sous Windows/Mac/Linux.</p>
......@@ -85,14 +82,14 @@ function dispVideosYear(){
$str = '';//'<B>'.$year_page.'</B>';
if ($_SESSION["user_right"] >= $GLOBALS["PRIV_GUEST"] ) {
if ($_SESSION["user_right"] >= $GLOBALS["PRIV_GUEST"] ) {
$result_prod = getVideosByYearAndTypeAndTendu($year_page, "eptvprod", 2);
$result_bonus = getVideosByYearAndTypeAndTendu($year_page, "eptvbonus", 2);
$result_adm = getVideosByYearAndTypeAndTendu($year_page, "eptv.adm", 2);
}
else if ($_SESSION["user_right"] >= $GLOBALS["GUEST"] ) {
else if ($_SESSION["user_right"] >= $GLOBALS["GUEST"] ) {
$result_prod = getVideosByYearAndTypeAndTendu($year_page, "eptvprod", 1);
$result_bonus = getVideosByYearAndTypeAndTendu($year_page, "eptvbonus", 1);
$result_adm = getVideosByYearAndTypeAndTendu($year_page, "eptv.adm", 1);
......@@ -102,12 +99,12 @@ function dispVideosYear(){
$result_bonus = getVideosByYearAndTypeAndTendu($year_page, "eptvbonus", 0);
$result_adm = getVideosByYearAndTypeAndTendu($year_page, "eptv.adm", 0);
}
if (mysql_num_rows($result_prod)) {
$str .= dispVideosByType($result_prod, "&nbsp;e p t v &nbsp; p r o d u c t i o n");
$str .= dispVideosByType($result_prod, "&nbsp;e p t v &nbsp; p r o d u c t i o n");
}
if (mysql_num_rows($result_bonus)) {
$str .= dispVideosByType($result_bonus, "&nbsp;e p t v &nbsp b o n u s");
}
......@@ -121,8 +118,8 @@ return ($str);
function dispVideosByType($result, $video_type) {
$str = '
$str = '
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#111111">
......@@ -133,10 +130,10 @@ function dispVideosByType($result, $video_type) {
<font color="#666666">
'.$video_type.'
</font>
</b>
</b>
</td>
</tr>
<tr>
<td bgcolor="#282828">
<table cellpadding="0" cellspacing="0" width="100%">
......@@ -145,40 +142,40 @@ function dispVideosByType($result, $video_type) {
<table width="100%" border="0" cellspacing="0" cellpadding="4">
';
while ($video = mysql_fetch_array($result))
{
$str .= dispWhenTendu($video["video_tendu"]);
$str .= '
&nbsp;<a href="' . $video["video_path"] . ' " class="texte_link"' . '>'.$video["video_name"].'</a>
</TD>
<TD>';
if ($video["video_path_daily"])
{
$str .= '<a href=\'public/dailymotion.php?q='.$video["video_path_daily"].'\' onclick="return popitup(this, \'EPTV\')" ><img src=\'../images/daily.png\' height=15 border=0></a>';
}
}
$str .= '</TD>
<TD>
'.$video["video_date"].'
</TD>
<TD align=center><strong>
'.$video["video_size"].' Mo</strong>
</TD>
</TR>';
}
$str .= '
</table>
......
......@@ -7,13 +7,14 @@ include "include/tables.php";
include "include/menu.php";
include "include/functions_www.php";
include "include/functions_display.php";
include "include/connection.php";
include "include/home.php";
include "include/news.php";
include "include/videos.php";
include "include/members.php";
include "include/contacts.php";
include "public/connection.php";
include "public/home.php";
include "public/videos.php";
include "public/members.php";
include "admin/admin_home.php";
include "public/contacts.php";
// define user right and id if new session
if (!$_SESSION["user_right"])
......
<?
function dispForum() {
/*echo '<iframe width="100%" scrolling="auto" height="100%"
style="width:100%;height:800px;border:0;background-color:ffffff" name="forum"
src="http://eptv.epitech.net/forum/"></iframe>';*/
echo '<!-- main body -->
<div id="main_body">
<div id="left_side">
<div id="newsbox">
<h1><img alt="" src="images/puce.png" /> Forum</h1>
<ul>
<li> Patience bordel !</li>
</ul></div>
</div>
<div id="right_side">
<div class="rightbox">
<h1><img alt="" src="images/puce.png" /> Rien</h1>
<ul><li></li></ul>
</div>
</div>
<div class="clr">&nbsp;</div>
</div>
';
}
?>
\ No newline at end of file
<?
function dispPhotos() {
(isset($_GET['year_page'])) ? ($curyear = " ".$_GET['year_page']) : ($curyear = " 2006");
$str = '
<!-- main body -->
<div id="main_body">
<div id="left_side">
<div id="newsbox">
<h1><img alt="" src="images/puce.png" /> <strong>Photos'.$curyear.'</strong></h1>
<ul>';
$str .=dispPhotosYear();
$str .= '
</ul></div>
</div>
<div id="right_side">
<div class="rightbox">
<h1><img alt="" src="images/puce.png" /> <strong>Ann&eacute;es</strong></h1>
';
$str .= dispPhotosMenu();
$str .= '
</div>
</div>
<div class="clr">&nbsp;</div>
</div>
</div>';
echo $str;
}
function dispPhotosMenu(){
$str = '';
$str .= '