Chargement en cours...
Connexion au forum informatique de Sur-la-Toile
La discussion « changer ajouter ou changer le champ banniere » se trouve dans le forum « Programmation »
Statut de la discussion » changer ajouter ou changer le champ banniere « ( sans réponse)

changer ajouter ou changer le champ banniere

» Liste des Forums » Programmation » Discussion

Le 28-10-2006 à 16:53 #

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:
  1.   <?php
  2.   //===========================================================================\
  3.   // Aardvark Topsites PHP 5 \
  4.   // Copyright (c) 2003-2006 Jeremy Scheff. All rights reserved. \
  5.   //---------------------------------------------------------------------------\
  6.   // http://www.aardvarktopsitesphp.com/ http://www.avatic.com/ \
  7.   //---------------------------------------------------------------------------\
  8.   // This program is free software; you can redistribute it and/or modify it \
  9.   // under the terms of the GNU General Public License as published by the \
  10.   // Free Software Foundation; either version 2 of the License, or (at your \
  11.   // option) any later version. \
  12.   // \
  13.   // This program is distributed in the hope that it will be useful, but \
  14.   // WITHOUT ANY WARRANTY; without even the implied warranty of \
  15.   // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General \
  16.   // Public License for more details. \
  17.   //===========================================================================\
  18.   
  19.   if (!defined('ATSPHP')) {
  20.    die("This file cannot be accessed directly.");
  21.   }
  22.   
  23.   class join extends join_edit {
  24.    function join() {
  25.    global $FORM, $LNG, $TMPL;
  26.   
  27.    $TMPL['header'] = $LNG['join_header'];
  28.   
  29.    if (!isset($FORM['submit'])) {
  30.    $this->form();
  31.    }
  32.    else {
  33.    $this->process();
  34.    }
  35.    }
  36.   
  37.    function form() {
  38.    global $CONF, $FORM, $LNG, $TMPL;
  39.   
  40.    if ($CONF['captcha']) {
  41.    $TMPL['join_captcha'] = $this->do_skin('join_captcha');
  42.    }
  43.    else {
  44.    $TMPL['join_captcha'] = '';
  45.    }
  46.   
  47.    $TMPL['categories_menu'] = "<select name=\"category\">\n";
  48.    foreach ($CONF['categories'] as $cat => $skin) {
  49.    if ($TMPL['category'] == $cat) {
  50.    $TMPL['categories_menu'] .= "<option value=\"{$cat}\" selected=\"selected\">{$cat}</option>\n";
  51.    }
  52.    else {
  53.    $TMPL['categories_menu'] .= "<option value=\"{$cat}\">{$cat}</option>\n";
  54.    }
  55.    }
  56.    $TMPL['categories_menu'] .= "</select>";
  57.   
  58.    if (!isset($TMPL['url'])) { $TMPL['url'] = 'http://'; }
  59.    if (!isset($TMPL['banner_url'])) { $TMPL['banner_url'] = 'http://'; }
  60.   
  61.    if (isset($TMPL['url'])) { $TMPL['url'] = stripslashes($TMPL['url']); }
  62.    if (isset($TMPL['title'])) { $TMPL['title'] = stripslashes($TMPL['title']); }
  63.    if (isset($TMPL['description'])) { $TMPL['description'] = stripslashes($TMPL['description']); }
  64.    if (isset($TMPL['category'])) { $TMPL['category'] = stripslashes($TMPL['category']); }
  65.    if (isset($TMPL['banner_url'])) { $TMPL['banner_url'] = stripslashes($TMPL['banner_url']); }
  66.    if (isset($TMPL['email'])) { $TMPL['email'] = stripslashes($TMPL['email']); }
  67.   
  68.    $TMPL['content'] = $this->do_skin('join_form');
  69.    }
  70.   
  71.    function process() {
  72.    global $CONF, $DB, $FORM, $LNG, $TMPL;
  73.   
  74.    $TMPL['username'] = $DB->escape($FORM['u'], 1);
  75.    $TMPL['url'] = $DB->escape($FORM['url'], 1);
  76.    $TMPL['title'] = $DB->escape($FORM['title'], 1);
  77.    $FORM['description'] = str_replace(array("\r\n", "\n", "\r"), ' ', $FORM['description']);
  78.    $TMPL['description'] = $DB->escape($FORM['description'], 1);
  79.    $TMPL['category'] = $DB->escape($FORM['category'], 1);
  80.    $TMPL['banner_url'] = $DB->escape($FORM['banner_url'], 1);
  81.    $TMPL['email'] = $DB->escape($FORM['email'], 1);
  82.   
  83.    $TMPL['title'] = $this->bad_words($TMPL['title']);
  84.    $TMPL['description'] = $this->bad_words($TMPL['description']);
  85.   
  86.    if ($this->check_input('join')) {
  87.    $password = md5($FORM['password']);
  88.   
  89.    require_once("{$CONF['path']}/sources/in.php");
  90.    $short_url = in::short_url($TMPL['url']);
  91.   
  92.    $join_date = date('Y-m-d', time() + (3600*$CONF['time_offset']));
  93.   
  94.    $DB->query("INSERT INTO {$CONF['sql_prefix']}_sites (username, password, url, short_url, title, description, category, banner_url, email, join_date, active, openid)
  95.    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__);
  96.    $DB->query("INSERT INTO {$CONF['sql_prefix']}_stats (username) VALUES ('{$TMPL['username']}')", __FILE__, __LINE__);
  97.   
  98.    if ($CONF['google_friendly_links']) {
  99.    $TMPL['verbose_link'] = "";
  100.    }
  101.    else {
  102.    $TMPL['verbose_link'] = "index.php?a=in&u={$TMPL['username']}";
  103.    }
  104.    $TMPL['link_code'] = $this->do_skin('link_code');
  105.   
  106.    $LNG['join_welcome'] = sprintf($LNG['join_welcome'], $TMPL['list_name']);
  107.   
  108.    if ($CONF['active_default']) {
  109.    $TMPL['approve_message'] = '';
  110.    }
  111.    else {
  112.    $TMPL['approve_message'] = $LNG['join_approve'];
  113.    }
  114.   
  115.    $join_email = new skin('join_email');
  116.    $join_email->send_email($TMPL['email']);
  117.   
  118.    if ($CONF['email_admin_on_join']) {
  119.    $join_email_admin = new skin('join_email_admin');
  120.    $join_email_admin->send_email($CONF['your_email']);
  121.    }
  122.   
  123.    $TMPL['content'] = $this->do_skin('join_finish');
  124.    }
  125.    else {
  126.    $this->form();
  127.    }
  128.    }
  129.   }
  130.   ?>



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

    Code:
    1.   <form action="index.php?a=join" method="post" name="join_form">
    2.   <fieldset>
    3.   <legend>{$lng->join_user}</legend>
    4.   <div class="{$error_style_username}"><label>{$lng->g_username}<br />
    5.   <input type="text" name="u" size="20" value="{$username}" />
    6.   {$error_username}
    7.   </label></div><br />
    8.   <div class="{$error_style_password}"><label>{$lng->g_password}<br />
    9.   <input type="password" name="password" size="20" value="{$password}" />
    10.   {$error_password}
    11.   </label></div>
    12.   </fieldset>
    13.   
    14.   <fieldset>
    15.   <legend>{$lng->join_website}</legend>
    16.   <div class="{$error_style_url}"><label>{$lng->g_url}<br />
    17.   <input type="text" name="url" size="50" value="{$url}" />
    18.   {$error_url}
    19.   </label></div><br />
    20.   <div class="{$error_style_title}"><label>{$lng->g_title}<br />
    21.   <input type="text" name="title" size="50" value="{$title}" />
    22.   {$error_title}
    23.   </label></div><br />
    24.   <label>{$lng->g_description}<br />
    25.   <textarea cols="40" rows="5" name="description">{$description}</textarea><br /><br />
    26.   </label>
    27.   <label>{$lng->g_category}<br />
    28.   {$categories_menu}<br /><br />
    29.   </label>
    30.   <div class="{$error_style_banner_url}"><label>{$lng->g_banner_url}<br />
    31.   <input type="text" name="banner_url" size="50" value="{$banner_url}" />
    32.   {$error_banner_url}
    33.   </label></div><br />
    34.   <div class="{$error_style_email}"><label>{$lng->g_email}<br />
    35.   <input type="text" name="email" size="50" value="{$email}" />
    36.   {$error_email}
    37.   </label></div><br />
    38.   {$join_captcha}
    39.   <input name="submit" type="submit" value="{$lng->join_header}" />
    40.   </fieldset>
    41.   </form>

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




      Ces discussions pourraient vous intéresser également:


      changer grafiste site web .
      changer une page perso
      Changer texte div clic
      impossible de changer la police de mon site
      Changer la vitesse d'un ugamela

      Sujets Connexes

      Arakien & WéWé


      Forums

      Navigation


      Publicité

      Connectés

      Il y a actuellement 820 visiteurs et 20 toiliens en ligne, ainsi que 8 connectés sur le tchat.

      Recherche

      Inscription


      Sauf mention contraire, le contenu du blog et du forum est sous licence Creative Commons By-Sa. Vous avez le droit de le reproduire à condition de citer l'auteur, de faire un lien vers la page d'origine, et de partager vos travaux dérivés selon les mêmes conditions.

      Conditions d'utilisation -

      Partenaires: [Informatique Multimédia] [Portail du Maroc] [Actualité High Tech]
      [Tutoriaux Photoshop] [éligibilité ADSL] [Astuces Windows]

      Page générée en 222 millisecondes sur WWW1.