====== Hacks et modifications effectuées sur Punbb ======
===== Swisslinux.org's templates =====
include/template/
|-> admin.tpl
|-> help.tpl
|-> main.tpl
|-> redirect.tpl
|-> maintenance.tpl
style/
|-> Swisslinux.css
|-> import/
|-> Swisslinux_cs.css
|-> base.css
===== Configuration =====
./
|-> conf.php
===== Navlinks modification =====
include/
|-> functions.php
===== "Modéré par" removed =====
./
|-> index.php
===== Copyright mention removed =====
./
|-> footer.php
===== Language files =====
/lang/
|-> French_UTF8
|-> German_UTF8
|-> Italian_UTF8
Converterd to UTF-8 from the iso8859-1 packages.
===== Language autoswitcher =====
In include/functions.php line 56 added
/** Swisslinux.org language switcher **/
require_once('/home/g-swisslinux/www/static.swisslinux.org/inc/templates/default/sl_l10n_getlang.inc.php');
$pun_user['language'] = sl_getlang();
// Set a default language if the user selected language no longer exists
[...]
Line 125 replaced
$pun_user['language'] = $pun_config['o_default_lang'];
by
/** Swisslinux.org language switcher **/
require_once('/home/g-swisslinux/www/static.swisslinux.org/inc/templates/default/sl_l10n_getlang.inc.php');
$pun_user['language'] = sl_getlang();
===== Symlinks created =====
include/
|-> user --> static.swisslinux.org/inc/
./
|-> images --> static.swisslinux.org/images/
|-> css --> static.swisslinux.org/css/
/lang/ (to switch the languages)
|-> fr --> French_UTF8
|-> de --> German_UTF8
|-> it --> Italian_UTF8
|-> en --> English
===== Avatar =====
./
|-> viewtopic.php
Replaced ''$user_avatar=""''; by ''$user_avatar=" "'' to avoid having an empty ''
$subject_truncated = pun_htmlspecialchars(trim(mb_strcut( $cur_topic['subject'], 0 , ($max_subject_length-5), "UTF-8" ))).'…';
// old version not able to handle UTF-8
//pun_htmlspecialchars(trim(substr($cur_topic['subject'], 0, ($max_subject_length-5)))).' …';
Replace the require function for the file functions.php and common_db.php by require_once, to avoid errors.
===== Icons =====
See [[.punbb:icones]]
===== RSS =====
See [[.punbb:rss]]
===== Easy BB code =====
http://www.punres.org/desc.php?pid=50
Add an edition bar to the message edition formular.
post.php : Line 493 replaced with
edit.php : Line 210 replace with
===== Login =====
./login.php
Modification pour le système de login "universel" de Swisslinux.org :
redirect(htmlspecialchars($_POST['redirect_url']), $lang_login['Login redirect']);
[ou]
header('Location: index.php');
ont été remplacé par :
// Go back to the right page
header('Location:'.$_SERVER['HTTP_REFERER']);
ligne 194 supprimé :
// Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to index.php after login)
$redirect_url = (isset($_SERVER['HTTP_REFERER']) && preg_match('#^'.preg_quote($pun_config['o_base_url']).'/(.*?)\.php#i', $_SERVER['HTTP_REFERER'])) ? htmlspecialchars($_SERVER['HTTP_REFERER']) : 'index.php';
ligne 212 supprimé :
===== Changement de l'ordre des catégories selon la langue =====
=== config.php ===
Ajouter le code suivant à la fin du fichier
//Ajoute les option pour l'ordre de la langue ! (si une langue n'est pas dans la liste il prendra l'ordre par défaut)
//!!!!!!!!!!!!!!! Attention !!!!!!!!!!!!!!!!!
//Avant d'ajouter une langue il faut crée un champ "disp_position_" dans la table "categories"
// = abréviation de la langue
$lng_disp = array("en","de","it");
=== index.php ===
== Pour changer l'ordre d'affichage. ==
Remplacer ce code
// Print the categories and forums
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id 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 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
Par ce code
// Si il y a une configuration spécial pour la langue de l'utilisateur changer la requete SQL
if (in_array($pun_user['language'],$lng_disp)) $compSQL = "_".$pun_user['language'];
// Print the categories and forums
$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id 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 ORDER BY c.disp_position'.$compSQL.' , c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
=== admin_categories.php ===
== Pour l'ajout dans l'interface d'administration ==
Remplacer
$result = $db->query('SELECT id, disp_position FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Unable to fetch category list', __FILE__, __LINE__, $db->error());
par ce code
// Ajoute la recherche de tout les champs
$compSQL="";// init var
for ($i=0;$iquery('SELECT id, disp_position'.$compSQL.' FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Unable to fetch category list', __FILE__, __LINE__, $db->error());
----
Remplacer
$db->query('UPDATE '.$db->prefix.'categories SET cat_name=\''.$db->escape($cat_name[$i]).'\', disp_position='.$cat_order[$i].' WHERE id='.$cat_id) or error('Unable to update category', __FILE__, __LINE__, $db->error());
Par ce code
// Ajoute la modification de tout les champs
$compSQL="";// init var
for ($w=0;$wquery('UPDATE '.$db->prefix.'categories SET cat_name=\''.$db->escape($cat_name[$i]).'\', disp_position='.$cat_order[$i].$compSQL.' WHERE id='.$cat_id) or error('Unable to update category', __FILE__, __LINE__, $db->error());
----
Remplacer
// Generate an array with all categories
$result = $db->query('SELECT id, cat_name, disp_position FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Unable to fetch category list', __FILE__, __LINE__, $db->error());
$num_cats = $db->num_rows($result);
Par ce code
// Ajoute la recherche de tout les champs
$compSQL="";// init var
for ($i=0;$iquery('SELECT id, cat_name, disp_position'.$compSQL.' FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Unable to fetch category list', __FILE__, __LINE__, $db->error());
$num_cats = $db->num_rows($result);
----
Remplacer :
Position
Par ce code
Position
Position ".$lng_disp[$i].""; ?>
-----
Puis remplacer :
list(, list($cat_id, $cat_name, $position)) = @each($cat_list);
?>
Par ce code
list(, list($cat_id, $cat_name, $position)) = @each($cat_list);
?>
"; ?>
====== Pour désactiver les courriels entre utilisateurs. ======
=== misc.php ===
--- misc.php.old
+++ misc.php
@@ -72,6 +72,10 @@
else if (isset($_GET['email']))
{
+ /* Modification par OdyX le 2 juillet 2009 pour éviter les mails entre personnes */
+ message($lang_common['No user2user mail']);
+ /* FIN */
+
if ($pun_user['is_guest'])
message($lang_common['No permission']);
=== profile.php ===
--- profile.php.old 2009-07-02 18:12:51.000000000 +0200
+++ profile.php 2009-07-02 18:11:20.000000000 +0200
@@ -915,7 +915,10 @@
if ($user['email_setting'] == '0' && !$pun_user['is_guest'])
$email_field = ''.$user['email'].'';
else if ($user['email_setting'] == '1' && !$pun_user['is_guest'])
- $email_field = ''.$lang_common['Send e-mail'].'';
+ /* Modification faite par OdyX le 2 juillet 2009 pour eviter les courriels entre utilisateurs */
+ // $email_field = ''.$lang_common['Send e-mail'].'';
+ $email_field = '';
+ /* FIN */
else
$email_field = $lang_profile['Private'];
@@ -1056,7 +1059,10 @@
else
$username_field = ''.$lang_common['Username'].': '.pun_htmlspecialchars($user['username']).'
'."\n";
- $email_field = ''."\n";
+ /* Modification faite par OdyX le 2 juillet 2009 pour eviter les courriels entre utilisateurs */
+ // $email_field = ''."\n";
+ $email_field = ''."\n";
+ /* FIN */
}
else
{