Afficher le Slide sur les news [Réglé]
tony Membre non connecté
Booster Mortier
- Booster Mortier
- Voir le profil du membre tony
- Inscrit le : 11/11/2009
comment on pourrait adapter ce slide sur notre page index.php ?
ReidLos Membre non connecté
- Modérateur
- Voir le profil du membre ReidLos
- Inscrit le : 27/02/2009
- Site internet
- Groupes :
- Equipe Développement
Code PHP :
<?php /*################################################## * index.php * ------------------- * begin : August 23 2007 * copyright : (C) 2007 CrowkaiT * email : crowkait@phpboost.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; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ###################################################*/ define('PATH_TO_ROOT', '.'); include_once('./kernel/begin.php'); define('TITLE', 'montitre'); require_once('./kernel/header.php'); include_once('./cache/slide.php'); if(!empty($CONFIG_SLIDE['link'])) { if(!file_exists('slide/slide.xml')) { $array = unserialize($CONFIG_SLIDE['link']); gener_xml($array,true); } } ?> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width=" <?php echo $CONFIG_SLIDE['width'] ?> " height=" <?php echo $CONFIG_SLIDE['height'] ?> " id="dewslider4" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="./slide/dewslider.swf?xml=./slide/slide.xml" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="./slide/dewslider.swf?xml=./slide/slide.xml" quality="high" bgcolor="#ffffff" width=" <?php echo $CONFIG_SLIDE['width'] ?> " height=" <?php echo $CONFIG_SLIDE['height'] ?> " name="dewslider4" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> <?php include_once('./kernel/footer.php'); ?>
tony Membre non connecté
Booster Mortier
- Booster Mortier
- Voir le profil du membre tony
- Inscrit le : 11/11/2009
Merci de ton aide reidlos
ReidLos Membre non connecté
- Modérateur
- Voir le profil du membre ReidLos
- Inscrit le : 27/02/2009
- Site internet
- Groupes :
- Equipe Développement
tony Membre non connecté
Booster Mortier
- Booster Mortier
- Voir le profil du membre tony
- Inscrit le : 11/11/2009
Moi j'aimerai que le slide ce trouve entre l'edito et la première news.
Édité par tony Le 01/05/2010 à 23h37
jjcc Membre non connecté
Booster Roquette
- Booster Roquette
- Voir le profil du membre jjcc
- Inscrit le : 29/04/2009
- Site internet
votre site sur mon annuaire !! c'est gratuit .. La Rochelle et....
L'esprit d'équipe... C'est des mecs qui sont une équipe, ils ont un esprit ! Alors, ils partagent !
L'esprit d'équipe... C'est des mecs qui sont une équipe, ils ont un esprit ! Alors, ils partagent !
ReidLos Membre non connecté
- Modérateur
- Voir le profil du membre ReidLos
- Inscrit le : 27/02/2009
- Site internet
- Groupes :
- Equipe Développement
Code PHP :
include_once '../cache/slide.php'; if(!empty($CONFIG_SLIDE['link'])) { if(!file_exists('../slide/slide.xml')) { $array = unserialize($CONFIG_SLIDE['link']); gener_xml($array,true); } $tpl->assign_vars(array( 'LINK_XML' => '../slide/slide.xml', 'LINK_SWF' => '../slide/dewslider.swf', 'TITLE' => $CONFIG_SLIDE['title'], 'HEIGHT' => $CONFIG_SLIDE['height'], 'WIDTH' => $CONFIG_SLIDE['width'], )); }
et ligne 58 de news_list.tpl (chez moi) :
Code TPL :
<div class="news_container"> <div class="news_top_l"></div> <div class="news_top_r"></div> <div class="news_top">{TITLE}</div> <div class="news_content" style="text-align:center;"> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="{WIDTH}" height="{HEIGHT}" id="dewslider4" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="{LINK_SWF}?xml={LINK_XML}" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="{LINK_SWF}?xml={LINK_XML}" quality="high" bgcolor="#ffffff" width="{WIDTH}" height="{HEIGHT}" name="dewslider4" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> </div> <div class="news_bottom_l"></div> <div class="news_bottom_r"></div> <div class="news_bottom"></div> </div>
tony Membre non connecté
Booster Mortier
- Booster Mortier
- Voir le profil du membre tony
- Inscrit le : 11/11/2009
Caché :
<?php
/*##################################################
* news.php
* -------------------
* begin : June 20, 2005
* copyright : (C) 2005 Viarre Régis
* email : crowkait@phpboost.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; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
###################################################*/
require_once('../kernel/begin.php');
require_once('../news/news_begin.php');
require_once('../kernel/header.php');
//$idnews, $idcat, $show_archive définies dans news_begin.php
$is_admin = $User->check_level(ADMIN_LEVEL);
if (empty($idnews) && empty($idcat)) // Accueil du module de news
{
import('modules/modules_discovery_service');
$modulesLoader = new ModulesDiscoveryService();
$module_name = 'news';
$module = $modulesLoader->get_module($module_name);
if ($module->has_functionality('get_home_page')) {
echo $module->functionality('get_home_page');
require_once('../kernel/footer.php');
exit;
} elseif (!$no_alert_on_error) {
global $Errorh;
$Errorh->handler('Le module ' . $module_name . ' n'a pas de fonction get_home_page!', E_USER_ERROR, __LINE__, __FILE__);
exit;
}
}
elseif (!empty($idnews)) //On affiche la news correspondant à l'id envoyé.
{
if (empty($news['id']))
$Errorh->handler('e_unexist_news', E_USER_REDIRECT);
import('content/comments');
import('content/syndication/feed');
$tpl_news = new Template('news/news.tpl');
$next_news = $Sql->query_array(PREFIX . "news", "title", "id", "WHERE visible = 1 AND id > '" . $idnews . "' " . $Sql->limit(0, 1), __LINE__, __FILE__);
$previous_news = $Sql->query_array(PREFIX . "news", "title", "id", "WHERE visible = 1 AND id < '" . $idnews . "' ORDER BY id DESC " . $Sql->limit(0, 1), __LINE__, __FILE__);
$tpl_news->assign_vars(array(
'C_IS_ADMIN' => $is_admin,
'C_NEWS_BLOCK' => true,
'C_NEWS_NAVIGATION_LINKS' => true,
'C_PREVIOUS_NEWS' => !empty($previous_news['id']),
'C_NEXT_NEWS' =>!empty($next_news['id']),
'TOKEN' => $Session->get_token(),
'PREVIOUS_NEWS' => $previous_news['title'],
'NEXT_NEWS' => $next_news['title'],
'U_PREVIOUS_NEWS' => url('.php?id=' . $previous_news['id'], '-0-' . $previous_news['id'] . '+' . url_encode_rewrite($previous_news['title']) . '.php'),
'U_NEXT_NEWS' => url('.php?id=' . $next_news['id'], '-0-' . $next_news['id'] . '+' . url_encode_rewrite($next_news['title']) . '.php'),
'L_SYNDICATION' => $LANG['syndication'],
'L_ALERT_DELETE_NEWS' => $LANG['alert_delete_news'],
'L_ON' => $LANG['on'],
'L_DELETE' => $LANG['delete'],
'L_EDIT' => $LANG['edit'],
));
$tpl_news->assign_block_vars('news', array(
'C_IMG' => !empty($news['img']),
'C_ICON' => (!empty($news['icon']) && $CONFIG_NEWS['activ_icon'] == 1),
'ID' => $news['id'],
'IDCAT' => $news['idcat'],
'ICON' => second_parse_url($news['icon']),
'TITLE' => $news['title'],
'CONTENTS' => second_parse($news['contents']),
'EXTEND_CONTENTS' => second_parse($news['extend_contents']) . '
',
'IMG' => second_parse_url($news['img']),
'IMG_DESC' => $news['alt'],
'PSEUDO' => $CONFIG_NEWS['display_author'] ? $news['login'] : '',
'DATE' => $CONFIG_NEWS['display_date'] ? $LANG['on'] . ': ' . gmdate_format('date_format_short', $news['timestamp']) : '',
'U_COM' => ($CONFIG_NEWS['activ_com'] == 1) ? Comments::com_display_link($news['nbr_com'], '../news/news' . url('.php?cat=0&id=' . $idnews . '&com=0', '-0-' . $idnews . '+' . url_encode_rewrite($news['title']) . '.php?com=0'), $idnews, 'news') : '',
'U_USER_ID' => url('.php?id=' . $news['user_id'], '-' . $news['user_id'] . '.php'),
'U_NEWS_LINK' => url('.php?id=' . $news['id'], '-0-' . $news['id'] . '+' . url_encode_rewrite($news['title']) . '.php'),
'FEED_MENU' => Feed::get_feed_menu(FEED_URL)
));
}
elseif (!empty($idcat))
{
$tpl_news = new Template('news/news_cat.tpl');
$cat = $Sql->query_array(PREFIX . 'news_cat', 'id', 'name', 'icon', "WHERE id = '" . $idcat . "'", __LINE__, __FILE__);
if (empty($cat['id']))
$Errorh->handler('error_unexist_cat', E_USER_REDIRECT);
$tpl_news->assign_vars(array(
'C_IS_ADMIN' => $is_admin,
'C_NEWS_LINK' => true,
'CAT_NAME' => $cat['name'],
'IDCAT' => $cat['id'],
'L_EDIT' => $LANG['edit'],
'L_CATEGORY' => $LANG['category']
));
$result = $Sql->query_while("SELECT n.id, n.title, n.nbr_com, nc.id AS idcat, nc.icon
FROM " . PREFIX . "news n
LEFT JOIN " . PREFIX . "news_cat nc ON nc.id = n.idcat
WHERE n.visible = 1 AND n.idcat = '" . $idcat . "'
ORDER BY n.timestamp DESC", __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result))
{
$tpl_news->assign_block_vars('list', array(
'ICON' => ((!empty($row['icon']) && $CONFIG_NEWS['activ_icon'] == 1) ? '[url=news' . url('.php?cat=' . $row['idcat'], '-' . $row['idcat'] . '.php') . ']<img class="valign_middle" src="' . $row['icon'] . '" alt="" />[/url]' : ''),
'TITLE' => $row['title'],
'COM' => $row['nbr_com'],
'U_NEWS' => 'news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php')
));
}
}
include_once '../cache/slide.php';
if(!empty($CONFIG_SLIDE['link']))
{
if(!file_exists('../slide/slide.xml'))
{
$array = unserialize($CONFIG_SLIDE['link']);
gener_xml($array,true);
}
$tpl->assign_vars(array(
'LINK_XML' => '/slide/slide.xml',
'LINK_SWF' => '/slide/dewslider.swf',
'TITLE' => $CONFIG_SLIDE['title'],
'HEIGHT' => $CONFIG_SLIDE['height'],
'WIDTH' => $CONFIG_SLIDE['width'],
));
}
//Affichage commentaires.
if (isset($_GET['com']) && $idnews > 0)
{
$tpl_news->assign_vars(array(
'COMMENTS' => display_comments('news', $idnews, url('news.php?id=' . $idnews . '&com=%s', 'news-0-' . $idnews . '.php?com=%s'))
));
}
$tpl_news->parse();
require_once('../kernel/footer.php');
?>
/*##################################################
* news.php
* -------------------
* begin : June 20, 2005
* copyright : (C) 2005 Viarre Régis
* email : crowkait@phpboost.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; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
###################################################*/
require_once('../kernel/begin.php');
require_once('../news/news_begin.php');
require_once('../kernel/header.php');
//$idnews, $idcat, $show_archive définies dans news_begin.php
$is_admin = $User->check_level(ADMIN_LEVEL);
if (empty($idnews) && empty($idcat)) // Accueil du module de news
{
import('modules/modules_discovery_service');
$modulesLoader = new ModulesDiscoveryService();
$module_name = 'news';
$module = $modulesLoader->get_module($module_name);
if ($module->has_functionality('get_home_page')) {
echo $module->functionality('get_home_page');
require_once('../kernel/footer.php');
exit;
} elseif (!$no_alert_on_error) {
global $Errorh;
$Errorh->handler('Le module ' . $module_name . ' n'a pas de fonction get_home_page!', E_USER_ERROR, __LINE__, __FILE__);
exit;
}
}
elseif (!empty($idnews)) //On affiche la news correspondant à l'id envoyé.
{
if (empty($news['id']))
$Errorh->handler('e_unexist_news', E_USER_REDIRECT);
import('content/comments');
import('content/syndication/feed');
$tpl_news = new Template('news/news.tpl');
$next_news = $Sql->query_array(PREFIX . "news", "title", "id", "WHERE visible = 1 AND id > '" . $idnews . "' " . $Sql->limit(0, 1), __LINE__, __FILE__);
$previous_news = $Sql->query_array(PREFIX . "news", "title", "id", "WHERE visible = 1 AND id < '" . $idnews . "' ORDER BY id DESC " . $Sql->limit(0, 1), __LINE__, __FILE__);
$tpl_news->assign_vars(array(
'C_IS_ADMIN' => $is_admin,
'C_NEWS_BLOCK' => true,
'C_NEWS_NAVIGATION_LINKS' => true,
'C_PREVIOUS_NEWS' => !empty($previous_news['id']),
'C_NEXT_NEWS' =>!empty($next_news['id']),
'TOKEN' => $Session->get_token(),
'PREVIOUS_NEWS' => $previous_news['title'],
'NEXT_NEWS' => $next_news['title'],
'U_PREVIOUS_NEWS' => url('.php?id=' . $previous_news['id'], '-0-' . $previous_news['id'] . '+' . url_encode_rewrite($previous_news['title']) . '.php'),
'U_NEXT_NEWS' => url('.php?id=' . $next_news['id'], '-0-' . $next_news['id'] . '+' . url_encode_rewrite($next_news['title']) . '.php'),
'L_SYNDICATION' => $LANG['syndication'],
'L_ALERT_DELETE_NEWS' => $LANG['alert_delete_news'],
'L_ON' => $LANG['on'],
'L_DELETE' => $LANG['delete'],
'L_EDIT' => $LANG['edit'],
));
$tpl_news->assign_block_vars('news', array(
'C_IMG' => !empty($news['img']),
'C_ICON' => (!empty($news['icon']) && $CONFIG_NEWS['activ_icon'] == 1),
'ID' => $news['id'],
'IDCAT' => $news['idcat'],
'ICON' => second_parse_url($news['icon']),
'TITLE' => $news['title'],
'CONTENTS' => second_parse($news['contents']),
'EXTEND_CONTENTS' => second_parse($news['extend_contents']) . '
',
'IMG' => second_parse_url($news['img']),
'IMG_DESC' => $news['alt'],
'PSEUDO' => $CONFIG_NEWS['display_author'] ? $news['login'] : '',
'DATE' => $CONFIG_NEWS['display_date'] ? $LANG['on'] . ': ' . gmdate_format('date_format_short', $news['timestamp']) : '',
'U_COM' => ($CONFIG_NEWS['activ_com'] == 1) ? Comments::com_display_link($news['nbr_com'], '../news/news' . url('.php?cat=0&id=' . $idnews . '&com=0', '-0-' . $idnews . '+' . url_encode_rewrite($news['title']) . '.php?com=0'), $idnews, 'news') : '',
'U_USER_ID' => url('.php?id=' . $news['user_id'], '-' . $news['user_id'] . '.php'),
'U_NEWS_LINK' => url('.php?id=' . $news['id'], '-0-' . $news['id'] . '+' . url_encode_rewrite($news['title']) . '.php'),
'FEED_MENU' => Feed::get_feed_menu(FEED_URL)
));
}
elseif (!empty($idcat))
{
$tpl_news = new Template('news/news_cat.tpl');
$cat = $Sql->query_array(PREFIX . 'news_cat', 'id', 'name', 'icon', "WHERE id = '" . $idcat . "'", __LINE__, __FILE__);
if (empty($cat['id']))
$Errorh->handler('error_unexist_cat', E_USER_REDIRECT);
$tpl_news->assign_vars(array(
'C_IS_ADMIN' => $is_admin,
'C_NEWS_LINK' => true,
'CAT_NAME' => $cat['name'],
'IDCAT' => $cat['id'],
'L_EDIT' => $LANG['edit'],
'L_CATEGORY' => $LANG['category']
));
$result = $Sql->query_while("SELECT n.id, n.title, n.nbr_com, nc.id AS idcat, nc.icon
FROM " . PREFIX . "news n
LEFT JOIN " . PREFIX . "news_cat nc ON nc.id = n.idcat
WHERE n.visible = 1 AND n.idcat = '" . $idcat . "'
ORDER BY n.timestamp DESC", __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result))
{
$tpl_news->assign_block_vars('list', array(
'ICON' => ((!empty($row['icon']) && $CONFIG_NEWS['activ_icon'] == 1) ? '[url=news' . url('.php?cat=' . $row['idcat'], '-' . $row['idcat'] . '.php') . ']<img class="valign_middle" src="' . $row['icon'] . '" alt="" />[/url]' : ''),
'TITLE' => $row['title'],
'COM' => $row['nbr_com'],
'U_NEWS' => 'news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php')
));
}
}
include_once '../cache/slide.php';
if(!empty($CONFIG_SLIDE['link']))
{
if(!file_exists('../slide/slide.xml'))
{
$array = unserialize($CONFIG_SLIDE['link']);
gener_xml($array,true);
}
$tpl->assign_vars(array(
'LINK_XML' => '/slide/slide.xml',
'LINK_SWF' => '/slide/dewslider.swf',
'TITLE' => $CONFIG_SLIDE['title'],
'HEIGHT' => $CONFIG_SLIDE['height'],
'WIDTH' => $CONFIG_SLIDE['width'],
));
}
//Affichage commentaires.
if (isset($_GET['com']) && $idnews > 0)
{
$tpl_news->assign_vars(array(
'COMMENTS' => display_comments('news', $idnews, url('news.php?id=' . $idnews . '&com=%s', 'news-0-' . $idnews . '.php?com=%s'))
));
}
$tpl_news->parse();
require_once('../kernel/footer.php');
?>
Et moi j'aimerai l'adapter sur la page news.tpl de mon thème, voici comment j'ai fait mais sa marche pas :
Caché :
<div class="news_top_r"></div>
<div class="news_top">
<div style="float:left;padding-left:30px;"><h3 class="title">{TITLE}</h3></div>
<div style="float:right;"># IF C_IS_ADMIN # <a href="../news/admin_news_config.php" title="{L_EDIT}"><img src="../templates/{THEME}/images/{LANG}/edit.png" class="valign_middle" alt="{L_EDIT}" /></a> # ENDIF #</div>
</div>
<div class="news_content">
{CONTENTS}
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom"></div>
</div>
# ENDIF #
# IF C_NEWS_NO_AVAILABLE #
<div class="news_container">
<div class="news_top_l"></div>
<div class="news_top_r"></div>
<div class="news_top">
<div style="float:left;padding-left:30px;"><a href="../syndication.php?m=news" title="Syndication"><img class="valign_middle" src="../templates/{THEME}/images/rss.png" alt="Syndication" title="Syndication" /></a></div>
<div style="float:right;"><h3 class="title valign_middle">{L_LAST_NEWS}</h3></div>
</div>
<div class="news_content">
<p class="text_strong text_center">{L_NO_NEWS_AVAILABLE}[/p]
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom"></div>
</div>
# ENDIF #
# IF C_NEWS_BLOCK #
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="{WIDTH}" height="{HEIGHT}" id="dewslider4" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="{LINK_SWF}?xml={LINK_XML}" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="{LINK_SWF}?xml={LINK_XML}" quality="high" bgcolor="#ffffff" width="{WIDTH}" height="{HEIGHT}" name="dewslider4" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
# START news #
# IF news.C_NEWS_ROW # <div class="spacer"></div> # ENDIF #
# IF C_NEWS_BLOCK_COLUMN #
<div class="news_container" style="float:left;width:{COLUMN_WIDTH}%">
# ELSE #
<div class="news_container">
# ENDIF #
<div class="news_top_l"></div>
<div class="news_top_r"></div>
<div class="news_top">
<span style="float: left; padding-left: 5px; margin-top: 5px;">
<a href="../syndication.php?m=news" title="Rss"><img class="valign_middle" src="../templates/{THEME}/images/rss.png" alt="Rss" title="Rss" /></a>
<a class="news_title" href="../news/news{news.U_NEWS_LINK}">{news.TITLE}</a>
</span>
<span style="float:right; margin-top: 5px;">
[img class="valign_middle"]{PATH_TO_ROOT}/news/templates/images/comments.png[/img] {news.U_COM}
# IF C_IS_ADMIN #
<a href="../news/admin_news.php?id={news.ID}" title="{L_EDIT}"><img class="valign_middle" src="../templates/{THEME}/images/{LANG}/edit.png" alt="{L_EDIT}" /></a>
<a href="../news/admin_news.php?delete=1&id={news.ID}&token={TOKEN}" title="{L_DELETE}" onclick="javascript:return Confirm();"><img class="valign_middle" src="../templates/{THEME}/images/{LANG}/delete.png" alt="{L_DELETE}" /></a>
# ENDIF #
</span>
</div>
<div class="news_content">
# IF news.IMG # [img alt="{news.IMG_DESC}" title="{news.IMG_DESC}" class="img_right"]{news.IMG}[/img] # ENDIF #
# IF news.C_ICON # [url=news.php?cat={news.IDCAT}]<img class="valign_middle" src="{news.ICON}" alt="" />[/url] # ENDIF #
{news.CONTENTS}
{news.EXTEND_CONTENTS}
<div class="spacer"></div>
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom">
<span style="float:left"><a class="small_link" href="../member/member{news.U_USER_ID}">{news.PSEUDO}</a></span>
<span style="float:right">{news.DATE}</span>
</div>
</div>
{COMMENTS}
# END news #
# IF C_NEWS_NAVIGATION_LINKS #
<div style="width:90%;padding:20px;margin:auto;margin-top:-15px;">
# IF C_PREVIOUS_NEWS # <span style="float:left;">[url=news{U_PREVIOUS_NEWS}][/url] [url=news{U_PREVIOUS_NEWS}]{PREVIOUS_NEWS}[/url]</span> # ENDIF #
# IF C_NEXT_NEWS # <span style="float:right;">[url=news{U_NEXT_NEWS}]{NEXT_NEWS}[/url] [url=news{U_NEXT_NEWS}][/url]</span> # ENDIF #
</div>
# ENDIF #
<div class="spacer"></div>
<div class="text_center">{PAGINATION}</div>
<div class="text_center">{ARCHIVES}</div>
<div class="spacer"></div>
# ENDIF #
# IF C_NEWS_LINK #
<div class="news_container">
<div class="news_top_l"></div>
<div class="news_top_r"></div>
<div class="news_top">
<div style="float:left"><a href="../syndication.php?m=news" title="Syndication"><img class="valign_middle" src="../templates/{THEME}/images/rss.png" alt="Syndication" title="Syndication" /></a> <h3 class="title valign_middle">{L_LAST_NEWS}</h3></div>
<div style="float:right"># IF C_IS_ADMIN # <a href="admin_news_cat.php?id={IDCAT}" title="{L_EDIT}"><img class="valign_middle" src="../templates/{THEME}/images/{LANG}/edit.png" /></a> # ENDIF #</div>
</div>
<div class="news_content">
# START list #
# IF list.C_NEWS_ROW #
<div class="spacer"></div>
# ENDIF #
# IF C_NEWS_LINK_COLUMN #
<div style="float:left;width:{COLUMN_WIDTH}%">
# ELSE #
<div>
# ENDIF #
<ul style="margin:0;padding:0;list-style-type:none;">
<li> {list.ICON} <span class="text_small">{list.DATE} :</span> [url={list.U_NEWS}]{list.TITLE}[/url]</li>
</ul>
</div>
# END list #
<div class="spacer"> </div>
<div class="text_center">{PAGINATION}</div>
<div class="text_center">{ARCHIVES}</div>
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom"></div>
</div>
# ENDIF #
</div> <script type="text/javascript">
<!--
function Confirm() {
return confirm("{L_ALERT_DELETE_NEWS}");
}
-->
</script>
# IF C_NEWS_EDITO #
<div class="news_container">
<div class="news_top_l">
<!--
function Confirm() {
return confirm("{L_ALERT_DELETE_NEWS}");
}
-->
</script>
# IF C_NEWS_EDITO #
<div class="news_container">
<div class="news_top_l">
<div class="news_top_r"></div>
<div class="news_top">
<div style="float:left;padding-left:30px;"><h3 class="title">{TITLE}</h3></div>
<div style="float:right;"># IF C_IS_ADMIN # <a href="../news/admin_news_config.php" title="{L_EDIT}"><img src="../templates/{THEME}/images/{LANG}/edit.png" class="valign_middle" alt="{L_EDIT}" /></a> # ENDIF #</div>
</div>
<div class="news_content">
{CONTENTS}
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom"></div>
</div>
# ENDIF #
# IF C_NEWS_NO_AVAILABLE #
<div class="news_container">
<div class="news_top_l"></div>
<div class="news_top_r"></div>
<div class="news_top">
<div style="float:left;padding-left:30px;"><a href="../syndication.php?m=news" title="Syndication"><img class="valign_middle" src="../templates/{THEME}/images/rss.png" alt="Syndication" title="Syndication" /></a></div>
<div style="float:right;"><h3 class="title valign_middle">{L_LAST_NEWS}</h3></div>
</div>
<div class="news_content">
<p class="text_strong text_center">{L_NO_NEWS_AVAILABLE}[/p]
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom"></div>
</div>
# ENDIF #
# IF C_NEWS_BLOCK #
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="{WIDTH}" height="{HEIGHT}" id="dewslider4" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="{LINK_SWF}?xml={LINK_XML}" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="{LINK_SWF}?xml={LINK_XML}" quality="high" bgcolor="#ffffff" width="{WIDTH}" height="{HEIGHT}" name="dewslider4" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
# START news #
# IF news.C_NEWS_ROW # <div class="spacer"></div> # ENDIF #
# IF C_NEWS_BLOCK_COLUMN #
<div class="news_container" style="float:left;width:{COLUMN_WIDTH}%">
# ELSE #
<div class="news_container">
# ENDIF #
<div class="news_top_l"></div>
<div class="news_top_r"></div>
<div class="news_top">
<span style="float: left; padding-left: 5px; margin-top: 5px;">
<a href="../syndication.php?m=news" title="Rss"><img class="valign_middle" src="../templates/{THEME}/images/rss.png" alt="Rss" title="Rss" /></a>
<a class="news_title" href="../news/news{news.U_NEWS_LINK}">{news.TITLE}</a>
</span>
<span style="float:right; margin-top: 5px;">
[img class="valign_middle"]{PATH_TO_ROOT}/news/templates/images/comments.png[/img] {news.U_COM}
# IF C_IS_ADMIN #
<a href="../news/admin_news.php?id={news.ID}" title="{L_EDIT}"><img class="valign_middle" src="../templates/{THEME}/images/{LANG}/edit.png" alt="{L_EDIT}" /></a>
<a href="../news/admin_news.php?delete=1&id={news.ID}&token={TOKEN}" title="{L_DELETE}" onclick="javascript:return Confirm();"><img class="valign_middle" src="../templates/{THEME}/images/{LANG}/delete.png" alt="{L_DELETE}" /></a>
# ENDIF #
</span>
</div>
<div class="news_content">
# IF news.IMG # [img alt="{news.IMG_DESC}" title="{news.IMG_DESC}" class="img_right"]{news.IMG}[/img] # ENDIF #
# IF news.C_ICON # [url=news.php?cat={news.IDCAT}]<img class="valign_middle" src="{news.ICON}" alt="" />[/url] # ENDIF #
{news.CONTENTS}
{news.EXTEND_CONTENTS}
<div class="spacer"></div>
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom">
<span style="float:left"><a class="small_link" href="../member/member{news.U_USER_ID}">{news.PSEUDO}</a></span>
<span style="float:right">{news.DATE}</span>
</div>
</div>
{COMMENTS}
# END news #
# IF C_NEWS_NAVIGATION_LINKS #
<div style="width:90%;padding:20px;margin:auto;margin-top:-15px;">
# IF C_PREVIOUS_NEWS # <span style="float:left;">[url=news{U_PREVIOUS_NEWS}][/url] [url=news{U_PREVIOUS_NEWS}]{PREVIOUS_NEWS}[/url]</span> # ENDIF #
# IF C_NEXT_NEWS # <span style="float:right;">[url=news{U_NEXT_NEWS}]{NEXT_NEWS}[/url] [url=news{U_NEXT_NEWS}][/url]</span> # ENDIF #
</div>
# ENDIF #
<div class="spacer"></div>
<div class="text_center">{PAGINATION}</div>
<div class="text_center">{ARCHIVES}</div>
<div class="spacer"></div>
# ENDIF #
# IF C_NEWS_LINK #
<div class="news_container">
<div class="news_top_l"></div>
<div class="news_top_r"></div>
<div class="news_top">
<div style="float:left"><a href="../syndication.php?m=news" title="Syndication"><img class="valign_middle" src="../templates/{THEME}/images/rss.png" alt="Syndication" title="Syndication" /></a> <h3 class="title valign_middle">{L_LAST_NEWS}</h3></div>
<div style="float:right"># IF C_IS_ADMIN # <a href="admin_news_cat.php?id={IDCAT}" title="{L_EDIT}"><img class="valign_middle" src="../templates/{THEME}/images/{LANG}/edit.png" /></a> # ENDIF #</div>
</div>
<div class="news_content">
# START list #
# IF list.C_NEWS_ROW #
<div class="spacer"></div>
# ENDIF #
# IF C_NEWS_LINK_COLUMN #
<div style="float:left;width:{COLUMN_WIDTH}%">
# ELSE #
<div>
# ENDIF #
<ul style="margin:0;padding:0;list-style-type:none;">
<li> {list.ICON} <span class="text_small">{list.DATE} :</span> [url={list.U_NEWS}]{list.TITLE}[/url]</li>
</ul>
</div>
# END list #
<div class="spacer"> </div>
<div class="text_center">{PAGINATION}</div>
<div class="text_center">{ARCHIVES}</div>
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom"></div>
</div>
# ENDIF #
Merci de ton aide reidlos
Édité par tony Le 02/05/2010 à 20h56
ReidLos Membre non connecté
- Modérateur
- Voir le profil du membre ReidLos
- Inscrit le : 27/02/2009
- Site internet
- Groupes :
- Equipe Développement
tony Membre non connecté
Booster Mortier
- Booster Mortier
- Voir le profil du membre tony
- Inscrit le : 11/11/2009
Mais sa devrait marcher comme j'ai fait ou non ?
Édité par tony Le 02/05/2010 à 19h29
KONA Membre non connecté
Booster Fusée
- Booster Fusée
- Voir le profil du membre KONA
- Inscrit le : 21/05/2006
- Site internet
tony :
Screen de quoi ?
à ton avis ? il ne va pas te demander un screen de tes partie génitale ....
Tony réfléchit un peut avant de poster dans tout les sens .
Citation :
Mais sa devrait marcher comme j'ai fait ou non ?
Tu obtiens quel résultat ?
tony Membre non connecté
Booster Mortier
- Booster Mortier
- Voir le profil du membre tony
- Inscrit le : 11/11/2009
Merci de ton aide reidlos
Édité par tony Le 02/05/2010 à 20h41
KONA Membre non connecté
Booster Fusée
- Booster Fusée
- Voir le profil du membre KONA
- Inscrit le : 21/05/2006
- Site internet
ça aidera reidlos .
tony Membre non connecté
Booster Mortier
- Booster Mortier
- Voir le profil du membre tony
- Inscrit le : 11/11/2009
Caché :
<?php
/*##################################################
* news.php
* -------------------
* begin : June 20, 2005
* copyright : (C) 2005 Viarre Régis
* email : crowkait@phpboost.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; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
###################################################*/
require_once('../kernel/begin.php');
require_once('../news/news_begin.php');
require_once('../kernel/header.php');
//$idnews, $idcat, $show_archive définies dans news_begin.php
$is_admin = $User->check_level(ADMIN_LEVEL);
if (empty($idnews) && empty($idcat)) // Accueil du module de news
{
import('modules/modules_discovery_service');
$modulesLoader = new ModulesDiscoveryService();
$module_name = 'news';
$module = $modulesLoader->get_module($module_name);
if ($module->has_functionality('get_home_page')) {
echo $module->functionality('get_home_page');
require_once('../kernel/footer.php');
exit;
} elseif (!$no_alert_on_error) {
global $Errorh;
$Errorh->handler('Le module ' . $module_name . ' n'a pas de fonction get_home_page!', E_USER_ERROR, __LINE__, __FILE__);
exit;
}
}
elseif (!empty($idnews)) //On affiche la news correspondant à l'id envoyé.
{
if (empty($news['id']))
$Errorh->handler('e_unexist_news', E_USER_REDIRECT);
import('content/comments');
import('content/syndication/feed');
$tpl_news = new Template('news/news.tpl');
$next_news = $Sql->query_array(PREFIX . "news", "title", "id", "WHERE visible = 1 AND id > '" . $idnews . "' " . $Sql->limit(0, 1), __LINE__, __FILE__);
$previous_news = $Sql->query_array(PREFIX . "news", "title", "id", "WHERE visible = 1 AND id < '" . $idnews . "' ORDER BY id DESC " . $Sql->limit(0, 1), __LINE__, __FILE__);
$tpl_news->assign_vars(array(
'C_IS_ADMIN' => $is_admin,
'C_NEWS_BLOCK' => true,
'C_NEWS_NAVIGATION_LINKS' => true,
'C_PREVIOUS_NEWS' => !empty($previous_news['id']),
'C_NEXT_NEWS' =>!empty($next_news['id']),
'TOKEN' => $Session->get_token(),
'PREVIOUS_NEWS' => $previous_news['title'],
'NEXT_NEWS' => $next_news['title'],
'U_PREVIOUS_NEWS' => url('.php?id=' . $previous_news['id'], '-0-' . $previous_news['id'] . '+' . url_encode_rewrite($previous_news['title']) . '.php'),
'U_NEXT_NEWS' => url('.php?id=' . $next_news['id'], '-0-' . $next_news['id'] . '+' . url_encode_rewrite($next_news['title']) . '.php'),
'L_SYNDICATION' => $LANG['syndication'],
'L_ALERT_DELETE_NEWS' => $LANG['alert_delete_news'],
'L_ON' => $LANG['on'],
'L_DELETE' => $LANG['delete'],
'L_EDIT' => $LANG['edit'],
));
$tpl_news->assign_block_vars('news', array(
'C_IMG' => !empty($news['img']),
'C_ICON' => (!empty($news['icon']) && $CONFIG_NEWS['activ_icon'] == 1),
'ID' => $news['id'],
'IDCAT' => $news['idcat'],
'ICON' => second_parse_url($news['icon']),
'TITLE' => $news['title'],
'CONTENTS' => second_parse($news['contents']),
'EXTEND_CONTENTS' => second_parse($news['extend_contents']) . '
',
'IMG' => second_parse_url($news['img']),
'IMG_DESC' => $news['alt'],
'PSEUDO' => $CONFIG_NEWS['display_author'] ? $news['login'] : '',
'DATE' => $CONFIG_NEWS['display_date'] ? $LANG['on'] . ': ' . gmdate_format('date_format_short', $news['timestamp']) : '',
'U_COM' => ($CONFIG_NEWS['activ_com'] == 1) ? Comments::com_display_link($news['nbr_com'], '../news/news' . url('.php?cat=0&id=' . $idnews . '&com=0', '-0-' . $idnews . '+' . url_encode_rewrite($news['title']) . '.php?com=0'), $idnews, 'news') : '',
'U_USER_ID' => url('.php?id=' . $news['user_id'], '-' . $news['user_id'] . '.php'),
'U_NEWS_LINK' => url('.php?id=' . $news['id'], '-0-' . $news['id'] . '+' . url_encode_rewrite($news['title']) . '.php'),
'FEED_MENU' => Feed::get_feed_menu(FEED_URL)
));
}
elseif (!empty($idcat))
{
$tpl_news = new Template('news/news_cat.tpl');
$cat = $Sql->query_array(PREFIX . 'news_cat', 'id', 'name', 'icon', "WHERE id = '" . $idcat . "'", __LINE__, __FILE__);
if (empty($cat['id']))
$Errorh->handler('error_unexist_cat', E_USER_REDIRECT);
$tpl_news->assign_vars(array(
'C_IS_ADMIN' => $is_admin,
'C_NEWS_LINK' => true,
'CAT_NAME' => $cat['name'],
'IDCAT' => $cat['id'],
'L_EDIT' => $LANG['edit'],
'L_CATEGORY' => $LANG['category']
));
$result = $Sql->query_while("SELECT n.id, n.title, n.nbr_com, nc.id AS idcat, nc.icon
FROM " . PREFIX . "news n
LEFT JOIN " . PREFIX . "news_cat nc ON nc.id = n.idcat
WHERE n.visible = 1 AND n.idcat = '" . $idcat . "'
ORDER BY n.timestamp DESC", __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result))
{
$tpl_news->assign_block_vars('list', array(
'ICON' => ((!empty($row['icon']) && $CONFIG_NEWS['activ_icon'] == 1) ? '[url=news' . url('.php?cat=' . $row['idcat'], '-' . $row['idcat'] . '.php') . ']<img class="valign_middle" src="' . $row['icon'] . '" alt="" />[/url]' : ''),
'TITLE' => $row['title'],
'COM' => $row['nbr_com'],
'U_NEWS' => 'news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php')
));
}
}
include_once '../cache/slide.php';
if(!empty($CONFIG_SLIDE['link']))
{
if(!file_exists('../slide/slide.xml'))
{
$array = unserialize($CONFIG_SLIDE['link']);
gener_xml($array,true);
}
$tpl->assign_vars(array(
'LINK_XML' => '/slide/slide.xml',
'LINK_SWF' => '/slide/dewslider.swf',
'TITLE' => $CONFIG_SLIDE['title'],
'HEIGHT' => $CONFIG_SLIDE['height'],
'WIDTH' => $CONFIG_SLIDE['width'],
));
}
//Affichage commentaires.
if (isset($_GET['com']) && $idnews > 0)
{
$tpl_news->assign_vars(array(
'COMMENTS' => display_comments('news', $idnews, url('news.php?id=' . $idnews . '&com=%s', 'news-0-' . $idnews . '.php?com=%s'))
));
}
$tpl_news->parse();
require_once('../kernel/footer.php');
?>
/*##################################################
* news.php
* -------------------
* begin : June 20, 2005
* copyright : (C) 2005 Viarre Régis
* email : crowkait@phpboost.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; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
###################################################*/
require_once('../kernel/begin.php');
require_once('../news/news_begin.php');
require_once('../kernel/header.php');
//$idnews, $idcat, $show_archive définies dans news_begin.php
$is_admin = $User->check_level(ADMIN_LEVEL);
if (empty($idnews) && empty($idcat)) // Accueil du module de news
{
import('modules/modules_discovery_service');
$modulesLoader = new ModulesDiscoveryService();
$module_name = 'news';
$module = $modulesLoader->get_module($module_name);
if ($module->has_functionality('get_home_page')) {
echo $module->functionality('get_home_page');
require_once('../kernel/footer.php');
exit;
} elseif (!$no_alert_on_error) {
global $Errorh;
$Errorh->handler('Le module ' . $module_name . ' n'a pas de fonction get_home_page!', E_USER_ERROR, __LINE__, __FILE__);
exit;
}
}
elseif (!empty($idnews)) //On affiche la news correspondant à l'id envoyé.
{
if (empty($news['id']))
$Errorh->handler('e_unexist_news', E_USER_REDIRECT);
import('content/comments');
import('content/syndication/feed');
$tpl_news = new Template('news/news.tpl');
$next_news = $Sql->query_array(PREFIX . "news", "title", "id", "WHERE visible = 1 AND id > '" . $idnews . "' " . $Sql->limit(0, 1), __LINE__, __FILE__);
$previous_news = $Sql->query_array(PREFIX . "news", "title", "id", "WHERE visible = 1 AND id < '" . $idnews . "' ORDER BY id DESC " . $Sql->limit(0, 1), __LINE__, __FILE__);
$tpl_news->assign_vars(array(
'C_IS_ADMIN' => $is_admin,
'C_NEWS_BLOCK' => true,
'C_NEWS_NAVIGATION_LINKS' => true,
'C_PREVIOUS_NEWS' => !empty($previous_news['id']),
'C_NEXT_NEWS' =>!empty($next_news['id']),
'TOKEN' => $Session->get_token(),
'PREVIOUS_NEWS' => $previous_news['title'],
'NEXT_NEWS' => $next_news['title'],
'U_PREVIOUS_NEWS' => url('.php?id=' . $previous_news['id'], '-0-' . $previous_news['id'] . '+' . url_encode_rewrite($previous_news['title']) . '.php'),
'U_NEXT_NEWS' => url('.php?id=' . $next_news['id'], '-0-' . $next_news['id'] . '+' . url_encode_rewrite($next_news['title']) . '.php'),
'L_SYNDICATION' => $LANG['syndication'],
'L_ALERT_DELETE_NEWS' => $LANG['alert_delete_news'],
'L_ON' => $LANG['on'],
'L_DELETE' => $LANG['delete'],
'L_EDIT' => $LANG['edit'],
));
$tpl_news->assign_block_vars('news', array(
'C_IMG' => !empty($news['img']),
'C_ICON' => (!empty($news['icon']) && $CONFIG_NEWS['activ_icon'] == 1),
'ID' => $news['id'],
'IDCAT' => $news['idcat'],
'ICON' => second_parse_url($news['icon']),
'TITLE' => $news['title'],
'CONTENTS' => second_parse($news['contents']),
'EXTEND_CONTENTS' => second_parse($news['extend_contents']) . '
',
'IMG' => second_parse_url($news['img']),
'IMG_DESC' => $news['alt'],
'PSEUDO' => $CONFIG_NEWS['display_author'] ? $news['login'] : '',
'DATE' => $CONFIG_NEWS['display_date'] ? $LANG['on'] . ': ' . gmdate_format('date_format_short', $news['timestamp']) : '',
'U_COM' => ($CONFIG_NEWS['activ_com'] == 1) ? Comments::com_display_link($news['nbr_com'], '../news/news' . url('.php?cat=0&id=' . $idnews . '&com=0', '-0-' . $idnews . '+' . url_encode_rewrite($news['title']) . '.php?com=0'), $idnews, 'news') : '',
'U_USER_ID' => url('.php?id=' . $news['user_id'], '-' . $news['user_id'] . '.php'),
'U_NEWS_LINK' => url('.php?id=' . $news['id'], '-0-' . $news['id'] . '+' . url_encode_rewrite($news['title']) . '.php'),
'FEED_MENU' => Feed::get_feed_menu(FEED_URL)
));
}
elseif (!empty($idcat))
{
$tpl_news = new Template('news/news_cat.tpl');
$cat = $Sql->query_array(PREFIX . 'news_cat', 'id', 'name', 'icon', "WHERE id = '" . $idcat . "'", __LINE__, __FILE__);
if (empty($cat['id']))
$Errorh->handler('error_unexist_cat', E_USER_REDIRECT);
$tpl_news->assign_vars(array(
'C_IS_ADMIN' => $is_admin,
'C_NEWS_LINK' => true,
'CAT_NAME' => $cat['name'],
'IDCAT' => $cat['id'],
'L_EDIT' => $LANG['edit'],
'L_CATEGORY' => $LANG['category']
));
$result = $Sql->query_while("SELECT n.id, n.title, n.nbr_com, nc.id AS idcat, nc.icon
FROM " . PREFIX . "news n
LEFT JOIN " . PREFIX . "news_cat nc ON nc.id = n.idcat
WHERE n.visible = 1 AND n.idcat = '" . $idcat . "'
ORDER BY n.timestamp DESC", __LINE__, __FILE__);
while ($row = $Sql->fetch_assoc($result))
{
$tpl_news->assign_block_vars('list', array(
'ICON' => ((!empty($row['icon']) && $CONFIG_NEWS['activ_icon'] == 1) ? '[url=news' . url('.php?cat=' . $row['idcat'], '-' . $row['idcat'] . '.php') . ']<img class="valign_middle" src="' . $row['icon'] . '" alt="" />[/url]' : ''),
'TITLE' => $row['title'],
'COM' => $row['nbr_com'],
'U_NEWS' => 'news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php')
));
}
}
include_once '../cache/slide.php';
if(!empty($CONFIG_SLIDE['link']))
{
if(!file_exists('../slide/slide.xml'))
{
$array = unserialize($CONFIG_SLIDE['link']);
gener_xml($array,true);
}
$tpl->assign_vars(array(
'LINK_XML' => '/slide/slide.xml',
'LINK_SWF' => '/slide/dewslider.swf',
'TITLE' => $CONFIG_SLIDE['title'],
'HEIGHT' => $CONFIG_SLIDE['height'],
'WIDTH' => $CONFIG_SLIDE['width'],
));
}
//Affichage commentaires.
if (isset($_GET['com']) && $idnews > 0)
{
$tpl_news->assign_vars(array(
'COMMENTS' => display_comments('news', $idnews, url('news.php?id=' . $idnews . '&com=%s', 'news-0-' . $idnews . '.php?com=%s'))
));
}
$tpl_news->parse();
require_once('../kernel/footer.php');
?>
Et le "templates/mon-théme/modules/news/news.tpl" (le code que j'ai rajouter et marquer en rouge) :
Caché :
<div class="news_top_r"></div>
<div class="news_top">
<div style="float:left;padding-left:30px;"><h3 class="title">{TITLE}</h3></div>
<div style="float:right;"># IF C_IS_ADMIN # <a href="../news/admin_news_config.php" title="{L_EDIT}"><img src="../templates/{THEME}/images/{LANG}/edit.png" class="valign_middle" alt="{L_EDIT}" /></a> # ENDIF #</div>
</div>
<div class="news_content">
{CONTENTS}
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom"></div>
</div>
# ENDIF #
# IF C_NEWS_NO_AVAILABLE #
<div class="news_container">
<div class="news_top_l"></div>
<div class="news_top_r"></div>
<div class="news_top">
<div style="float:left;padding-left:30px;"><a href="../syndication.php?m=news" title="Syndication"><img class="valign_middle" src="../templates/{THEME}/images/rss.png" alt="Syndication" title="Syndication" /></a></div>
<div style="float:right;"><h3 class="title valign_middle">{L_LAST_NEWS}</h3></div>
</div>
<div class="news_content">
<p class="text_strong text_center">{L_NO_NEWS_AVAILABLE}[/p]
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom"></div>
</div>
# ENDIF #
# IF C_NEWS_BLOCK #
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="{WIDTH}" height="{HEIGHT}" id="dewslider4" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="{LINK_SWF}?xml={LINK_XML}" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="{LINK_SWF}?xml={LINK_XML}" quality="high" bgcolor="#ffffff" width="{WIDTH}" height="{HEIGHT}" name="dewslider4" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
# START news #
# IF news.C_NEWS_ROW # <div class="spacer"></div> # ENDIF #
# IF C_NEWS_BLOCK_COLUMN #
<div class="news_container" style="float:left;width:{COLUMN_WIDTH}%">
# ELSE #
<div class="news_container">
# ENDIF #
<div class="news_top_l"></div>
<div class="news_top_r"></div>
<div class="news_top">
<span style="float: left; padding-left: 5px; margin-top: 5px;">
<a href="../syndication.php?m=news" title="Rss"><img class="valign_middle" src="../templates/{THEME}/images/rss.png" alt="Rss" title="Rss" /></a>
<a class="news_title" href="../news/news{news.U_NEWS_LINK}">{news.TITLE}</a>
</span>
<span style="float:right; margin-top: 5px;">
[img class="valign_middle"]{PATH_TO_ROOT}/news/templates/images/comments.png[/img] {news.U_COM}
# IF C_IS_ADMIN #
<a href="../news/admin_news.php?id={news.ID}" title="{L_EDIT}"><img class="valign_middle" src="../templates/{THEME}/images/{LANG}/edit.png" alt="{L_EDIT}" /></a>
<a href="../news/admin_news.php?delete=1&id={news.ID}&token={TOKEN}" title="{L_DELETE}" onclick="javascript:return Confirm();"><img class="valign_middle" src="../templates/{THEME}/images/{LANG}/delete.png" alt="{L_DELETE}" /></a>
# ENDIF #
</span>
</div>
<div class="news_content">
# IF news.IMG # [img alt="{news.IMG_DESC}" title="{news.IMG_DESC}" class="img_right"]{news.IMG}[/img] # ENDIF #
# IF news.C_ICON # [url=news.php?cat={news.IDCAT}]<img class="valign_middle" src="{news.ICON}" alt="" />[/url] # ENDIF #
{news.CONTENTS}
{news.EXTEND_CONTENTS}
<div class="spacer"></div>
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom">
<span style="float:left"><a class="small_link" href="../member/member{news.U_USER_ID}">{news.PSEUDO}</a></span>
<span style="float:right">{news.DATE}</span>
</div>
</div>
{COMMENTS}
# END news #
# IF C_NEWS_NAVIGATION_LINKS #
<div style="width:90%;padding:20px;margin:auto;margin-top:-15px;">
# IF C_PREVIOUS_NEWS # <span style="float:left;">[url=news{U_PREVIOUS_NEWS}][/url] [url=news{U_PREVIOUS_NEWS}]{PREVIOUS_NEWS}[/url]</span> # ENDIF #
# IF C_NEXT_NEWS # <span style="float:right;">[url=news{U_NEXT_NEWS}]{NEXT_NEWS}[/url] [url=news{U_NEXT_NEWS}][/url]</span> # ENDIF #
</div>
# ENDIF #
<div class="spacer"></div>
<div class="text_center">{PAGINATION}</div>
<div class="text_center">{ARCHIVES}</div>
<div class="spacer"></div>
# ENDIF #
# IF C_NEWS_LINK #
<div class="news_container">
<div class="news_top_l"></div>
<div class="news_top_r"></div>
<div class="news_top">
<div style="float:left"><a href="../syndication.php?m=news" title="Syndication"><img class="valign_middle" src="../templates/{THEME}/images/rss.png" alt="Syndication" title="Syndication" /></a> <h3 class="title valign_middle">{L_LAST_NEWS}</h3></div>
<div style="float:right"># IF C_IS_ADMIN # <a href="admin_news_cat.php?id={IDCAT}" title="{L_EDIT}"><img class="valign_middle" src="../templates/{THEME}/images/{LANG}/edit.png" /></a> # ENDIF #</div>
</div>
<div class="news_content">
# START list #
# IF list.C_NEWS_ROW #
<div class="spacer"></div>
# ENDIF #
# IF C_NEWS_LINK_COLUMN #
<div style="float:left;width:{COLUMN_WIDTH}%">
# ELSE #
<div>
# ENDIF #
<ul style="margin:0;padding:0;list-style-type:none;">
<li> {list.ICON} <span class="text_small">{list.DATE} :</span> [url={list.U_NEWS}]{list.TITLE}[/url]</li>
</ul>
</div>
# END list #
<div class="spacer"> </div>
<div class="text_center">{PAGINATION}</div>
<div class="text_center">{ARCHIVES}</div>
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom"></div>
</div>
# ENDIF #
</div> <script type="text/javascript">
<!--
function Confirm() {
return confirm("{L_ALERT_DELETE_NEWS}");
}
-->
</script>
# IF C_NEWS_EDITO #
<div class="news_container">
<div class="news_top_l">
<!--
function Confirm() {
return confirm("{L_ALERT_DELETE_NEWS}");
}
-->
</script>
# IF C_NEWS_EDITO #
<div class="news_container">
<div class="news_top_l">
<div class="news_top_r"></div>
<div class="news_top">
<div style="float:left;padding-left:30px;"><h3 class="title">{TITLE}</h3></div>
<div style="float:right;"># IF C_IS_ADMIN # <a href="../news/admin_news_config.php" title="{L_EDIT}"><img src="../templates/{THEME}/images/{LANG}/edit.png" class="valign_middle" alt="{L_EDIT}" /></a> # ENDIF #</div>
</div>
<div class="news_content">
{CONTENTS}
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom"></div>
</div>
# ENDIF #
# IF C_NEWS_NO_AVAILABLE #
<div class="news_container">
<div class="news_top_l"></div>
<div class="news_top_r"></div>
<div class="news_top">
<div style="float:left;padding-left:30px;"><a href="../syndication.php?m=news" title="Syndication"><img class="valign_middle" src="../templates/{THEME}/images/rss.png" alt="Syndication" title="Syndication" /></a></div>
<div style="float:right;"><h3 class="title valign_middle">{L_LAST_NEWS}</h3></div>
</div>
<div class="news_content">
<p class="text_strong text_center">{L_NO_NEWS_AVAILABLE}[/p]
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom"></div>
</div>
# ENDIF #
# IF C_NEWS_BLOCK #
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="{WIDTH}" height="{HEIGHT}" id="dewslider4" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="{LINK_SWF}?xml={LINK_XML}" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="{LINK_SWF}?xml={LINK_XML}" quality="high" bgcolor="#ffffff" width="{WIDTH}" height="{HEIGHT}" name="dewslider4" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
# START news #
# IF news.C_NEWS_ROW # <div class="spacer"></div> # ENDIF #
# IF C_NEWS_BLOCK_COLUMN #
<div class="news_container" style="float:left;width:{COLUMN_WIDTH}%">
# ELSE #
<div class="news_container">
# ENDIF #
<div class="news_top_l"></div>
<div class="news_top_r"></div>
<div class="news_top">
<span style="float: left; padding-left: 5px; margin-top: 5px;">
<a href="../syndication.php?m=news" title="Rss"><img class="valign_middle" src="../templates/{THEME}/images/rss.png" alt="Rss" title="Rss" /></a>
<a class="news_title" href="../news/news{news.U_NEWS_LINK}">{news.TITLE}</a>
</span>
<span style="float:right; margin-top: 5px;">
[img class="valign_middle"]{PATH_TO_ROOT}/news/templates/images/comments.png[/img] {news.U_COM}
# IF C_IS_ADMIN #
<a href="../news/admin_news.php?id={news.ID}" title="{L_EDIT}"><img class="valign_middle" src="../templates/{THEME}/images/{LANG}/edit.png" alt="{L_EDIT}" /></a>
<a href="../news/admin_news.php?delete=1&id={news.ID}&token={TOKEN}" title="{L_DELETE}" onclick="javascript:return Confirm();"><img class="valign_middle" src="../templates/{THEME}/images/{LANG}/delete.png" alt="{L_DELETE}" /></a>
# ENDIF #
</span>
</div>
<div class="news_content">
# IF news.IMG # [img alt="{news.IMG_DESC}" title="{news.IMG_DESC}" class="img_right"]{news.IMG}[/img] # ENDIF #
# IF news.C_ICON # [url=news.php?cat={news.IDCAT}]<img class="valign_middle" src="{news.ICON}" alt="" />[/url] # ENDIF #
{news.CONTENTS}
{news.EXTEND_CONTENTS}
<div class="spacer"></div>
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom">
<span style="float:left"><a class="small_link" href="../member/member{news.U_USER_ID}">{news.PSEUDO}</a></span>
<span style="float:right">{news.DATE}</span>
</div>
</div>
{COMMENTS}
# END news #
# IF C_NEWS_NAVIGATION_LINKS #
<div style="width:90%;padding:20px;margin:auto;margin-top:-15px;">
# IF C_PREVIOUS_NEWS # <span style="float:left;">[url=news{U_PREVIOUS_NEWS}][/url] [url=news{U_PREVIOUS_NEWS}]{PREVIOUS_NEWS}[/url]</span> # ENDIF #
# IF C_NEXT_NEWS # <span style="float:right;">[url=news{U_NEXT_NEWS}]{NEXT_NEWS}[/url] [url=news{U_NEXT_NEWS}][/url]</span> # ENDIF #
</div>
# ENDIF #
<div class="spacer"></div>
<div class="text_center">{PAGINATION}</div>
<div class="text_center">{ARCHIVES}</div>
<div class="spacer"></div>
# ENDIF #
# IF C_NEWS_LINK #
<div class="news_container">
<div class="news_top_l"></div>
<div class="news_top_r"></div>
<div class="news_top">
<div style="float:left"><a href="../syndication.php?m=news" title="Syndication"><img class="valign_middle" src="../templates/{THEME}/images/rss.png" alt="Syndication" title="Syndication" /></a> <h3 class="title valign_middle">{L_LAST_NEWS}</h3></div>
<div style="float:right"># IF C_IS_ADMIN # <a href="admin_news_cat.php?id={IDCAT}" title="{L_EDIT}"><img class="valign_middle" src="../templates/{THEME}/images/{LANG}/edit.png" /></a> # ENDIF #</div>
</div>
<div class="news_content">
# START list #
# IF list.C_NEWS_ROW #
<div class="spacer"></div>
# ENDIF #
# IF C_NEWS_LINK_COLUMN #
<div style="float:left;width:{COLUMN_WIDTH}%">
# ELSE #
<div>
# ENDIF #
<ul style="margin:0;padding:0;list-style-type:none;">
<li> {list.ICON} <span class="text_small">{list.DATE} :</span> [url={list.U_NEWS}]{list.TITLE}[/url]</li>
</ul>
</div>
# END list #
<div class="spacer"> </div>
<div class="text_center">{PAGINATION}</div>
<div class="text_center">{ARCHIVES}</div>
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom"></div>
</div>
# ENDIF #
Merci de ton aide reidlos
Édité par tony Le 02/05/2010 à 21h01
KONA Membre non connecté
Booster Fusée
- Booster Fusée
- Voir le profil du membre KONA
- Inscrit le : 21/05/2006
- Site internet
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie