1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425
| <?php
//Modifiez ici l'id du forum de présentation
$forum_de_prez ='3';
//Modifiez ici l'id du forum de présentation
/***************************************************************************
Created by DaEmOn_KiLLeR (Contact : www.prezup.com)
Modified by Versace 69 (Contact: http://2e.rep.free.fr)
***************************************************************************/
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
$page_title = pun_htmlspecialchars($pun_config['o_board_title']) . ' / Présentez-vous';
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';
if ($pun_user['is_guest']) message($lang_common['No permission']);
else {
if (isset($_GET['fid'])) {
$fid = isset($_GET['fid']) ? intval($_GET['fid']) : 0;
if ($fid < 1 && $fid > 0) message($lang_common['Bad request']);
if ($fid) $result = $db->query('SELECT f.id, f.forum_name, f.moderators, f.redirect_url, fp.post_replies, fp.post_topics FROM '.$db->prefix.'forums AS f LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fid) or error('Impossible de retrouver les informations forum', __FILE__, __LINE__, $db->error());
if (!$db->num_rows($result)) message($lang_common['Bad request']);
$cur_posting = $db->fetch_assoc($result);
// Is someone trying to post into a redirect forum?
if ($cur_posting['redirect_url'] != '') message($lang_common['Bad request']);
// Start with a clean slate
$errors = array();
// Make sure form_user is correct
if (($pun_user['is_guest'] && $_POST['form_user'] != 'Invité') || (!$pun_user['is_guest'] && $_POST['form_user'] != $pun_user['username'])) message($lang_common['Bad request']);
// Flood protection
if (!$pun_user['is_guest'] && !isset($_POST['preview']) && $pun_user['last_post'] != '' && (time() - $pun_user['last_post']) < $pun_user['g_post_flood']) $errors[] = $lang_post['Flood start'].' '.$pun_user['g_post_flood'].' '.$lang_post['flood end'];
// If it's a new topic
if ($fid)
{
$subject = pun_trim($_POST['req_subject']);
if ($subject == '') $errors[] = $lang_post['No subject'];
else if (pun_strlen($subject) > 70) $errors[] = $lang_post['Too long subject'];
else if ($pun_config['p_subject_all_caps'] == '0' && strtoupper($subject) == $subject && $pun_user['g_id'] > PUN_MOD) $subject = ucwords(strtolower($subject));
}
// If the user is logged in we get the username and e-mail from $pun_user
if (!$pun_user['is_guest'])
{
$username = $pun_user['username'];
$email = $pun_user['email'];
}
// Clean up message from POST
extract($_POST);
$titre = "
Ma présentation :: [".$form_user."]
\n";
// Informations personnelles
$infos_persos = "
Informations personnelles:
\n";
$prenom2 = "· Mon prénom: ".$prenom."\n";
$age2 = "· Mon âge: ".$age." ans\n";
$localisation2 = "· Localisation: ".$localisation."\n";
$loisir2 = "· Mes loisirs: ".$loisir."\n";
$emploi2 = "· Mon métier / Mes études: ".$emploi."\n\n";
// Informations sur DoD: Source
$dod_source = "\n";
$debut2 = "· Temps de jeu: ".$debut."\n";
$level2 = "· Mon niveau: ".$level."\n";
$team2 = "· Ma team: ".$team."\n";
$attitude2 = "· Mon attitude au combat: ".$attitude."et".$attitude1." (".$attitude_autres.")\n";
$map2 = "· Mon type de map: ".$map." (".$map_autres.")\n\n";
// Autres informations
$autre = "\n";
$jeux2 = "· Autres jeux auxquels je joue: ".$jeux."\n";
$type_jeux2 = "· Mon type de jeux: ".$type_jeux." (".$jeux_autres.")\n";
$autres2 = "· Message(s) supplémentaire(s): ".$autres."\n";
// $2 = "· : ".$."\n";
// Message
$message = pun_linebreaks(pun_trim($titre.$infos_persos.$prenom2.$age2.$localisation2.$loisir2.$emploi2.$dod_source.$debut2.$level2.$team2.$attitude2.$map2.$autre.$jeux2.$type_jeux2.$autres2));
if (strlen($message) > 65535) $errors[] = $lang_post['Too long message'];
else if ($pun_config['p_message_all_caps'] == '0' && strtoupper($message) == $message && $pun_user['g_id'] > PUN_MOD) $message = ucwords(strtolower($message));
require PUN_ROOT.'include/search_idx.php';
$now = time();
// It's a new topic
if ($fid)
{
// Create the topic
$db->query('INSERT INTO '.$db->prefix.'topics (poster, subject, posted, last_post, last_poster, forum_id) VALUES(\''.$db->escape($username).'\', \''.$db->escape($subject).'\', '.$now.', '.$now.', \''.$db->escape($username).'\', '.$fid.')') or error('Impossible de créer la discussion', __FILE__, __LINE__, $db->error());
$new_tid = $db->insert_id();
if (!$pun_user['is_guest'])
{
// Create the post ("topic post")
$db->query('INSERT INTO '.$db->prefix.'posts (poster, poster_id, poster_ip, message, hide_smilies, posted, topic_id) VALUES(\''.$db->escape($username).'\', '.$pun_user['id'].', \''.get_remote_address().'\', \''.$db->escape($message).'\', \''.$hide_smilies.'\', '.$now.', '.$new_tid.')') or error('Impossible de créer le message', __FILE__, __LINE__, $db->error());
}
$new_pid = $db->insert_id();
// Update the topic with last_post_id
$db->query('UPDATE '.$db->prefix.'topics SET last_post_id='.$new_pid.' WHERE id='.$new_tid) or error('Impossible de modifier la discussion', __FILE__, __LINE__, $db->error());
update_search_index('post', $new_pid, $message, $subject);
update_forum($fid);
}
// Increment his/her post count
if (!$pun_user['is_guest'])
{
$low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
$db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.' WHERE id='.$pun_user['id']) or error('Impossible de modifier l\'utilisateur', __FILE__, __LINE__, $db->error());
}
redirect('viewtopic.php?pid='.$new_pid.'#p'.$new_pid, "Message envoyé. Redirection ...");
} // Fin d'envois des infos dans la bdd
else { ?>
<script language="javascript" type="text/javascript">
function validation()
{
// Validation Titre Sujet
if(document.prez.req_subject.value == "")
{
alert ('Vous n\'avez pas remplis le champ concernant l\'intitulé du sujet !');
document.prez.req_subject.focus();
return false;
}
// Validation Prénom
if(document.prez.prenom.value == "")
{
alert ('Vous n\'avez pas remplis le champ concernant votre prénom !');
document.prez.prenom.focus();
return false;
}
// Validation Age
if(document.prez.age.value == "")
{
alert ('Vous n\'avez pas remplis le champ concernant votre âge !');
document.prez.age.focus();
return false;
}
// Validation Temps de Jeu à DoD:S
if(document.prez.debut.value == "")
{
alert ('Vous n\'avez pas remplis le champ concernant votre temps de jeu à DoD: Source !');
document.prez.debut.focus();
return false;
}
// Si tout est ok, on envoit !
else {return true;}
}
</script>
<div class="formulaire">
<div class="blockform">
<h2><span>Se présenter sur <?php echo $pun_config['o_board_title']; ?></span></h2>
<div class="box">
<form name="prez" method="post" action="<?php echo $PHP_SELF."?fid=".$forum_de_prez; ?>" onsubmit="return validation();">
<center>
<br /><br />Remplissez les champs ci-dessous, validez et le module va créer automatiquement le post !<br />
</center>
<div class="inform">
<input type="hidden" name="form_sent" value="1" />
<fieldset>
<legend>Intitulé du topic:</legend>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Nom du sujet de la nouvelle discussion:</th>
<td>
<input type="text" name="req_subject" size="50" maxlength="255" value="" />
<span>Veuillez entrer ici le nom de la nouvelle discussion qui va être créée suite à ce formulaire.<br />
Le titre doit être de la forme: "Présentation de <?php echo pun_htmlspecialchars($pun_user['username']);?>" (sans les guillemets).<br />
Il vous suffit donc de faire un copier/coller...</span>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<div class="inform">
<fieldset>
<legend>Vous:</legend>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Votre prénom:</th>
<td>
<input type="text" name="prenom" size="50" maxlength="255" value="" />
<span></span>
</td>
</tr>
</table>
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Votre pseudo:</th>
<td>
<input type="text" readonly="readonly" name="pseudo" size="50" maxlength="255" value="<?php echo pun_htmlspecialchars($pun_user['username']);?>" />
<span>Votre pseudo est reconnu automatiquement par le formulaire.<br />
<strong>Vous ne pouvez pas le changer !</strong></span>
</td>
</tr>
</table>
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Quel âge avez-vous ?</th>
<td>
<input type="text" name="age" size="3" maxlength="2" value="" /> Ans.
<span></span>
</td>
</tr>
</table>
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Où habitez-vous ?</th>
<td>
<input type="text" name="localisation" size="50" maxlength="255" value="" />
<span></span>
</td>
</tr>
</table>
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Que faites-vous dans la vie ?</th>
<td>
<input type="text" name="emploi" size="50" maxlength="255" value="" />
<span></span>
</td>
</tr>
</table>
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Qu'aimez-vous faire ?</th>
<td>
<input type="text" name="loisir" size="50" maxlength="255" value="" />
<span></span>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<div class="inform">
<fieldset>
<legend>DoD: Source & Vous:</legend>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Depuis combien de temps jouez-vous à DoD:Source ? </th>
<td>
<input type="text" name="debut" size="50" maxlength="255" value="" />
<span></span>
</td>
</tr>
</table>
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Quel est votre level ?</th>
<td>
<select name="level">
<option value="Big Noob" selected="selected">Big Noob</option> //Big Noob par défaut
<option value="Low -">Low -</option>
<option value="Low">Low</option>
<option value="Low +">Low +</option>
<option value="Middle -">Middle -</option>
<option value="Middle">Middle</option>
<option value="Middle +">Middle +</option>
<option value="High -">High -</option>
<option value="High">High</option>
<option value="ProGamer (PGM)">ProGamer (PGM)</option>
</select>
<span></span>
</td>
</tr>
</table>
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Quelle est votre Team ?</th>
<td>
<input type="text" name="team" size="50" maxlength="255" value="**2.REP**" />
<span>Indiquez ici le nom de votre team.<br />
Si vous faites parti de notre team **2.REP**, le nom est déjà indiqué ;)</span>
</td>
</tr>
</table>
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Attitude au combat:</th>
<td>
<select name="attitude">
<option value="Solo">Solo</option>
<option value="En Équipe" selected="selected">En Équipe</option>
</select>
<select name="attitude1">
<option value="Défensif">Défensif</option>
<option value="Offensif">Offensif</option>
</select>
<input type="text" name="attitude_autres" value="Autres..." size="21" maxlength="255" />
<span>Veuillez sélectionner vos attitudes au combat.<br />
Si vous avez autre chose à ajouter, faites-le dans la dernière case.</span>
</td>
</tr>
</table>
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Quel type de map jouez-vous ?</th>
<td>
<select name="map">
<option value="Officielles" selected="selected">Officielles</option>
<option value="Customs">Customs</option>
</select>
<input type="text" name="map_autres" id="map" value="Autres..." size="35" maxlength="255" />
<span>Veuillez sélectionner le type de map que vous préférez.<br />
Si vous avez autre chose à ajouter, faites-le dans la dernière case.</span>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<div class="inform">
<fieldset>
<legend>Autres:</legend>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">A quel(s) autre(s) jeu(x) jouez-vous ?</th>
<td>
<input type="text" name="jeux" size="50" maxlength="255" value="" />
<span></span>
</td>
</tr>
</table>
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Vous préférez quel type de jeux ?</th>
<td>
<select name="type_jeux">
<option value="Solo">Solo</option>
<option value="Multijoueurs" selected="selected">Multijoueurs</option>
</select>
<input type="text" name="jeux_autres" id="jeux" value="Autres..." size="33" maxlength="255" />
<span>Veuillez sélectionner le type de jeux que vous préférez.<br />
Si vous avez autre chose à ajouter, faites-le dans la dernière case.</span>
</td>
</tr>
</table>
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Ce que vous avez à ajouter qui ne rentre dans aucune autre partie:</th>
<td>
<textarea name="autres" rows="3" cols="55"></textarea>
<span>Indiquez ici tous ce que vous avez à dire qui ne rentre dans aucune autre partie.</span>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
<div class="inform">
<fieldset>
<legend>Création du post:</legend>
<div class="infldset">
<table class="aligntop" cellspacing="0">
<tr>
<th scope="row">Créer le post:</th>
<td>
<span style="color: #FF0000;"><b>/!\ Attention /!\</b><br />
La génération de la présentation va créer automatiquement le post.<br />
Veillez à bien avoir remplir tous les champs et à relire avant de Créer le post...</span>
<br />
<p><input type="reset" name="reset" value="Remettre à zéro" /><input type="submit" name="update" value="Créer !" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
<br />
<span style="color: #525151;">(Module créé par <b>DaEmOn_KiLLeR</b> et modifié par Versace 69)</span>
<span></span>
</td>
</tr>
</table>
</div>
</fieldset>
</div>
</form>
</div>
</div>
</div>
<?php
?>
<?php
}
} //close if statement
require PUN_ROOT.'footer.php'; |
Partager