@pitbull
29/05/2006, 00h55
bonjour a tous ,voila j'aurais besoin d'un ti coup de pouce , je souhaite creer un ti hack qui affiche les news du jour sur une page externe le soucis c'est que j'en suis arriver a afficher une seul ligne sur 2 presente dans ma table ,
--
-- Structure de la table `news`
--
CREATE TABLE `news` (
`contenu` mediumtext NOT NULL,
`posteur` mediumtext NOT NULL,
`categorie` mediumtext NOT NULL,
`sender` mediumtext NOT NULL,
`source` binary(1) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Contenu de la table `news`
--
INSERT INTO `news` VALUES ('contenu news une', 'admin', 'internet', 'membre', 'google news');
INSERT INTO `news` VALUES ('contenu news 2', 'admin2', 'informatique', 'membre2', 'info du net');
mon template
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<!-- end no cache headers -->
<title><phrase 1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase></title>
$headinclude
</head>
<body>
$header
$navbar
<br>
<!-- main -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<td class="thead" width="65%" align="$stylevar[left]">
<center>Contenue</center>
</td>
<td class="thead" width="150">
<center>Posteur</center>
</td>
<td class="thead" width="150">
<center>Categorie</center>
</td>
<td class="thead" width="250">
<center>Sendeur</center>
</td>
<td class="thead" width="250">
<center>Source</center>
</td>
</thead>
<tbody>
$aup
</tbody>
</table>
<!-- /main -->
<br />
<br />
$footer
</body>
</html>
mon fichier php
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'news');
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
$newss = $db->query_first("SELECT contenu AS test, posteur AS post, categorie AS cat, sender AS send, source AS sourc FROM " . TABLE_PREFIX . "news");
{
$aup .= "<tr align=\"center\">";
$aup .= "<td class=\"alt1\">$newss[test]</td>";
$aup .= "<td class=\"alt2\">$newss[post]</td>";
$aup .= "<td class=\"alt1\">$newss[cat]</td>";
$aup .= "<td class=\"alt2\">$newss[send]</td>";
$aup .= "<td class=\"alt1\">$newss[sourc]</td>";
$aup .= "</tr>";
}
$navbits[''] =$vbphrase['manage'];
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('manage_bit') . '");');
?>
donc avec cela jaffiche juste la premiere ligne :(
si quelqu'un voit ou je seche? merci
--
-- Structure de la table `news`
--
CREATE TABLE `news` (
`contenu` mediumtext NOT NULL,
`posteur` mediumtext NOT NULL,
`categorie` mediumtext NOT NULL,
`sender` mediumtext NOT NULL,
`source` binary(1) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Contenu de la table `news`
--
INSERT INTO `news` VALUES ('contenu news une', 'admin', 'internet', 'membre', 'google news');
INSERT INTO `news` VALUES ('contenu news 2', 'admin2', 'informatique', 'membre2', 'info du net');
mon template
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<!-- end no cache headers -->
<title><phrase 1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase></title>
$headinclude
</head>
<body>
$header
$navbar
<br>
<!-- main -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<td class="thead" width="65%" align="$stylevar[left]">
<center>Contenue</center>
</td>
<td class="thead" width="150">
<center>Posteur</center>
</td>
<td class="thead" width="150">
<center>Categorie</center>
</td>
<td class="thead" width="250">
<center>Sendeur</center>
</td>
<td class="thead" width="250">
<center>Source</center>
</td>
</thead>
<tbody>
$aup
</tbody>
</table>
<!-- /main -->
<br />
<br />
$footer
</body>
</html>
mon fichier php
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'news');
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
$newss = $db->query_first("SELECT contenu AS test, posteur AS post, categorie AS cat, sender AS send, source AS sourc FROM " . TABLE_PREFIX . "news");
{
$aup .= "<tr align=\"center\">";
$aup .= "<td class=\"alt1\">$newss[test]</td>";
$aup .= "<td class=\"alt2\">$newss[post]</td>";
$aup .= "<td class=\"alt1\">$newss[cat]</td>";
$aup .= "<td class=\"alt2\">$newss[send]</td>";
$aup .= "<td class=\"alt1\">$newss[sourc]</td>";
$aup .= "</tr>";
}
$navbits[''] =$vbphrase['manage'];
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('manage_bit') . '");');
?>
donc avec cela jaffiche juste la premiere ligne :(
si quelqu'un voit ou je seche? merci