Changer un champ ou en cree un autre

xavier230573 Messages postés 47 Date d'inscription samedi 10 avril 2004 Statut Membre Dernière intervention 17 février 2009 - 28 oct. 2006 à 19:04
xavier230573 Messages postés 47 Date d'inscription samedi 10 avril 2004 Statut Membre Dernière intervention 17 février 2009 - 1 nov. 2006 à 00:24
bonjour j utilise un script de top site . son nom atsphp-5.1.2 il est anglais
j aimerai ajouter ou changer le champ à l interieur . Celui de la banniere .
Dans le script lorsqu une personne s enregistre elle dois donner l url de ça banniere. cette url est enregistre dans la base de donnée et pas l image de la banniere . moi ce que j aimerai c est de uploadé , de la renomer, de la redimentionner et de l enregistrer sur mon serveur dans un dossier .

Dans ma base de donnée j aimerai enregistrer le chemin qui mene au dossier ou à ete enregisté la banniere corespondant au site qui vien de s enregistre

se script et composé de deux fichier qui se combine ensemble join.php et join_form.html meme un petit aide de rien du tous me ferai plaisir car je suis debutant et je suis coinçé depuis un moment mon site reposera une parti sur se script encore merci de bien vouloir m aider
voici le fichier join.php
[code]
<?php
//===========================================================================\
// Aardvark Topsites PHP 5 \
// Copyright (c) 2003-2006 Jeremy Scheff. All rights reserved. \
//---------------------------------------------------------------------------\
// http://www.aardvarktopsitesphp.com/http://www.avatic.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. \
//===========================================================================\

if (!defined('ATSPHP')) {
die("This file cannot be accessed directly.");
}

class join extends join_edit {
function join() {
global $FORM, $LNG, $TMPL;

$TMPL['header'] = $LNG['join_header'];

if (!isset($FORM['submit'])) {
$this->form();
}
else {
$this->process();
}
}

function form() {
global $CONF, $FORM, $LNG, $TMPL;

if ($CONF['captcha']) {
$TMPL['join_captcha'] = $this->do_skin('join_captcha');
}
else {
$TMPL['join_captcha'] = '';
}

$TMPL['categories_menu'] = "<select name="category">\n";
foreach ($CONF['categories'] as $cat => $skin) {
if ($TMPL['category'] == $cat) {
$TMPL['categories_menu'] .= "<option value="{$cat}" selected="selected">{$cat}</option>\n";
}
else {
$TMPL['categories_menu'] .= "<option value="{$cat}">{$cat}</option>\n";
}
}
$TMPL['categories_menu'] .= "</select>";

if (!isset($TMPL['url'])) { $TMPL['url'] = 'http://'; }
if (!isset($TMPL['banner_url'])) { $TMPL['banner_url'] = 'http://'; }

if (isset($TMPL['url'])) { $TMPL['url'] = stripslashes($TMPL['url']); }
if (isset($TMPL['title'])) { $TMPL['title'] = stripslashes($TMPL['title']); }
if (isset($TMPL['description'])) { $TMPL['description'] = stripslashes($TMPL['description']); }
if (isset($TMPL['category'])) { $TMPL['category'] = stripslashes($TMPL['category']); }
if (isset($TMPL['banner_url'])) { $TMPL['banner_url'] = stripslashes($TMPL['banner_url']); }
if (isset($TMPL['email'])) { $TMPL['email'] = stripslashes($TMPL['email']); }

$TMPL['content'] = $this->do_skin('join_form');
}

function process() {
global $CONF, $DB, $FORM, $LNG, $TMPL;

$TMPL['username'] = $DB->escape($FORM['u'], 1);
$TMPL['url'] = $DB->escape($FORM['url'], 1);
$TMPL['title'] = $DB->escape($FORM['title'], 1);
$FORM['description'] = str_replace(array("\r\n", "\n", "\r"), ' ', $FORM['description']);
$TMPL['description'] = $DB->escape($FORM['description'], 1);
$TMPL['category'] = $DB->escape($FORM['category'], 1);
$TMPL['banner_url'] = $DB->escape($FORM['banner_url'], 1);
$TMPL['email'] = $DB->escape($FORM['email'], 1);

$TMPL['title'] = $this->bad_words($TMPL['title']);
$TMPL['description'] = $this->bad_words($TMPL['description']);

if ($this->check_input('join')) {
$password = md5($FORM['password']);

require_once("{$CONF['path']}/sources/in.php");
$short_url = in::short_url($TMPL['url']);

$join_date = date('Y-m-d', time() + (3600*$CONF['time_offset']));

$DB->query("INSERT INTO {$CONF['sql_prefix']}_sites (username, password, url, short_url, title, description, category, banner_url, email, join_date, active, openid)
VALUES ('{$TMPL['username']}', '{$password}', '{$TMPL['url']}', '{$short_url}', '{$TMPL['title']}', '{$TMPL['description']}', '{$TMPL['category']}', '{$TMPL['banner_url']}', '{$TMPL['email']}', '{$join_date}', {$CONF['active_default']}, 0)", __FILE__, __LINE__);
$DB->query("INSERT INTO {$CONF['sql_prefix']}_stats (username) VALUES ('{$TMPL['username']}')", __FILE__, __LINE__);

if ($CONF['google_friendly_links']) {
$TMPL['verbose_link'] = "";
}
else {
$TMPL['verbose_link'] = "index.php?a=in&u={$TMPL['username']}";
}
$TMPL['link_code'] = $this->do_skin('link_code');

$LNG['join_welcome'] = sprintf($LNG['join_welcome'], $TMPL['list_name']);

if ($CONF['active_default']) {
$TMPL['approve_message'] = '';
}
else {
$TMPL['approve_message'] = $LNG['join_approve'];
}

$join_email = new skin('join_email');
$join_email->send_email($TMPL['email']);

if ($CONF['email_admin_on_join']) {
$join_email_admin = new skin('join_email_admin');
$join_email_admin->send_email($CONF['your_email']);
}

$TMPL['content'] = $this->do_skin('join_finish');
}
else {
$this->form();
}
}
}
?>
[code]

et en dessous le formulaire join_form.html se script sous LICENSE GNU

[code]

<form action="index.php?a=join" method="post" name="join_form">
<fieldset>
<legend>{$lng->join_user}</legend>

<label>{$lng->g_username}


{$error_username}
</label>



<label>{$lng->g_password}


{$error_password}
</label>

</fieldset>

<fieldset>
<legend>{$lng->join_website}</legend>

<label>{$lng->g_url}


{$error_url}
</label>



<label>{$lng->g_title}


{$error_title}
</label>


<label>{$lng->g_description}

<textarea cols="40" rows="5" name="description">{$description}</textarea>


</label>
<label>{$lng->g_category}

{$categories_menu}


</label>

<label>{$lng->g_banner_url}


{$error_banner_url}
</label>



<label>{$lng->g_email}


{$error_email}
</label>


{$join_captcha}
join_header}" />
</fieldset>
</form>
[code]

dans la base j ai 9 tables les enregistrement des sites se font dans la table _sites

la table _site est composé des champs suivant
username / password / url / short_url / title / description / category / banner_url / email / fichier / join_date / active

1 réponse

xavier230573 Messages postés 47 Date d'inscription samedi 10 avril 2004 Statut Membre Dernière intervention 17 février 2009
1 nov. 2006 à 00:24
de l aide svp
0
Rejoignez-nous