salut merci de me repondre aussi vite
tu entend quoi par le contenu des variable variables $UpdateTopicEtat et $UpdateTopicQuotat.
ce que je peu faire c est te mettre mon fichier en entier
<?php
/***************************************************************************
* statut_ftp.php
* -------------------
* begin : Sunday, Apr 25, 2005
* copyright : (C) 2005 GGDN Group
* email : [email protected]
*
* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
*
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//Variable passées en parametre de l'URL
//1ere execution du script : t -> topic
//2eme execution du script : t -> topic, etat -> nouvel etat du topic , newquotat -> quotat topic
// Start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// End session management
//
// Check and set various parameters
//
if (isset($HTTP_POST_VARS['etat']))
{
//exception : topic_inexistant
if (!isset($HTTP_POST_VARS['t']))
{
message_die(GENERAL_MESSAGE, $lang['No_such_topic']);
}
$topic_id = $HTTP_POST_VARS['t'];
$tempSql = "select * from " . TOPICS_TABLE . " where topic_id = ".$topic_id ;
if (!$result = $db->sql_query($tempSql) )
{
message_die(GENERAL_MESSAGE, $lang['No_such_topic']);
}
//variables parametres
$nouveau_etat = $HTTP_POST_VARS['etat'];
$dateUpdate = $HTTP_POST_VARS['dateUpdateFtp'];
$new_quotat = $HTTP_POST_VARS['newquotat'] ;
//infos topic
$topic_info = $db->sql_fetchrow($result);
$forum_id = $topic_info['forum_id'];
$poster_id = $topic_info['topic_poster'] ;
//infos quotat
$sqlUser = "select * from " . USERS_TABLE . " where user_id = ".$poster_id ;
$resultUser = $db->sql_query($sqlUser);
$userInfo = $db->sql_fetchrow($resultUser);
$QuotatUser = $userInfo['user_upload_taille'];
$old_quotat_topic = $topic_info['topic_quotat'];
$UpdateTopicQuotat = "";
$UpdateTopicEtat = "";
$nbTopicMaj = 0;
$newQuotatUser = 0;
if($new_quotat != $old_quotat_topic)
{
$nbTopicMaj ++;
$new_quotat_enGo = $new_quotat/1024 ;
$old_quotat_topic_enGo = $old_quotat_topic/1024;
$newQuotatUser = $QuotatUser + $new_quotat_enGo - $old_quotat_topic_enGo;
$UpdateTopicQuotat = ", topic_quotat = ".$new_quotat ;
}
$nbTopicMaj ++;
$UpdateTopicEtat = "topic_etat_ftp = ". $nouveau_etat .", topic_date_etat = ".$dateUpdate." " ;
$message ="";
if($nbTopicMaj > 0)
{
$sqlUpdateTopic = "Update " . TOPICS_TABLE . " set ".$UpdateTopicEtat." ".$UpdateTopicQuotat." where topic_id = ". $topic_id ;
if ( $result = $db->sql_query($sqlUpdateTopic) )
{
if($newQuotatUser != 0)
{
$sqlUpdateUser = "Update " . USERS_TABLE . " set user_upload_taille = ". $newQuotatUser ." where user_id = ". $poster_id ;
if($resultUpdateUser = $db->sql_query($sqlUpdateUser))
{
$message = $lang['Update_statut_ftp'];
$message .= '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
$message .= '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
}
else
{
$message = "Erreur sur la BD1" ;
$message .= '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
$message .= '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
}
}
else
{
$message = $lang['Update_statut_ftp'];
$message .= '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
$message .= '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
}
}
else
{
$message = "Erreur sur la BD2" ;
$message .= '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
$message .= '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
}
}
else
{
$message = "Aucune Modification effectuée" ;
$message .= '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
$message .= '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
}
message_die(GENERAL_MESSAGE, $message);
}
//
//Affichage du formulaire
//
$topic_id = $_GET['t'];
$sql = "SELECT f.*, t.*, u.username
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . USERS_TABLE . " u
WHERE t.topic_id = $topic_id
AND f.forum_id = t.forum_id
AND u.user_id = t.topic_poster";
//exception : topic_inexistant
//si le topic passé en parametre du script n'est pas dans la BD
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_MESSAGE, $lang['No_such_topic']);
}
$post_info = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$forum_id = $post_info['forum_id'];
$forum_name = $post_info['forum_name'];
$valeurquotat = $post_info['topic_quotat'];
$subject = $post_info['topic_title'];
$poster = $post_info['username'];
$poster_id = $post_info['topic_poster'];
$page_title = $lang['Post_statut_ftp'];
$dateDuJour = time();
//champs HTML du formulaire
$affich_quotat .= '<input type="text" size="8" maxlength="7" style="background-white:\'black\'" name="newquotat" value="'.$valeurquotat.'" >' ;
$hidden_form_fields .= '<input type="hidden" name="' . POST_TOPIC_URL . '" value="' . $topic_id . '" />';
$hidden_form_fields .= '<input type="hidden" name="dateUpdateFtp" value="' . $dateDuJour . '" />';
$affich_etat .= "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" ><tr><td>";
if ($post_info['topic_etat_ftp'] == 0)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"0\" checked=\"checked\" /><small>Aucun</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"0\" /><small>Aucun</small>";
}
$affich_etat .= "</td></tr><tr><td>" ;
if ($post_info['topic_etat_ftp'] == 1)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"1\" checked=\"checked\" /><small>O.K</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"1\" /><small>O.K</small>";
}
if ($post_info['topic_etat_ftp'] == 2)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"2\" checked=\"checked\" /><small>421</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"2\" /><small>421</small>";
}
if ($post_info['topic_etat_ftp'] == 3)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"3\" checked=\"checked\" /><small>530</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"3\" /><small>530</small>";
}
if ($post_info['topic_etat_ftp'] == 4)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"4\" checked=\"checked\" /><small>Dead</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"4\" /><small>Dead</small>";
}
if ($post_info['topic_etat_ftp'] == 5)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"5\" checked=\"checked\" /><small>Timeout</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"5\" /><small>Timeout</small>";
}
$affich_etat .= "</td></tr><tr><td>" ;
if ($post_info['topic_etat_ftp'] == 6)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"6\" checked=\"checked\" /><small>Stro Online</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"6\" /><small>Stro Online</small>";
}
if ($post_info['topic_etat_ftp'] == 7)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"7\" checked=\"checked\" /><small>Stro Offline</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"7\" /><small>Stro Offline</small>";
}
if ($post_info['topic_etat_ftp'] == 8)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"8\" checked=\"checked\" /><small>Delete</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"8\" /><small>Delete</small>";
}
$affich_etat .= "</td><td> </td></table>";
//
// Start output of page
//
$page_title = $lang['Index'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'statut_ftp.tpl')
);
$template->assign_vars(array(
'FORUM_NAME' => $forum_name,
'L_POST_A' => $page_title,
'L_USERNAME' => $lang['Uploadeur'],
'L_SUBJECT' => $lang['Subject'],
'L_STATUT' => $lang['Statut'],
'L_QUOTAT' => $lang['Quotat'],
'L_SUBMIT' => $lang['Submit'],
'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?".POST_FORUM_URL."=$forum_id"),
'U_SUBJECT' => append_sid("viewtopic.$phpEx?".POST_TOPIC_URL."=$topic_id"),
'U_USER' => append_sid("profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=$poster_id"),
'S_USERNAME' => $poster,
'S_SUBJECT' => $subject,
'S_STATUT_FTP' => $affich_etat,
'S_QUOTAT_FTP' => $affich_quotat,
'S_POST_ACTION' => append_sid("statut_ftp.$phpEx"),
'S_TOPIC_ID' => $topic_id,
'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields)
);
// Generate the page
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
je vais regarder ce que tu a mie
@++
salut merci de me repondre aussi vite :wink:
tu entend quoi par le contenu des variable variables $UpdateTopicEtat et $UpdateTopicQuotat.
ce que je peu faire c est te mettre mon fichier en entier
[php]<?php
/***************************************************************************
* statut_ftp.php
* -------------------
* begin : Sunday, Apr 25, 2005
* copyright : (C) 2005 GGDN Group
* email :
[email protected] *
* $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
*
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//Variable passées en parametre de l'URL
//1ere execution du script : t -> topic
//2eme execution du script : t -> topic, etat -> nouvel etat du topic , newquotat -> quotat topic
// Start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// End session management
//
// Check and set various parameters
//
if (isset($HTTP_POST_VARS['etat']))
{
//exception : topic_inexistant
if (!isset($HTTP_POST_VARS['t']))
{
message_die(GENERAL_MESSAGE, $lang['No_such_topic']);
}
$topic_id = $HTTP_POST_VARS['t'];
$tempSql = "select * from " . TOPICS_TABLE . " where topic_id = ".$topic_id ;
if (!$result = $db->sql_query($tempSql) )
{
message_die(GENERAL_MESSAGE, $lang['No_such_topic']);
}
//variables parametres
$nouveau_etat = $HTTP_POST_VARS['etat'];
$dateUpdate = $HTTP_POST_VARS['dateUpdateFtp'];
$new_quotat = $HTTP_POST_VARS['newquotat'] ;
//infos topic
$topic_info = $db->sql_fetchrow($result);
$forum_id = $topic_info['forum_id'];
$poster_id = $topic_info['topic_poster'] ;
//infos quotat
$sqlUser = "select * from " . USERS_TABLE . " where user_id = ".$poster_id ;
$resultUser = $db->sql_query($sqlUser);
$userInfo = $db->sql_fetchrow($resultUser);
$QuotatUser = $userInfo['user_upload_taille'];
$old_quotat_topic = $topic_info['topic_quotat'];
$UpdateTopicQuotat = "";
$UpdateTopicEtat = "";
$nbTopicMaj = 0;
$newQuotatUser = 0;
if($new_quotat != $old_quotat_topic)
{
$nbTopicMaj ++;
$new_quotat_enGo = $new_quotat/1024 ;
$old_quotat_topic_enGo = $old_quotat_topic/1024;
$newQuotatUser = $QuotatUser + $new_quotat_enGo - $old_quotat_topic_enGo;
$UpdateTopicQuotat = ", topic_quotat = ".$new_quotat ;
}
$nbTopicMaj ++;
$UpdateTopicEtat = "topic_etat_ftp = ". $nouveau_etat .", topic_date_etat = ".$dateUpdate." " ;
$message ="";
if($nbTopicMaj > 0)
{
$sqlUpdateTopic = "Update " . TOPICS_TABLE . " set ".$UpdateTopicEtat." ".$UpdateTopicQuotat." where topic_id = ". $topic_id ;
if ( $result = $db->sql_query($sqlUpdateTopic) )
{
if($newQuotatUser != 0)
{
$sqlUpdateUser = "Update " . USERS_TABLE . " set user_upload_taille = ". $newQuotatUser ." where user_id = ". $poster_id ;
if($resultUpdateUser = $db->sql_query($sqlUpdateUser))
{
$message = $lang['Update_statut_ftp'];
$message .= '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
$message .= '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
}
else
{
$message = "Erreur sur la BD1" ;
$message .= '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
$message .= '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
}
}
else
{
$message = $lang['Update_statut_ftp'];
$message .= '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
$message .= '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
}
}
else
{
$message = "Erreur sur la BD2" ;
$message .= '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
$message .= '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
}
}
else
{
$message = "Aucune Modification effectuée" ;
$message .= '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
$message .= '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
}
message_die(GENERAL_MESSAGE, $message);
}
//
//Affichage du formulaire
//
$topic_id = $_GET['t'];
$sql = "SELECT f.*, t.*, u.username
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . USERS_TABLE . " u
WHERE t.topic_id = $topic_id
AND f.forum_id = t.forum_id
AND u.user_id = t.topic_poster";
//exception : topic_inexistant
//si le topic passé en parametre du script n'est pas dans la BD
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_MESSAGE, $lang['No_such_topic']);
}
$post_info = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$forum_id = $post_info['forum_id'];
$forum_name = $post_info['forum_name'];
$valeurquotat = $post_info['topic_quotat'];
$subject = $post_info['topic_title'];
$poster = $post_info['username'];
$poster_id = $post_info['topic_poster'];
$page_title = $lang['Post_statut_ftp'];
$dateDuJour = time();
//champs HTML du formulaire
$affich_quotat .= '<input type="text" size="8" maxlength="7" style="background-white:\'black\'" name="newquotat" value="'.$valeurquotat.'" >' ;
$hidden_form_fields .= '<input type="hidden" name="' . POST_TOPIC_URL . '" value="' . $topic_id . '" />';
$hidden_form_fields .= '<input type="hidden" name="dateUpdateFtp" value="' . $dateDuJour . '" />';
$affich_etat .= "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" ><tr><td>";
if ($post_info['topic_etat_ftp'] == 0)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"0\" checked=\"checked\" /><small>Aucun</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"0\" /><small>Aucun</small>";
}
$affich_etat .= "</td></tr><tr><td>" ;
if ($post_info['topic_etat_ftp'] == 1)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"1\" checked=\"checked\" /><small>O.K</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"1\" /><small>O.K</small>";
}
if ($post_info['topic_etat_ftp'] == 2)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"2\" checked=\"checked\" /><small>421</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"2\" /><small>421</small>";
}
if ($post_info['topic_etat_ftp'] == 3)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"3\" checked=\"checked\" /><small>530</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"3\" /><small>530</small>";
}
if ($post_info['topic_etat_ftp'] == 4)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"4\" checked=\"checked\" /><small>Dead</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"4\" /><small>Dead</small>";
}
if ($post_info['topic_etat_ftp'] == 5)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"5\" checked=\"checked\" /><small>Timeout</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"5\" /><small>Timeout</small>";
}
$affich_etat .= "</td></tr><tr><td>" ;
if ($post_info['topic_etat_ftp'] == 6)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"6\" checked=\"checked\" /><small>Stro Online</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"6\" /><small>Stro Online</small>";
}
if ($post_info['topic_etat_ftp'] == 7)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"7\" checked=\"checked\" /><small>Stro Offline</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"7\" /><small>Stro Offline</small>";
}
if ($post_info['topic_etat_ftp'] == 8)
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"8\" checked=\"checked\" /><small>Delete</small>";
}
else
{
$affich_etat .= "<input type=\"radio\" name=\"etat\" value=\"8\" /><small>Delete</small>";
}
$affich_etat .= "</td><td> </td></table>";
//
// Start output of page
//
$page_title = $lang['Index'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'statut_ftp.tpl')
);
$template->assign_vars(array(
'FORUM_NAME' => $forum_name,
'L_POST_A' => $page_title,
'L_USERNAME' => $lang['Uploadeur'],
'L_SUBJECT' => $lang['Subject'],
'L_STATUT' => $lang['Statut'],
'L_QUOTAT' => $lang['Quotat'],
'L_SUBMIT' => $lang['Submit'],
'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?".POST_FORUM_URL."=$forum_id"),
'U_SUBJECT' => append_sid("viewtopic.$phpEx?".POST_TOPIC_URL."=$topic_id"),
'U_USER' => append_sid("profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=$poster_id"),
'S_USERNAME' => $poster,
'S_SUBJECT' => $subject,
'S_STATUT_FTP' => $affich_etat,
'S_QUOTAT_FTP' => $affich_quotat,
'S_POST_ACTION' => append_sid("statut_ftp.$phpEx"),
'S_TOPIC_ID' => $topic_id,
'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields)
);
// Generate the page
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>[/php]
je vais regarder ce que tu a mie
@++