Problème d'affichage dans mon bloc rss
DreK Membre non connecté
Booster Minigun
-
Booster Minigun
- Voir le profil du membre DreK
- Inscrit le : 25/03/2011
j'utilise le code de news.tpl
Tout s'affiche correctement, mais quand j'affiche par exemple, lire la suite de la news, la il y' aura sa dans le bloc :
Suggestion : Undefined variable: tplString dans le fichier /public_html/guidelol/cache/tpl/news_tpl_news.php à la ligne 19
Petit screen à l'appuie :
http://s3.noelshack.com/uploads/images/384256210536_sans_titre.jpg (affichage normal, l'accueil)
http://s3.noelshack.com/uploads/images/4568358878424_sans_titre1.jpg (quand je veux voir les détails d'une news, ou une autre page qui affiche le bloc)
ReidLos Membre non connecté
-
Modérateur
- Voir le profil du membre ReidLos
- Inscrit le : 27/02/2009
- Site internet
- Groupes :
-
Equipe Développement
Édité par ReidLos Le 01/04/2011 à 22h28
DreK Membre non connecté
Booster Minigun
-
Booster Minigun
- Voir le profil du membre DreK
- Inscrit le : 25/03/2011
Code PHP :
<!--START : tableau en class BBcode -->
<table style="width: 99%;" class="formatter-table">
<tbody>
<tr class="formatter-table-row">
<th style="width: 50%; text-align: left;" class="formatter-table-head">
<a href="{PATH_TO_ROOT}/syndication.php?m=forum" title="Rss forum"><img class="valign_middle" src="{PATH_TO_ROOT}/templates/{THEME}/images/rss.png" alt="Rss" title="Rss" align="left" border="0"></a>
Forum
</th>
<th style="width: 50%; text-align: left;" class="formatter-table-head">
<a href="{PATH_TO_ROOT}/syndication.php?m=news" title="Rss téléchargement"><img class="valign_middle" src="{PATH_TO_ROOT}/templates/{THEME}/images/rss.png" alt="Rss" title="Rss" align="left" border="0"></a>
Actualités
</th>
</tr>
<tr class="formatter-table-row">
<td class="formatter-table-col">
<?php $tplString .= Feed::get_parsed('forum', DEFAULT_FEED_NAME, 0, false, 10); ?>
</td>
<td class="formatter-table-col">
<?php $tplString .= Feed::get_parsed('news', DEFAULT_FEED_NAME, 0, false, 10); ?>
</td>
</tr>
<tr class="formatter-table-row" style="text-align: right;">
<td class="formatter-table-col">
<a href="http://guide-lol.fr.nf/forum/" class="small_link">Plus de sujets...</a>
</td>
<td class="formatter-table-col">
<a href="./news/news.php" class="small_link">Plus de news...</a>
</td>
</tr>
</tbody>
</table>
<!--END : tableau en class BBcode-->
<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"></div>
<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 #
# 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;">
<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;">
<img src="{PATH_TO_ROOT}/news/templates/images/comments.png" alt="" class="valign_middle" /> {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 src="{news.IMG}" alt="{news.IMG_DESC}" title="{news.IMG_DESC}" class="img_right" /> # ENDIF #
# IF news.C_ICON # <a href="news.php?cat={news.IDCAT}"><img class="valign_middle" src="{news.ICON}" alt="" /></a> # 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;"><a href="news{U_PREVIOUS_NEWS}"><img src="../templates/{THEME}/images/left.png" alt="" class="valign_middle" /></a> <a href="news{U_PREVIOUS_NEWS}">{PREVIOUS_NEWS}</a></span> # ENDIF #
# IF C_NEXT_NEWS # <span style="float:right;"><a href="news{U_NEXT_NEWS}">{NEXT_NEWS}</a> <a href="news{U_NEXT_NEWS}"><img src="../templates/{THEME}/images/right.png" alt="" class="valign_middle" /></a></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><img src="../templates/{THEME}/images/li.png" alt="" /> {list.ICON} <span class="text_small">{list.DATE} :</span> <a href="{list.U_NEWS}">{list.TITLE}</a></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 #
news_tpl
Code PHP :
<!--START : tableau en class BBcode -->
<table style="width: 99%;" class="formatter-table">
<tbody>
<tr class="formatter-table-row">
<th style="width: 50%; text-align: left;" class="formatter-table-head">
<a href="<?php if (isset($this->_var['PATH_TO_ROOT'])) echo $this->_var['PATH_TO_ROOT']; ?>/syndication.php?m=forum" title="Rss forum"><img class="valign_middle" src="<?php if (isset($this->_var['PATH_TO_ROOT'])) echo $this->_var['PATH_TO_ROOT']; ?>/templates/<?php if (isset($this->_var['THEME'])) echo $this->_var['THEME']; ?>/images/rss.png" alt="Rss" title="Rss" align="left" border="0"></a>
Forum
</th>
<th style="width: 50%; text-align: left;" class="formatter-table-head">
<a href="<?php if (isset($this->_var['PATH_TO_ROOT'])) echo $this->_var['PATH_TO_ROOT']; ?>/syndication.php?m=news" title="Rss téléchargement"><img class="valign_middle" src="<?php if (isset($this->_var['PATH_TO_ROOT'])) echo $this->_var['PATH_TO_ROOT']; ?>/templates/<?php if (isset($this->_var['THEME'])) echo $this->_var['THEME']; ?>/images/rss.png" alt="Rss" title="Rss" align="left" border="0"></a>
Actualités
</th>
</tr>
<tr class="formatter-table-row">
<td class="formatter-table-col">
<?php $tplString .= Feed::get_parsed('forum', DEFAULT_FEED_NAME, 0, false, 10); ?>
</td>
<td class="formatter-table-col">
<?php $tplString .= Feed::get_parsed('news', DEFAULT_FEED_NAME, 0, false, 10); ?>
</td>
</tr>
<tr class="formatter-table-row" style="text-align: right;">
<td class="formatter-table-col">
<a href="http://guide-lol.fr.nf/forum/" class="small_link">Plus de sujets...</a>
</td>
<td class="formatter-table-col">
<a href="./news/news.php" class="small_link">Plus de news...</a>
</td>
</tr>
</tbody>
</table>
<!--END : tableau en class BBcode-->
<script type="text/javascript">
<!--
function Confirm() {
return confirm("<?php if (isset($this->_var['L_ALERT_DELETE_NEWS'])) echo $this->_var['L_ALERT_DELETE_NEWS']; ?>");
}
-->
</script>
<?php if (isset($this->_var['C_NEWS_EDITO']) && $this->_var['C_NEWS_EDITO']) { ?>
<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;"><h3 class="title"><?php if (isset($this->_var['TITLE'])) echo $this->_var['TITLE']; ?></h3></div>
<div style="float:right;"><?php if (isset($this->_var['C_IS_ADMIN']) && $this->_var['C_IS_ADMIN']) { ?> <a href="../news/admin_news_config.php" title="<?php if (isset($this->_var['L_EDIT'])) echo $this->_var['L_EDIT']; ?>"><img src="../templates/<?php if (isset($this->_var['THEME'])) echo $this->_var['THEME']; ?>/images/<?php if (isset($this->_var['LANG'])) echo $this->_var['LANG']; ?>/edit.png" class="valign_middle" alt="<?php if (isset($this->_var['L_EDIT'])) echo $this->_var['L_EDIT']; ?>" /></a> <?php } ?></div>
</div>
<div class="news_content">
<?php if (isset($this->_var['CONTENTS'])) echo $this->_var['CONTENTS']; ?>
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom"></div>
</div>
<?php }echo ' ';if (isset($this->_var['C_NEWS_NO_AVAILABLE']) && $this->_var['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/<?php if (isset($this->_var['THEME'])) echo $this->_var['THEME']; ?>/images/rss.png" alt="Syndication" title="Syndication" /></a></div>
<div style="float:right;"><h3 class="title valign_middle"><?php if (isset($this->_var['L_LAST_NEWS'])) echo $this->_var['L_LAST_NEWS']; ?></h3></div>
</div>
<div class="news_content">
<p class="text_strong text_center"><?php if (isset($this->_var['L_NO_NEWS_AVAILABLE'])) echo $this->_var['L_NO_NEWS_AVAILABLE']; ?></p>
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom"></div>
</div>
<?php }echo ' ';if (isset($this->_var['C_NEWS_BLOCK']) && $this->_var['C_NEWS_BLOCK']) {echo ' ';if (!isset($this->_block['news']) || !is_array($this->_block['news'])) $this->_block['news'] = array();
foreach ($this->_block['news'] as $news_key => $news_value) {
$_tmpb_news = &$this->_block['news'][$news_key];echo ' ';if (isset($_tmpb_news['C_NEWS_ROW']) && $_tmpb_news['C_NEWS_ROW']) { ?> <div class="spacer"></div> <?php }echo ' ';if (isset($this->_var['C_NEWS_BLOCK_COLUMN']) && $this->_var['C_NEWS_BLOCK_COLUMN']) { ?>
<div class="news_container" style="float:left;width:<?php if (isset($this->_var['COLUMN_WIDTH'])) echo $this->_var['COLUMN_WIDTH']; ?>%">
<?php } else { ?>
<div class="news_container">
<?php } ?>
<div class="news_top_l"></div>
<div class="news_top_r"></div>
<div class="news_top">
<span style="float:left;padding-left:5px;">
<a href="../syndication.php?m=news" title="Rss"><img class="valign_middle" src="../templates/<?php if (isset($this->_var['THEME'])) echo $this->_var['THEME']; ?>/images/rss.png" alt="Rss" title="Rss" /></a>
<a class="news_title" href="../news/news<?php if (isset($_tmpb_news['U_NEWS_LINK'])) echo $_tmpb_news['U_NEWS_LINK']; ?>"><?php if (isset($_tmpb_news['TITLE'])) echo $_tmpb_news['TITLE']; ?></a>
</span>
<span style="float:right;">
<img src="<?php if (isset($this->_var['PATH_TO_ROOT'])) echo $this->_var['PATH_TO_ROOT']; ?>/news/templates/images/comments.png" alt="" class="valign_middle" /> <?php if (isset($_tmpb_news['U_COM'])) echo $_tmpb_news['U_COM'];echo ' ';if (isset($this->_var['C_IS_ADMIN']) && $this->_var['C_IS_ADMIN']) { ?>
<a href="../news/admin_news.php?id=<?php if (isset($_tmpb_news['ID'])) echo $_tmpb_news['ID']; ?>" title="<?php if (isset($this->_var['L_EDIT'])) echo $this->_var['L_EDIT']; ?>"><img class="valign_middle" src="../templates/<?php if (isset($this->_var['THEME'])) echo $this->_var['THEME']; ?>/images/<?php if (isset($this->_var['LANG'])) echo $this->_var['LANG']; ?>/edit.png" alt="<?php if (isset($this->_var['L_EDIT'])) echo $this->_var['L_EDIT']; ?>" /></a>
<a href="../news/admin_news.php?delete=1&id=<?php if (isset($_tmpb_news['ID'])) echo $_tmpb_news['ID']; ?>&token=<?php if (isset($this->_var['TOKEN'])) echo $this->_var['TOKEN']; ?>" title="<?php if (isset($this->_var['L_DELETE'])) echo $this->_var['L_DELETE']; ?>" onclick="javascript:return Confirm();"><img class="valign_middle" src="../templates/<?php if (isset($this->_var['THEME'])) echo $this->_var['THEME']; ?>/images/<?php if (isset($this->_var['LANG'])) echo $this->_var['LANG']; ?>/delete.png" alt="<?php if (isset($this->_var['L_DELETE'])) echo $this->_var['L_DELETE']; ?>" /></a>
<?php } ?>
</span>
</div>
<div class="news_content">
<?php if (isset($_tmpb_news['IMG']) && $_tmpb_news['IMG']) { ?> <img src="<?php if (isset($_tmpb_news['IMG'])) echo $_tmpb_news['IMG']; ?>" alt="<?php if (isset($_tmpb_news['IMG_DESC'])) echo $_tmpb_news['IMG_DESC']; ?>" title="<?php if (isset($_tmpb_news['IMG_DESC'])) echo $_tmpb_news['IMG_DESC']; ?>" class="img_right" /> <?php }echo ' ';if (isset($_tmpb_news['C_ICON']) && $_tmpb_news['C_ICON']) { ?> <a href="news.php?cat=<?php if (isset($_tmpb_news['IDCAT'])) echo $_tmpb_news['IDCAT']; ?>"><img class="valign_middle" src="<?php if (isset($_tmpb_news['ICON'])) echo $_tmpb_news['ICON']; ?>" alt="" /></a> <?php }echo ' ';if (isset($_tmpb_news['CONTENTS'])) echo $_tmpb_news['CONTENTS']; ?>
<?php if (isset($_tmpb_news['EXTEND_CONTENTS'])) echo $_tmpb_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<?php if (isset($_tmpb_news['U_USER_ID'])) echo $_tmpb_news['U_USER_ID']; ?>"><?php if (isset($_tmpb_news['PSEUDO'])) echo $_tmpb_news['PSEUDO']; ?></a></span>
<span style="float:right"><?php if (isset($_tmpb_news['DATE'])) echo $_tmpb_news['DATE']; ?></span>
</div>
</div>
<?php if (isset($this->_var['COMMENTS'])) echo $this->_var['COMMENTS'];echo ' ';}echo ' ';if (isset($this->_var['C_NEWS_NAVIGATION_LINKS']) && $this->_var['C_NEWS_NAVIGATION_LINKS']) { ?>
<div style="width:90%;padding:20px;margin:auto;margin-top:-15px;">
<?php if (isset($this->_var['C_PREVIOUS_NEWS']) && $this->_var['C_PREVIOUS_NEWS']) { ?> <span style="float:left;"><a href="news<?php if (isset($this->_var['U_PREVIOUS_NEWS'])) echo $this->_var['U_PREVIOUS_NEWS']; ?>"><img src="../templates/<?php if (isset($this->_var['THEME'])) echo $this->_var['THEME']; ?>/images/left.png" alt="" class="valign_middle" /></a> <a href="news<?php if (isset($this->_var['U_PREVIOUS_NEWS'])) echo $this->_var['U_PREVIOUS_NEWS']; ?>"><?php if (isset($this->_var['PREVIOUS_NEWS'])) echo $this->_var['PREVIOUS_NEWS']; ?></a></span> <?php }echo ' ';if (isset($this->_var['C_NEXT_NEWS']) && $this->_var['C_NEXT_NEWS']) { ?> <span style="float:right;"><a href="news<?php if (isset($this->_var['U_NEXT_NEWS'])) echo $this->_var['U_NEXT_NEWS']; ?>"><?php if (isset($this->_var['NEXT_NEWS'])) echo $this->_var['NEXT_NEWS']; ?></a> <a href="news<?php if (isset($this->_var['U_NEXT_NEWS'])) echo $this->_var['U_NEXT_NEWS']; ?>"><img src="../templates/<?php if (isset($this->_var['THEME'])) echo $this->_var['THEME']; ?>/images/right.png" alt="" class="valign_middle" /></a></span> <?php } ?>
</div>
<?php } ?>
<div class="spacer"></div>
<div class="text_center"><?php if (isset($this->_var['PAGINATION'])) echo $this->_var['PAGINATION']; ?></div>
<div class="text_center"><?php if (isset($this->_var['ARCHIVES'])) echo $this->_var['ARCHIVES']; ?></div>
<div class="spacer"></div>
<?php }echo ' ';if (isset($this->_var['C_NEWS_LINK']) && $this->_var['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/<?php if (isset($this->_var['THEME'])) echo $this->_var['THEME']; ?>/images/rss.png" alt="Syndication" title="Syndication" /></a> <h3 class="title valign_middle"><?php if (isset($this->_var['L_LAST_NEWS'])) echo $this->_var['L_LAST_NEWS']; ?></h3></div>
<div style="float:right"><?php if (isset($this->_var['C_IS_ADMIN']) && $this->_var['C_IS_ADMIN']) { ?> <a href="admin_news_cat.php?id=<?php if (isset($this->_var['IDCAT'])) echo $this->_var['IDCAT']; ?>" title="<?php if (isset($this->_var['L_EDIT'])) echo $this->_var['L_EDIT']; ?>"><img class="valign_middle" src="../templates/<?php if (isset($this->_var['THEME'])) echo $this->_var['THEME']; ?>/images/<?php if (isset($this->_var['LANG'])) echo $this->_var['LANG']; ?>/edit.png" /></a> <?php } ?></div>
</div>
<div class="news_content">
<?php if (!isset($this->_block['list']) || !is_array($this->_block['list'])) $this->_block['list'] = array();
foreach ($this->_block['list'] as $list_key => $list_value) {
$_tmpb_list = &$this->_block['list'][$list_key];echo ' ';if (isset($_tmpb_list['C_NEWS_ROW']) && $_tmpb_list['C_NEWS_ROW']) { ?>
<div class="spacer"></div>
<?php }echo ' ';if (isset($this->_var['C_NEWS_LINK_COLUMN']) && $this->_var['C_NEWS_LINK_COLUMN']) { ?>
<div style="float:left;width:<?php if (isset($this->_var['COLUMN_WIDTH'])) echo $this->_var['COLUMN_WIDTH']; ?>%">
<?php } else { ?>
<div>
<?php } ?>
<ul style="margin:0;padding:0;list-style-type:none;">
<li><img src="../templates/<?php if (isset($this->_var['THEME'])) echo $this->_var['THEME']; ?>/images/li.png" alt="" /> <?php if (isset($_tmpb_list['ICON'])) echo $_tmpb_list['ICON']; ?> <span class="text_small"><?php if (isset($_tmpb_list['DATE'])) echo $_tmpb_list['DATE']; ?> :</span> <a href="<?php if (isset($_tmpb_list['U_NEWS'])) echo $_tmpb_list['U_NEWS']; ?>"><?php if (isset($_tmpb_list['TITLE'])) echo $_tmpb_list['TITLE']; ?></a></li>
</ul>
</div>
<?php } ?>
<div class="spacer"> </div>
<div class="text_center"><?php if (isset($this->_var['PAGINATION'])) echo $this->_var['PAGINATION']; ?></div>
<div class="text_center"><?php if (isset($this->_var['ARCHIVES'])) echo $this->_var['ARCHIVES']; ?></div>
</div>
<div class="news_bottom_l"></div>
<div class="news_bottom_r"></div>
<div class="news_bottom"></div>
</div>
<?php } ?>
ReidLos Membre non connecté
-
Modérateur
- Voir le profil du membre ReidLos
- Inscrit le : 27/02/2009
- Site internet
- Groupes :
-
Equipe Développement

Il va falloir modifier ton NewsInterface.class.php, tu n'as pas le choix
DreK Membre non connecté
Booster Minigun
-
Booster Minigun
- Voir le profil du membre DreK
- Inscrit le : 25/03/2011

Et plus précisément cela veut dire ? je dois le modifier quand quel sens ?
ReidLos Membre non connecté
-
Modérateur
- Voir le profil du membre ReidLos
- Inscrit le : 27/02/2009
- Site internet
- Groupes :
-
Equipe Développement
/news/ news_interface.class.php remplacer par :
Code PHP :
<?php /*################################################## * news_interface.class.php * ------------------- * begin : April 9, 2008 * copyright : (C) 2008 Loïc Rouchon * email : horn@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. * ###################################################*/ // Inclusion du fichier contenant la classe ModuleInterface import('modules/module_interface'); define('NEWS_MAX_SEARCH_RESULTS', 100); // Classe ForumInterface qui hérite de la classe ModuleInterface class NewsInterface extends ModuleInterface { ## Public Methods ## function NewsInterface() //Constructeur de la classe ForumInterface { parent::ModuleInterface('news'); } //Récupération du cache. function get_cache() { global $Sql; $news_config = 'global $CONFIG_NEWS;' . "n"; //Récupération du tableau linéarisé dans la bdd. $CONFIG_NEWS = unserialize($Sql->query("SELECT value FROM " . DB_TABLE_CONFIGS . " WHERE name = 'news'", __LINE__, __FILE__)); $news_config .= '$CONFIG_NEWS = ' . var_export($CONFIG_NEWS, true) . ';' . "n"; return $news_config; } //Actions journalière. function on_changeday() { global $Sql; //Publication des news en attente pour la date donnée. $result = $Sql->query_while("SELECT id, start, end FROM " . PREFIX . "news WHERE visible != 0", __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { if ($row['start'] <= time() && $row['start'] != 0) $Sql->query_inject("UPDATE " . PREFIX . "news SET visible = 1, start = 0 WHERE id = '" . $row['id'] . "'", __LINE__, __FILE__); if ($row['end'] <= time() && $row['end'] != 0) $Sql->query_inject("UPDATE " . PREFIX . "news SET visible = 0, start = 0, end = 0 WHERE id = '" . $row['id'] . "'", __LINE__, __FILE__); } } function get_search_request($args) /** * Renvoie la requête de recherche */ { global $Sql; $weight = isset($args['weight']) && is_numeric($args['weight']) ? $args['weight'] : 1; $request = "SELECT " . $args['id_search'] . " AS id_search, n.id AS id_content, n.title AS title, ( 2 * MATCH(n.title) AGAINST('" . $args['search'] . "') + (MATCH(n.contents) AGAINST('" . $args['search'] . "') + MATCH(n.extend_contents) AGAINST('" . $args['search'] . "')) / 2 ) / 3 * " . $weight . " AS relevance, " . $Sql->concat("'" . PATH_TO_ROOT . "/news/news.php?id='","n.id") . " AS link FROM " . PREFIX . "news n WHERE ( MATCH(n.title) AGAINST('" . $args['search'] . "') OR MATCH(n.contents) AGAINST('" . $args['search'] . "') OR MATCH(n.extend_contents) AGAINST('" . $args['search'] . "') ) AND visible = 1 AND ('" . time() . "' > start AND ( end = 0 OR '" . time() . "' < end ) ) ORDER BY relevance DESC " . $Sql->limit(0, NEWS_MAX_SEARCH_RESULTS); return $request; } function get_feeds_list() { global $LANG, $Sql; import('content/syndication/feeds_list'); $feeds = new FeedsList(); $cats_tree = new FeedsCat('news', 0, $LANG['root']); $result = $Sql->query_while("SELECT id, name FROM " . PREFIX . "news_cat ORDER BY name ASC", __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { $cats_tree->add_child(new FeedsCat('news', $row['id'], $row['name'])); } $Sql->query_close($result); $feeds->add_feed($cats_tree, DEFAULT_FEED_NAME); return $feeds; } function get_feed_data_struct($idcat = 0, $name = '') { global $Cache, $Sql, $LANG, $CONFIG, $CONFIG_NEWS; import('content/syndication/feed_data'); import('util/date'); import('util/url'); load_module_lang('news'); $data = new FeedData(); $data->set_title($LANG['xml_news_desc'] . ' ' . $CONFIG['server_name']); $data->set_date(new Date()); $data->set_link(new Url('/syndication.php?m=news&cat=' . $idcat)); $data->set_host(HOST); $data->set_desc($LANG['xml_news_desc'] . ' ' . $CONFIG['server_name']); $data->set_lang($LANG['xml_lang']); // Load the new's config $Cache->load('news'); // Last news $result = $Sql->query_while("SELECT id, title, contents, timestamp, img FROM " . PREFIX . "news WHERE visible = 1 ORDER BY timestamp DESC" . $Sql->limit(0, 2 * $CONFIG_NEWS['pagination_news']), __LINE__, __FILE__); // Generation of the feed's items while ($row = $Sql->fetch_assoc($result)) { $item = new FeedItem(); $item->set_title($row['title']); // Rewriting $link = new Url('/news/news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php')); $item->set_link($link); $item->set_guid($link); $item->set_desc(second_parse($row['contents'])); $item->set_date(new Date(DATE_TIMESTAMP, TIMEZONE_SYSTEM, $row['timestamp'])); $item->set_image_url($row['img']); $data->add_item($item); } $Sql->query_close($result); return $data; } function get_cat() { global $Sql; $result = $Sql->query_while("SELECT * FROM " . PREFIX . "news_cat", __LINE__, __FILE__); $data = array(); while ($row = $Sql->fetch_assoc($result)) { $data[$row['id']] = $row['name']; } $Sql->query_close($result); return $data; } function get_home_page() { global $User, $Sql, $Cache, $Bread_crumb, $CONFIG_NEWS, $LANG, $Session; require_once(PATH_TO_ROOT . '/news/news_begin.php'); $show_archive = retrieve(GET, 'arch', false); $is_admin = $User->check_level(ADMIN_LEVEL); $tpl_news = new Template('news/news.tpl'); $tpl_news->assign_vars( array( 'FORUM_FEED' => Feed::get_parsed('forum', DEFAULT_FEED_NAME, 0, false, 10), 'NEWS_FEED' => Feed::get_parsed('news', DEFAULT_FEED_NAME, 0, false, 10) )); if ($CONFIG_NEWS['activ_edito'] == 1) //Affichage de l'édito { $tpl_news->assign_vars( array( 'C_NEWS_EDITO' => true, 'CONTENTS' => second_parse($CONFIG_NEWS['edito']), 'TITLE' => $CONFIG_NEWS['edito_title'] )); } import('content/comments'); import('content/syndication/feed'); //On crée une pagination (si activé) si le nombre de news est trop important. import('util/pagination'); $Pagination = new Pagination(); //Pagination activée, sinon affichage lien vers les archives. if ($CONFIG_NEWS['activ_pagin'] == '1') { $show_pagin = $Pagination->display(PATH_TO_ROOT . '/news/news' . url('.php?p=%d', '-0-0-%d.php'), $CONFIG_NEWS['nbr_news'], 'p', $CONFIG_NEWS['pagination_news'], 3); $first_msg = $Pagination->get_first_msg($CONFIG_NEWS['pagination_news'], 'p'); } elseif ($show_archive) //Pagination des archives. { $show_pagin = $Pagination->display(PATH_TO_ROOT . '/news/news' . url('.php?arch=1&p=%d', '-0-0-%d.php?arch=1'), $CONFIG_NEWS['nbr_news'] - $CONFIG_NEWS['pagination_news'], 'p', $CONFIG_NEWS['pagination_arch'], 3); $first_msg = $CONFIG_NEWS['pagination_news'] + $Pagination->get_first_msg($CONFIG_NEWS['pagination_arch'], 'p'); $CONFIG_NEWS['pagination_news'] = $CONFIG_NEWS['pagination_arch']; } else //Affichage du lien vers les archives. { $show_pagin = (($CONFIG_NEWS['nbr_news'] > $CONFIG_NEWS['pagination_news']) && ($CONFIG_NEWS['nbr_news'] != 0)) ? '<a href="' . PATH_TO_ROOT . '/news/news.php?arch=1" title="' . $LANG['display_archive'] . '">' . $LANG['display_archive'] . '</a>' : ''; $first_msg = 0; } $tpl_news->assign_vars(array( 'C_IS_ADMIN' => $is_admin, 'C_NEWS_NAVIGATION_LINKS' => false, 'L_SYNDICATION' => $LANG['syndication'], 'PAGINATION' => $show_pagin, 'L_ALERT_DELETE_NEWS' => $LANG['alert_delete_news'], 'L_LAST_NEWS' => !$show_archive ? $LANG['last_news'] : $LANG['archive'], 'PATH_TO_ROOT' => TPL_PATH_TO_ROOT, 'THEME' => get_utheme(), 'FEED_MENU' => Feed::get_feed_menu(FEED_URL) )); //Si les news en block sont activées on recupère la page. if ($CONFIG_NEWS['type'] == 1 && !$show_archive) { $tpl_news->assign_vars(array( 'C_NEWS_BLOCK' => true )); $column = ($CONFIG_NEWS['nbr_column'] > 1) ? true : false; if ($column) { $i = 0; $CONFIG_NEWS['nbr_column'] = !empty($CONFIG_NEWS['nbr_column']) ? $CONFIG_NEWS['nbr_column'] : 1; $column_width = floor(100/$CONFIG_NEWS['nbr_column']); $tpl_news->assign_vars(array( 'C_NEWS_BLOCK_COLUMN' => true, 'COLUMN_WIDTH' => $column_width )); } $z = 0; list($admin, $del) = array('', ''); $result = $Sql->query_while("SELECT n.contents, n.extend_contents, n.title, n.id, n.timestamp, n.user_id, n.img, n.alt, n.nbr_com, nc.id AS idcat, nc.icon, m.login FROM " . PREFIX . "news n LEFT JOIN " . PREFIX . "news_cat nc ON nc.id = n.idcat LEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = n.user_id WHERE '" . time() . "' >= n.start AND ('" . time() . "' <= n.end OR n.end = 0) AND n.visible = 1 ORDER BY n.timestamp DESC " . $Sql->limit($first_msg, $CONFIG_NEWS['pagination_news']), __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { //Séparation des news en colonnes si activé. $new_row = false; if ($column) { $new_row = (($i%$CONFIG_NEWS['nbr_column']) == 0 && $i > 0); $i++; } $tpl_news->assign_block_vars('news', array( 'C_IMG' => !empty($row['img']), 'C_ICON' => (!empty($row['icon']) && $CONFIG_NEWS['activ_icon'] == 1), 'C_NEWS_ROW' => $new_row, 'ID' => $row['id'], 'IDCAT' => $row['idcat'], 'ICON' => second_parse_url($row['icon']), 'TITLE' => $row['title'], 'CONTENTS' => second_parse($row['contents']), 'EXTEND_CONTENTS' => (!empty($row['extend_contents']) ? '<a style="font-size:10px" href="' . PATH_TO_ROOT . '/news/news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '.php') . '">[' . $LANG['extend_contents'] . ']</a> ' : ''), 'IMG' => second_parse_url($row['img']), 'IMG_DESC' => $row['alt'], 'PSEUDO' => $CONFIG_NEWS['display_author'] ? $row['login'] : '', 'DATE' => $CONFIG_NEWS['display_date'] ? $LANG['on'] . ': ' . gmdate_format('date_format_short', $row['timestamp']) : '', 'TOKEN' => $Session->get_token(), 'U_COM' => ($CONFIG_NEWS['activ_com'] == 1) ? Comments::com_display_link($row['nbr_com'], PATH_TO_ROOT . '/news/news' . url('.php?cat=0&id=' . $row['id'] . '&com=0', '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php?com=0'), $row['id'], 'news') : '', 'NEW_ROW' => $new_row, 'U_USER_ID' => url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php'), 'U_NEWS_LINK' => url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php'), 'FEED_MENU' => Feed::get_feed_menu(FEED_URL) )); $z++; } $Sql->query_close($result); if ($z == 0) { $tpl_news->assign_vars( array( 'C_NEWS_NO_AVAILABLE' => true, 'L_NO_NEWS_AVAILABLE' => $LANG['no_news_available'] )); } } else //News en liste { $tpl_news->assign_vars(array( 'C_NEWS_LINK' => true )); $column = ($CONFIG_NEWS['nbr_column'] > 1) ? true : false; if ($column) { $i = 0; $CONFIG_NEWS['nbr_column'] = !empty($CONFIG_NEWS['nbr_column']) ? $CONFIG_NEWS['nbr_column'] : 1; $column_width = floor(100/$CONFIG_NEWS['nbr_column']); $tpl_news->assign_vars(array( 'C_NEWS_LINK_COLUMN' => true, 'COLUMN_WIDTH' => $column_width )); } $result = $Sql->query_while("SELECT n.id, n.title, n.timestamp, 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 ORDER BY n.timestamp DESC " . $Sql->limit($first_msg, $CONFIG_NEWS['pagination_news']), __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { //Séparation des news en colonnes si activé. $new_row = false; if ($column) { $new_row = (($i%$CONFIG_NEWS['nbr_column']) == 0 && $i > 0); $i++; } $tpl_news->assign_block_vars('list', array( 'C_NEWS_ROW' => $new_row, 'ICON' => ((!empty($row['icon']) && $CONFIG_NEWS['activ_icon'] == 1) ? '<a href="' . PATH_TO_ROOT . '/news/news' . url('.php?cat=' . $row['idcat'], '-' . $row['idcat'] . '.php') . '"><img class="valign_middle" src="' . $row['icon'] . '" alt="" /></a>' : ''), 'DATE' => gmdate_format('date_format_tiny', $row['timestamp']), 'TITLE' => $row['title'], 'NEW_ROW' => $new_row, 'U_NEWS' => PATH_TO_ROOT . '/news/news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php') )); } $Sql->query_close($result); } return $tpl_news->parse(TRUE); } } ?>
ton news.tpl :
Code TPL :
<!--START : tableau en class BBcode --> <table style="width: 99%;" class="formatter-table"> <tbody> <tr class="formatter-table-row"> <th style="width: 50%; text-align: left;" class="formatter-table-head"> <a href="{PATH_TO_ROOT}/syndication.php?m=forum" title="Rss forum"><img class="valign_middle" src="{PATH_TO_ROOT}/templates/{THEME}/images/rss.png" alt="Rss" title="Rss" align="left" border="0"></a> Forum </th> <th style="width: 50%; text-align: left;" class="formatter-table-head"> <a href="{PATH_TO_ROOT}/syndication.php?m=news" title="Rss téléchargement"><img class="valign_middle" src="{PATH_TO_ROOT}/templates/{THEME}/images/rss.png" alt="Rss" title="Rss" align="left" border="0"></a> Actualités </th> </tr> <tr class="formatter-table-row"> <td class="formatter-table-col"> {FORUM_FEED} </td> <td class="formatter-table-col"> {NEWS_FEED} </td> </tr> <tr class="formatter-table-row" style="text-align: right;"> <td class="formatter-table-col"> <a href="http://guide-lol.fr.nf/forum/" class="small_link">Plus de sujets...</a> </td> <td class="formatter-table-col"> <a href="./news/news.php" class="small_link">Plus de news...</a> </td> </tr> </tbody> </table> <!--END : tableau en class BBcode--> <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"></div> <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 # # 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;"> <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;"> <img src="{PATH_TO_ROOT}/news/templates/images/comments.png" alt="" class="valign_middle" /> {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 src="{news.IMG}" alt="{news.IMG_DESC}" title="{news.IMG_DESC}" class="img_right" /> # ENDIF # # IF news.C_ICON # <a href="news.php?cat={news.IDCAT}"><img class="valign_middle" src="{news.ICON}" alt="" /></a> # 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;"><a href="news{U_PREVIOUS_NEWS}"><img src="../templates/{THEME}/images/left.png" alt="" class="valign_middle" /></a> <a href="news{U_PREVIOUS_NEWS}">{PREVIOUS_NEWS}</a></span> # ENDIF # # IF C_NEXT_NEWS # <span style="float:right;"><a href="news{U_NEXT_NEWS}">{NEXT_NEWS}</a> <a href="news{U_NEXT_NEWS}"><img src="../templates/{THEME}/images/right.png" alt="" class="valign_middle" /></a></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><img src="../templates/{THEME}/images/li.png" alt="" /> {list.ICON} <span class="text_small">{list.DATE} :</span> <a href="{list.U_NEWS}">{list.TITLE}</a></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 #
DreK Membre non connecté
Booster Minigun
-
Booster Minigun
- Voir le profil du membre DreK
- Inscrit le : 25/03/2011
ReidLos Membre non connecté
-
Modérateur
- Voir le profil du membre ReidLos
- Inscrit le : 27/02/2009
- Site internet
- Groupes :
-
Equipe Développement
Etee $tpl_news =... et $tpl_news->assign...
Rajoute import('content/syndication/feed');
DreK Membre non connecté
Booster Minigun
-
Booster Minigun
- Voir le profil du membre DreK
- Inscrit le : 25/03/2011
Mais je fais quoi avec ta deuxième ligne ?
Et j'ajoute ou : import('content/syndication/feed');
désolé de l'incompréhension ..
ReidLos Membre non connecté
-
Modérateur
- Voir le profil du membre ReidLos
- Inscrit le : 27/02/2009
- Site internet
- Groupes :
-
Equipe Développement
DreK Membre non connecté
Booster Minigun
-
Booster Minigun
- Voir le profil du membre DreK
- Inscrit le : 25/03/2011
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 /*################################################## * news_interface.class.php * ------------------- * begin : April 9, 2008 * copyright : (C) 2008 Loïc Rouchon * email : horn@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. * ###################################################*/ // Inclusion du fichier contenant la classe ModuleInterface import('modules/module_interface'); define('NEWS_MAX_SEARCH_RESULTS', 100); // Classe ForumInterface qui hérite de la classe ModuleInterface class NewsInterface extends ModuleInterface { ## Public Methods ## function NewsInterface() //Constructeur de la classe ForumInterface { parent::ModuleInterface('news'); } //Récupération du cache. function get_cache() { global $Sql; $news_config = 'global $CONFIG_NEWS;' . "n"; //Récupération du tableau linéarisé dans la bdd. $CONFIG_NEWS = unserialize($Sql->query("SELECT value FROM " . DB_TABLE_CONFIGS . " WHERE name = 'news'", __LINE__, __FILE__)); $news_config .= '$CONFIG_NEWS = ' . var_export($CONFIG_NEWS, true) . ';' . "n"; return $news_config; } //Actions journalière. function on_changeday() { global $Sql; //Publication des news en attente pour la date donnée. $result = $Sql->query_while("SELECT id, start, end FROM " . PREFIX . "news WHERE visible != 0", __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { if ($row['start'] <= time() && $row['start'] != 0) $Sql->query_inject("UPDATE " . PREFIX . "news SET visible = 1, start = 0 WHERE id = '" . $row['id'] . "'", __LINE__, __FILE__); if ($row['end'] <= time() && $row['end'] != 0) $Sql->query_inject("UPDATE " . PREFIX . "news SET visible = 0, start = 0, end = 0 WHERE id = '" . $row['id'] . "'", __LINE__, __FILE__); } } function get_search_request($args) /** * Renvoie la requête de recherche */ { global $Sql; $weight = isset($args['weight']) && is_numeric($args['weight']) ? $args['weight'] : 1; $request = "SELECT " . $args['id_search'] . " AS id_search, n.id AS id_content, n.title AS title, ( 2 * MATCH(n.title) AGAINST('" . $args['search'] . "') + (MATCH(n.contents) AGAINST('" . $args['search'] . "') + MATCH(n.extend_contents) AGAINST('" . $args['search'] . "')) / 2 ) / 3 * " . $weight . " AS relevance, " . $Sql->concat("'" . PATH_TO_ROOT . "/news/news.php?id='","n.id") . " AS link FROM " . PREFIX . "news n WHERE ( MATCH(n.title) AGAINST('" . $args['search'] . "') OR MATCH(n.contents) AGAINST('" . $args['search'] . "') OR MATCH(n.extend_contents) AGAINST('" . $args['search'] . "') ) AND visible = 1 AND ('" . time() . "' > start AND ( end = 0 OR '" . time() . "' < end ) ) ORDER BY relevance DESC " . $Sql->limit(0, NEWS_MAX_SEARCH_RESULTS); return $request; } function get_feeds_list() { global $LANG, $Sql; import('content/syndication/feeds_list'); $feeds = new FeedsList(); $cats_tree = new FeedsCat('news', 0, $LANG['root']); $result = $Sql->query_while("SELECT id, name FROM " . PREFIX . "news_cat ORDER BY name ASC", __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { $cats_tree->add_child(new FeedsCat('news', $row['id'], $row['name'])); } $Sql->query_close($result); $feeds->add_feed($cats_tree, DEFAULT_FEED_NAME); return $feeds; } function get_feed_data_struct($idcat = 0, $name = '') { global $Cache, $Sql, $LANG, $CONFIG, $CONFIG_NEWS; import('content/syndication/feed_data'); import('util/date'); import('util/url'); load_module_lang('news'); $data = new FeedData(); $data->set_title($LANG['xml_news_desc'] . ' ' . $CONFIG['server_name']); $data->set_date(new Date()); $data->set_link(new Url('/syndication.php?m=news&cat=' . $idcat)); $data->set_host(HOST); $data->set_desc($LANG['xml_news_desc'] . ' ' . $CONFIG['server_name']); $data->set_lang($LANG['xml_lang']); // Load the new's config $Cache->load('news'); // Last news $result = $Sql->query_while("SELECT id, title, contents, timestamp, img FROM " . PREFIX . "news WHERE visible = 1 ORDER BY timestamp DESC" . $Sql->limit(0, 2 * $CONFIG_NEWS['pagination_news']), __LINE__, __FILE__); // Generation of the feed's items while ($row = $Sql->fetch_assoc($result)) { $item = new FeedItem(); $item->set_title($row['title']); // Rewriting $link = new Url('/news/news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php')); $item->set_link($link); $item->set_guid($link); $item->set_desc(second_parse($row['contents'])); $item->set_date(new Date(DATE_TIMESTAMP, TIMEZONE_SYSTEM, $row['timestamp'])); $item->set_image_url($row['img']); $data->add_item($item); } $Sql->query_close($result); return $data; } function get_cat() { global $Sql; $result = $Sql->query_while("SELECT * FROM " . PREFIX . "news_cat", __LINE__, __FILE__); $data = array(); while ($row = $Sql->fetch_assoc($result)) { $data[$row['id']] = $row['name']; } $Sql->query_close($result); return $data; } function get_home_page() { global $User, $Sql, $Cache, $Bread_crumb, $CONFIG_NEWS, $LANG, $Session; require_once(PATH_TO_ROOT . '/news/news_begin.php'); $show_archive = retrieve(GET, 'arch', false); $is_admin = $User->check_level(ADMIN_LEVEL); $tpl_news = new Template('news/news.tpl'); import('content/syndication/feed'); $tpl_news->assign_vars( array( 'FORUM_FEED' => Feed::get_parsed('forum', DEFAULT_FEED_NAME, 0, false, 10), 'NEWS_FEED' => Feed::get_parsed('news', DEFAULT_FEED_NAME, 0, false, 10) )); if ($CONFIG_NEWS['activ_edito'] == 1) //Affichage de l'édito { $tpl_news->assign_vars( array( 'C_NEWS_EDITO' => true, 'CONTENTS' => second_parse($CONFIG_NEWS['edito']), 'TITLE' => $CONFIG_NEWS['edito_title'] )); } import('content/comments'); //On crée une pagination (si activé) si le nombre de news est trop important. import('util/pagination'); $Pagination = new Pagination(); //Pagination activée, sinon affichage lien vers les archives. if ($CONFIG_NEWS['activ_pagin'] == '1') { $show_pagin = $Pagination->display(PATH_TO_ROOT . '/news/news' . url('.php?p=%d', '-0-0-%d.php'), $CONFIG_NEWS['nbr_news'], 'p', $CONFIG_NEWS['pagination_news'], 3); $first_msg = $Pagination->get_first_msg($CONFIG_NEWS['pagination_news'], 'p'); } elseif ($show_archive) //Pagination des archives. { $show_pagin = $Pagination->display(PATH_TO_ROOT . '/news/news' . url('.php?arch=1&p=%d', '-0-0-%d.php?arch=1'), $CONFIG_NEWS['nbr_news'] - $CONFIG_NEWS['pagination_news'], 'p', $CONFIG_NEWS['pagination_arch'], 3); $first_msg = $CONFIG_NEWS['pagination_news'] + $Pagination->get_first_msg($CONFIG_NEWS['pagination_arch'], 'p'); $CONFIG_NEWS['pagination_news'] = $CONFIG_NEWS['pagination_arch']; } else //Affichage du lien vers les archives. { $show_pagin = (($CONFIG_NEWS['nbr_news'] > $CONFIG_NEWS['pagination_news']) && ($CONFIG_NEWS['nbr_news'] != 0)) ? '<a href="' . PATH_TO_ROOT . '/news/news.php?arch=1" title="' . $LANG['display_archive'] . '">' . $LANG['display_archive'] . '</a>' : ''; $first_msg = 0; } $tpl_news->assign_vars(array( 'C_IS_ADMIN' => $is_admin, 'C_NEWS_NAVIGATION_LINKS' => false, 'L_SYNDICATION' => $LANG['syndication'], 'PAGINATION' => $show_pagin, 'L_ALERT_DELETE_NEWS' => $LANG['alert_delete_news'], 'L_LAST_NEWS' => !$show_archive ? $LANG['last_news'] : $LANG['archive'], 'PATH_TO_ROOT' => TPL_PATH_TO_ROOT, 'THEME' => get_utheme(), 'FEED_MENU' => Feed::get_feed_menu(FEED_URL) )); //Si les news en block sont activées on recupère la page. if ($CONFIG_NEWS['type'] == 1 && !$show_archive) { $tpl_news->assign_vars(array( 'C_NEWS_BLOCK' => true )); $column = ($CONFIG_NEWS['nbr_column'] > 1) ? true : false; if ($column) { $i = 0; $CONFIG_NEWS['nbr_column'] = !empty($CONFIG_NEWS['nbr_column']) ? $CONFIG_NEWS['nbr_column'] : 1; $column_width = floor(100/$CONFIG_NEWS['nbr_column']); $tpl_news->assign_vars(array( 'C_NEWS_BLOCK_COLUMN' => true, 'COLUMN_WIDTH' => $column_width )); } $z = 0; list($admin, $del) = array('', ''); $result = $Sql->query_while("SELECT n.contents, n.extend_contents, n.title, n.id, n.timestamp, n.user_id, n.img, n.alt, n.nbr_com, nc.id AS idcat, nc.icon, m.login FROM " . PREFIX . "news n LEFT JOIN " . PREFIX . "news_cat nc ON nc.id = n.idcat LEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = n.user_id WHERE '" . time() . "' >= n.start AND ('" . time() . "' <= n.end OR n.end = 0) AND n.visible = 1 ORDER BY n.timestamp DESC " . $Sql->limit($first_msg, $CONFIG_NEWS['pagination_news']), __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { //Séparation des news en colonnes si activé. $new_row = false; if ($column) { $new_row = (($i%$CONFIG_NEWS['nbr_column']) == 0 && $i > 0); $i++; } $tpl_news->assign_block_vars('news', array( 'C_IMG' => !empty($row['img']), 'C_ICON' => (!empty($row['icon']) && $CONFIG_NEWS['activ_icon'] == 1), 'C_NEWS_ROW' => $new_row, 'ID' => $row['id'], 'IDCAT' => $row['idcat'], 'ICON' => second_parse_url($row['icon']), 'TITLE' => $row['title'], 'CONTENTS' => second_parse($row['contents']), 'EXTEND_CONTENTS' => (!empty($row['extend_contents']) ? '<a style="font-size:10px" href="' . PATH_TO_ROOT . '/news/news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '.php') . '">[' . $LANG['extend_contents'] . ']</a> ' : ''), 'IMG' => second_parse_url($row['img']), 'IMG_DESC' => $row['alt'], 'PSEUDO' => $CONFIG_NEWS['display_author'] ? $row['login'] : '', 'DATE' => $CONFIG_NEWS['display_date'] ? $LANG['on'] . ': ' . gmdate_format('date_format_short', $row['timestamp']) : '', 'TOKEN' => $Session->get_token(), 'U_COM' => ($CONFIG_NEWS['activ_com'] == 1) ? Comments::com_display_link($row['nbr_com'], PATH_TO_ROOT . '/news/news' . url('.php?cat=0&id=' . $row['id'] . '&com=0', '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php?com=0'), $row['id'], 'news') : '', 'NEW_ROW' => $new_row, 'U_USER_ID' => url('.php?id=' . $row['user_id'], '-' . $row['user_id'] . '.php'), 'U_NEWS_LINK' => url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php'), 'FEED_MENU' => Feed::get_feed_menu(FEED_URL) )); $z++; } $Sql->query_close($result); if ($z == 0) { $tpl_news->assign_vars( array( 'C_NEWS_NO_AVAILABLE' => true, 'L_NO_NEWS_AVAILABLE' => $LANG['no_news_available'] )); } } else //News en liste { $tpl_news->assign_vars(array( 'C_NEWS_LINK' => true )); $column = ($CONFIG_NEWS['nbr_column'] > 1) ? true : false; if ($column) { $i = 0; $CONFIG_NEWS['nbr_column'] = !empty($CONFIG_NEWS['nbr_column']) ? $CONFIG_NEWS['nbr_column'] : 1; $column_width = floor(100/$CONFIG_NEWS['nbr_column']); $tpl_news->assign_vars(array( 'C_NEWS_LINK_COLUMN' => true, 'COLUMN_WIDTH' => $column_width )); } $result = $Sql->query_while("SELECT n.id, n.title, n.timestamp, 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 ORDER BY n.timestamp DESC " . $Sql->limit($first_msg, $CONFIG_NEWS['pagination_news']), __LINE__, __FILE__); while ($row = $Sql->fetch_assoc($result)) { //Séparation des news en colonnes si activé. $new_row = false; if ($column) { $new_row = (($i%$CONFIG_NEWS['nbr_column']) == 0 && $i > 0); $i++; } $tpl_news->assign_block_vars('list', array( 'C_NEWS_ROW' => $new_row, 'ICON' => ((!empty($row['icon']) && $CONFIG_NEWS['activ_icon'] == 1) ? '<a href="' . PATH_TO_ROOT . '/news/news' . url('.php?cat=' . $row['idcat'], '-' . $row['idcat'] . '.php') . '"><img class="valign_middle" src="' . $row['icon'] . '" alt="" /></a>' : ''), 'DATE' => gmdate_format('date_format_tiny', $row['timestamp']), 'TITLE' => $row['title'], 'NEW_ROW' => $new_row, 'U_NEWS' => PATH_TO_ROOT . '/news/news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php') )); } $Sql->query_close($result); } return $tpl_news->parse(TRUE); } } ?>
DreK Membre non connecté
Booster Minigun
-
Booster Minigun
- Voir le profil du membre DreK
- Inscrit le : 25/03/2011
DreK Membre non connecté
Booster Minigun
-
Booster Minigun
- Voir le profil du membre DreK
- Inscrit le : 25/03/2011
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie