sylvain421 | Bonjour,
Je crée un site en HTML, mais pour le module de news cutenews, j'ai mit une page php. Voila le manuel de cutenews :
Code :
- Insertion de news
- Lorsque CuteNews est installé correctement, vous pouvez commencer à poster des news. Pour les afficher, vous devez insérer le ficher show_news.php (situé dans le dossier principal de CuteNews). Pour inclure show_news.php dans votre page vous devez utiliser le code de cette façon :
- <?PHP
- include("path/to/show_news.php" );
- ?>
- Vous devez remplacer path/to/show_news.php avec le chemin réel de show_news.php, MAIS PAS son URL !!!
- Exemples:
- CORRECT : include("cutenews/show_news.php" );
- MAUVAIS : include("http://site.com/cutenews/show_news.php" );
- N'oubliez pas, pour utiliser du code PHP, l'extension du fichier où vous faites votre "include" doit être de type .php
- Pour insérer le code dans une page .html, renommez l'extension .html en .php, cela fonctionnera.
|
Voici ma page (Le script que j'ai rajouter et a la ligne 118 à 120):
Code :
- <?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Taatu-France - Bienvenue</title>
- <meta name="title" content="News" />
- <meta name="author" content="Lepopo" />
- <meta name="description" content="" />
- <meta name="keywords" content="" />
- <meta name="Generator" content="Joomla! - Copyright (C) 2005 Open Source Matters. All rights reserved." />
- <meta name="robots" content="index, follow" />
- <link rel="shortcut icon" href="http://www.taatu.com/cms/images/favicon.ico" />
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <link href="http://www.taatu.com/cms/templates/taatu/template_css.css" rel="stylesheet" type="text/css"/>
- <style type="text/css">
- <!--
- a:link {
- text-decoration: none;
- }
- a:visited {
- text-decoration: none;
- }
- a:hover {
- text-decoration: underline;
- }
- a:active {
- text-decoration: none;
- }
- body {
- margin-top: 6px;
- }
- -->
- </style></head>
- <body>
- <div align="center">
- <img src="Image/entrecopie2ub.jpg" alt="Taatu-France" width="534" height="250" align="middle" />
- <table width="1058" border="0" align="center" cellpadding="0" cellspacing="10px">
- <tr>
- <td width="244" valign="top">
- <div class="moduletable_left">
- <table width="249" height="163" class="contentpaneopen">
- <tr class="title">
- <td width="233" height="24" valign="top" class="newsTitle"><a href="News.html?option=com_content&task=view&id=26&lang=FR" class="newsReadon">News </a></td>
- </tr>
- <tr>
- <td height="131" valign="top" class="newsContent"><p>Toutes les nouveautés de taatu, vous serez au courant de tout ce qui se passe dans taatu.<br />
- Vu que le site ne vient juste d'ouvrir nous n'avons pas encore une team de journaliste, si vous souhaitez postuler allez dans la partie contact. </p> </td>
- </tr>
- </table>
- <table class="contentpaneopen">
- <tr class="title">
- <td valign="top" class="newsTitle">
- <a href="Team taatu.html?option=com_content&task=view&id=26&lang=FR" class="newsReadon">La team taatu</a> </td>
- </tr>
- <tr>
- <td valign="top" class="newsContent"><strong><table width="220" cellspacing="0" cellpadding="2" border="0" align="left"><tbody><tr><td valign="top"><img width="97" height="97" border="0" alt="TAATU, le monde" /> </td>
- <td width="114" valign="top">Descriptitions, informations, interviews, etc... de la Team <strong>Taatu</strong>.</td>
- </tr>
- </tbody></table></strong></td>
- </tr>
- </table>
- <table class="contentpaneopen">
- <tr class="title">
- <td valign="top" class="newsTitle">
- <a href="Sécurité dans Taatu.html?option=com_content&task=view&id=21&lang=FR" class="newsReadon">Sécurité dans taatu </a> </td>
- </tr>
- <tr>
- <td valign="top" class="newsContent"><table width="220" cellspacing="0" cellpadding="2" border="0"><tbody><tr><td width="98" valign="top"><strong><img width="102" height="97" border="0" src="Image/lol taatu.JPG" alt="accuiel et Taatu's" /></strong></td>
- <td width="114" valign="top">Les régles élémentaires pour garder son<strong> Taatu</strong>. </td>
- </tr>
- </tbody></table></td>
- </tr>
- </table>
- <table class="contentpaneopen">
- <tr class="title">
- <td valign="top" class="newsTitle">
- <a href="Classement.html?option=com_content&task=view&id=18&lang=FR" class="newsReadon">Classement</a> </td>
- </tr>
- <tr>
- <td valign="top" class="newsContent"><table width="220" cellspacing="0" cellpadding="2" border="0"><tbody><tr><td valign="top"><strong><img width="97" height="97" border="0" alt="TAATU mag" src="images/homeBilingual/carre_taatumag.jpg" /></strong></td>
- <td valign="top">Tu mérite d'être dans le top 10 des <strong>Taatus</strong>, ou, ton aparte le mérite, regarde si tu es dans le classement<strong>. </strong></td>
- </tr></tbody></table></td>
- </tr>
- </table>
- <table class="contentpaneopen">
- <tr class="title">
- <td valign="top" class="newsTitle">
- <a href="index.php?option=com_content&task=view&id=12&lang=FR" class="newsReadon">
- ?????????????????</a> </td>
- </tr>
- <tr>
- <td valign="top" class="newsContent"><p>Quelle sera la prochaine section ?<br />
- Envoyez nous vos idées.
- <br />
- Plus d'info bientôt. ;) </p> </td>
- </tr>
- </table>
- </div> </td>
- <td width="530" valign="top">
- <table width="471" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td width="471" class="body_outer" valign="top">
- <table class="contentpaneopen">
- <tr>
- <td class="contentheading" width="100%">News </td>
- </tr>
- </table>
- <table width="780" height="780" class="contentpaneopen">
- <tr>
- <td width="102" height="307" colspan="2" valign="top"><p> </p>
- <p><?PHP
- include("/cutenews/cutenews/show_news.php" );
- ?> </p>
- <p align="left"> </p></td>
- </tr>
- </table>
- <span class="article_seperator"> </span> </td>
- </tr>
- <tr><td class="gradient"></td></tr>
- </table> </td>
- <td width="244" valign="top">
- <div class="moduletable_right">
- <table class="contentpaneopen">
- <tr class="title">
- <td valign="top" class="newsTitle">
- <a href="News de Taatu-France.html?option=com_content&task=view&id=20&lang=FR" class="newsReadon">News de Taatu-France </a> </td>
- </tr>
- <tr>
- <td valign="top" class="newsContent"><table width="220" cellspacing="0" cellpadding="2" border="0"><tbody><tr>
- <td valign="top">L'actualité, les nouveutés, etc... se passera dans cette partie. <strong></strong></td>
- <td valign="top"><img width="97" height="97" border="0" src="images/homeFR/carre_ami_fr.jpg" alt="TAATU mag" /><br /></td></tr></tbody></table></td>
- </tr>
- </table>
- <table class="contentpaneopen">
- <tr class="title">
- <td valign="top" class="newsTitle">
- <a href="Forum.html?option=com_content&task=view&id=24&lang=FR" class="newsReadon">Forum</a> </td>
- </tr>
- <tr>
- <td valign="top" class="newsContent"><table width="220" cellspacing="0" cellpadding="2" border="0"><tbody><tr>
- <td valign="top">Pour faire des rencontres, parler de toutes choses, etc... c'est sur le forum.</td>
- <td valign="top"><img width="97" height="97" border="0" alt="questions" src="images/HomeFR/carre_questions.jpg" /> </td></tr></tbody></table></td>
- </tr>
- </table>
- <table class="contentpaneopen">
- <tr class="title">
- <td valign="top" class="newsTitle">
- <a href="Team Taatu-France.html?option=com_content&task=view&id=22&lang=FR" class="newsReadon">
- Team Taatu-France </a> </td>
- </tr>
- <tr>
- <td valign="top" class="newsContent">Tout sur la team de Taatu-France.</td>
- </tr>
- </table>
- <table class="contentpaneopen">
- <tr class="title">
- <td valign="top" class="newsTitle">
- <a href="Contact.html?option=com_content&task=view&id=37&lang=FR" class="newsReadon">
- Contact</a> </td>
- </tr>
- <tr>
- <td valign="top" class="newsContent"><table width="220" cellspacing="0" cellpadding="2" border="0"><tbody><tr>
- <td width="114" valign="top">Vous voulez poser vos questions au staff de Taatu-France, ou les rejoindre, ou encore autre chose, c'est par ici. </td>
- <td width="98" valign="top"><strong><img width="97" height="97" border="0" src="Image/carre_questions.jpg" alt="TAATU couleur du chat" /></strong></td>
- </tr></tbody></table></td>
- </tr>
- </table>
- <table class="contentpaneopen">
- <tr class="title">
- <td valign="top" class="newsTitle">
- <a href="http://d.wogame.free.fr/Version%20du%20site.html?option=com_content&task=view&id=23&lang=FR" class="newsReadon">
- Version du site </a> </td>
- </tr>
- <tr>
- <td valign="top" class="newsContent">Taatu-France met souvent le site à jour, vous pourez les découvrir ici. </td>
- </tr>
- </table><table class="contentpaneopen">
- <tr class="title">
- <td valign="top" class="newsTitle">
- <a href="Suggestions.html?option=com_content&task=view&id=23&lang=FR" class="newsReadon">
- Suggestions</a> </td>
- </tr>
- <tr>
- <td valign="top" class="newsContent">Toutes vos idées envoyer par mail on la réponse ici. </td>
- </tr>
- </table>
- </div> </td>
- </tr>
- <tr>
- <td> </td>
- <td>
- <div class="moduletable_footer">
- <table width="100%" border="0" cellpadding="0" cellspacing="1"><tr>
- <td nowrap="nowrap"> <blockquote>
- <blockquote>
- <blockquote>
- <p> Taatu-France est un site de fan du site www.taatu.com </p>
- </blockquote>
- </blockquote>
- </blockquote></td>
- </tr></table> </div> </td>
- <td> </td>
- </tr>
- </table>
- </div>
- </body>
- </html>
- <!-- 1135848243 -->
|
Voila le fichier show_news :
Code :
- <?PHP
- error_reporting (E_ALL ^ E_NOTICE);
- $cutepath = __FILE__;
- $cutepath = preg_replace( "'\\\show_news\.php'", "", $cutepath);
- $cutepath = preg_replace( "'/show_news\.php'", "", $cutepath);
- require_once("$cutepath/inc/functions.inc.php" );
- require_once("$cutepath/data/config.php" );
- //----------------------------------
- // Check if we are included by PATH
- //----------------------------------
- if($HTTP_SERVER_VARS["HTTP_ACCEPT"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_CHARSET"] or $HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"] or $HTTP_SERVER_VARS["HTTP_CONNECTION"]){ /* do nothing */ }
- elseif(eregi("show_news.php", $PHP_SELF)){
- die("<h4>CuteNews has detected that you are including show_news.php using the URL to this file.<br>
- This is incorrect and you must include it using the PATH to show_news.php</h4><br>Example:<br>
- this is <font color=red>WRONG</font> : <?PHP include(\"http://yoursite.com/cutenews/show_news.php\" ); ?><br>
- this is <font color=green>CORRECT</font>: <?PHP include(\"cutenews/show_news.php\" ); ?><br>
- <br><BR>// <font size=2>if you think this message shouldn't be shown, open show_news.php and delete it from there</font>" );
- }
- //----------------------------------
- // End of the check
- //----------------------------------
- if(!isset($subaction) or $subaction == "" ){ $subaction = $POST["subaction"]; }
- if(!isset($template) or $template == "" or strtolower($template) == "default" ){ require_once("$cutepath/data/Default.tpl" ); }
- else{
- if(file_exists("$cutepath/data/${template}.tpl" )){ require_once("$cutepath/data/${template}.tpl" ); }
- else{ die("Error!<br>the template <b>".htmlspecialchars($template)."</b> does not exists, note that templates are case sensetive and you must write the name exactly as it is" ); }
- }
- // Prepare requested categories
- if(eregi("[a-z]", $category)){
- die("<b>Error</b>!<br>CuteNews has detected that you use \$category = \"$category\"; but you can call the categories only with their <b>ID</b> numbers and not with names<br>
- example:<br><blockquote><?PHP<br>\$category = \"1\";<br>include(\"path/to/show_news.php\" );<br>?></blockquote>" );
- }
- $category = preg_replace("/ /", "", $category);
- $tmp_cats_arr = explode(",", $category);
- foreach($tmp_cats_arr as $key=>$value){
- if($value != "" ){ $requested_cats[$value] = TRUE; }
- }
- if($archive == "" ){
- $news_file = "$cutepath/data/news.txt";
- $comm_file = "$cutepath/data/comments.txt";
- }else{
- $news_file = "$cutepath/data/archives/$archive.news.arch";
- $comm_file = "$cutepath/data/archives/$archive.comments.arch";
- }
- $allow_add_comment = FALSE;
- $allow_full_story = FALSE;
- $allow_active_news = FALSE;
- $allow_comments = FALSE;
- //<<<------------ Detarime what user want to do
- if( $CN_HALT != TRUE and $static != TRUE and ($subaction == "showcomments" or $subaction == "showfull" or $subaction == "addcomment" ) and ((!isset($category) or $category == "" ) or $requested_cats[$ucat] == TRUE) ){
- if($subaction == "addcomment" ){ $allow_add_comment = TRUE; $allow_comments = TRUE; }
- if($subaction == "showcomments" ) $allow_comments = TRUE;
- if(($subaction == "showcomments" or $allow_comments == TRUE) and $config_show_full_with_comments == "yes" ) $allow_full_story = TRUE;
- if($subaction == "showfull" ) $allow_full_story = TRUE;
- if($subaction == "showfull" and $config_show_comments_with_full == "yes" ) $allow_comments = TRUE;
- }
- else{
- if($config_reverse_active == "yes" ){ $reverse = TRUE; }
- $allow_active_news = TRUE;
- }
- //----------->>> Detarime what user want to do
- require("$cutepath/inc/shows.inc.php" );
- if($_GET['archive'] and $_GET['archive'] != ''){ $archive = $_GET['archive']; } // stupid fix ?
- unset($static, $template, $requested_cats, $category, $catid, $cat,$reverse, $in_use, $archives_arr, $number, $no_prev, $no_next, $i, $showed, $prev, $used_archives);
- ?>
- <!-- News Powered by CuteNews: http://cutephp.com/ -->
|
Et voici l'erreur sur mon site :
Code :
- Parse error: parse error, unexpected T_STRING in /var/www/free.fr/a/1/d.wogame/News.php on line 1
|
Voila que dois-je faire pour régler ce probléme ?
Merci d'avance. |