FluxBB.fr

Le site des utilisateurs francophones de FluxBB.

Recherche rapide

Vous n'êtes pas identifié(e).

Version 1.4.13 : [.tar.gz][.zip] (maj 20/10/2014)
Pack langue française pour 1.4.x : [.zip] (maj 06/01/2012)

Branche 1.5.x : fluxbb.org
Pack langue française pour 1.5.x : [.zip] (maj 14/01/2016)

Ancienne Version 1.2.24 fr : [.zip] (maj 26/08/2011)

Vous avez un problème ?
Avant de poser votre question sur les forums d'entraide nous vous invitons à consulter :

#1 17-01-2014 23:46:24

alex83270
Habitué
Inscription : 06-11-2013
Messages : 162

[Mod] Simple Custom Spoiler v1

Bonjour,
j'espère réussir pour ma première mod qui a été créé à partir de :
http://fluxbb.fr/forums/viewtopic.php?id=13335

Un grand merci à David18 qui m'a énormément aidé depuis que je suis sur ce site.

Avec un peu de mélange de :
http://www.kafeinemarketing.com/collapsing-divs-jquery/

Donc voici un spoiler qui marche et personnalisable avec une séparation du teaser et du contenu caché, elle peut être aussi utilisé avec la FluxToolbar.

Il est aussi possible de créer une section dans le help.php mais je ne l'ai pas fais dans la mod.

PS : Je suis un débutant donc a mon avis des erreurs il y en aura mais pour l'instant j'en ai pas.

Download : http://www.mediafire.com/view/du2dgc4c9 … oiler).txt

Pastebin : http://pastebin.com/RQt2SzhY

Astuce : Pour ceux qui veulent changer "spoiler" par "montrer" et "cacher" voici le code :

parser.php

CHANGER L'ANCIEN CODE PAR :

	$replace[] = '<div class="spoiler"><div class="teaser"><p class="show">Montrer</p><p class="hide"><Cacher></p></div><div class="contenu">$1</div></div>'; // SPOILER




main.tpl

CHANGER L'ANCIEN CODE PAR :

// AJOUTER || SPOILER
$(document).ready(function() {
jQuery(".contenu").hide();
jQuery(".teaser").click(function()
{
jQuery(this).next(".contenu").slideToggle(500);
var title = $('.show');
if (title.text() == 'Montrer') title.text('Cacher');
else title.text('Montrer');
});
});





style.css

CHANGER L'ANCIEN CODE PAR :

 /* AJOUTER || SPOILER
 ----------------------------------------------------------------*/
div.spoiler {
	margin: 0 0 5px 0;
 }

div.teaser {
	padding: 5px 10px;
	margin-bottom: -5px;
	cursor: pointer;
	position: relative;
	background-color: rgb(35, 35, 35);
	border-top: 5px solid rgb(48, 206, 0);
	width: 7.5%;
 }
 
p.show {
	color: rgb(48, 206, 0);
	text-align: center;
	text-transform: uppercase;
	font-weight: bold;
	padding: 0px;
 }

p.hide {
	color: rgb(48, 206, 0);
	text-align: center;
	text-transform: uppercase;
	font-weight: bold;
	padding: 0px;
 }

div.contenu {
	padding: 5px 10px;
	background-color: rgb(35, 35, 35);
	color: white;
	border-top: 5px solid rgb(48, 206, 0);
 }

Exemple :

spoilervie.png

Amicalement.

Dernière modification par alex83270 (18-01-2014 19:29:58)

Hors ligne

#2 18-01-2014 00:39:56

alex83270
Habitué
Inscription : 06-11-2013
Messages : 162

Re : [Mod] Simple Custom Spoiler v1

petit problème, la balise ne suis pas le texte,
si on centre le texte la balise ne suis pas.
bugspoiler.png

Et pour les pros on peut aussi faire changer le texte qui est Spoiler par Montrer et quand on clique Cacher mais ça c'est trop pour moi big_smile

Dernière modification par alex83270 (19-01-2014 12:42:55)

Hors ligne

#3 18-01-2014 19:30:16

alex83270
Habitué
Inscription : 06-11-2013
Messages : 162

Re : [Mod] Simple Custom Spoiler v1

up

Hors ligne

#4 19-01-2014 11:23:00

david18
Habitué très actif
Lieu : France
Inscription : 28-10-2012
Messages : 467
Site Web

Re : [Mod] Simple Custom Spoiler v1

Bonjour,


je vient d'essayer et ça  a l'air d'être correcte ..  Et j'ai regardé votre site rien anormale si vous avez plus d'information a ce sujet  wink

cdlt

Dernière modification par david18 (19-01-2014 11:29:35)

Hors ligne

#5 19-01-2014 11:31:16

alex83270
Habitué
Inscription : 06-11-2013
Messages : 162

Re : [Mod] Simple Custom Spoiler v1

D'accord merci d'avoir essayé ou sinon de la mise en forme je ne comprend pas.
Voici un lien de test : http://black-omegadesign.fr/forum/viewtopic.php?id=63

Hors ligne

#6 19-01-2014 11:39:10

david18
Habitué très actif
Lieu : France
Inscription : 28-10-2012
Messages : 467
Site Web

Re : [Mod] Simple Custom Spoiler v1

oui je voulais dire pour  le décalage du texte de votre capture happy

Hors ligne

#7 19-01-2014 12:42:40

alex83270
Habitué
Inscription : 06-11-2013
Messages : 162

Re : [Mod] Simple Custom Spoiler v1

A ben je ne comprend pas car moi c'est justement comme sur la capture alors que je demande de centrer le spoiler.

Hors ligne

#8 19-01-2014 20:16:55

alex83270
Habitué
Inscription : 06-11-2013
Messages : 162

Re : [Mod] Simple Custom Spoiler v1

Réparé tout seul big_smile

Hors ligne

#9 26-01-2014 16:28:27

ReaverSX
Nouveau Membre
Inscription : 26-01-2014
Messages : 2

Re : [Mod] Simple Custom Spoiler v1

Bonjour,

j'ai installer votre mod spoilers sur fluxbb 1.5.6 j'ai fait les modif nécessaire cepandant mon spoiler ne marche pas, le contenu du spoiler n'est pas masqué :

L’aperçu de mon problème en question:

912607spoiler.jpg

J'ai fait des recherches sur le forum ca doit être lié a JQUERY dans le main.tpl mais je suis pas sur :

Voila un aperçue du main :

<!-- ADD JQUERY -->

	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
	<script> // AJOUTER || SPOILER
		$(document).ready(function() {
		jQuery(".contenu").hide();
		jQuery(".teaser").click(function()
		{
		jQuery(this).next(".contenu").slideToggle(500);
		var title = $('.show');
		if (title.text() == 'Montrer') title.text('Cacher');
		else title.text('Montrer');
		});
		});
	</script>

<!-- END ADD -->

Si quelqu'un connait à une solution je suis preneur  smile

Cordialement

Dernière modification par ReaverSX (26-01-2014 19:41:43)

Hors ligne

#10 26-01-2014 20:49:22

david18
Habitué très actif
Lieu : France
Inscription : 28-10-2012
Messages : 467
Site Web

Re : [Mod] Simple Custom Spoiler v1

Bonsoir,


Avez vous un lien de votre site pour voir et sinon avez vous bien suivi le tuto ?

et je vous laisse un exemple  que j'ai fait en local :

##   Affected files: 
                                              include/search_idx.php
##                                        include/parser.php
##                                        

##                                        include/template/main.tpl

include/search_idx.php

<?php

/**
 * Copyright (C) 2008-2012 FluxBB
 * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
 * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
 */

// The contents of this file are very much inspired by the file functions_search.php
// from the phpBB Group forum software phpBB2 (http://www.phpbb.com)


// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
	exit;


// Make a regex that will match CJK or Hangul characters
define('PUN_CJK_HANGUL_REGEX', '['.
	'\x{1100}-\x{11FF}'.		// Hangul Jamo							1100-11FF		(http://www.fileformat.info/info/unicode/block/hangul_jamo/index.htm)
	'\x{3130}-\x{318F}'.		// Hangul Compatibility Jamo			3130-318F		(http://www.fileformat.info/info/unicode/block/hangul_compatibility_jamo/index.htm)
	'\x{AC00}-\x{D7AF}'.		// Hangul Syllables						AC00-D7AF		(http://www.fileformat.info/info/unicode/block/hangul_syllables/index.htm)

	// Hiragana
	'\x{3040}-\x{309F}'.		// Hiragana								3040-309F		(http://www.fileformat.info/info/unicode/block/hiragana/index.htm)

	// Katakana
	'\x{30A0}-\x{30FF}'.		// Katakana								30A0-30FF		(http://www.fileformat.info/info/unicode/block/katakana/index.htm)
	'\x{31F0}-\x{31FF}'.		// Katakana Phonetic Extensions			31F0-31FF		(http://www.fileformat.info/info/unicode/block/katakana_phonetic_extensions/index.htm)

	// CJK Unified Ideographs	(http://en.wikipedia.org/wiki/CJK_Unified_Ideographs)
	'\x{2E80}-\x{2EFF}'.		// CJK Radicals Supplement				2E80-2EFF		(http://www.fileformat.info/info/unicode/block/cjk_radicals_supplement/index.htm)
	'\x{2F00}-\x{2FDF}'.		// Kangxi Radicals						2F00-2FDF		(http://www.fileformat.info/info/unicode/block/kangxi_radicals/index.htm)
	'\x{2FF0}-\x{2FFF}'.		// Ideographic Description Characters	2FF0-2FFF		(http://www.fileformat.info/info/unicode/block/ideographic_description_characters/index.htm)
	'\x{3000}-\x{303F}'.		// CJK Symbols and Punctuation			3000-303F		(http://www.fileformat.info/info/unicode/block/cjk_symbols_and_punctuation/index.htm)
	'\x{31C0}-\x{31EF}'.		// CJK Strokes							31C0-31EF		(http://www.fileformat.info/info/unicode/block/cjk_strokes/index.htm)
	'\x{3200}-\x{32FF}'.		// Enclosed CJK Letters and Months		3200-32FF		(http://www.fileformat.info/info/unicode/block/enclosed_cjk_letters_and_months/index.htm)
	'\x{3400}-\x{4DBF}'.		// CJK Unified Ideographs Extension A	3400-4DBF		(http://www.fileformat.info/info/unicode/block/cjk_unified_ideographs_extension_a/index.htm)
	'\x{4E00}-\x{9FFF}'.		// CJK Unified Ideographs				4E00-9FFF		(http://www.fileformat.info/info/unicode/block/cjk_unified_ideographs/index.htm)
	'\x{20000}-\x{2A6DF}'.		// CJK Unified Ideographs Extension B	20000-2A6DF		(http://www.fileformat.info/info/unicode/block/cjk_unified_ideographs_extension_b/index.htm)
']');


//
// "Cleans up" a text string and returns an array of unique words
// This function depends on the current locale setting
//
function split_words($text, $idx)
{
	 // Remove BBCode // MODIFIED ||SPOILER
        $text = preg_replace('%\[/?(spoiler|b|u|s|ins|del|em|i|h|colou?r|quote|code|img|url|email|list|topic|post|forum|user)(?:\=[^\]]*)?\]%', ' ', $text);

	// Remove any apostrophes or dashes which aren't part of words
	$text = substr(ucp_preg_replace('%((?<=[^\p{L}\p{N}])[\'\-]|[\'\-](?=[^\p{L}\p{N}]))%u', '', ' '.$text.' '), 1, -1);

	// Remove punctuation and symbols (actually anything that isn't a letter or number), allow apostrophes and dashes (and % * if we aren't indexing)
	$text = ucp_preg_replace('%(?![\'\-'.($idx ? '' : '\%\*').'])[^\p{L}\p{N}]+%u', ' ', $text);

	// Replace multiple whitespace or dashes
	$text = preg_replace('%(\s){2,}%u', '\1', $text);

	// Fill an array with all the words
	$words = array_unique(explode(' ', $text));

	// Remove any words that should not be indexed
	foreach ($words as $key => $value)
	{
		// If the word shouldn't be indexed, remove it
		if (!validate_search_word($value, $idx))
			unset($words[$key]);
	}

	return $words;
}


//
// Checks if a word is a valid searchable word
//
function validate_search_word($word, $idx)
{
	static $stopwords;

	// If the word is a keyword we don't want to index it, but we do want to be allowed to search it
	if (is_keyword($word))
		return !$idx;

	if (!isset($stopwords))
	{
		if (file_exists(FORUM_CACHE_DIR.'cache_stopwords.php'))
			include FORUM_CACHE_DIR.'cache_stopwords.php';

		if (!defined('PUN_STOPWORDS_LOADED'))
		{
			if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
				require PUN_ROOT.'include/cache.php';

			generate_stopwords_cache();
			require FORUM_CACHE_DIR.'cache_stopwords.php';
		}
	}

	// If it is a stopword it isn't valid
	if (in_array($word, $stopwords))
		return false;

	// If the word is CJK we don't want to index it, but we do want to be allowed to search it
	if (is_cjk($word))
		return !$idx;

	// Exclude % and * when checking whether current word is valid
	$word = str_replace(array('%', '*'), '', $word);

	// Check the word is within the min/max length
	$num_chars = pun_strlen($word);
	return $num_chars >= PUN_SEARCH_MIN_WORD && $num_chars <= PUN_SEARCH_MAX_WORD;
}


//
// Check a given word is a search keyword.
//
function is_keyword($word)
{
	return $word == 'and' || $word == 'or' || $word == 'not';
}


//
// Check if a given word is CJK or Hangul.
//
function is_cjk($word)
{
	return preg_match('%^'.PUN_CJK_HANGUL_REGEX.'+$%u', $word) ? true : false;
}


//
// Strip [img] [url] and [email] out of the message so we don't index their contents
//
function strip_bbcode($text)
{
	static $patterns;

	if (!isset($patterns))
	{
		$patterns = array(
			'%\[img=([^\]]*+)\]([^[]*+)\[/img\]%'									=>	'$2 $1',	// Keep the url and description
			'%\[(url|email)=([^\]]*+)\]([^[]*+(?:(?!\[/\1\])\[[^[]*+)*)\[/\1\]%'	=>	'$2 $3',	// Keep the url and text
			'%\[(img|url|email)\]([^[]*+(?:(?!\[/\1\])\[[^[]*+)*)\[/\1\]%'			=>	'$2',		// Keep the url
			'%\[(topic|post|forum|user)\][1-9]\d*\[/\1\]%'							=>	' ',		// Do not index topic/post/forum/user ID
		);
	}

	return preg_replace(array_keys($patterns), array_values($patterns), $text);
}


//
// Updates the search index with the contents of $post_id (and $subject)
//
function update_search_index($mode, $post_id, $message, $subject = null)
{
	global $db_type, $db;

	$message = utf8_strtolower($message);
	$subject = utf8_strtolower($subject);

	// Remove any bbcode that we shouldn't index
	$message = strip_bbcode($message);

	// Split old and new post/subject to obtain array of 'words'
	$words_message = split_words($message, true);
	$words_subject = ($subject) ? split_words($subject, true) : array();

	if ($mode == 'edit')
	{
		$result = $db->query('SELECT w.id, w.word, m.subject_match FROM '.$db->prefix.'search_words AS w INNER JOIN '.$db->prefix.'search_matches AS m ON w.id=m.word_id WHERE m.post_id='.$post_id, true) or error('Unable to fetch search index words', __FILE__, __LINE__, $db->error());

		// Declare here to stop array_keys() and array_diff() from complaining if not set
		$cur_words['post'] = array();
		$cur_words['subject'] = array();

		while ($row = $db->fetch_row($result))
		{
			$match_in = ($row[2]) ? 'subject' : 'post';
			$cur_words[$match_in][$row[1]] = $row[0];
		}

		$db->free_result($result);

		$words['add']['post'] = array_diff($words_message, array_keys($cur_words['post']));
		$words['add']['subject'] = array_diff($words_subject, array_keys($cur_words['subject']));
		$words['del']['post'] = array_diff(array_keys($cur_words['post']), $words_message);
		$words['del']['subject'] = array_diff(array_keys($cur_words['subject']), $words_subject);
	}
	else
	{
		$words['add']['post'] = $words_message;
		$words['add']['subject'] = $words_subject;
		$words['del']['post'] = array();
		$words['del']['subject'] = array();
	}

	unset($words_message);
	unset($words_subject);

	// Get unique words from the above arrays
	$unique_words = array_unique(array_merge($words['add']['post'], $words['add']['subject']));

	if (!empty($unique_words))
	{
		$result = $db->query('SELECT id, word FROM '.$db->prefix.'search_words WHERE word IN(\''.implode('\',\'', array_map(array($db, 'escape'), $unique_words)).'\')', true) or error('Unable to fetch search index words', __FILE__, __LINE__, $db->error());

		$word_ids = array();
		while ($row = $db->fetch_row($result))
			$word_ids[$row[1]] = $row[0];

		$db->free_result($result);

		$new_words = array_diff($unique_words, array_keys($word_ids));
		unset($unique_words);

		if (!empty($new_words))
		{
			switch ($db_type)
			{
				case 'mysql':
				case 'mysqli':
				case 'mysql_innodb':
				case 'mysqli_innodb':
					$db->query('INSERT INTO '.$db->prefix.'search_words (word) VALUES(\''.implode('\'),(\'', array_map(array($db, 'escape'), $new_words)).'\')');
					break;

				default:
					foreach ($new_words as $word)
						$db->query('INSERT INTO '.$db->prefix.'search_words (word) VALUES(\''.$db->escape($word).'\')');
					break;
			}
		}

		unset($new_words);
	}

	// Delete matches (only if editing a post)
	foreach ($words['del'] as $match_in => $wordlist)
	{
		$subject_match = ($match_in == 'subject') ? 1 : 0;

		if (!empty($wordlist))
		{
			$sql = '';
			foreach ($wordlist as $word)
				$sql .= (($sql != '') ? ',' : '').$cur_words[$match_in][$word];

			$db->query('DELETE FROM '.$db->prefix.'search_matches WHERE word_id IN('.$sql.') AND post_id='.$post_id.' AND subject_match='.$subject_match) or error('Unable to delete search index word matches', __FILE__, __LINE__, $db->error());
		}
	}

	// Add new matches
	foreach ($words['add'] as $match_in => $wordlist)
	{
		$subject_match = ($match_in == 'subject') ? 1 : 0;

		if (!empty($wordlist))
			$db->query('INSERT INTO '.$db->prefix.'search_matches (post_id, word_id, subject_match) SELECT '.$post_id.', id, '.$subject_match.' FROM '.$db->prefix.'search_words WHERE word IN(\''.implode('\',\'', array_map(array($db, 'escape'), $wordlist)).'\')') or error('Unable to insert search index word matches', __FILE__, __LINE__, $db->error());
	}

	unset($words);
}


//
// Strip search index of indexed words in $post_ids
//
function strip_search_index($post_ids)
{
	global $db_type, $db;

	switch ($db_type)
	{
		case 'mysql':
		case 'mysqli':
		case 'mysql_innodb':
		case 'mysqli_innodb':
		{
			$result = $db->query('SELECT word_id FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.') GROUP BY word_id') or error('Unable to fetch search index word match', __FILE__, __LINE__, $db->error());

			if ($db->num_rows($result))
			{
				$word_ids = '';
				while ($row = $db->fetch_row($result))
					$word_ids .= ($word_ids != '') ? ','.$row[0] : $row[0];

				$result = $db->query('SELECT word_id FROM '.$db->prefix.'search_matches WHERE word_id IN('.$word_ids.') GROUP BY word_id HAVING COUNT(word_id)=1') or error('Unable to fetch search index word match', __FILE__, __LINE__, $db->error());

				if ($db->num_rows($result))
				{
					$word_ids = '';
					while ($row = $db->fetch_row($result))
						$word_ids .= ($word_ids != '') ? ','.$row[0] : $row[0];

					$db->query('DELETE FROM '.$db->prefix.'search_words WHERE id IN('.$word_ids.')') or error('Unable to delete search index word', __FILE__, __LINE__, $db->error());
				}
			}

			break;
		}

		default:
			$db->query('DELETE FROM '.$db->prefix.'search_words WHERE id IN(SELECT word_id FROM '.$db->prefix.'search_matches WHERE word_id IN(SELECT word_id FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.') GROUP BY word_id) GROUP BY word_id HAVING COUNT(word_id)=1)') or error('Unable to delete from search index', __FILE__, __LINE__, $db->error());
			break;
	}

	$db->query('DELETE FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.')') or error('Unable to delete search index word match', __FILE__, __LINE__, $db->error());
}

   include/parser.php

<?php

/**
 * Copyright (C) 2008-2012 FluxBB
 * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
 * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
 */

// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
	exit;

// Global variables
/* regular expression to match nested BBCode LIST tags
'%
\[list                # match opening bracket and tag name of outermost LIST tag
(?:=([1a*]))?+        # optional attribute capture in group 1
\]                    # closing bracket of outermost opening LIST tag
(                     # capture contents of LIST tag in group 2
  (?:                 # non capture group for either contents or whole nested LIST
	[^\[]*+           # unroll the loop! consume everything up to next [ (normal *)
	(?:               # (See "Mastering Regular Expressions" chapter 6 for details)
	  (?!             # negative lookahead ensures we are NOT on [LIST*] or [/list]
		\[list        # opening LIST tag
		(?:=[1a*])?+  # with optional attribute
		\]            # closing bracket of opening LIST tag
		|             # or...
		\[/list\]     # a closing LIST tag
	  )               # end negative lookahead assertion (we are not on a LIST tag)
	  \[              # match the [ which is NOT the start of LIST tag (special)
	  [^\[]*+         # consume everything up to next [ (normal *)
	)*+               # finish up "unrolling the loop" technique (special (normal*))*
  |                   # or...
	(?R)              # recursively match a whole nested LIST element
  )*                  # as many times as necessary until deepest nested LIST tag grabbed
)                     # end capturing contents of LIST tag into group 2
\[/list\]             # match outermost closing LIST tag
%iex' */
$re_list = '%\[list(?:=([1a*]))?+\]((?:[^\[]*+(?:(?!\[list(?:=[1a*])?+\]|\[/list\])\[[^\[]*+)*+|(?R))*)\[/list\]%i';

// Here you can add additional smilies if you like (please note that you must escape single quote and backslash)
$smilies = array(
	':)' => 'smile.png',
	'=)' => 'smile.png',
	':|' => 'neutral.png',
	'=|' => 'neutral.png',
	':(' => 'sad.png',
	'=(' => 'sad.png',
	':D' => 'big_smile.png',
	'=D' => 'big_smile.png',
	':o' => 'yikes.png',
	':O' => 'yikes.png',
	';)' => 'wink.png',
	':/' => 'hmm.png',
	':P' => 'tongue.png',
	':p' => 'tongue.png',
	':lol:' => 'lol.png',
	':mad:' => 'mad.png',
	':rolleyes:' => 'roll.png',
	':cool:' => 'cool.png');

//
// Make sure all BBCodes are lower case and do a little cleanup
//
function preparse_bbcode($text, &$errors, $is_signature = false)
{
	global $pun_config, $lang_common, $lang_post, $re_list;

	// Remove empty tags
	while (($new_text = strip_empty_bbcode($text)) !== false)
	{
		if ($new_text != $text)
		{
			$text = $new_text;
			if ($new_text == '')
			{
				$errors[] = $lang_post['Empty after strip'];
				return '';
			}
		}
		else
			break;
	}

	if ($is_signature)
	{
		global $lang_profile;

		 // MODIFIED ||SPOILER
                if (preg_match('%\[/?(?:spoiler|quote|code|list|h)\b[^\]]*\]%i', $text))
                        $errors[] = $lang_profile['Signature quote/code/list/h'];
	}

	// If the message contains a code tag we have to split it up (text within  shouldn't be touched)
	if (strpos($text, '[code]') !== false && strpos($text, '[/code]') !== false)
		list($inside, $text) = extract_blocks($text, '[code]', '[/code]');

	// Tidy up lists
	$temp = preg_replace_callback($re_list, create_function('$matches', 'return preparse_list_tag($matches[2], $matches[1]);'), $text);

	// If the regex failed
	if (is_null($temp))
		$errors[] = $lang_common['BBCode list size error'];
	else
		$text = str_replace('*'."\0".']', '*]', $temp);

	if ($pun_config['o_make_links'] == '1')
		$text = do_clickable($text);

	$temp_text = false;
	if (empty($errors))
		$temp_text = preparse_tags($text, $errors, $is_signature);

	if ($temp_text !== false)
		$text = $temp_text;

	// If we split up the message before we have to concatenate it together again (code tags)
	if (isset($inside))
	{
		$outside = explode("\1", $text);
		$text = '';

		$num_tokens = count($outside);
		for ($i = 0; $i < $num_tokens; ++$i)
		{
			$text .= $outside[$i];
			if (isset($inside[$i]))
				$text .= '[code]'.$inside[$i].'[/code]';
		}

		unset($inside);
	}

	// Remove empty tags
	while (($new_text = strip_empty_bbcode($text)) !== false)
	{
		if ($new_text != $text)
		{
			$text = $new_text;
			if ($new_text == '')
			{
				$errors[] = $lang_post['Empty after strip'];
				break;
			}
		}
		else
			break;
	}

	return pun_trim($text);
}


//
// Strip empty bbcode tags from some text
//
function strip_empty_bbcode($text)
{
	// If the message contains a code tag we have to split it up (empty tags within  are fine)
	if (strpos($text, '[code]') !== false && strpos($text, '[/code]') !== false)
		list($inside, $text) = extract_blocks($text, '[code]', '[/code]');

	  // Remove empty tags // MODIFIED ||SPOILER
        while (!is_null($new_text = preg_replace('%\[(spoiler|b|u|s|ins|del|em|i|h|colou?r|quote|img|url|email|list|topic|post|forum|user)(?:\=[^\]]*)?\]\s*\[/\1\]%', '', $text)))
	{
		if ($new_text != $text)
			$text = $new_text;
		else
			break;
	}

	// If we split up the message before we have to concatenate it together again (code tags)
	if (isset($inside))
	{
		$parts = explode("\1", $text);
		$text = '';
		foreach ($parts as $i => $part)
		{
			$text .= $part;
			if (isset($inside[$i]))
				$text .= '[code]'.$inside[$i].'[/code]';
		}
	}

	// Remove empty code tags
	while (!is_null($new_text = preg_replace('%\[(code)\]\s*\[/\1\]%', '', $text)))
	{
		if ($new_text != $text)
			$text = $new_text;
		else
			break;
	}

	return $text;
}


//
// Check the structure of bbcode tags and fix simple mistakes where possible
//
function preparse_tags($text, &$errors, $is_signature = false)
{
	global $lang_common, $pun_config, $pun_user;

	// Start off by making some arrays of bbcode tags and what we need to do with each one

	// List of all the tags // MODIFIED ||SPOILER
        $tags = array('spoiler', 'quote', 'code', 'b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'url', 'email', 'img', 'list', '*', 'h', 'topic', 'post', 'forum', 'user');
	// List of tags that we need to check are open (You could not put b,i,u in here then illegal nesting like [b][i][/b][/i] would be allowed)
	$tags_opened = $tags;
	// and tags we need to check are closed (the same as above, added it just in case)
	$tags_closed = $tags;
	// Tags we can nest and the depth they can be nested to // MODIFIED ||SPOILER
        $tags_nested = array('quote' => $pun_config['o_quote_depth'], 'list' => 5, '*' => 5, 'spoiler' => 5);
	// Tags to ignore the contents of completely (just code)
	$tags_ignore = array('code');
	// Tags not allowed
	$tags_forbidden = array();
	   // Block tags, block tags can only go within another block tag, they cannot be in a normal tag // MODIFIED ||SPOILER
        $tags_block = array('quote', 'code', 'list', 'h', '*', 'spoiler');
	// Inline tags, we do not allow new lines in these
	$tags_inline = array('b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'h', 'topic', 'post', 'forum', 'user');
	// Tags we trim interior space
	$tags_trim = array('img');
	// Tags we remove quotes from the argument
	$tags_quotes = array('url', 'email', 'img', 'topic', 'post', 'forum', 'user');
	// Tags we limit bbcode in
	$tags_limit_bbcode = array(
		'*' 	=> array('b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'url', 'email', 'list', 'img', 'code', 'topic', 'post', 'forum', 'user'),
		'list' 	=> array('*'),
		'url' 	=> array('img'),
		'email' => array('img'),
		'topic' => array('img'),
		'post'  => array('img'),
		'forum' => array('img'),
		'user'  => array('img'),
		'img' 	=> array(),
		'h'		=> array('b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'url', 'email', 'topic', 'post', 'forum', 'user'),
	);
	// Tags we can automatically fix bad nesting
	$tags_fix = array('quote', 'b', 'i', 'u', 's', 'ins', 'del', 'em', 'color', 'colour', 'url', 'email', 'h', 'topic', 'post', 'forum', 'user');

	// Disallow URL tags
	if ($pun_user['g_post_links'] != '1')
		$tags_forbidden[] = 'url';

	$split_text = preg_split('%(\[[\*a-zA-Z0-9-/]*?(?:=.*?)?\])%', $text, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);

	$open_tags = array('fluxbb-bbcode');
	$open_args = array('');
	$opened_tag = 0;
	$new_text = '';
	$current_ignore = '';
	$current_nest = '';
	$current_depth = array();
	$limit_bbcode = $tags;
	$count_ignored = array();

	foreach ($split_text as $current)
	{
		if ($current == '')
			continue;

		// Are we dealing with a tag?
		if (substr($current, 0, 1) != '[' || substr($current, -1, 1) != ']')
		{
			// It's not a bbcode tag so we put it on the end and continue
			// If we are nested too deeply don't add to the end
			if ($current_nest)
				continue;

			$current = str_replace("\r\n", "\n", $current);
			$current = str_replace("\r", "\n", $current);
			if (in_array($open_tags[$opened_tag], $tags_inline) && strpos($current, "\n") !== false)
			{
				// Deal with new lines
				$split_current = preg_split('%(\n\n+)%', $current, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
				$current = '';

				if (!pun_trim($split_current[0], "\n")) // The first part is a linebreak so we need to handle any open tags first
					array_unshift($split_current, '');

				for ($i = 1; $i < count($split_current); $i += 2)
				{
					$temp_opened = array();
					$temp_opened_arg = array();
					$temp = $split_current[$i - 1];
					while (!empty($open_tags))
					{
						$temp_tag = array_pop($open_tags);
						$temp_arg = array_pop($open_args);

						if (in_array($temp_tag , $tags_inline))
						{
							array_push($temp_opened, $temp_tag);
							array_push($temp_opened_arg, $temp_arg);
							$temp .= '[/'.$temp_tag.']';
						}
						else
						{
							array_push($open_tags, $temp_tag);
							array_push($open_args, $temp_arg);
							break;
						}
					}
					$current .= $temp.$split_current[$i];
					$temp = '';
					while (!empty($temp_opened))
					{
						$temp_tag = array_pop($temp_opened);
						$temp_arg = array_pop($temp_opened_arg);
						if (empty($temp_arg))
							$temp .= '['.$temp_tag.']';
						else
							$temp .= '['.$temp_tag.'='.$temp_arg.']';
						array_push($open_tags, $temp_tag);
						array_push($open_args, $temp_arg);
					}
					$current .= $temp;
				}

				if (array_key_exists($i - 1, $split_current))
					$current .= $split_current[$i - 1];
			}

			if (in_array($open_tags[$opened_tag], $tags_trim))
				$new_text .= pun_trim($current);
			else
				$new_text .= $current;

			continue;
		}

		// Get the name of the tag
		$current_arg = '';
		if (strpos($current, '/') === 1)
		{
			$current_tag = substr($current, 2, -1);
		}
		else if (strpos($current, '=') === false)
		{
			$current_tag = substr($current, 1, -1);
		}
		else
		{
			$current_tag = substr($current, 1, strpos($current, '=')-1);
			$current_arg = substr($current, strpos($current, '=')+1, -1);
		}
		$current_tag = strtolower($current_tag);

		// Is the tag defined?
		if (!in_array($current_tag, $tags))
		{
			// It's not a bbcode tag so we put it on the end and continue
			if (!$current_nest)
				$new_text .= $current;

			continue;
		}

		// We definitely have a bbcode tag

		// Make the tag string lower case
		if ($equalpos = strpos($current,'='))
		{
			// We have an argument for the tag which we don't want to make lowercase
			if (strlen(substr($current, $equalpos)) == 2)
			{
				// Empty tag argument
				$errors[] = sprintf($lang_common['BBCode error empty attribute'], $current_tag);
				return false;
			}
			$current = strtolower(substr($current, 0, $equalpos)).substr($current, $equalpos);
		}
		else
			$current = strtolower($current);

		// This is if we are currently in a tag which escapes other bbcode such as code
		// We keep a count of ignored bbcodes (code tags) so we can nest them, but
		// only balanced sets of tags can be nested
		if ($current_ignore)
		{
			// Increase the current ignored tags counter
			if ('['.$current_ignore.']' == $current)
				$count_ignored[$current_tag]++;

			// Decrease the current ignored tags counter
			if ('[/'.$current_ignore.']' == $current)
				$count_ignored[$current_tag]--;

			if ('[/'.$current_ignore.']' == $current && $count_ignored[$current_tag] == 0)
			{
				// We've finished the ignored section
				$current = '[/'.$current_tag.']';
				$current_ignore = '';
				$count_ignored = array();
			}

			$new_text .= $current;

			continue;
		}

		// Is the tag forbidden?
		if (in_array($current_tag, $tags_forbidden))
		{
			if (isset($lang_common['BBCode error tag '.$current_tag.' not allowed']))
				$errors[] = sprintf($lang_common['BBCode error tag '.$current_tag.' not allowed']);
			else
				$errors[] = sprintf($lang_common['BBCode error tag not allowed'], $current_tag);

			return false;
		}

		if ($current_nest)
		{
			// We are currently too deeply nested so lets see if we are closing the tag or not
			if ($current_tag != $current_nest)
				continue;

			if (substr($current, 1, 1) == '/')
				$current_depth[$current_nest]--;
			else
				$current_depth[$current_nest]++;

			if ($current_depth[$current_nest] <= $tags_nested[$current_nest])
				$current_nest = '';

			continue;
		}

		// Check the current tag is allowed here
		if (!in_array($current_tag, $limit_bbcode) && $current_tag != $open_tags[$opened_tag])
		{
			$errors[] = sprintf($lang_common['BBCode error invalid nesting'], $current_tag, $open_tags[$opened_tag]);
			return false;
		}

		if (substr($current, 1, 1) == '/')
		{
			// This is if we are closing a tag
			if ($opened_tag == 0 || !in_array($current_tag, $open_tags))
			{
				// We tried to close a tag which is not open
				if (in_array($current_tag, $tags_opened))
				{
					$errors[] = sprintf($lang_common['BBCode error no opening tag'], $current_tag);
					return false;
				}
			}
			else
			{
				// Check nesting
				while (true)
				{
					// Nesting is ok
					if ($open_tags[$opened_tag] == $current_tag)
					{
						array_pop($open_tags);
						array_pop($open_args);
						$opened_tag--;
						break;
					}

					// Nesting isn't ok, try to fix it
					if (in_array($open_tags[$opened_tag], $tags_closed) && in_array($current_tag, $tags_closed))
					{
						if (in_array($current_tag, $open_tags))
						{
							$temp_opened = array();
							$temp_opened_arg = array();
							$temp = '';
							while (!empty($open_tags))
							{
								$temp_tag = array_pop($open_tags);
								$temp_arg = array_pop($open_args);

								if (!in_array($temp_tag, $tags_fix))
								{
									// We couldn't fix nesting
									$errors[] = sprintf($lang_common['BBCode error no closing tag'], array_pop($temp_opened));
									return false;
								}
								array_push($temp_opened, $temp_tag);
								array_push($temp_opened_arg, $temp_arg);

								if ($temp_tag == $current_tag)
									break;
								else
									$temp .= '[/'.$temp_tag.']';
							}
							$current = $temp.$current;
							$temp = '';
							array_pop($temp_opened);
							array_pop($temp_opened_arg);

							while (!empty($temp_opened))
							{
								$temp_tag = array_pop($temp_opened);
								$temp_arg = array_pop($temp_opened_arg);
								if (empty($temp_arg))
									$temp .= '['.$temp_tag.']';
								else
									$temp .= '['.$temp_tag.'='.$temp_arg.']';
								array_push($open_tags, $temp_tag);
								array_push($open_args, $temp_arg);
							}
							$current .= $temp;
							$opened_tag--;
							break;
						}
						else
						{
							// We couldn't fix nesting
							$errors[] = sprintf($lang_common['BBCode error no opening tag'], $current_tag);
							return false;
						}
					}
					else if (in_array($open_tags[$opened_tag], $tags_closed))
						break;
					else
					{
						array_pop($open_tags);
						array_pop($open_args);
						$opened_tag--;
					}
				}
			}

			if (in_array($current_tag, array_keys($tags_nested)))
			{
				if (isset($current_depth[$current_tag]))
					$current_depth[$current_tag]--;
			}

			if (in_array($open_tags[$opened_tag], array_keys($tags_limit_bbcode)))
				$limit_bbcode = $tags_limit_bbcode[$open_tags[$opened_tag]];
			else
				$limit_bbcode = $tags;

			$new_text .= $current;

			continue;
		}
		else
		{
			// We are opening a tag
			if (in_array($current_tag, array_keys($tags_limit_bbcode)))
				$limit_bbcode = $tags_limit_bbcode[$current_tag];
			else
				$limit_bbcode = $tags;

			if (in_array($current_tag, $tags_block) && !in_array($open_tags[$opened_tag], $tags_block) && $opened_tag != 0)
			{
				// We tried to open a block tag within a non-block tag
				$errors[] = sprintf($lang_common['BBCode error invalid nesting'], $current_tag, $open_tags[$opened_tag]);
				return false;
			}

			if (in_array($current_tag, $tags_ignore))
			{
				// It's an ignore tag so we don't need to worry about what's inside it
				$current_ignore = $current_tag;
				$count_ignored[$current_tag] = 1;
				$new_text .= $current;
				continue;
			}

			// Deal with nested tags
			if (in_array($current_tag, $open_tags) && !in_array($current_tag, array_keys($tags_nested)))
			{
				// We nested a tag we shouldn't
				$errors[] = sprintf($lang_common['BBCode error invalid self-nesting'], $current_tag);
				return false;
			}
			else if (in_array($current_tag, array_keys($tags_nested)))
			{
				// We are allowed to nest this tag

				if (isset($current_depth[$current_tag]))
					$current_depth[$current_tag]++;
				else
					$current_depth[$current_tag] = 1;

				// See if we are nested too deep
				if ($current_depth[$current_tag] > $tags_nested[$current_tag])
				{
					$current_nest = $current_tag;
					continue;
				}
			}

			// Remove quotes from arguments for certain tags
			if (strpos($current, '=') !== false && in_array($current_tag, $tags_quotes))
			{
				$current = preg_replace('%\['.$current_tag.'=("|\'|)(.*?)\\1\]\s*%i', '['.$current_tag.'=$2]', $current);
			}

			if (in_array($current_tag, array_keys($tags_limit_bbcode)))
				$limit_bbcode = $tags_limit_bbcode[$current_tag];

			$open_tags[] = $current_tag;
			$open_args[] = $current_arg;
			$opened_tag++;
			$new_text .= $current;
			continue;
		}
	}

	// Check we closed all the tags we needed to
	foreach ($tags_closed as $check)
	{
		if (in_array($check, $open_tags))
		{
			// We left an important tag open
			$errors[] = sprintf($lang_common['BBCode error no closing tag'], $check);
			return false;
		}
	}

	if ($current_ignore)
	{
		// We left an ignore tag open
		$errors[] = sprintf($lang_common['BBCode error no closing tag'], $current_ignore);
		return false;
	}

	return $new_text;
}


//
// Preparse the contents of [list] bbcode
//
function preparse_list_tag($content, $type = '*')
{
	global $lang_common, $re_list;

	if (strlen($type) != 1)
		$type = '*';

	if (strpos($content,'[list') !== false)
	{
		$content = preg_replace_callback($re_list, create_function('$matches', 'return preparse_list_tag($matches[2], $matches[1]);'), $content);
	}

	$items = explode('[*]', str_replace('\"', '"', $content));

	$content = '';
	foreach ($items as $item)
	{
		if (pun_trim($item) != '')
			$content .= '[*'."\0".']'.str_replace('[/*]', '', pun_trim($item)).'[/*'."\0".']'."\n";
	}

	return '[list='.$type.']'."\n".$content.'[/list]';
}


//
// Truncate URL if longer than 55 characters (add http:// or ftp:// if missing)
//
function handle_url_tag($url, $link = '', $bbcode = false)
{
	$url = pun_trim($url);

	// Deal with [url][img]http://example.com/test.png[/img][/url]
	if (preg_match('%<img src=\\\\"(.*?)\\\\"%', $url, $matches))
		return handle_url_tag($matches[1], $url, $bbcode);

	$full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url);
	if (strpos($url, 'www.') === 0) // If it starts with www, we add http://
		$full_url = 'http://'.$full_url;
	else if (strpos($url, 'ftp.') === 0) // Else if it starts with ftp, we add ftp://
		$full_url = 'ftp://'.$full_url;
	else if (strpos($url, '/') === 0) // Allow for relative URLs that start with a slash
		$full_url = get_base_url(true).$full_url;
	else if (!preg_match('#^([a-z0-9]{3,6})://#', $url)) // Else if it doesn't start with abcdef://, we add http://
		$full_url = 'http://'.$full_url;

	// Ok, not very pretty :-)
	if ($bbcode)
	{
		if ($full_url == $link)
			return '[url]'.$link.'[/url]';
		else
			return '[url='.$full_url.']'.$link.'[/url]';
	}
	else
	{
		if ($link == '' || $link == $url)
		{
			$url = pun_htmlspecialchars_decode($url);
			$link = utf8_strlen($url) > 55 ? utf8_substr($url, 0 , 39).' … '.utf8_substr($url, -10) : $url;
			$link = pun_htmlspecialchars($link);
		}
		else
			$link = stripslashes($link);

		return '<a href="'.$full_url.'" rel="nofollow">'.$link.'</a>';
	}
}


//
// Turns an URL from the [img] tag into an <img> tag or a <a href...> tag
//
function handle_img_tag($url, $is_signature = false, $alt = null)
{
	global $lang_common, $pun_user;

	if (is_null($alt))
		$alt = basename($url);

	$img_tag = '<a href="'.$url.'" rel="nofollow">&lt;'.$lang_common['Image link'].' - '.$alt.'&gt;</a>';

	if ($is_signature && $pun_user['show_img_sig'] != '0')
		$img_tag = '<img class="sigimage" src="'.$url.'" alt="'.$alt.'" />';
	else if (!$is_signature && $pun_user['show_img'] != '0')
		$img_tag = '<span class="postimg"><img src="'.$url.'" alt="'.$alt.'" /></span>';

	return $img_tag;
}


//
// Parse the contents of [list] bbcode
//
function handle_list_tag($content, $type = '*')
{
	global $re_list;

	if (strlen($type) != 1)
		$type = '*';

	if (strpos($content,'[list') !== false)
	{
		$content = preg_replace_callback($re_list, create_function('$matches', 'return handle_list_tag($matches[2], $matches[1]);'), $content);
	}

	$content = preg_replace('#\s*\[\*\](.*?)\[/\*\]\s*#s', '<li><p>$1</p></li>', pun_trim($content));

	if ($type == '*')
		$content = '<ul>'.$content.'</ul>';
	else
		if ($type == 'a')
			$content = '<ol class="alpha">'.$content.'</ol>';
		else
			$content = '<ol class="decimal">'.$content.'</ol>';

	return '</p>'.$content.'<p>';
}


//
// Convert BBCodes to their HTML equivalent
//
function do_bbcode($text, $is_signature = false)
{
	global $lang_common, $pun_user, $pun_config, $re_list;

	if (strpos($text, '[quote') !== false)
	{
		$text = preg_replace('%\[quote\]\s*%', '</p><div class="quotebox"><blockquote><div><p>', $text);
		$text = preg_replace_callback('%\[quote=(&quot;|&\#039;|"|\'|)(.*?)\\1\]%s', create_function('$matches', 'global $lang_common; return "</p><div class=\"quotebox\"><cite>".str_replace(array(\'[\', \'\\"\'), array(\'&#91;\', \'"\'), $matches[2])." ".$lang_common[\'wrote\']."</cite><blockquote><div><p>";'), $text);
		$text = preg_replace('%\s*\[\/quote\]%S', '</p></div></blockquote></div><p>', $text);
	}
	if (!$is_signature)
	{
		$pattern_callback[] = $re_list;
		$replace_callback[] = 'handle_list_tag($matches[2], $matches[1])';
	}

	$pattern[] = '%\[b\](.*?)\[/b\]%ms';
	$pattern[] = '%\[i\](.*?)\[/i\]%ms';
	$pattern[] = '%\[u\](.*?)\[/u\]%ms';
	$pattern[] = '%\[s\](.*?)\[/s\]%ms';
	$pattern[] = '%\[del\](.*?)\[/del\]%ms';
	$pattern[] = '%\[ins\](.*?)\[/ins\]%ms';
	$pattern[] = '%\[em\](.*?)\[/em\]%ms';
	$pattern[] = '%\[colou?r=([a-zA-Z]{3,20}|\#[0-9a-fA-F]{6}|\#[0-9a-fA-F]{3})](.*?)\[/colou?r\]%ms';
	$pattern[] = '%\[h\](.*?)\[/h\]%ms';
	$pattern[] = '%\[spoiler\](.*?)\[/spoiler\]%ms'; // SPOILER

	$replace[] = '<strong>$1</strong>';
	$replace[] = '<em>$1</em>';
	$replace[] = '<span class="bbu">$1</span>';
	$replace[] = '<span class="bbs">$1</span>';
	$replace[] = '<del>$1</del>';
	$replace[] = '<ins>$1</ins>';
	$replace[] = '<em>$1</em>';
	$replace[] = '<span style="color: $1">$2</span>';
	$replace[] = '</p><h5>$1</h5><p>';
	$replace[] = '<div class="spoiler"><div class="teaser"><p class="show">Montrer</p><p class="hide"><Cacher></p></div><div class="contenu">$1</div></div>'; // SPOILER

	if (($is_signature && $pun_config['p_sig_img_tag'] == '1') || (!$is_signature && $pun_config['p_message_img_tag'] == '1'))
	{
		$pattern_callback[] = '%\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]%';
		$pattern_callback[] = '%\[img=([^\[]*?)\]((ht|f)tps?://)([^\s<"]*?)\[/img\]%';
		if ($is_signature)
		{
			$replace_callback[] = 'handle_img_tag($matches[1].$matches[3], true)';
			$replace_callback[] = 'handle_img_tag($matches[2].$matches[4], true, $matches[1])';
		}
		else
		{
			$replace_callback[] = 'handle_img_tag($matches[1].$matches[3], false)';
			$replace_callback[] = 'handle_img_tag($matches[2].$matches[4], false, $matches[1])';
		}
	}

	$pattern_callback[] = '%\[url\]([^\[]*?)\[/url\]%';
	$pattern_callback[] = '%\[url=([^\[]+?)\](.*?)\[/url\]%';
	$pattern[] = '%\[email\]([^\[]*?)\[/email\]%';
	$pattern[] = '%\[email=([^\[]+?)\](.*?)\[/email\]%';
	$pattern_callback[] = '%\[topic\]([1-9]\d*)\[/topic\]%';
	$pattern_callback[] = '%\[topic=([1-9]\d*)\](.*?)\[/topic\]%';
	$pattern_callback[] = '%\[post\]([1-9]\d*)\[/post\]%';
	$pattern_callback[] = '%\[post=([1-9]\d*)\](.*?)\[/post\]%';
	$pattern_callback[] = '%\[forum\]([1-9]\d*)\[/forum\]%';
	$pattern_callback[] = '%\[forum=([1-9]\d*)\](.*?)\[/forum\]%';
	$pattern_callback[] = '%\[user\]([1-9]\d*)\[/user\]%';
	$pattern_callback[] = '%\[user=([1-9]\d*)\](.*?)\[/user\]%';

	$replace_callback[] = 'handle_url_tag($matches[1])';
	$replace_callback[] = 'handle_url_tag($matches[1], $matches[2])';
	$replace[] = '<a href="mailto:$1">$1</a>';
	$replace[] = '<a href="mailto:$1">$2</a>';
	$replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?id=\'.$matches[1])';
	$replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?id=\'.$matches[1], $matches[2])';
	$replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?pid=\'.$matches[1].\'#p\'.$matches[1])';
	$replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/viewtopic.php?pid=\'.$matches[1].\'#p\'.$matches[1], $matches[2])';
	$replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/viewforum.php?id=\'.$matches[1])';
	$replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/viewforum.php?id=\'.$matches[1], $matches[2])';
	$replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/profile.php?id=\'.$matches[1])';
	$replace_callback[] = 'handle_url_tag(\''.get_base_url(true).'/profile.php?id=\'.$matches[1], $matches[2])';

	// This thing takes a while! :)
	$text = preg_replace($pattern, $replace, $text);
	$count = count($pattern_callback);
	for($i = 0 ; $i < $count ; $i++)
	{
		$text = preg_replace_callback($pattern_callback[$i], create_function('$matches', 'return '.$replace_callback[$i].';'), $text);
	}
	return $text;
}


//
// Make hyperlinks clickable
//
function do_clickable($text)
{
	$text = ' '.$text;
	$text = ucp_preg_replace_callback('%(?<=[\s\]\)])(<)?(\[)?(\()?([\'"]?)(https?|ftp|news){1}://([\p{L}\p{N}\-]+\.([\p{L}\p{N}\-]+\.)*[\p{L}\p{N}]+(:[0-9]+)?(/(?:[^\s\[]*[^\s.,?!\[;:-])?)?)\4(?(3)(\)))(?(2)(\]))(?(1)(>))(?![^\s]*\[/(?:url|img)\])%ui', 'stripslashes($matches[1].$matches[2].$matches[3].$matches[4]).handle_url_tag($matches[5]."://".$matches[6], $matches[5]."://".$matches[6], true).stripslashes($matches[4].forum_array_key($matches, 10).forum_array_key($matches, 11).forum_array_key($matches, 12))', $text);
	$text = ucp_preg_replace_callback('%(?<=[\s\]\)])(<)?(\[)?(\()?([\'"]?)(www|ftp)\.(([\p{L}\p{N}\-]+\.)+[\p{L}\p{N}]+(:[0-9]+)?(/(?:[^\s\[]*[^\s.,?!\[;:-])?)?)\4(?(3)(\)))(?(2)(\]))(?(1)(>))(?![^\s]*\[/(?:url|img)\])%ui','stripslashes($matches[1].$matches[2].$matches[3].$matches[4]).handle_url_tag($matches[5].".".$matches[6], $matches[5].".".$matches[6], true).stripslashes($matches[4].forum_array_key($matches, 10).forum_array_key($matches, 11).forum_array_key($matches, 12))', $text);

	return substr($text, 1);
}


//
// Return an array key, if it exists, otherwise return an empty string
//
function forum_array_key($arr, $key)
{
	return isset($arr[$key]) ? $arr[$key] : '';
}


//
// Convert a series of smilies to images
//
function do_smilies($text)
{
	global $smilies;

	$text = ' '.$text.' ';

	foreach ($smilies as $smiley_text => $smiley_img)
	{
		if (strpos($text, $smiley_text) !== false)
			$text = ucp_preg_replace('%(?<=[>\s])'.preg_quote($smiley_text, '%').'(?=[^\p{L}\p{N}])%um', '<img src="'.pun_htmlspecialchars(get_base_url(true).'/img/smilies/'.$smiley_img).'" width="15" height="15" alt="'.substr($smiley_img, 0, strrpos($smiley_img, '.')).'" />', $text);
	}

	return substr($text, 1, -1);
}


//
// Parse message text
//
function parse_message($text, $hide_smilies)
{
	global $pun_config, $lang_common, $pun_user;

	if ($pun_config['o_censoring'] == '1')
		$text = censor_words($text);

	// Convert applicable characters to HTML entities
	$text = pun_htmlspecialchars($text);

	// If the message contains a code tag we have to split it up (text within  shouldn't be touched)
	if (strpos($text, '[code]') !== false && strpos($text, '[/code]') !== false)
		list($inside, $text) = extract_blocks($text, '[code]', '[/code]');

	if ($pun_config['p_message_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false)
		$text = do_bbcode($text);

	if ($pun_config['o_smilies'] == '1' && $pun_user['show_smilies'] == '1' && $hide_smilies == '0')
		$text = do_smilies($text);

	// Deal with newlines, tabs and multiple spaces
	$pattern = array("\n", "\t", '  ', '  ');
	$replace = array('<br />', '&#160; &#160; ', '&#160; ', ' &#160;');
	$text = str_replace($pattern, $replace, $text);

	// If we split up the message before we have to concatenate it together again (code tags)
	if (isset($inside))
	{
		$parts = explode("\1", $text);
		$text = '';
		foreach ($parts as $i => $part)
		{
			$text .= $part;
			if (isset($inside[$i]))
			{
				$num_lines = (substr_count($inside[$i], "\n"));
				$text .= '</p><div class="codebox"><pre'.(($num_lines > 28) ? ' class="vscroll"' : '').'><code>'.pun_trim($inside[$i], "\n\r").'</code></pre></div><p>';
			}
		}
	}

	return clean_paragraphs($text);
}


//
// Clean up paragraphs and line breaks
//
function clean_paragraphs($text)
{
	// Add paragraph tag around post, but make sure there are no empty paragraphs

	$text = '<p>'.$text.'</p>';

	// Replace any breaks next to paragraphs so our replace below catches them
	$text = preg_replace('%(</?p>)(?:\s*?<br />){1,2}%i', '$1', $text);
	$text = preg_replace('%(?:<br />\s*?){1,2}(</?p>)%i', '$1', $text);

	// Remove any empty paragraph tags (inserted via quotes/lists/code/etc) which should be stripped
	$text = str_replace('<p></p>', '', $text);

	$text = preg_replace('%<br />\s*?<br />%i', '</p><p>', $text);

	$text = str_replace('<p><br />', '<br /><p>', $text);
	$text = str_replace('<br /></p>', '</p><br />', $text);
	$text = str_replace('<p></p>', '<br /><br />', $text);

	return $text;
}


//
// Parse signature text
//
function parse_signature($text)
{
	global $pun_config, $lang_common, $pun_user;

	if ($pun_config['o_censoring'] == '1')
		$text = censor_words($text);

	// Convert applicable characters to HTML entities
	$text = pun_htmlspecialchars($text);

	if ($pun_config['p_sig_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false)
		$text = do_bbcode($text, true);

	if ($pun_config['o_smilies_sig'] == '1' && $pun_user['show_smilies'] == '1')
		$text = do_smilies($text);


	// Deal with newlines, tabs and multiple spaces
	$pattern = array("\n", "\t", '  ', '  ');
	$replace = array('<br />', '&#160; &#160; ', '&#160; ', ' &#160;');
	$text = str_replace($pattern, $replace, $text);

	return clean_paragraphs($text);
}

style/style.php  - Ps : dans mon cas mon tème est Earth , il suffit de prendre le bout  de  code à la fin   et de l'ajouter dans votre théme actuelle


/*****************************************************************
1. INITIAL SETTINGS
*****************************************************************/

/* Limited Reset
----------------------------------------------------------------*/

html, body, .pun table, .pun div, .pun form, .pun p, .pun h1, .pun h2, .pun h3, .pun h4, .pun h5, .pun pre, .pun blockquote,
.pun ul, .pun ol, .pun li, .pun dl, .pun dt, .pun dd, .pun th, .pun td, .pun fieldset, .pun legend .pun img,
.pun abbr, .pun cite {
	border: 0;
	font-style: normal;
	font-weight: normal;
	margin: 0;
	padding: 0;
}

.pun ul, .pun ol {
	list-style: none;
}

.pun select {
	padding-bottom: 1px;
	padding-top: 1px;
	padding-right: 1px;
}

/* Content Defaults
----------------------------------------------------------------*/

.pun {
	font: 81.25%/1.462em Arial, Helvetica, sans-serif;
}

.pun table, .pun td, .pun th, .pun input, .pun select, .pun optgroup, .pun textarea, .pun legend {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 1em;
}

.pun pre, .pun code {
	font-family: consolas, monaco, "bitstream vera sans mono", "courier new", courier, monospace;
	font-size: 1em;
}

.pun pre code {
	font-size: 1em;
}

.pun table {
	border-collapse: collapse;
	border-spacing: 0;
	border: 0;
	empty-cells: show;
	width: 100%;
}

.pun h1 {
	font:2.154em/1em "Trebuchet MS", Arial, Helvetica, sans-serif;
	padding: 7px 0;
}

.pun h2, .pun .hd h2 {
	font: 1.462em/1em "Trebuchet MS", Arial, Helvetica, sans-serif;
	padding: 7px 0;
}

.pun h3 {
	font-size: 1.154em;
	line-height: 1.267em;
	padding: 7px 0;
}

.pun h4 {
	font-size: 1.077em;
	font-weight: bold;
	padding: 7px 0;
}

.pun h5, .pun h6 {
	font-size: 1em;
	font-weight: bold;
	padding: 7px 0;
}

.pun p, .pun ul, .pun ol, .pun dl, .pun th, .pun td, .pun legend {
	padding: 7px 0;
}

.pun strong, .pun th, .pun span.warntext, .pun p.warntext {
	font-weight: bold;
}

.pun em {
	font-style: italic;
}

.pun a, .pun a:link, .pun a:visited {
	text-decoration: none;
}

.pun a:hover, .pun a:active, .pun a:focus {
	text-decoration: underline;
}

.pun .actions span {
	padding-left: 16px;
	padding-right: 8px;
	background: url(Air/img/bull.png) center left no-repeat;
	display: inline-block;
	line-height: normal;
}

/* Hidden Elements
----------------------------------------------------------------*/

#brdfooter h2, #brdstats h2, #debug h2, #brdstats .conl dt, #brdstats .conr dt, #modcontrols dt,
#searchlinks dt, div.postright h3, .pun .subscribelink span, #announce .hd, #reportform h2, #punmoderate #vf h2,
#punviewforum #vf h2, .pun .required strong span, .pun .icon div {
	display: block;
	overflow: hidden;
	position: absolute;
	text-indent: -9999em;
	width: 0;
}

/* Generic Float Clear
----------------------------------------------------------------*/

.pun .inbox, .pun #brdmain, .pun .crumbs, .pun .pagepost, .pun .block2col {
	min-height: 1px;
}

* html .pun .inbox, * html .pun #brdmain, * html .pun .infldset, * html .pun .crumbs, * html .pun .pagepost, * html .pun .block2col {
	display: inline-block;
}

* html .pun .inbox, * html .pun #bdrdmain, * html .pun .infldset, * html .pun .crumbs, * html .pun .pagepost, * html .pun .block2col {
	display: block;
}

.pun .inbox:after, .pun #brdmain:after, .pun .crumbs:after, .pun .pagepost:after, .pun .block2col:after {
	content: " ";
	display: block;
	height: 0;
	font-size: 0;
	clear: both;
	visibility: hidden;
}

.pun .block2col .inbox:after {
	content: none;
	clear: none;
}

.clearl {
	clear: left;
}


/*****************************************************************
2. COMMON STYLES
*****************************************************************/

/* Page Layout
----------------------------------------------------------------*/

.pun {
	padding: 30px 40px;
}

#punredirect, #punmaint {
	padding: 60px 20% 12px 20%;
}

#puninstall, #pundb_update {
	padding: 20px 10%;
}

.pun .punwrap {
	border: 1px solid;
	padding: 18px;
}

.pun .top-box {
	height: 18px;
	margin-bottom: -18px;
	position: relative;
	background: url(Air/img/main_top.png) top left no-repeat;
}

.pun .top-box div {
	height: 18px;
	margin-left: 50%;
	background: url(Air/img/main_top.png) top right no-repeat;
}

.pun .end-box {
	margin-top: -17px;
	height: 18px;
	position: relative;
	background: url(Air/img/main_end.png) bottom left no-repeat;
}

.pun .end-box div {
	height: 18px;
	margin-left: 50%;
	background: url(Air/img/main_end.png) bottom right no-repeat;
}

#punredirect h2, #punmaint h2 {
	border-bottom-style: dotted;
	border-bottom-width: 1px;
	margin-bottom: 3px;
}

/* Section Spacing and Borders
----------------------------------------------------------------*/

#brdmain {
	border-style: solid none;
	border-width: 2px 0;
	margin-bottom: 12px;
	padding: 12px 0;
}

#punindex #brdmain {
	padding-top: 24px;
}

#punredirect #brdmain, #punmaint #brdmain {
	border: 0;
	margin: 0;
	padding: 0;
}

#brdstats {
	border-style: solid none none none;
	border-width: 2px 0 0 0;
	margin-top: 24px;
	padding-top: 12px;
}

#quickpost {
	border-style: solid none none none;
	border-width: 2px 0 0 0;
	margin-top: 12px;
	padding-top: 12px;
}

#announce {
	border-style: solid none none none;
	border-width: 2px 0 0 0;
	padding-top: 3px;
}

/*****************************************************************
3. COMMON BOARD ELEMENTS
*****************************************************************/

/* Logo, Description and Main Menu
----------------------------------------------------------------*/

#brdtitle h1 {
	padding: 0 0 10px 0;
}

#brddesc {
	border-top-style: dotted;
	border-top-width: 1px;
	padding: 10px 0;
}

#brddesc p {
	padding: 0;
}

#brdmenu ul {
	padding: 0;
}

#brdmenu li {
	float: left;
}

#brdmenu a:link, #brdmenu a:visited {
	border-right-style: solid;
	border-width: 1px;
	display: block;
	min-width: 60px;
	padding: 12px 16px 6px 8px;
	white-space: nowrap;
}

#brdmenu a:hover, #brmenu a:active, #brdmenu a:focus {
	text-decoration: none;
}

/* Welcome Box
----------------------------------------------------------------*/

#brdwelcome {
	padding: 10px 0;
}

#brdwelcome .conl, #brdwelcome .conr, #brdwelcome p, #brdwelcome li {
	display: inline;
	padding: 0;
}

#brdwelcome .conl {
  float: left;
}

#brdwelcome .conr {
  float: right;
}

#brdwelcome li span {
	background: url(Air/img/bull.png) center left no-repeat;
	padding-left: 18px;
	margin-right: 3px;
	display: inline-block;
	line-height: normal;
	white-space: nowrap;
}

#brdwelcome .conl li:first-child span {
	padding-left: 0;
	background: none;
}

/* Stats
----------------------------------------------------------------*/

#brdstats .conl {
	float: left;
}

#brdstats .conr {
	float: right;
	text-align: right;
}

#brdstats #onlinelist {
	border-top-style: dotted;
	border-top-width: 1px;
	clear: both;
}

#brdstats #onlinelist dt, #brdstats #onlinelist dd {
	display: inline;
}

/* Footer
----------------------------------------------------------------*/

.pun #modcontrols {
	border-style: none none dotted none;
	border-width: 0 0 1px 0;
	margin-bottom: 4px;
	text-align: center;
	width: 100%;
}

.pun #modcontrols dd {
	display: inline;
}

.pun #brdfooter #modcontrols dd span {
	background: url(Air/img/bull.png) center left no-repeat;
	display: inline-block;
	line-height: normal;
	padding-left: 18px;
	white-space: nowrap;
}

.pun #brdfooter .conl {
	float: left;
}

.pun #brdfooter .conr {
	text-align: right;
	float: right;
}

.pun #brdfooter #poweredby a {
	font-size: 1.077em;
	font-weight: bold;
}

.pun #brdfooter #qjump {
	padding-top: 5px;
}

.pun #brdfooter #qjump * {
	white-space: nowrap;
}

.pun #brdfooter #searchlinks dd span {
	background: url(Air/img/bull.png) center left no-repeat;
	display: inline-block;
	line-height: normal;
	padding-left: 18px;
	white-space: nowrap;
}

.pun #brdfooter #feedlinks {
	padding-bottom: 0;
}

.pun #brdfooter #feedlinks span {
	background: url(Air/img/feed.png) center left no-repeat;
	display: inline-block;
	padding-left: 18px;
	white-space: nowrap;
}

.pun #debugtime {
	border-style: dotted none none none;
	border-width: 1px 0 0 0;
	margin-top: 7px;
	text-align: center;
}

/* Breadcrumbs, Postlink, Pagination
----------------------------------------------------------------*/

.pun .linkst .inbox, .pun .linksb .inbox, .pun .postlinksb .inbox {
	overflow: hidden;
}

.pun .linksb, .pun .postlinksb, .pun .linkst, .pun .crumbs {
	clear: both;
	position: relative;
}

.pun .linkst .crumbs {
	font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
	font-size: 1.462em;
	line-height: 1.211em;
	padding: 7px 0;
}

.pun .linksb .crumbs, .pun .postlinksb .crumbs {
	font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
	font-size: 1.154em;
}

.pun .linkst .crumbsplus .pagepost {
	border-top-style: dotted;
	border-top-width: 1px;
}

.pun .linksb .crumbsplus .pagepost, .pun .postlinksb .crumbsplus .pagepost {
	border-bottom-style: dotted;
	border-bottom-width: 1px;
}

.pun .postlinksb .crumbs {
	margin-right: 11em;
}

.pun .crumbs li {
	float: left;
	padding-right: 0.4em;
	white-space: nowrap;
}

.pun .crumbs li strong {
	font-weight: normal;
}

.pun .pagelink {
	float: left;
	white-space: nowrap;
}

.pun .pagelink strong, .pun .pagelink a, .pun .pagelink span.spacer {
	border-style: none none none solid;
	border-width: 0 0 0 1px;
	display: inline-block;
	padding: 0 12px 0 10px;
	margin-right: -6px;
}

.pun .pagelink .item1 {
	border: 0;
}

.pun .pagelink .pages-label {
	display: inline-block;
}

.pun .postlink {
	float: right;
	font-weight: bold;
	text-align: right;
}

.pun .modbuttons {
	float: right;
	padding: 5px 0 3px 0;
}

.pun .modbuttons input {
	margin-left: 8px;
}

.pun .subscribelink {
	position: absolute;
	right: 0;
	text-align: right;
	top: 33px;
}

#punindex .subscribelink {
	top: 0px;
}

#punindex .linksb {
	height: 12px;
}

/*****************************************************************
4. MAIN TABLES
*****************************************************************/

.pun #brdmain .blocktable {
	position: relative;
}

#punindex #brdmain .blocktable h2, #punsearch #vf h2 {
	font: 1em/1.462em Arial, Helvetica, sans-serif;
	font-weight: bold;
	margin: 1px 1px 0 1px;
	padding-left: 8px;
	position: absolute;
	left: 0;
	white-space: nowrap;
	z-index: 100;
}

#punindex .blocktable th.tcl, #punsearch #vf th.tcl {
	font-size: 0;
	text-indent: -9999em;
}

.pun .blocktable .box {
	border-style: solid;
	border-width: 1px;
	margin-bottom: -1px;
	overflow: hidden;
	position: relative;
}

* html .pun .blocktable .box {
	display: inline-block;
}

.pun .blocktable table {
	table-layout: fixed;
	margin-bottom: -1px;
}

.pun .blocktable th {
	padding: 7px 8px;
	border-style: none none solid none;
	border-width: 1px;
	text-align: left;
}

.pun .blocktable td {
	padding: 7px 8px;
	line-height: 1.3077em;
	border-style: none none solid none;
	border-width: 1px;
	text-align: left;
}

.pun .blocktable h3 {
	font-size: 1.077em;
	font-weight: bold;
	padding: 0;
}

.pun .blocktable p {
	padding: 0;
}

.pun .blocktable .tcl p {
	padding: 5px 0 0 0;
}

.pun .blocktable .tcl {
	width: auto;
}

.pun .blocktable .tc2, .pun .blocktable .tc3, .pun .blocktable .tcmod {
	padding-left: 0;
	padding-right: 0;
	text-align: center;
	width: 11%;
}

.pun .blocktable .tcr {
	width: 30%;
}

.pun .blocktable td .newtext, .pun .blocktable td .pagestext, .pun .blocktable td .byuser {
	white-space: nowrap;
}

.pun .blocktable .tcl h3 span.newtext {
	font-size: 0.929em;
	font-weight: normal;
}

.pun #vf td.tcl span.stickytext, .pun #vf td.tcl span.closedtext {
	font-size: 1em;
	font-weight: bold;
}

#punsearch #vf .tc2 {
	padding-left: 8px;
	padding-right: 8px;
	text-align: left;
	width: 18%;
}

#users1 .tcr {
	width: 25%;
}

#users1 .tc2 {
	padding-left: 8px;
	padding-right: 8px;
	text-align: left;
	width: 25%;
}

#debug {
	margin-top: 12px;
}

#debug .tcl {
	width: 10%;
}

#punredirect #debug .tcl, #punmaint #debug .tcl {
	width: 20%;
}

#debug .tcr {
	width: 90%;
	white-space: normal
}

#punindex .tcr .byuser {
	display: block
}

#punindex td.tc2, #punindex td.tc3, #punindex td.tcr, .pun #vf td.tc2, .pun #vf td.tc3,
.pun #vf td.tcr, #punindex td.tcl div.forumdesc, .pun #vf td.tcl span {
	font-size: 0.923em;
}

.pun #vf td.tcl a {
	font-weight: bold;
}

.pun #vf td.tcl span a {
	font-weight: normal;
}

.pun .blocktable .tclcon {
	min-height: 1px;
	overflow: hidden;
	padding: 0 11px 0 12px;
	position: relative;
}

.pun .blocktable .tclcon div {
	width: 100%;
	overflow: hidden;
}

.pun .icon {
	border-style: solid;
	border-width: 8px;
	float: left;
	height: 0;
	overflow: hidden;
	width: 0;
}

.pun .iposted .ipost {
	font-weight: bold;
	left: 0;
	padding-left: 4px;
	position: absolute;
	text-align: center;
	top: 0;
	width: 8px;
}

/*****************************************************************
MAIN POSTS
*****************************************************************/

/* Structure
----------------------------------------------------------------*/

.pun .blockpost {
	border-style: solid;
	border-width: 1px;
	margin-bottom: -1px;
	overflow: hidden;
	position: relative;
}

* html .pun .blockpost {
	display: inline-block;
}

.pun .blockpost h2 {
	font: 1em/1.462em Arial, Helvetica, sans-serif;
	white-space: nowrap;
	border-bottom-style: solid;
	border-bottom-width: 1px;
	height: 1.462em;
	padding: 0.538em 8px 0.538em 236px;
	font-weight: normal;
}

#punsearch .blockpost h2 {
	height: auto;
	padding-left: 36px;
	white-space: normal;
}

#punsearch .blockpost h2 span span {
	white-space: nowrap;
	display: inline-block;
	font: 1.077em "Trebuchet MS", Arial, Helvetica, sans-serif
}

#punsearch .blockpost .icon {
	position: absolute;
	top: 0;
	margin-top: -2.154em;
}

.pun .blockpost h2 .conr {
	float: right;
	text-align: right;
}

.pun .blockpost .inbox {
	float: right;
	position: relative;
	width: 100%;
}

.pun .blockpost .postbody, .pun .blockpost .postfoot {
	border-left-style: solid;
	border-left-width: 1px;
	float: right;
	margin-right: -218px;
	position: relative;
	text-align: left;
	width: 100%;
}

.pun .blockpost .postleft, .pun .blockpost .postfootleft {
	width: 194px;
	padding: 7px 12px 7px 12px;
	float: left;
	margin-left: -218px;
	position: relative;
}

.pun .blockpost .postleft dl {
	padding: 0;
}

#punviewtopic .blockpost dt, #punmoderate .blockpost dt {
	display: block;
	position: absolute;
	padding: 0.538em 0 0.538em 12px;
	height: 1.462em;
	top: -2.615em;
	left: 0;
	overflow: hidden;
	width: 206px;
}

.pun .blockpost dt strong {
	font-size: 1.231em;
	font-weight: bold;
}

.pun .blockpost .postleft dd {
	font-size: 0.923em;
}

.pun .blockpost .postleft .usertitle {
	padding: 4px 0 6px 0;
	font-size: 1em;
}

.pun .blockpost .postleft .postavatar {
	display: block;
	margin: 0 0 4px 0;
}

.pun .blockpost .postright {
	position: relative;
	padding: 4px 230px 7px 18px;
}

.pun .postmsg {
	width:100%;
	overflow: hidden;
	word-wrap: break-word;
}

.pun .blockpost .postfootright {
	position: relative;
	padding: 7px 230px 7px 18px;
	text-align: right;
}

.pun .postfoot p, .pun .postfoot ul {
	padding: 0;
}

.pun .blockpost .postfootright li {
	display: inline;
}

.pun .blockpost .postfootright li span {
	display: inline-block;
	padding-left: 16px;
	margin-left: 8px;
	line-height: normal;
	background: url(Air/img/bull.png) center left no-repeat;
}

.pun .blockpost .usercontacts {
	padding: 7px 0;
}

.pun .blockpost .usercontacts .email {
	background: url(Air/img/email.png) left 65% no-repeat;
	margin-right: 5px;
	padding-left: 21px;
	display: inline-block;
	line-height: normal;
}

.pun .blockpost .usercontacts .website {
	background: url(Air/img/ext.png) left 65% no-repeat;
	padding-left: 18px;
	display: inline-block;
	line-height: normal;
}

.pun .postsignature hr {
	border:none;
	height: 1px;
	margin-left: 0px;
	text-align: left;
}

/* Content (includes other user content)
----------------------------------------------------------------*/

.pun .usercontent {
	padding: 7px 0;
}

.pun .postmsg p, .pun .postmsg li, #punhelp p samp {
	font-family: Verdana, Arial, Helvetica, sans-serif;
}

.pun .usercontent h1, .pun .usercontent h2, .pun .usercontent h3,
.pun .usercontent h4, .pun .usercontent h5, .pun .usercontent h6 {
	padding: 7px 0 0 0;
}

.pun .postmsg h5, #punhelp h5 {
	font-size: 1.231em;
	font-weight: bold;
	padding: 7px 0;
}

.pun .usercontent ul, .pun .postmsg ul {
	list-style: disc;
	padding: 4px 13px 4px 30px;
}

.pun .usercontent ol, .pun .postmsg ol {
	list-style: decimal;
	padding: 4px 13px 4px 30px;
}

.pun .usercontent ol.alpha, .pun .postmsg ol.alpha {
	list-style: lower-alpha;
}

.pun .usercontent li, .pun .postmsg li {
	padding: 0 3px;
}

.pun .usercontent li p, .pun .postmsg li p {
	padding: 0;
}

.pun span.bbu {
	text-decoration: underline;
}

.pun span.bbs, .pun del {
	text-decoration: line-through;
}

.pun .postmsg ins, #punhelp samp ins {
	text-decoration: none;
}

.pun .blockpost .postmsg .postedit {
	font-size: 0.857em;
}

.pun .blockform .postsignature, .pun .blockpost .postsignature {
	font-size: 0.923em;
}

.pun .codebox {
	border-style: solid;
	border-width: 1px;
	margin: 0.75em 1em;
	padding: 0;
}

.pun .quotebox {
	border-style: solid;
	border-width: 1px 1px 1px 3px;
	margin: 0.75em 1em;
	padding: 0 0.75em;
}

.pun .quotebox cite {
	display: block;
	padding: 0.75em 0 0 0;
	font-weight: bold;
	line-height: 1.462em;
}

.pun .quotebox blockquote {
	overflow: hidden;
	width: 100%;
}

.pun .codebox pre {
	overflow: auto;
	width: 100%;
	direction: ltr;
	text-align: left;
}

* html .pun .codebox pre {
	padding-bottom: 10px;
}

*:first-child+html .pun .codebox pre {
	padding-bottom: 10px;
}

.pun .codebox pre code {
	padding: 0.75em;
	white-space: pre;
}

.pun div[class*=codebox] pre code {
	display: inline-block;
}

* html .pun .codebox pre code {
	display: block;
}

.pun .codebox pre.vscroll {
	height: 32em;
	overflow: auto;
	overflow-y: auto
}

.pun .postmsg img, #punhelp samp img {
	vertical-align: text-top;
}

.pun .postmsg .postimg img {
	max-width: 98%;
	vertical-align: middle;
	margin: 7px 0.5em 7px 0;
}

.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
	border-style: solid;
	border-width: 2px;
}

/*****************************************************************
MAIN FORMS
*****************************************************************/

#punedit .blockform h2, #punpost .blockform h2, #postpreview h2, #posterror h2,
.pun #quickpost h2, .pun #reportform h2, #pundelete .blockform h2 {
	font: 1em/1.462em Arial, Helvetica, sans-serif;
	font-weight: bold;
	white-space: nowrap;
	padding: 10px 19px 4px 37px;
	border: 0;
}

#punpost .blockform h2, #punedit .blockform h2,.pun #quickpost h2,
#pundelete .blockform h2 {
	margin: 1px 1px 0 1px;
	width: 25em;
	position: absolute;
	z-index: 100;
}

.pun #quickpost legend, #punpost legend, #punedit legend {
	width: 25em;
	overflow: hidden;
	white-space: nowrap;
}

.pun .blockform .box {
	border-style: solid;
	border-width: 1px;
	padding-bottom: 12px;
}

.pun #posterror {
	border-style: solid;
	border-width: 1px;
}

.pun #posterror .box {
	padding: 0 18px 12px 18px;
}

* html .pun .blockform .box, * html .pun #posterror {
	display: inline-block;
}

.pun .blockform .forminfo, .pun .error-info {
	padding: 12px 18px;
	border-style: solid;
	border-width: 1px;
	position: relative;
}

.pun .blockform .forminfo {
	margin-top: 12px;
}

#pundelete .blockform .forminfo {
	margin-top: 33px;
}

.pun .forminfo h3 {
	padding-bottom: 0;
}

.pun .error-list li {
	padding-left: 24px;
	background: url(Air/img/exclaim.png) center left no-repeat;
}

.pun .inform {
	padding: 0 18px;
}

.pun legend {
	font-weight: bold;
	padding: 10px 19px 4px 19px;
}

* html .pun legend {
	margin-left: -7px;
}

*:first-child+html .pun legend {
	margin-left: -7px;
}

.pun .infldset {
	border-style: solid;
	border-width: 1px;
	padding: 12px 18px;
}

#punregister #rules .infldset {
	padding: 5px 18px;
}

.pun fieldset p {
	padding: 0 0 7px 0;
	width: 100%;
}

.pun fieldset .usercontent p {
	padding: 7px 0;
}

.pun fieldset label {
	display: block;
	padding: 0 0 7px 0;
}

.pun label em {
	font-weight: normal;
	font-style: normal;
}

.pun .required strong {
	background: url(Air/img/asterisk.png) center right no-repeat;
	font-weight: normal;
	padding-right: 14px;
	white-space: pre;
	display: inline-block;
	line-height: normal;
}

.pun label input, .pun label select, .pun label textarea {
	margin-top: 2px;
}

.pun label.conl {
	display: inline-block;
	padding-right: 12px;
}

.pun form .buttons {
	padding: 8px 19px 8px 34px;
	margin-bottom: -12px;
}

.pun .blockform .buttons input {
	margin-right: 12px;
}

.pun .rbox {
	padding: 3px 0;
}

.pun .rbox label {
	padding: 3px 0 3px 1.75em;
	position: relative;
	min-height: 1px;
}

* html .pun .rbox label {
	text-indent: -3px;
	height: 1%;
}

.pun .rbox input {
	margin: 3px 0.75em 3px -1.75em;
	float: left;
	position: relative;
	vertical-align: middle;
	padding: 0;
	height: 1em;
	width: 1em;
}

.pun input[type=text], .pun select, .pun textarea {
	font-family: Verdana, Arial, Helvetica, sans-serif;
}

.pun .txtarea textarea, .pun input.longinput {
	width: 98%;
}

.pun textarea {
	resize: vertical;
}

.pun #quickpost .txtarea {
	padding-right: 12px;
	position: relative;
}

.pun .blockform .bblinks {
	padding-top: 0;
}

.pun .blockform .bblinks li {
	display: inline;
}

.pun .blockform .bblinks li span {
	background: url(Air/img/help.png) center left no-repeat;
	margin-right: 8px;
	padding-left: 20px;
	display: inline-block;
}

.pun #quickpost .bblinks {
	padding-top: 0;
}

.pun #quickpost .bblinks li {
	display: inline;
}

.pun #login p.clearb {
	border-top-style: dotted;
	border-top-width: 1px;
	font-size: 0;
	height: 0;
	line-height: 0;
	margin-top: 7px;
	overflow: hidden;
	padding-bottom: 3px;
	padding-top: 7px;
	text-indent: -9999em;
	width: 100%;
}

.pun #postreview {
	padding-top: 12px;
}

.pun #postpreview, .pun #posterror {
	margin-bottom: 12px;
}

.pun #postpreview .postright {
	padding: 0;
}

.pun #postpreview .postbody {
	border-style: solid;
	border-width: 1px;
	float: none;
	margin: 0 18px 12px 18px;
	padding: 0;
	padding: 4px 18px 4px 18px;
	width: auto;
}

.pun span.email {
	background: url(Air/img/email.png) left 65% no-repeat;
	margin-right: 5px;
	padding-left: 21px;
	display: inline-block;
	line-height: normal;
}

.pun span.website {
	background: url(Air/img/ext.png) left 65% no-repeat;
	padding-left: 18px;
	display: inline-block;
	line-height: normal;
}

#punmisc #rules .box {
	border-style: solid;
	border-width: 1px;
	padding: 5px 18px;
}


#punhelp .box {
	border-style: solid;
	border-width: 1px;
	padding: 7px 12px;
}

.pun .multiselect {
	float: left;
	padding-bottom: 7px;
}

.pun .checklist {
	border-width: 1px;
	border-style: solid;
	max-height: 9em;
	width: 20em;
	overflow: auto;
	padding: 0.25em 0.5em;
	margin: 0.25em 16px 0 0.15em;
}

.pun .checklist legend {
	padding: 0;
}

.pun .checklist legend span {
	width: auto;
	max-width: 25em;
}

/*****************************************************************
PROFILES (+ ADMIN MENU)
*****************************************************************/

/* Profile / Admin
----------------------------------------------------------------*/

.pun .blockmenu {
	width: 13em;
	float: left;
	padding-bottom: 12px;
}

.pun .block2col .blockform, .pun .block2col .block {
	margin-left: 15em;
}

.pun .blockmenu .block2 {
	padding-top: 19px;
}

.pun .blockmenu ul {
	border-top-style: dotted;
	border-top-width: 1px;
	padding: 0;
}

.pun .blockmenu li {
	border-bottom-style: dotted;
	border-bottom-width: 1px;
	font-weight: bold;
	padding: 0;
}

.pun .blockmenu a:link, .pun .blockmenu a:visited {
	display: block;
	padding: 9px 6px 3px 6px;
	min-height: 1px;
	text-decoration: none;
}

* html .pun .blockmenu a:link,  * html .pun .blockmenu a:visited {
	height: 1%;
}

.pun .blockmenu a:hover, .pun .blockmenu a:active, .pun .blockmenu a:focus {
	text-decoration: none;
}

#viewprofile .box {
	border-style: solid;
	border-width: 1px;
	padding-bottom: 18px;
}

#viewprofile dt, #adstats dt {
	padding: 7px 0;
	position: absolute;
	width: 13em;
	left: 0;
}

#viewprofile dl {
	border-style: solid none none none;
	border-width: 1px;
	margin: 7px 0;
	padding: 0;
	width: 100%;
	position: relative;
}

#adintro, #adstats {
	border-style: solid;
	border-width: 1px;
	padding: 18px;
}

#adintro li span {
	display: inline-block;
	padding-left: 16px;
	margin-left: 8px;
	line-height: normal;
	background: url(Air/img/bull.png) center left no-repeat;
}

#adstats .inbox, #adintro .inbox {
	border-style: solid;
	border-width: 1px;
	padding: 18px;
}

#adstats dl {
	margin: 0;
	padding: 0;
	width: 100%;
	position: relative;
}

#viewprofile dd, #adstats dd {
	border-style: none none solid none;
	border-width: 1px;
	padding: 7px 0 7px 13em;
}

/*****************************************************************
COLOUR SCHEME
*****************************************************************/

/* Basic defaults and Common Items
----------------------------------------------------------------*/

html, body, .pun {
	background: #f6f9fc;
	color: #333;
}

.pun .punwrap {
	background: #fff;
	border-color: #cad7e1;
	color: #566579;
}

#brdtitle #brddesc, .pun .pagepost, #brdstats #onlinelist, #brdfooter #searchlinks, #brdfooter #modcontrols,
#punmaint h2, #punredirect h2, #adminconsole .submittop, .pun #debugtime, .pun .pagelink a, .pun .pagelink * {
	border-color: #b9c5ce;
}

.pun a, .pun a:link, .pun a:visited {
	color: #2365B0;
}

.pun a:hover, .pun a:active, .pun a:focus {
	color: #b50000;
}

.pun .postmsg .postimg a:link img, .pun .postmsg .postimg a:visited img {
	border-color: #22538a;
}

.pun .postmsg .postimg a:hover img, .pun .postmsg .postimg a:active img, .pun .postmsg .postimg a:focus img {
	border-color: #b50000;
}

/* Primary Navigation
----------------------------------------------------------------*/

#brdmenu {
	background: #44699c;
}

#brdmenu a, #brdmenu a:link, #brdmenu a:visited {
	background: #44699c;
	border-color: #fff;
	color: #d4dae2;
}

#brdmenu a:hover, #brdmenu a:active, #brdmenu a:focus {
	background: #b50000;
	border-color: #fff;
	color: #fff;
}

/* Main Tables
----------------------------------------------------------------*/

.pun .blocktable .box {
	background: #fcfdfe;
	border-color: #b9c5ce #d9e1e7;
}

#punindex .blocktable h2, .pun #vf h2 {
	color: #357082;
}

#adminconsole fieldset th, #adminconsole fieldset td {
	background: #f6f9fc;
	border-color: #dfe6ee;
}

.pun #users1 h2 {
	background: #fff;
}

.pun .blocktable td {
	border-color: #dfe6ee;
}

.pun .blocktable th {
	background: #ebf1f5;
	border-color: #cad7e1;
	color: #357082;
}

.pun .blocktable td.tcl span.stickytext {
	color: #3399CC;
}

/* Main Posts
----------------------------------------------------------------*/

.pun .blockpost {
	background: #f6f9fc;
	border-color: #b9c5ce #d9e1e7;
}

.pun .blockpost h2 {
	background: #ebf1f5;
	border-color: #cad7e1;
	color: #357082;
}

.pun .blockpost .postbody, .pun .blockpost .postfoot {
	background: #fcfdfe;
	border-color: #dfe6ee;
}

.pun .blockpost .postfootright li {
	color: #fcfdfe;
}

.pun .postmsg, #punhelp code, #punhelp samp {
	color: #333;
}

.pun .postsignature, .pun .postmsg .postedit {
	color: #566579;
}

.pun .quotebox {
	background: #f8f9f0;
	border-color: #7aadbd;
	color: #566579;
}

.pun .quotebox cite {
	color: #357082;
}

.pun .codebox, #punhelp .codebox code {
	background: #333;
	color: #fff;
}

.pun .postmsg hr {
	background: #b9c5ce;
}

.pun .postmsg ins, #punhelp samp ins {
	background-color: #ff0;
}

/* Main Forms + Profile
----------------------------------------------------------------*/

.pun .blockform .box, #adstats, #adintro, #postpreview, #posterror {
	border-color: #b9c5ce #d9e1e7;
	background: #ebf1f5;
}

#punmisc #rules .box, #punhelp .box {
	border-color: #b9c5ce #d9e1e7;
	background: #f6f9fc;
}

.pun #quickpost h2, #punpost .blockform h2, #punedit .blockform h2, #posterror h2,
#pundelete .blockform h2 {
	background: #ebf1f5;
	color: #357082;
}

.pun .forminfo {
	background: #fff;
	border-color: #dfe6ee;
}

#puninstall form#install .forminfo {
	background: #44699c;
	color: #fff;
}

.pun #posterror .error-info {
	background: #ffffe1;
	border-color: #dfe6ee;
}

#puninstall form#install .error-info {
	background: #ffffe1;
	border-color: #dfe6ee;
	color: #333;
}

.pun .infldset, #adintro .inbox, #adstats .inbox {
	background: #f6f9fc;
	border-color: #dfe6ee;
}

.pun label, .pun legend, #adminconsole fieldset th {
	color: #357082;
}

.pun fieldset p {
	border-color: #b9c5ce;
}

.pun .blockmenu ul, .pun .blockmenu li {
	border-color: #b9c5ce;
}

.pun .blockmenu a:hover, .pun .blockmenu a:active, .pun .blockmenu a:focus {
	background: #ffffe6;
}

.pun .blockmenu .isactive a:link, .pun .blockmenu .isactive a:visited {
	color: #333;
	background: #f6f9fc;
	}

.pun #viewprofile .box {
	border-color: #b9c5ce #d9e1e7;
	background: #ebf1f5;
}

.pun #viewprofile dt, #adstats dt {
	color: #357082;
}

.pun #viewprofile dl, .pun #viewprofile dd, #adstats dl, #adstats dd {
	border-color: #dfe6ee;
}

#adminconsole fieldset td.nodefault {
	background: #d59b9b;
}

.pun .multiselect {
	color: #357082;
}

.pun .checklist {
	background: white;
	border-color: #ccc;
}

/* Status Indicators
----------------------------------------------------------------*/

.pun .icon {
	border-color: #e8ecf1 #d4d9dd #dfe3e8 #e8ecf1;
}

.pun .iredirect .icon {
	border-color: #b9c5ce;
	border-width: 1px;
	padding: 7px;
}

.pun .inew .icon {
	border-color: #91b3d9 #87a8d1 #6c85bb #7292c3;
}
 /* AJOUTER || SPOILER
 ----------------------------------------------------------------*/
div.spoiler {
	margin: 0 0 5px 0;
 }

div.teaser {
	padding: 5px 10px;
	margin-bottom: -5px;
	cursor: pointer;
	position: relative;
	background-color: rgb(35, 35, 35);
	border-top: 5px solid rgb(48, 206, 0);
	width: 7.5%;
 }
 
p.show {
	color: rgb(48, 206, 0);
	text-align: center;
	text-transform: uppercase;
	font-weight: bold;
	padding: 0px;
 }

p.hide {
	color: rgb(48, 206, 0);
	text-align: center;
	text-transform: uppercase;
	font-weight: bold;
	padding: 0px;
 }

div.contenu {
	padding: 5px 10px;
	background-color: rgb(35, 35, 35);
	color: white;
	border-top: 5px solid rgb(48, 206, 0);
 }


include/template/main.tpl


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<pun_language>" lang="<pun_language>" dir="<pun_content_direction>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <!-- ADD JQUERY -->
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
   <!-- END ADD -->
<pun_head>
</head>

<body>

<div id="pun<pun_page>" class="pun">
<div class="top-box"><div><!-- Top Corners --></div></div>
<div class="punwrap">

<div id="brdheader" class="block">
	<div class="box">
		<div id="brdtitle" class="inbox">
			<pun_title>
			<pun_desc>
		</div>
		<pun_navlinks>
		<pun_status>
	</div>
</div>

<pun_announcement>

<div id="brdmain">
<pun_main>
</div>

<pun_footer>

</div>
<div class="end-box"><div><!-- Bottom corners --></div></div>
</div>


<script> // AJOUTER || SPOILER
$(document).ready(function() {
jQuery(".contenu").hide();
jQuery(".teaser").click(function()
{
jQuery(this).next(".contenu").slideToggle(500);
var title = $('.show');
if (title.text() == 'Montrer') title.text('Cacher');
else title.text('Montrer');
});
}); 
</script>   

  
</body>
</html>

ses fichiers sont sans mod , inspirer vous de ses fichiers afin de voir si tout est correct : perso sa marche bien chez moi


aussi il pourrait s'avérer qu'il pourrait y manquer des // ou autre symbole  ...

cdlt

Dernière modification par david18 (26-01-2014 21:19:58)

Hors ligne

#11 27-01-2014 22:53:32

alex83270
Habitué
Inscription : 06-11-2013
Messages : 162

Re : [Mod] Simple Custom Spoiler v1

En fait je pense que c'est l'appelle du code qui n'est pas bon, je ne suis pas un expert.
Avez vous bien fais :

#
#---------[ 25. FIND ]-----------------------------------------------------------
#

        <head>
       
#
#---------[ 26. AFTER, ADD ]-----------------------------------------------------------
#

        <!-- ADD JQUERY -->
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
        <!-- END ADD -->

#
#---------[ 27. ADD (AT THE END) ]-----------------------------------------------------------
#

        <script> // ADD || SPOILER
        $(document).ready(function() {
        jQuery(".contenu").hide();
        jQuery(".teaser").click(function()
        {
        jQuery(this).next(".contenu").slideToggle(500);
        });
        });
        </script>

Car j'ai l'impression que vous avez regroupé :

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  <script> // ADD || SPOILER
        $(document).ready(function() {
        jQuery(".contenu").hide();
        jQuery(".teaser").click(function()
        {
        jQuery(this).next(".contenu").slideToggle(500);
        });
        });
        </script>

Ce qui faut pas faire car le premier code va en dessous du head et le second complètement à la fin.

Je sais pas si cela y joue, à voir.

Cdlt.

Hors ligne

#12 30-01-2014 21:47:48

ReaverSX
Nouveau Membre
Inscription : 26-01-2014
Messages : 2

Re : [Mod] Simple Custom Spoiler v1

Re bonjour le problème est résolu il suffisait juste de modifier le main.tpl du thème utilisé, et non pas celui du include simple comme bonjour siffle ....
Merci quand meme pour votre aide.

Cdlt.

Hors ligne

#13 31-01-2014 22:01:35

alex83270
Habitué
Inscription : 06-11-2013
Messages : 162

Re : [Mod] Simple Custom Spoiler v1

A ben je suis content que vous ayez réussi car je ne suis qu'un bricoleur du dimanche au sujet du codage.

Hors ligne

Pied de page des forums