Outils pour utilisateurs

Outils du site


site:creation

HTML

Type Mime d'un fichier

Pour envoyer des fichiers, il faut connaitre son mime type:

Type Mime d'un fichier

Encodage & Caractère spéciaux

Forum phpBB

Référencement

Optimisation des titres de page

Ouvrez le fichier viewtopic.php, et remplacez

Code:

$page_title = $lang['View_topic'] .' - ' . $topic_title;

Par :

Code:

$page_title = $topic_title;

Fichier robots.txt

Permet d'empêcher la redondance des pages sur les moteurs de recherche.

User-agent: *
Disallow: /admin/
Disallow: /db/
Disallow: /images/
Disallow: /includes/
Disallow: /language/
Disallow: /templates/
Disallow: /common.php
Disallow: /config.php
Disallow: /faq.php
Disallow: /groupcp.php
Disallow: /login.php
Disallow: /memberlist.php
Disallow: /modcp.php
Disallow: /posting.php
Disallow: /privmsg.php
Disallow: /profile.php
Disallow: /search.php
Disallow: /viewonline.php

Supprimer le sid dans les url pour les invités

  Le meilleur mod pour faire ceci est Guest Sessions Mod de CyberAlien , qui suit :
################################################################# 
## MOD Title: Guest Sessions MOD 
## MOD Version: 0.04 
## MOD Author: CyberAlien <[email protected]_email> (Vjacheslav Trushkin) http://www.phpbbstyles.com 
## MOD Description: 
##      This mod removes session id for guests from url and this way 
##      guests who don't have cookies like different robots will use 
##      correct urls. It can be used to allow googlebot and other 
##      search engines to spider your forum correctly. 
## 
## Installation Level:   Easy 
## Installation Time:   1-2 Minutes 
## Files To Edit (1): includes/sessions.php 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ OPEN ]--------------------------------------------- 
# 
includes/sessions.php 
 
# 
#-----[ FIND ]--------------------------------------------- 
# around line 157 
   $sql = "UPDATE " . SESSIONS_TABLE . " 
      SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login, session_admin = $admin 
      WHERE session_id = '" . $session_id . "' 
         AND session_ip = '$user_ip'"; 
 
# 
#-----[ REPLACE WITH ]--------------------------------------- 
# 
   $sql_ip = $user_id == ANONYMOUS ? " AND session_ip = '$user_ip'" : ''; 
   $sql = "UPDATE " . SESSIONS_TABLE . " 
      SET session_ip = '$user_ip', session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login, session_admin = $admin 
      WHERE session_id = '" . $session_id . "' $sql_ip 
         AND session_user_id = '$user_id'"; 
 
# 
#-----[ FIND ]--------------------------------------------- 
# around line 210 
   $SID = 'sid=' . $session_id; 
 
# 
#-----[ REPLACE WITH ]--------------------------------------- 
# 
   $SID = $user_id > 0 ? 'sid=' . $session_id : ''; 
 
# 
#-----[ FIND ]--------------------------------------------- 
# around line 288 
            $SID = ($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : ''; 
 
# 
#-----[ REPLACE WITH ]--------------------------------------- 
# 
            $SID = $userdata['user_id'] > 0 ? (($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : '') : ''; 
 
# 
#-----[ FIND ]--------------------------------------------- 
# around line 340 
   // 
   // If we reach here then no (valid) session exists. So we'll create a new one, 
# 
#-----[ BEFORE, ADD ]--------------------------------------- 
# 
   elseif(empty($sessiondata)) 
   { 
      // try to login guest 
      $sql = "SELECT u.*, s.* 
         FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u 
         WHERE s.session_ip = '$user_ip' 
            AND s.session_user_id = " . ANONYMOUS . " 
            AND u.user_id = s.session_user_id 
               LIMIT 0, 1"; 
      if ( !($result = $db->sql_query($sql)) ) 
      { 
         message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql); 
      } 
 
      $userdata = $db->sql_fetchrow($result); 
 
      if ( isset($userdata['user_id']) ) 
      { 
         if ( $current_time - $userdata['session_time'] > 60 ) 
         { 
            $sql = "UPDATE " . SESSIONS_TABLE . " 
               SET session_time = $current_time, session_start = $current_time, session_page = 0 
               WHERE session_id = '" . $userdata['session_id'] . "'"; 
            if ( !$db->sql_query($sql) ) 
            { 
               message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql); 
            } 
         } 
         return $userdata; 
      } 
   } 
 
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM

PHP

Supprimer les fichiers FTP protégés

Fichier “effaceFichier.php” à mettre à la racine

<?php
// Supprimer un fichier ou dossier FTP via son navigateur par
// l'adresse: http://localhost/effaceFichier.php?x=dossier/fichier.ext
 
$xx=$_GET['x'];
if($xx==''){ die("Paramètre x oublié"); }
 
// si fichier
if(is_file($xx)){
chmod($xx,0777);
unlink($xx);
exit;
}
// si dossier
$xx=$_GET['x'].'/';
if(is_dir($xx)){
chmod($xx,0777);
$question=opendir($xx); // vider tout son contenu
while($fichier=readdir($question)){
 if(is_file($xx.$fichier)){
  chmod($xx.$fichier,0777);
  unlink($xx.$fichier); }
 }
closedir($question);
rmdir($xx);
}
?>

Usage:

  • pour un fichier “foo.txt”
      http://localhost/effaceFichier.php?x=foo.txt
  • pour un dossier “fuu”
      http://localhost/effaceFichier.php?x=fuu
  • pour un fichier “foo.txt” qui se trouve dans un dossier “fuu”
      http://localhost/effaceFichier.php?x=fuu/foo.txt
      
      

Gestion des messages d'erreurs en production

Utiliser le script suivant avec un parametrage dans le fichier de propriete

if( $state == "testing" ){
 ini_set( "display_errors", "1" );
 error_reporting( E_ALL & ~E_NOTICE );
} else { // production
 error_reporting( 0 );
}
site/creation.txt · Dernière modification: 2012/02/10 23:24 (modification externe)