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 :

#51 26-12-2013 16:50:21

Ba_Ko
Membre
Inscription : 24-12-2013
Messages : 40

Re : TopicTags

Bonjour

J'ai un probleme suite à l'installation du MOD TOPIC TAGs

P4iX8ge.png


Amicalement, Ba_Ko

Hors ligne

#52 26-12-2013 18:09:24

Otomatic
Régisseur
Lieu : Paris, France
Inscription : 12-12-2005
Messages : 3 556
Site Web

Re : TopicTags

Bonjour,
Il y a eu au moins une erreur dans l'installation. À priori, il manquerait une balise d'ouverture de code PHP <?php


Ce n'est pas parce que l'erreur se propage qu'elle devient vérité. Gandhi
Sont différents : ça et sa - est et ait - à et a - ce et se - mes et mais ou met - été et était - c'est et ces - ce-si et ceci
La vie sans musique est tout simplement une erreur, une fatigue, un exil. Friedrich Nietzsche

Hors ligne

#53 26-12-2013 18:58:21

Ba_Ko
Membre
Inscription : 24-12-2013
Messages : 40

Re : TopicTags

Otomatic a écrit :

Bonjour,
Il y a eu au moins une erreur dans l'installation. À priori, il manquerait une balise d'ouverture de code PHP <?php

Il n'e manque pas dans viewtopic.php

le voila d'ailleurs :*

<?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
 */

define('PUN_ROOT', dirname(__FILE__).'/');
require PUN_ROOT.'include/common.php';


if ($pun_user['g_read_board'] == '0')
	message($lang_common['No view'], false, '403 Forbidden');


$action = isset($_GET['action']) ? $_GET['action'] : null;
$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
$pid = isset($_GET['pid']) ? intval($_GET['pid']) : 0;
if ($id < 1 && $pid < 1)
	message($lang_common['Bad request'], false, '404 Not Found');

// [modif oto] - mod VSABR Very Simple AntiBot Registration - Add language file
if(file_exists(PUN_ROOT.'lang/'.$pun_user['language'].'/mod_very_simple_antibot.php'))
  require PUN_ROOT.'lang/'.$pun_user['language'].'/mod_very_simple_antibot.php';
else
  require PUN_ROOT.'lang/English/mod_very_simple_antibot.php';
$mod_vsabr_index = rand(0,count($mod_vsabr_questions)-1);
// [modif oto] - End mod VSABR
// Load the viewtopic.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/topic.php';


// If a post ID is specified we determine topic ID and page number so we can redirect to the correct message
if ($pid)
{
	$result = $db->query('SELECT topic_id, posted FROM '.$db->prefix.'posts WHERE id='.$pid) or error('Unable to fetch topic ID', __FILE__, __LINE__, $db->error());
	if (!$db->num_rows($result))
		message($lang_common['Bad request'], false, '404 Not Found');

	list($id, $posted) = $db->fetch_row($result);

	// Determine on which page the post is located (depending on $forum_user['disp_posts'])
	$result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE topic_id='.$id.' AND posted<'.$posted) or error('Unable to count previous posts', __FILE__, __LINE__, $db->error());
	$num_posts = $db->result($result) + 1;

	$_GET['p'] = ceil($num_posts / $pun_user['disp_posts']);
}

// If action=new, we redirect to the first new post (if any)
else if ($action == 'new')
{
	if (!$pun_user['is_guest'])
	{
		// We need to check if this topic has been viewed recently by the user
		$tracked_topics = get_tracked_topics();
		$last_viewed = isset($tracked_topics['topics'][$id]) ? $tracked_topics['topics'][$id] : $pun_user['last_visit'];

		$result = $db->query('SELECT MIN(id) FROM '.$db->prefix.'posts WHERE topic_id='.$id.' AND posted>'.$last_viewed) or error('Unable to fetch first new post info', __FILE__, __LINE__, $db->error());
		$first_new_post_id = $db->result($result);

		if ($first_new_post_id)
		{
			header('Location: viewtopic.php?pid='.$first_new_post_id.'#p'.$first_new_post_id);
			exit;
		}
	}

	// If there is no new post, we go to the last post
	header('Location: viewtopic.php?id='.$id.'&action=last');
	exit;
}

// If action=last, we redirect to the last post
else if ($action == 'last')
{
	$result = $db->query('SELECT MAX(id) FROM '.$db->prefix.'posts WHERE topic_id='.$id) or error('Unable to fetch last post info', __FILE__, __LINE__, $db->error());
	$last_post_id = $db->result($result);

	if ($last_post_id)
	{
		header('Location: viewtopic.php?pid='.$last_post_id.'#p'.$last_post_id);
		exit;
	}
}


// Fetch some info about the topic
if (!$pun_user['is_guest'])
	$result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, t.first_post_id, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'topic_subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['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) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
else
	$result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, t.first_post_id, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_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) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());

if (!$db->num_rows($result))
	message($lang_common['Bad request'], false, '404 Not Found');

$cur_topic = $db->fetch_assoc($result);

// Sort out who the moderators are and if we are currently a moderator (or an admin)
$mods_array = ($cur_topic['moderators'] != '') ? unserialize($cur_topic['moderators']) : array();
$is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_moderator'] == '1' && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
if ($is_admmod)
	$admin_ids = get_admin_ids();

// Can we or can we not post replies?
if ($cur_topic['closed'] == '0')
{
	if (($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1') || $cur_topic['post_replies'] == '1' || $is_admmod)
		$post_link = "\t\t\t".'<p class="postlink conr"><a href="post.php?tid='.$id.'">'.$lang_topic['Post reply'].'</a></p>'."\n";
	else
		$post_link = '';
}
else
{
	$post_link = $lang_topic['Topic closed'];

	if ($is_admmod)
		$post_link .= ' / <a href="post.php?tid='.$id.'">'.$lang_topic['Post reply'].'</a>';

	$post_link = "\t\t\t".'<p class="postlink conr">'.$post_link.'</p>'."\n";
}

// Begin TopicTags
require PUN_ROOT.'include/topictags.php';
if (file_exists(FORUM_CACHE_DIR.'cache_topictags.php'))
	require FORUM_CACHE_DIR.'cache_topictags.php';
else
{
	generate_tag_cache();
	require FORUM_CACHE_DIR.'cache_topictags.php';
}
if (file_exists(PUN_ROOT.'lang/'.$pun_user['language'].'/topictags.php'))
	require PUN_ROOT.'lang/'.$pun_user['language'].'/topictags.php';
else
	require PUN_ROOT.'lang/English/topictags.php';

// Retrieve topic author (for 'restricted' test)
$result = $db->query('SELECT poster_id FROM '.$db->prefix.'posts WHERE id='.$cur_topic['first_post_id']) or error('Unable to fetch topic author', __FILE__, __LINE__, $db->error());
$topic_author = $db->result($result);

// Retrieve tags
$result = $db->query('SELECT tag_id FROM '.$db->prefix.'tagged WHERE topic_id='.$id) or error('Unable to fetch topic tags', __FILE__, __LINE__, $db->error());
$tagged = array();
$span_tag = array();
$text_tag = array();
$remove_tag = array();
while ($tag = $db->fetch_row($result))
{
	$tagged[] = $tag[0];
	$span_tag[] = $topictags[$tag[0]]['span'];
	$text_tag[] = $topictags[$tag[0]]['text'];

	// Fill the remove select
	if (	($pun_user['g_id'] == PUN_ADMIN ||
			($is_admmod && $topictags[$tag[0]]['rights'] != PUN_ADMIN) ||
			(!$is_admmod && $topictags[$tag[0]]['rights'] == $pun_user['g_id']) ||
			(!$pun_user['is_guest'] &&
				($topictags[$tag[0]]['rights'] == PUN_MEMBER || $topictags[$tag[0]]['rights'] == PUN_GUEST)
			)
		) &&
		(!$topictags[$tag[0]]['restricted'] || $pun_user['id'] == $topic_author)
	)
		$remove_tag[$tag[0]] = $topictags[$tag[0]]['text'];
}

// Fill the add select
$add_tag = array();
foreach ($topictags as $tag_id => $t)
	if (	!in_array($tag_id, $tagged) &&
		($pun_user['g_id'] == PUN_ADMIN ||
			($is_admmod && $t['rights'] != PUN_ADMIN) ||
			(!$is_admmod && $t['rights'] == $pun_user['g_id']) ||
			(!$pun_user['is_guest'] &&
				($t['rights'] == PUN_MEMBER || $t['rights'] == PUN_GUEST)
			)
		) &&
		(!$t['restricted'] || $pun_user['id'] == $topic_author)
	)
		$add_tag[$tag_id] = $t['text'];

// Add a form to $post_link
if (!empty($remove_tag) || !empty($add_tag))
{
	$post_link .= "\t\t\t".'<form method="post" action="manage_tags.php" style="margin: 4px 0; text-align: center"><div>'."\n";
	if (!empty($add_tag))
	{
		$post_link .= "\t\t\t\t".'<select name="added">'."\n";
		foreach ($add_tag as $tag_id => $texttag)
			$post_link .= "\t\t\t\t\t".'<option value="'.$tag_id.'">'.$texttag.'</option>'."\n";
		$post_link .= "\t\t\t\t".'</select>'."\n";
		$post_link .= "\t\t\t\t".'<input type="submit" name="add_tag" value="'.$lang_topictag['Add Tag'].'" />&nbsp;&nbsp;&nbsp;&nbsp;'."\n";
	}
	if (!empty($remove_tag))
	{
		$post_link .= "\t\t\t\t".'<select name="removed">'."\n";
		foreach ($remove_tag as $tag_id => $texttag)
			$post_link .= "\t\t\t\t\t".'<option value="'.$tag_id.'">'.$texttag.'</option>'."\n";
		$post_link .= "\t\t\t\t".'</select>'."\n";
		$post_link .= "\t\t\t\t".'<input type="submit" name="remove_tag" value="'.$lang_topictag['Remove Tag'].'" />'."\n";
	}
	$post_link .= "\t\t\t\t".'<input type="hidden" name="topic" value="'.$id.'" />'."\n";
	$post_link .= "\t\t\t\t".'<input type="hidden" name="author" value="'.$topic_author.'" />'."\n";
	$post_link .= "\t\t\t\t".'<input type="hidden" name="ref" value="'.$_SERVER['REQUEST_URI'].'" />'."\n";
	$post_link .= "\t\t\t".'</div></form>'."\n";
}
// End TopicTags
// Add/update this topic in our list of tracked topics
if (!$pun_user['is_guest'])
{
	$tracked_topics = get_tracked_topics();
	$tracked_topics['topics'][$id] = time();
	set_tracked_topics($tracked_topics);
}


// Determine the post offset (based on $_GET['p'])
$num_pages = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);

$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : intval($_GET['p']);
$start_from = $pun_user['disp_posts'] * ($p - 1);

// Generate paging links
$paging_links = '<span class="pages-label">'.$lang_common['Pages'].' </span>'.paginate($num_pages, $p, 'viewtopic.php?id='.$id);


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


$quickpost = false;
if ($pun_config['o_quickpost'] == '1' &&
	($cur_topic['post_replies'] == '1' || ($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1')) &&
	($cur_topic['closed'] == '0' || $is_admmod))
{
	// Load the post.php language file
	require PUN_ROOT.'lang/'.$pun_user['language'].'/post.php';

	$required_fields = array('req_message' => $lang_common['Message']);
	if ($pun_user['is_guest'])
	{
		$required_fields['req_username'] = $lang_post['Guest name'];
		if ($pun_config['p_force_guest_email'] == '1')
			$required_fields['req_email'] = $lang_common['Email'];
	}
	$quickpost = true;
}

if (!$pun_user['is_guest'] && $pun_config['o_topic_subscriptions'] == '1')
{
	if ($cur_topic['is_subscribed'])
		// I apologize for the variable naming here. It's a mix of subscription and action I guess :-)
		$subscraction = "\t\t".'<p class="subscribelink clearb"><span>'.$lang_topic['Is subscribed'].' - </span><a href="misc.php?action=unsubscribe&amp;tid='.$id.'">'.$lang_topic['Unsubscribe'].'</a></p>'."\n";
	else
		$subscraction = "\t\t".'<p class="subscribelink clearb"><a href="misc.php?action=subscribe&amp;tid='.$id.'">'.$lang_topic['Subscribe'].'</a></p>'."\n";
}
else
	$subscraction = '';

if ($pun_config['o_feed_type'] == '1')
	$page_head = array('feed' => '<link rel="alternate" type="application/rss+xml" href="extern.php?action=feed&amp;tid='.$id.'&amp;type=rss" title="'.$lang_common['RSS topic feed'].'" />');
else if ($pun_config['o_feed_type'] == '2')
	$page_head = array('feed' => '<link rel="alternate" type="application/atom+xml" href="extern.php?action=feed&amp;tid='.$id.'&amp;type=atom" title="'.$lang_common['Atom topic feed'].'" />');

$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), pun_htmlspecialchars($cur_topic['forum_name']), (!empty($text_tag)) ? sprintf($tag_display_text, implode(', ', $text_tag)).pun_htmlspecialchars($cur_topic['subject']) : pun_htmlspecialchars($cur_topic['subject']));
define('PUN_ALLOW_INDEX', 1);
define('PUN_ACTIVE_PAGE', 'index');
require PUN_ROOT.'header.php';

?>
<div class="linkst">
	<div class="inbox crumbsplus">
		<ul class="crumbs">
			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
			<li><span>»&#160;</span><a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li>
			<li><span>»&#160;</span><a href="viewtopic.php?id=<?php echo $id ?>"><strong><?php echo (!empty($span_tag)) ? sprintf($tag_display_span, implode(', ', $span_tag)).pun_htmlspecialchars($cur_topic['subject']) : pun_htmlspecialchars($cur_topic['subject']) ?></strong></a></li></ul>
		<div class="pagepost">
			<p class="pagelink conl"><?php echo $paging_links ?></p>
<?php echo $post_link ?>
		</div>
		<div class="clearer"></div>
	</div>
</div>

<?php


require PUN_ROOT.'include/parser.php';

$post_count = 0; // Keep track of post numbers

// Retrieve a list of post IDs, LIMIT is (really) expensive so we only fetch the IDs here then later fetch the remaining data
$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$id.' ORDER BY id LIMIT '.$start_from.','.$pun_user['disp_posts']) or error('Unable to fetch post IDs', __FILE__, __LINE__, $db->error());

$post_ids = array();
for ($i = 0;$cur_post_id = $db->result($result, $i);$i++)
	$post_ids[] = $cur_post_id;

if (empty($post_ids))
	error('The post table and topic table seem to be out of sync!', __FILE__, __LINE__);

// Retrieve the posts (and their respective poster/online status)
$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.signature, u.email_setting, u.use_pm, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, g.g_pm, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.id IN ('.implode(',', $post_ids).') ORDER BY p.id', true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
while ($cur_post = $db->fetch_assoc($result))
{
	$post_count++;
	$user_avatar = '';
	$user_info = array();
	$user_contacts = array();
	$post_actions = array();
	$is_online = '';
	$signature = '';

	// If the poster is a registered user
	if ($cur_post['poster_id'] > 1)
	{
		if ($pun_user['g_view_users'] == '1')
			$username = '<a href="profile.php?id='.$cur_post['poster_id'].'">'.pun_htmlspecialchars($cur_post['username']).'</a>';
		else
			$username = pun_htmlspecialchars($cur_post['username']);

		$user_title = get_title($cur_post);

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

		// Format the online indicator
		$is_online = ($cur_post['is_online'] == $cur_post['poster_id']) ? '<strong>'.$lang_topic['Online'].'</strong>' : '<span>'.$lang_topic['Offline'].'</span>';

		if ($pun_config['o_avatars'] == '1' && $pun_user['show_avatars'] != '0')
		{
			if (isset($user_avatar_cache[$cur_post['poster_id']]))
				$user_avatar = $user_avatar_cache[$cur_post['poster_id']];
			else
				$user_avatar = $user_avatar_cache[$cur_post['poster_id']] = generate_avatar_markup($cur_post['poster_id']);
		}

		// We only show location, register date, post count and the contact links if "Show user info" is enabled
		if ($pun_config['o_show_user_info'] == '1')
		{
			if ($cur_post['location'] != '')
			{
				if ($pun_config['o_censoring'] == '1')
					$cur_post['location'] = censor_words($cur_post['location']);

				$user_info[] = '<dd><span>'.$lang_topic['From'].' '.pun_htmlspecialchars($cur_post['location']).'</span></dd>';
			}

			$user_info[] = '<dd><span>'.$lang_topic['Registered'].' '.format_time($cur_post['registered'], true).'</span></dd>';

			if ($pun_config['o_show_post_count'] == '1' || $pun_user['is_admmod'])
				$user_info[] = '<dd><span>'.$lang_topic['Posts'].' '.forum_number_format($cur_post['num_posts']).'</span></dd>';

			// Now let's deal with the contact links (Email and URL)
			if ((($cur_post['email_setting'] == '0' && !$pun_user['is_guest']) || $pun_user['is_admmod']) && $pun_user['g_send_email'] == '1')
				$user_contacts[] = '<span class="email"><a href="mailto:'.pun_htmlspecialchars($cur_post['email']).'">'.$lang_common['Email'].'</a></span>';
			else if ($cur_post['email_setting'] == '1' && !$pun_user['is_guest'] && $pun_user['g_send_email'] == '1')
				$user_contacts[] = '<span class="email"><a href="misc.php?email='.$cur_post['poster_id'].'">'.$lang_common['Email'].'</a></span>';

			require PUN_ROOT.'plugins/apms/viewtopic_add1.php';


			if ($cur_post['url'] != '')
			{
				if ($pun_config['o_censoring'] == '1')
					$cur_post['url'] = censor_words($cur_post['url']);

				$user_contacts[] = '<span class="website"><a href="'.pun_htmlspecialchars($cur_post['url']).'" rel="nofollow">'.$lang_topic['Website'].'</a></span>';
			}
		}

		if ($pun_user['is_admmod'])
		{
			$user_info[] = '<dd><span><a href="moderate.php?get_host='.$cur_post['id'].'" title="'.pun_htmlspecialchars($cur_post['poster_ip']).'">'.$lang_topic['IP address logged'].'</a></span></dd>';

			if ($cur_post['admin_note'] != '')
				$user_info[] = '<dd><span>'.$lang_topic['Note'].' <strong>'.pun_htmlspecialchars($cur_post['admin_note']).'</strong></span></dd>';
		}
	}
	// If the poster is a guest (or a user that has been deleted)
	else
	{
		$username = pun_htmlspecialchars($cur_post['username']);
		$user_title = get_title($cur_post);

		if ($pun_user['is_admmod'])
			$user_info[] = '<dd><span><a href="moderate.php?get_host='.$cur_post['id'].'" title="'.pun_htmlspecialchars($cur_post['poster_ip']).'">'.$lang_topic['IP address logged'].'</a></span></dd>';

		if ($pun_config['o_show_user_info'] == '1' && $cur_post['poster_email'] != '' && !$pun_user['is_guest'] && $pun_user['g_send_email'] == '1')
			$user_contacts[] = '<span class="email"><a href="mailto:'.pun_htmlspecialchars($cur_post['poster_email']).'">'.$lang_common['Email'].'</a></span>';
	}

	// Generation post action array (quote, edit, delete etc.)
	if (!$is_admmod)
	{
		if (!$pun_user['is_guest'])
			$post_actions[] = '<li class="postreport"><span><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a></span></li>';

		if ($cur_topic['closed'] == '0')
		{
			if ($cur_post['poster_id'] == $pun_user['id'])
			{
				if ((($start_from + $post_count) == 1 && $pun_user['g_delete_topics'] == '1') || (($start_from + $post_count) > 1 && $pun_user['g_delete_posts'] == '1'))
					$post_actions[] = '<li class="postdelete"><span><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a></span></li>';
				if ($pun_user['g_edit_posts'] == '1')
					$post_actions[] = '<li class="postedit"><span><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a></span></li>';
			}

			if (($cur_topic['post_replies'] == '' && $pun_user['g_post_replies'] == '1') || $cur_topic['post_replies'] == '1')
				$post_actions[] = '<li class="postquote"><span><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a></span></li>';
		}
	}
	else
	{
		$post_actions[] = '<li class="postreport"><span><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a></span></li>';
		if ($pun_user['g_id'] == PUN_ADMIN || !in_array($cur_post['poster_id'], $admin_ids))
		{
			$post_actions[] = '<li class="postdelete"><span><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a></span></li>';
			$post_actions[] = '<li class="postedit"><span><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a></span></li>';
		}
		$post_actions[] = '<li class="postquote"><span><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a></span></li>';
	}
if ($cur_post['poster_id'] > 1 && $pun_user['g_view_users'] == '1')
		$username = str_replace('">'.pun_htmlspecialchars($cur_post['username']).'</a>', '">'.colorize_group($cur_post['username'], $cur_post['g_id']).'</a>', $username);
	else
		$username = colorize_group($cur_post['username'], $cur_post['g_id']);
	// Perform the main parsing of the message (BBCode, smilies, censor words etc)
	$cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);

	// Do signature parsing/caching
	if ($pun_config['o_signatures'] == '1' && $cur_post['signature'] != '' && $pun_user['show_sig'] != '0')
	{
		if (isset($signature_cache[$cur_post['poster_id']]))
			$signature = $signature_cache[$cur_post['poster_id']];
		else
		{
			$signature = parse_signature($cur_post['signature']);
			$signature_cache[$cur_post['poster_id']] = $signature;
		}
	}

?>
<div id="p<?php echo $cur_post['id'] ?>" class="blockpost<?php echo ($post_count % 2 == 0) ? ' roweven' : ' rowodd' ?><?php if ($cur_post['id'] == $cur_topic['first_post_id']) echo ' firstpost'; ?><?php if ($post_count == 1) echo ' blockpost1'; ?>">
	<h2><span><span class="conr">#<?php echo ($start_from + $post_count) ?></span> <a href="viewtopic.php?pid=<?php echo $cur_post['id'].'#p'.$cur_post['id'] ?>"><?php echo format_time($cur_post['posted']) ?></a></span></h2>
	<div class="box">
		<div class="inbox">
			<div class="postbody">
				<div class="postleft">
					<dl>
						<dt><strong><?php echo $username ?></strong></dt>
						<dd class="usertitle"><strong><?php echo $user_title ?></strong></dd>
<?php if ($user_avatar != '') echo "\t\t\t\t\t\t".'<dd class="postavatar">'.$user_avatar.'</dd>'."\n"; ?>
<?php if (count($user_info)) echo "\t\t\t\t\t\t".implode("\n\t\t\t\t\t\t", $user_info)."\n"; ?>
<?php if (count($user_contacts)) echo "\t\t\t\t\t\t".'<dd class="usercontacts">'.implode(' ', $user_contacts).'</dd>'."\n"; ?>
					</dl>
				</div>
				<div class="postright">
					<h3><?php if ($cur_post['id'] != $cur_topic['first_post_id']) echo $lang_topic['Re'].' '; ?><?php echo (!empty($span_tag)) ? sprintf($tag_display_span, implode(', ', $span_tag)).pun_htmlspecialchars($cur_topic['subject']) : pun_htmlspecialchars($cur_topic['subject']) ?></h3>
					<div class="postmsg">$cur_post['message']."\n" ?>
<?php if ($cur_post['edited'] != '') echo "\t\t\t\t\t\t".'<p class="postedit"><em>'.$lang_topic['Last edit'].' '.pun_htmlspecialchars($cur_post['edited_by']).' ('.format_time($cur_post['edited']).')</em></p>'."\n"; ?>
					</div>
<?php if ($signature != '') echo "\t\t\t\t\t".'<div class="postsignature postmsg"><hr />'.$signature.'</div>'."\n"; ?>
				</div>
			</div>
		</div>
		<div class="inbox">
			<div class="postfoot clearb">
				<div class="postfootleft"><?php if ($cur_post['poster_id'] > 1) echo '<p>'.$is_online.'</p>'; ?></div>
<?php if (count($post_actions)) echo "\t\t\t\t".'<div class="postfootright">'."\n\t\t\t\t\t".'<ul>'."\n\t\t\t\t\t\t".implode("\n\t\t\t\t\t\t", $post_actions)."\n\t\t\t\t\t".'</ul>'."\n\t\t\t\t".'</div>'."\n" ?>
			</div>
		</div>
	</div>
</div>

<?php

}

?>
<div class="postlinksb">
	<div class="inbox crumbsplus">
		<div class="pagepost">
			<p class="pagelink conl"><?php echo $paging_links ?></p>
<?php echo $post_link ?>
		</div>
		<ul class="crumbs">
			<li><a href="index.php"><?php echo $lang_common['Index'] ?></a></li>
			<li><span>»&#160;</span><a href="viewforum.php?id=<?php echo $cur_topic['forum_id'] ?>"><?php echo pun_htmlspecialchars($cur_topic['forum_name']) ?></a></li>
			<li><span>»&#160;</span><a href="viewtopic.php?id=<?php echo $id ?>"><strong><?php echo (!empty($span_tag)) ? sprintf($tag_display_span, implode(', ', $span_tag)).pun_htmlspecialchars($cur_topic['subject']) : pun_htmlspecialchars($cur_topic['subject']) ?></strong></a></li>	</ul>
<?php echo $subscraction ?>
		<div class="clearer"></div>
	</div>
</div>

<?php

// Display quick post if enabled
if ($quickpost)
{

$cur_index = 1;

?>
<div id="quickpost" class="blockform">
	<h2><span><?php echo $lang_topic['Quick post'] ?></span></h2>
	<div class="box">
		<form id="quickpostform" method="post" action="post.php?tid=<?php echo $id ?>" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">
			<div class="inform">
				<fieldset>
					<legend><?php echo $lang_common['Write message legend'] ?></legend>
					<div class="infldset txtarea">
						<input type="hidden" name="form_sent" value="1" />
<?php if ($pun_config['o_topic_subscriptions'] == '1' && ($pun_user['auto_notify'] == '1' || $cur_topic['is_subscribed'])): ?>						<input type="hidden" name="subscribe" value="1" />
<?php endif; ?>
<?php

if ($pun_user['is_guest'])
{
	$email_label = ($pun_config['p_force_guest_email'] == '1') ? '<strong>'.$lang_common['Email'].' <span>'.$lang_common['Required'].'</span></strong>' : $lang_common['Email'];
	$email_form_name = ($pun_config['p_force_guest_email'] == '1') ? 'req_email' : 'email';

?>
						<label class="conl required"><strong><?php echo $lang_post['Guest name'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="text" name="req_username" value="<?php if (isset($_POST['req_username'])) echo pun_htmlspecialchars($username); ?>" size="25" maxlength="25" tabindex="<?php echo $cur_index++ ?>" /><br /></label>
						<label class="conl<?php echo ($pun_config['p_force_guest_email'] == '1') ? ' required' : '' ?>"><?php echo $email_label ?><br /><input type="text" name="<?php echo $email_form_name ?>" value="<?php if (isset($_POST[$email_form_name])) echo pun_htmlspecialchars($email); ?>" size="50" maxlength="80" tabindex="<?php echo $cur_index++ ?>" /><br /></label>
						<div class="clearer"></div>
<?php

	echo "\t\t\t\t\t\t".'<label class="required"><strong>'.$lang_common['Message'].' <span>'.$lang_common['Required'].'</span></strong><br />';
}
else
	echo "\t\t\t\t\t\t".'<label>';

?>
<textarea id="req_message" name="req_message" rows="7" cols="75" tabindex="<?php echo $cur_index++ ?>"></textarea></label>
<?php /* FluxToolBar */
if (file_exists(FORUM_CACHE_DIR.'cache_fluxtoolbar_quickform.php'))
	include FORUM_CACHE_DIR.'cache_fluxtoolbar_quickform.php';
else
{
	require_once PUN_ROOT.'include/cache_fluxtoolbar.php';
	generate_ftb_cache('quickform');
	require FORUM_CACHE_DIR.'cache_fluxtoolbar_quickform.php';
}
?>
						<ul class="bblinks">
							<li><span><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a> <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
							<li><span><a href="help.php#url" onclick="window.open(this.href); return false;"><?php echo $lang_common['url tag'] ?></a> <?php echo ($pun_config['p_message_bbcode'] == '1' && $pun_user['g_post_links'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
							<li><span><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a> <?php echo ($pun_config['p_message_bbcode'] == '1' && $pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
							<li><span><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a> <?php echo ($pun_config['o_smilies'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></span></li>
						</ul>
					</div>
				</fieldset>
			</div>
			<?php //[modif oto] - mod VSABR Very Simple AntiBot Registration
if($pun_user['is_guest']) : ?>
<div class="inform">
	<fieldset>
		<legend><?php	echo $lang_mod_vsabr['Robot title']	?></legend>
		<div class="infldset">
			<p><?php echo	$lang_mod_vsabr['Robot info']	?></p>
			<label class="required"><strong><?php
				 $question = array_keys($mod_vsabr_questions);
				 $qencoded = md5($question[$mod_vsabr_index]);
				 echo	sprintf($lang_mod_vsabr['Robot question'],$question[$mod_vsabr_index]);?>
				 <span><?php echo	$lang_common['Required'] ?></span></strong>
				 <input	name="captcha" id="captcha"	type="text"	size="10"	maxlength="30" /><input name="captcha_q"	value="<?php echo	$qencoded	?>"	type="hidden"	/><br	/>
			</label>
		</div>
	</fieldset>
</div>
<?php endif; //[modif oto] - End mod VSABR ?>
<p class="buttons"><input type="submit" name="submit" tabindex="<?php echo $cur_index++ ?>" value="<?php echo $lang_common['Submit'] ?>" accesskey="s" /> <input type="submit" name="preview" value="<?php echo $lang_topic['Preview'] ?>" tabindex="<?php echo $cur_index++ ?>" accesskey="p" /></p>
		</form>
	</div>
</div>
<?php

}

// Increment "num_views" for topic
if ($pun_config['o_topic_views'] == '1')
	$db->query('UPDATE '.$db->prefix.'topics SET num_views=num_views+1 WHERE id='.$id) or error('Unable to update topic', __FILE__, __LINE__, $db->error());

$forum_id = $cur_topic['forum_id'];
$footer_style = 'viewtopic';
require PUN_ROOT.'footer.php';

Dernière modification par Ba_Ko (26-12-2013 18:59:29)


Amicalement, Ba_Ko

Hors ligne

#54 26-12-2013 19:28:54

Otomatic
Régisseur
Lieu : Paris, France
Inscription : 12-12-2005
Messages : 3 556
Site Web

Re : TopicTags

Bonjour,

Il manque bien une balise d'ouverture <?php lignes 457/458 :

<h3><?php if ($cur_post['id'] != $cur_topic['first_post_id']) echo $lang_topic['Re'].' '; ?><?php echo (!empty($span_tag)) ? sprintf($tag_display_span, implode(', ', $span_tag)).pun_htmlspecialchars($cur_topic['subject']) : pun_htmlspecialchars($cur_topic['subject']) ?></h3>
<div class="postmsg">$cur_post['message']."\n" ?>

<h3> ouvert ; php ouvert-fermé-ouvert-fermé ; </h3> fermé puis <div > ouvert, puis php fermé SANS ouverture. L'erreur est ligne 458 :

<div class="postmsg">$cur_post['message']."\n" ?>

qui, d'origine est

<div class="postmsg">
	<?php echo $cur_post['message']."\n" ?>

Ce n'est pas parce que l'erreur se propage qu'elle devient vérité. Gandhi
Sont différents : ça et sa - est et ait - à et a - ce et se - mes et mais ou met - été et était - c'est et ces - ce-si et ceci
La vie sans musique est tout simplement une erreur, une fatigue, un exil. Friedrich Nietzsche

Hors ligne

#55 26-12-2013 19:37:33

Ba_Ko
Membre
Inscription : 24-12-2013
Messages : 40

Re : TopicTags

Merci sa marche smile


Amicalement, Ba_Ko

Hors ligne

#56 31-12-2013 01:09:54

Kervinou
Membre
Lieu : Ile de France
Inscription : 19-12-2013
Messages : 23
Site Web

Re : TopicTags

Bonsoir et merci pour le suivi, je vois que je peux tenter de le mettre en place sur une version 1.5.5, objet de ma recherche ici ;-)
Joyeuses fêtes !


Minecraft Serveur pour adulte et +21ans - MadInCRAFT 100% Survival
Informations et Forum http://madincraft.fr

Hors ligne

#57 06-05-2014 20:21:38

adaur
Habitué très actif
Lieu : Derrière Notepad ++ !
Inscription : 25-09-2008
Messages : 1 937
Site Web

Re : TopicTags

Readme màj pour 1.5.6:

##
##
##        Mod title:  TopicTags
##
##      Mod version:  1.1
##  Works on FluxBB:  1.4.6, 1.4.5, 1.4.4, 1.4.3
##     Release date:  2011-09-08
##      Review date:  YYYY-MM-DD (Leave unedited)
##
##           Author:  Mpok (mpok@fluxbb.fr)
##
##      Description:  This mod allows to add a "tag" to topics.
##                    Tags are defined by admins and will
##                    be displayed along with the subject of topics.
##
##   Repository URL:  http://fluxbb.org/resources/mods/topictags
##
##   Affected files:  admin_reports.php
##                    delete.php
##                    edit.php
##                    extern.php
##                    misc.php
##                    moderate.php
##                    post.php
##                    search.php
##                    viewforum.php
##                    viewtopic.php
##                    include/functions.php
##                    include/common_admin.php
##
##       Affects DB:  Yes (2 new tables)
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    FluxBB. Installation of this modification is done at
##                    your own risk. Backup your forum database and any and
##                    all applicable files before proceeding.
##
##

#
#---------[ 1. UPLOAD ]----------------------------------------------------
#---------[ 1. TELECHARGER LES FICHIERS ]----------------------------------
#

/files/install_mod.php			to /your_forum_folder/
/files/manage_tags.php			to /your_forum_folder/
/files/include/topictags.php		to /your_forum_folder/include/
/files/plugins/AP_TopicTags.php		to /your_forum_folder/plugins/
/files/lang/English/topictags.php	to /your_forum_folder/lang/English/
/files/lang/French/topictags.php	to /your_forum_folder/lang/French/

#
#---------[ 2. RUN ]-------------------------------------------------------
#---------[ 2. LANCER ]----------------------------------------------------
#

install_mod.php

#
#---------[ 3. DELETE ]----------------------------------------------------
#---------[ 3. SUPPRIMER ]-------------------------------------------------
#

install_mod.php

#
#---------[ 4. OPEN ]------------------------------------------------------
#---------[ 4. OUVRIR ]----------------------------------------------------
#

post.php

#
#---------[ 5. FIND ]------------------------------------------------------
#---------[ 5. TROUVER ]---------------------------------------------------
#

// Start with a clean slate
$errors = array();

#
#---------[ 6. ADD AFTER ]-------------------------------------------------
#---------[ 6. AJOUTER APRES ]---------------------------------------------
#

// Begin TopicTags
require PUN_ROOT.'include/topictags.php';
if (file_exists(FORUM_CACHE_DIR.'cache_topictags.php'))
	require FORUM_CACHE_DIR.'cache_topictags.php';
else
{
	generate_tag_cache();
	require FORUM_CACHE_DIR.'cache_topictags.php';
}

// Retrieve tags (of the topic)
$span_tag = array();
$text_tag = array();
if ($tid)
{
	$result = $db->query('SELECT tag_id FROM '.$db->prefix.'tagged WHERE topic_id='.$tid) or error('Unable to fetch topic tags', __FILE__, __LINE__, $db->error());
	while ($tag = $db->fetch_row($result))
	{
		$span_tag[] = $topictags[$tag[0]]['span'];
		$text_tag[] = $topictags[$tag[0]]['text'];
	}
}
// End TopicTags

#
#---------[ 7. FIND ]------------------------------------------------------
#---------[ 7. TROUVER ]---------------------------------------------------
#

								$first_crlf = strpos($mail_tpl_full, "\n");
								$mail_subject_full = trim(substr($mail_tpl_full, 8, $first_crlf-8));
								$mail_message_full = trim(substr($mail_tpl_full, $first_crlf));

#
#---------[ 8. ADD AFTER ]-------------------------------------------------
#---------[ 8. AJOUTER APRES ]---------------------------------------------
#

								// Begin TopicTags
								if (!empty($text_tag))
									$cur_posting['subject'] = sprintf($tag_display_text, implode(', ', $text_tag)).$cur_posting['subject'];
								// End TopicTags

#
#---------[ 9. FIND ]------------------------------------------------------
#---------[ 9. TROUVER ]---------------------------------------------------
#

<?php if (isset($cur_posting['subject'])): ?>			<li><span>»&#160;</span><a href="viewtopic.php?id=<?php echo $tid ?>"><?php echo pun_htmlspecialchars($cur_posting['subject']) ?></a></li>

#
#---------[ 10. REPLACE WITH ]---------------------------------------------
#---------[ 10. REMPLACER PAR ]--------------------------------------------
#

<?php if (isset($cur_posting['subject'])): ?>			<li><span>»&#160;</span><a href="viewtopic.php?id=<?php echo $tid ?>"><?php echo (!empty($span_tag)) ? sprintf($tag_display_span, implode(', ', $span_tag)).pun_htmlspecialchars($cur_posting['subject']) : pun_htmlspecialchars($cur_posting['subject']) ?></a></li>

#
#---------[ 11. OPEN ]-----------------------------------------------------
#---------[ 11. OUVRIR ]---------------------------------------------------
#

search.php

#
#---------[ 12. FIND ]-----------------------------------------------------
#---------[ 12. TROUVER ]--------------------------------------------------
#

require PUN_ROOT.'include/search_idx.php';

#
#---------[ 13. ADD AFTER ]------------------------------------------------
#---------[ 13. AJOUTER APRES ]--------------------------------------------
#

// Begin TopicTags
require PUN_ROOT.'include/topictags.php';
if (file_exists(FORUM_CACHE_DIR.'cache_topictags.php'))
	require FORUM_CACHE_DIR.'cache_topictags.php';
else
{
	generate_tag_cache();
	require FORUM_CACHE_DIR.'cache_topictags.php';
}
if (file_exists(PUN_ROOT.'lang/'.$pun_user['language'].'/topictags.php'))
	require PUN_ROOT.'lang/'.$pun_user['language'].'/topictags.php';
else
	require PUN_ROOT.'lang/English/topictags.php';
// End TopicTags

#
#---------[ 14. FIND ]-----------------------------------------------------
#---------[ 14. TROUVER ]--------------------------------------------------
#

			unset($keyword_results, $author_results);

#
#---------[ 15. ADD AFTER ]------------------------------------------------
#---------[ 15. AJOUTER APRES ]--------------------------------------------
#

			// Begin TopicTags
			$search_tag = (isset($_GET['do_tag'])) ? intval($_GET['tag']) : null;
			if ($search_tag)
			{
				// Retrieve the tagged topics
				$result = $db->query('SELECT topic_id FROM '.$db->prefix.'tagged WHERE tag_id='.$search_tag.' AND topic_id IN ('.implode(', ', array_unique(array_values($search_ids))).')') or error('Unable to fetch tagged topics', __FILE__, __LINE__, $db->error());
				$tag_ids = array();
				while ($row = $db->fetch_row($result))
					$tag_ids[] = $row[0];
				$db->free_result($result);

				// Intersect the results
				$search_ids = array_intersect($search_ids, $tag_ids);
			}
			// End TopicTags

#
#---------[ 16. FIND ]-----------------------------------------------------
#---------[ 16. TROUVER ]--------------------------------------------------
#

		if ($show_as == 'topics')
		{
			$topic_count = 0;

#
#---------[ 17. REPLACE WITH ]---------------------------------------------
#---------[ 17. REMPLACER PAR ]--------------------------------------------
#

		if ($show_as == 'topics')
		{
			// Begin TopicTags
			// Retrieve ALL tags (of all the topics) (note : ONLY for show as topic)
			$span_tag = array();
			$res = $db->query('SELECT topic_id, tag_id FROM '.$db->prefix.'tagged WHERE topic_id IN ('.implode(', ', $search_ids).')') or error('Unable to fetch topics tags', __FILE__, __LINE__, $db->error());
			while ($tag = $db->fetch_assoc($res))
				$span_tag[$tag['topic_id']][] = $topictags[$tag['tag_id']]['span'];
			// End TopicTags

			$topic_count = 0;

#
#---------[ 18. FIND ]-----------------------------------------------------
#---------[ 18. TROUVER ]--------------------------------------------------
#

				$subject = '<a href="viewtopic.php?id='.$cur_search['tid'].'">'.pun_htmlspecialchars($cur_search['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_search['poster']).'</span>';

#
#---------[ 19. REPLACE WITH ]---------------------------------------------
#---------[ 19. REMPLACER PAR ]--------------------------------------------
#

				$subject = '<a href="viewtopic.php?id='.$cur_search['tid'].'">';
				if (!empty($span_tag[$cur_search['tid']]))
					$subject .= sprintf($tag_display_span, implode(', ', $span_tag[$cur_search['tid']]));
				$subject .= pun_htmlspecialchars($cur_search['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_search['poster']).'</span>';

#
#---------[ 20. FIND ]-----------------------------------------------------
#---------[ 20. TROUVER ]--------------------------------------------------
#

						<label class="conl"><?php echo $lang_search['Author search'] ?><br /><input id="author" type="text" name="author" size="25" maxlength="25" /><br /></label>
						<p class="clearb"><?php echo $lang_search['Search info'] ?></p>

#
#---------[ 21. REPLACE WITH ]---------------------------------------------
#---------[ 21. REMPLACER PAR ]--------------------------------------------
#

						<label class="conl"><?php echo $lang_search['Author search'] ?><br /><input id="author" type="text" name="author" size="25" maxlength="25" /><br /></label>
						<label class="conl"><?php echo $lang_topictag['Search']."\n" ?><br /><input type="checkbox" name="do_tag" value="1" />
						<select id="tag" name="tag">
<?php
foreach ($topictags as $tag_id => $t)
	echo "\t\t\t\t\t\t\t".'<option value="'.$tag_id.'">'.$t['text'].'</option>'."\n";
?>
						</select>
						<br /></label>
						<p class="clearb"><?php echo $lang_search['Search info'] ?></p>

#
#---------[ 22. OPEN ]-----------------------------------------------------
#---------[ 22. OUVRIR ]---------------------------------------------------
#

viewtopic.php

#
#---------[ 23. FIND ]-----------------------------------------------------
#---------[ 23. TROUVER ]--------------------------------------------------
#

// Add/update this topic in our list of tracked topics
if (!$pun_user['is_guest'])
{

#
#---------[ 24. ADD BEFORE ]-----------------------------------------------
#---------[ 24. AJOUTER AVANT ]--------------------------------------------
#

// Begin TopicTags
require PUN_ROOT.'include/topictags.php';
if (file_exists(FORUM_CACHE_DIR.'cache_topictags.php'))
	require FORUM_CACHE_DIR.'cache_topictags.php';
else
{
	generate_tag_cache();
	require FORUM_CACHE_DIR.'cache_topictags.php';
}
if (file_exists(PUN_ROOT.'lang/'.$pun_user['language'].'/topictags.php'))
	require PUN_ROOT.'lang/'.$pun_user['language'].'/topictags.php';
else
	require PUN_ROOT.'lang/English/topictags.php';

// Retrieve topic author (for 'restricted' test)
$result = $db->query('SELECT poster_id FROM '.$db->prefix.'posts WHERE id='.$cur_topic['first_post_id']) or error('Unable to fetch topic author', __FILE__, __LINE__, $db->error());
$topic_author = $db->result($result);

// Retrieve tags
$result = $db->query('SELECT tag_id FROM '.$db->prefix.'tagged WHERE topic_id='.$id) or error('Unable to fetch topic tags', __FILE__, __LINE__, $db->error());
$tagged = array();
$span_tag = array();
$text_tag = array();
$remove_tag = array();
while ($tag = $db->fetch_row($result))
{
	$tagged[] = $tag[0];
	$span_tag[] = $topictags[$tag[0]]['span'];
	$text_tag[] = $topictags[$tag[0]]['text'];

	// Fill the remove select
	if (	($pun_user['g_id'] == PUN_ADMIN ||
			($is_admmod && $topictags[$tag[0]]['rights'] != PUN_ADMIN) ||
			(!$is_admmod && $topictags[$tag[0]]['rights'] == $pun_user['g_id']) ||
			(!$pun_user['is_guest'] &&
				($topictags[$tag[0]]['rights'] == PUN_MEMBER || $topictags[$tag[0]]['rights'] == PUN_GUEST)
			)
		) &&
		(!$topictags[$tag[0]]['restricted'] || $pun_user['id'] == $topic_author)
	)
		$remove_tag[$tag[0]] = $topictags[$tag[0]]['text'];
}

// Fill the add select
$add_tag = array();
foreach ($topictags as $tag_id => $t)
	if (	!in_array($tag_id, $tagged) &&
		($pun_user['g_id'] == PUN_ADMIN ||
			($is_admmod && $t['rights'] != PUN_ADMIN) ||
			(!$is_admmod && $t['rights'] == $pun_user['g_id']) ||
			(!$pun_user['is_guest'] &&
				($t['rights'] == PUN_MEMBER || $t['rights'] == PUN_GUEST)
			)
		) &&
		(!$t['restricted'] || $pun_user['id'] == $topic_author)
	)
		$add_tag[$tag_id] = $t['text'];

// Add a form to $post_link
if (!empty($remove_tag) || !empty($add_tag))
{
	$post_link .= "\t\t\t".'<form method="post" action="manage_tags.php" style="margin: 4px 0; text-align: center"><div>'."\n";
	if (!empty($add_tag))
	{
		$post_link .= "\t\t\t\t".'<select name="added">'."\n";
		foreach ($add_tag as $tag_id => $texttag)
			$post_link .= "\t\t\t\t\t".'<option value="'.$tag_id.'">'.$texttag.'</option>'."\n";
		$post_link .= "\t\t\t\t".'</select>'."\n";
		$post_link .= "\t\t\t\t".'<input type="submit" name="add_tag" value="'.$lang_topictag['Add Tag'].'" />&nbsp;&nbsp;&nbsp;&nbsp;'."\n";
	}
	if (!empty($remove_tag))
	{
		$post_link .= "\t\t\t\t".'<select name="removed">'."\n";
		foreach ($remove_tag as $tag_id => $texttag)
			$post_link .= "\t\t\t\t\t".'<option value="'.$tag_id.'">'.$texttag.'</option>'."\n";
		$post_link .= "\t\t\t\t".'</select>'."\n";
		$post_link .= "\t\t\t\t".'<input type="submit" name="remove_tag" value="'.$lang_topictag['Remove Tag'].'" />'."\n";
	}
	$post_link .= "\t\t\t\t".'<input type="hidden" name="topic" value="'.$id.'" />'."\n";
	$post_link .= "\t\t\t\t".'<input type="hidden" name="author" value="'.$topic_author.'" />'."\n";
	$post_link .= "\t\t\t\t".'<input type="hidden" name="ref" value="'.$_SERVER['REQUEST_URI'].'" />'."\n";
	$post_link .= "\t\t\t".'</div></form>'."\n";
}
// End TopicTags

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

$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), pun_htmlspecialchars($cur_topic['forum_name']), pun_htmlspecialchars($cur_topic['subject']));

#
#---------[ 26. REPLACE WITH ]---------------------------------------------
#---------[ 26. REMPLACER PAR ]--------------------------------------------
#

$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), pun_htmlspecialchars($cur_topic['forum_name']), (!empty($text_tag)) ? sprintf($tag_display_text, implode(', ', $text_tag)).pun_htmlspecialchars($cur_topic['subject']) : pun_htmlspecialchars($cur_topic['subject']));

#
#---------[ 27. FIND (line: 183 First occurrence ]-------------------------
#---------[ 27. TROUVER (ligne: 183 Première occurrence ]------------------
#

			<li><span>»&#160;</span><strong><a href="viewtopic.php?id=<?php echo $id ?>"><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></a></strong></li>

#
#---------[ 28. REPLACE WITH ]---------------------------------------------
#---------[ 28. REMPLACER PAR ]--------------------------------------------
#

			<li><span>»&#160;</span><strong><a href="viewtopic.php?id=<?php echo $id ?>"><?php echo (!empty($span_tag)) ? sprintf($tag_display_span, implode(', ', $span_tag)).pun_htmlspecialchars($cur_topic['subject']) : pun_htmlspecialchars($cur_topic['subject']) ?></a></strong></li>

#
#---------[ 29. FIND ]-----------------------------------------------------
#---------[ 29. TROUVER ]--------------------------------------------------
#

				<div class="postright">
					<h3><?php if ($cur_post['id'] != $cur_topic['first_post_id']) echo $lang_topic['Re'].' '; ?><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></h3>
					<div class="postmsg">

#
#---------[ 30. REPLACE WITH ]---------------------------------------------
#---------[ 30. REMPLACER PAR ]--------------------------------------------
#

				<div class="postright">
					<h3><?php if ($cur_post['id'] != $cur_topic['first_post_id']) echo $lang_topic['Re'].' '; ?><?php echo (!empty($span_tag)) ? sprintf($tag_display_span, implode(', ', $span_tag)).pun_htmlspecialchars($cur_topic['subject']) : pun_htmlspecialchars($cur_topic['subject']) ?></h3>
					<div class="postmsg">

#
#---------[ 31. FIND (line: 389 Second occurrence ]------------------------
#---------[ 31. TROUVER (ligne: 389 Seconde occurrence ]-------------------
#

			<li><span>»&#160;</span><strong><a href="viewtopic.php?id=<?php echo $id ?>"><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></a></strong></li>

#
#---------[ 32. REPLACE WITH ]---------------------------------------------
#---------[ 32. REMPLACER PAR ]--------------------------------------------
#

			<li><span>»&#160;</span><strong><a href="viewtopic.php?id=<?php echo $id ?>"><?php echo (!empty($span_tag)) ? sprintf($tag_display_span, implode(', ', $span_tag)).pun_htmlspecialchars($cur_topic['subject']) : pun_htmlspecialchars($cur_topic['subject']) ?></a></strong></li>

#
#---------[ 33. OPEN ]-----------------------------------------------------
#---------[ 33. OUVRIR ]---------------------------------------------------
#

viewforum.php

#
#---------[ 34. FIND ]-----------------------------------------------------
#---------[ 34. TROUVER ]--------------------------------------------------
#

	$topic_ids = array();
	for ($i = 0; $cur_topic_id = $db->result($result, $i); $i++)
		$topic_ids[] = $cur_topic_id;

#
#---------[ 35. ADD AFTER ]------------------------------------------------
#---------[ 35. AJOUTER APRES ]--------------------------------------------
#

	// Begin TopicTags
	require PUN_ROOT.'include/topictags.php';
	if (file_exists(FORUM_CACHE_DIR.'cache_topictags.php'))
		require FORUM_CACHE_DIR.'cache_topictags.php';
	else
	{
		generate_tag_cache();
		require FORUM_CACHE_DIR.'cache_topictags.php';
	}

	// Retrieve ALL tags (of all the topics)
	$span_tag = array();
	$res = $db->query('SELECT topic_id, tag_id FROM '.$db->prefix.'tagged WHERE topic_id IN ('.implode(', ', $topic_ids).')') or error('Unable to fetch topics tags', __FILE__, __LINE__, $db->error());
	while ($tag = $db->fetch_assoc($res))
		$span_tag[$tag['topic_id']][] = $topictags[$tag['tag_id']]['span'];
	// End TopicTags

#
#---------[ 36. FIND ]-----------------------------------------------------
#---------[ 36. TROUVER ]--------------------------------------------------
#

		if ($cur_topic['moved_to'] != 0)
		{
			$subject = '<a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
			$status_text[] = '<span class="movedtext">'.$lang_forum['Moved'].'</span>';
			$item_status .= ' imoved';
		}
		else if ($cur_topic['closed'] == '0')
			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
		else
		{
			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
			$status_text[] = '<span class="closedtext">'.$lang_forum['Closed'].'</span>';
			$item_status .= ' iclosed';
		}

#
#---------[ 37. REPLACE WITH ]---------------------------------------------
#---------[ 37. REMPLACER PAR ]--------------------------------------------
#

		$tagged_subject = (!empty($span_tag[$cur_topic['id']])) ? sprintf($tag_display_span, implode(', ', $span_tag[$cur_topic['id']])).pun_htmlspecialchars($cur_topic['subject']) : pun_htmlspecialchars($cur_topic['subject']);

		if ($cur_topic['moved_to'] != 0)
		{
			$subject = '<a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.$tagged_subject.'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
			$status_text[] = '<span class="movedtext">'.$lang_forum['Moved'].'</span>';
			$item_status .= ' imoved';
		}
		else if ($cur_topic['closed'] == '0')
			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.$tagged_subject.'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
		else
		{
			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.$tagged_subject.'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
			$status_text[] = '<span class="closedtext">'.$lang_forum['Closed'].'</span>';
			$item_status .= ' iclosed';
		}

#
#---------[ 38. OPEN ]-----------------------------------------------------
#---------[ 38. OUVRIR ]---------------------------------------------------
#

edit.php

#
#---------[ 39. FIND ]-----------------------------------------------------
#---------[ 39. TROUVER ]--------------------------------------------------
#

// Start with a clean slate
$errors = array();

#
#---------[ 40. ADD AFTER ]------------------------------------------------
#---------[ 40. AJOUTER APRES ]--------------------------------------------
#

// Begin TopicTags
require PUN_ROOT.'include/topictags.php';
if (file_exists(FORUM_CACHE_DIR.'cache_topictags.php'))
	require FORUM_CACHE_DIR.'cache_topictags.php';
else
{
	generate_tag_cache();
	require FORUM_CACHE_DIR.'cache_topictags.php';
}

// Retrieve tags (of the topic)
$span_tag = array();
$result = $db->query('SELECT tag_id FROM '.$db->prefix.'tagged WHERE topic_id='.$cur_post['tid']) or error('Unable to fetch topic tags', __FILE__, __LINE__, $db->error());
while ($tag = $db->fetch_row($result))
	$span_tag[] = $topictags[$tag[0]]['span'];
// End TopicTags

#
#---------[ 41. FIND ]-----------------------------------------------------
#---------[ 41. TROUVER ]--------------------------------------------------
#

			<li><span>»&#160;</span><a href="viewtopic.php?id=<?php echo $cur_post['tid'] ?>"><?php echo pun_htmlspecialchars($cur_post['subject']) ?></a></li>

#
#---------[ 42. REPLACE WITH ]---------------------------------------------
#---------[ 42. REMPLACER PAR ]--------------------------------------------
#

			<li><span>»&#160;</span><a href="viewtopic.php?id=<?php echo $cur_post['tid'] ?>"><?php echo (!empty($span_tag)) ? sprintf($tag_display_span, implode(', ', $span_tag)).pun_htmlspecialchars($cur_post['subject']) : pun_htmlspecialchars($cur_post['subject']) ?></a></li>

#
#---------[ 43. OPEN ]-----------------------------------------------------
#---------[ 43. OUVRIR ]---------------------------------------------------
#

delete.php

#
#---------[ 44. FIND ]-----------------------------------------------------
#---------[ 44. TROUVER ]--------------------------------------------------
#

// Load the delete.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/delete.php';

#
#---------[ 45. ADD AFTER ]------------------------------------------------
#---------[ 45. AJOUTER APRES ]--------------------------------------------
#

// Begin TopicTags
require PUN_ROOT.'include/topictags.php';
if (file_exists(FORUM_CACHE_DIR.'cache_topictags.php'))
	require FORUM_CACHE_DIR.'cache_topictags.php';
else
{
	generate_tag_cache();
	require FORUM_CACHE_DIR.'cache_topictags.php';
}

// Retrieve tags (of the topic)
$span_tag = array();
$result = $db->query('SELECT tag_id FROM '.$db->prefix.'tagged WHERE topic_id='.$cur_post['tid']) or error('Unable to fetch topic tags', __FILE__, __LINE__, $db->error());
while ($tag = $db->fetch_row($result))
	$span_tag[] = $topictags[$tag[0]]['span'];
// End TopicTags

#
#---------[ 46. FIND ]-----------------------------------------------------
#---------[ 46. TROUVER ]--------------------------------------------------
#

			<li><span>»&#160;</span><a href="viewtopic.php?pid=<?php echo $id ?>#p<?php echo $id ?>"><?php echo pun_htmlspecialchars($cur_post['subject']) ?></a></li>

#
#---------[ 47. REPLACE WITH ]---------------------------------------------
#---------[ 47. REMPLACER PAR ]--------------------------------------------
#

			<li><span>»&#160;</span><a href="viewtopic.php?pid=<?php echo $id ?>#p<?php echo $id ?>"><?php echo (!empty($span_tag)) ? sprintf($tag_display_span, implode(', ', $span_tag)).pun_htmlspecialchars($cur_post['subject']) : pun_htmlspecialchars($cur_post['subject']) ?></a></li>

#
#---------[ 48. OPEN ]-----------------------------------------------------
#---------[ 48. OUVRIR ]---------------------------------------------------
#

misc.php

#
#---------[ 49. FIND ]-----------------------------------------------------
#---------[ 49. TROUVER ]--------------------------------------------------
#

	$post_id = intval($_GET['report']);
	if ($post_id < 1)
		message($lang_common['Bad request'], false, '404 Not Found');

#
#---------[ 50. ADD AFTER ]------------------------------------------------
#---------[ 50. AJOUTER APRES ]--------------------------------------------
#

	// Begin TopicTags
	require PUN_ROOT.'include/topictags.php';
	if (file_exists(FORUM_CACHE_DIR.'cache_topictags.php'))
		require FORUM_CACHE_DIR.'cache_topictags.php';
	else
	{
		generate_tag_cache();
		require FORUM_CACHE_DIR.'cache_topictags.php';
	}
	// End TopicTags

#
#---------[ 51. FIND ]-----------------------------------------------------
#---------[ 51. TROUVER ]--------------------------------------------------
#

			// We send it to the complete mailing-list in one swoop
			if ($pun_config['o_mailing_list'] != '')
			{

#
#---------[ 52. ADD AFTER ]------------------------------------------------
#---------[ 52. AJOUTER APRES ]--------------------------------------------
#

				// Begin TopicTags
				// Retrieve tags
				$result = $db->query('SELECT tag_id FROM '.$db->prefix.'tagged WHERE topic_id='.$topic_id) or error('Unable to fetch topic tags', __FILE__, __LINE__, $db->error());
				$text_tag = array();
				while ($tag = $db->fetch_row($result))
					$text_tag[] = $topictags[$tag[0]]['text'];
				if (!empty($text_tag))
					$subject = sprintf($tag_display_text, implode(', ', $text_tag)).$subject;
				// End TopicTags

#
#---------[ 53. FIND ]-----------------------------------------------------
#---------[ 53. TROUVER ]--------------------------------------------------
#

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

#
#---------[ 54. ADD AFTER ]------------------------------------------------
#---------[ 54. AJOUTER APRES ]--------------------------------------------
#

	// Begin TopicTags
	// Retrieve tags (of the topic)
	$span_tag = array();
	$result = $db->query('SELECT tag_id FROM '.$db->prefix.'tagged WHERE topic_id='.$cur_post['tid']) or error('Unable to fetch topic tags', __FILE__, __LINE__, $db->error());
	while ($tag = $db->fetch_row($result))
		$span_tag[] = $topictags[$tag[0]]['span'];
	// End TopicTags

#
#---------[ 55. FIND ]-----------------------------------------------------
#---------[ 55. TROUVER ]--------------------------------------------------
#

			<li><span>»&#160;</span><a href="viewtopic.php?pid=<?php echo $post_id ?>#p<?php echo $post_id ?>"><?php echo pun_htmlspecialchars($cur_post['subject']) ?></a></li>

#
#---------[ 56. REPLACE WITH ]---------------------------------------------
#---------[ 56. REMPLACER PAR ]--------------------------------------------
#

			<li><span>»&#160;</span><a href="viewtopic.php?pid=<?php echo $post_id ?>#p<?php echo $post_id ?>"><?php echo (!empty($span_tag)) ? sprintf($tag_display_span, implode(', ', $span_tag)).pun_htmlspecialchars($cur_post['subject']) : pun_htmlspecialchars($cur_post['subject']) ?></a></li>

#
#---------[ 57. OPEN ]-----------------------------------------------------
#---------[ 57. OUVRIR ]---------------------------------------------------
#

extern.php

#
#---------[ 58. FIND ]-----------------------------------------------------
#---------[ 58. TROUVER ]--------------------------------------------------
#

	$show = isset($_GET['show']) ? intval($_GET['show']) : 15;
	if ($show < 1 || $show > 50)
		$show = 15;

#
#---------[ 59. ADD AFTER ]------------------------------------------------
#---------[ 59. AJOUTER APRES ]--------------------------------------------
#

	// Begin TopicTags
	require PUN_ROOT.'include/topictags.php';
	if (file_exists(FORUM_CACHE_DIR.'cache_topictags.php'))
		require FORUM_CACHE_DIR.'cache_topictags.php';
	else
	{
		generate_tag_cache();
		require FORUM_CACHE_DIR.'cache_topictags.php';
	}
	// End TopicTags

#
#---------[ 60. FIND ]-----------------------------------------------------
#---------[ 60. TROUVER ]--------------------------------------------------
#

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

#
#---------[ 61. ADD AFTER ]------------------------------------------------
#---------[ 61. AJOUTER APRES ]--------------------------------------------
#

		// Begin TopicTags
		// Retrieve tags
		$result = $db->query('SELECT tag_id FROM '.$db->prefix.'tagged WHERE topic_id='.$tid) or error('Unable to fetch topic tags', __FILE__, __LINE__, $db->error());
		$text_tag = array();
		while ($tag = $db->fetch_row($result))
			$text_tag[] = $topictags[$tag[0]]['text'];
		if (!empty($text_tag))
			$subject = sprintf($tag_display_text, implode(', ', $text_tag)).$cur_topic['subject'];
		else
			$subject = $cur_topic['subject'];
		// End TopicTags

#
#---------[ 62. FIND ]-----------------------------------------------------
#---------[ 62. TROUVER ]--------------------------------------------------
#

		// Setup the feed
		$feed = array(
			'title' 		=>	$pun_config['o_board_title'].$lang_common['Title separator'].$cur_topic['subject'],
			'link'			=>	get_base_url(true).'/viewtopic.php?id='.$tid,
			'description'		=>	sprintf($lang_common['RSS description topic'], $cur_topic['subject']),
			'items'			=>	array(),
			'type'			=>	'posts'
		);

#
#---------[ 63. REPLACE WITH ]---------------------------------------------
#---------[ 63. REMPLACER PAR ]--------------------------------------------
#

		// Setup the feed
		$feed = array(
			'title' 		=>	$pun_config['o_board_title'].$lang_common['Title separator'].$subject,
			'link'			=>	get_base_url(true).'/viewtopic.php?id='.$tid,
			'description'		=>	sprintf($lang_common['RSS description topic'], $subject),
			'items'			=>	array(),
			'type'			=>	'posts'
		);

#
#---------[ 64. FIND ]-----------------------------------------------------
#---------[ 64. TROUVER ]--------------------------------------------------
#

				$cur_topic['message'] = parse_message($cur_topic['message'], $cur_topic['hide_smilies']);

#
#---------[ 65. ADD AFTER ]------------------------------------------------
#---------[ 65. AJOUTER APRES ]--------------------------------------------
#

				// Begin TopicTags
				// Retrieve tags
				$res = $db->query('SELECT tag_id FROM '.$db->prefix.'tagged WHERE topic_id='.$cur_topic['id']) or error('Unable to fetch topic tags', __FILE__, __LINE__, $db->error());
				$text_tag = array();
				while ($tag = $db->fetch_row($res))
					$text_tag[] = $topictags[$tag[0]]['text'];
				if (!empty($text_tag))
					$subject = sprintf($tag_display_text, implode(', ', $text_tag)).$cur_topic['subject'];
				else
					$subject = $cur_topic['subject'];
				// End TopicTags

#
#---------[ 66. FIND ]-----------------------------------------------------
#---------[ 66. TROUVER ]--------------------------------------------------
#

				$item = array(
					'id'			=>	$cur_topic['id'],
					'title'			=>	$cur_topic['subject'],

#
#---------[ 67. REPLACE WITH ]---------------------------------------------
#---------[ 67. REMPLACER PAR ]--------------------------------------------
#

				$item = array(
					'id'			=>	$cur_topic['id'],
					'title'			=>	$subject,

#
#---------[ 68. OPEN ]-----------------------------------------------------
#---------[ 68. OUVRIR ]---------------------------------------------------
#

moderate.php

#
#---------[ 69. FIND ]-----------------------------------------------------
#---------[ 69. TROUVER ]--------------------------------------------------
#

require PUN_ROOT.'include/common.php';

#
#---------[ 70. ADD AFTER ]------------------------------------------------
#---------[ 70. AJOUTER APRES ]--------------------------------------------
#

// Begin TopicTags
require PUN_ROOT.'include/topictags.php';
if (file_exists(FORUM_CACHE_DIR.'cache_topictags.php'))
	require FORUM_CACHE_DIR.'cache_topictags.php';
else
{
	generate_tag_cache();
	require FORUM_CACHE_DIR.'cache_topictags.php';
}
// End TopicTags

#
#---------[ 71. FIND ]-----------------------------------------------------
#---------[ 71. TROUVER ]--------------------------------------------------
#

	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), pun_htmlspecialchars($cur_topic['forum_name']), pun_htmlspecialchars($cur_topic['subject']));

#
#---------[ 72. REPLACE WITH ]---------------------------------------------
#---------[ 72. REMPLACER PAR ]--------------------------------------------
#

	// Begin TopicTags
	// Retrieve tags
	$span_tag = array();
	$text_tag = array();
	$result = $db->query('SELECT tag_id FROM '.$db->prefix.'tagged WHERE topic_id='.$tid) or error('Unable to fetch topic tags', __FILE__, __LINE__, $db->error());
	while ($tag = $db->fetch_row($result))
	{
		$span_tag[] = $topictags[$tag[0]]['span'];
		$text_tag[] = $topictags[$tag[0]]['text'];
	}
	// End TopicTags

	$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), pun_htmlspecialchars($cur_topic['forum_name']), (!empty($text_tag)) ? sprintf($tag_display_text, implode(', ', $text_tag)).pun_htmlspecialchars($cur_topic['subject']) : pun_htmlspecialchars($cur_topic['subject']));

#
#---------[ 73. FIND (line: 302 First occurrence ]-------------------------
#---------[ 73. TROUVER (ligne: 302 Première occurrence ]------------------
#

			<li><span>»&#160;</span><a href="viewtopic.php?id=<?php echo $tid ?>"><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></a></li>

#
#---------[ 74. REPLACE WITH ]---------------------------------------------
#---------[ 74. REMPLACER PAR ]--------------------------------------------
#

			<li><span>»&#160;</span><a href="viewtopic.php?id=<?php echo $tid ?>"><?php echo (!empty($span_tag)) ? sprintf($tag_display_span, implode(', ', $span_tag)).pun_htmlspecialchars($cur_topic['subject']) : pun_htmlspecialchars($cur_topic['subject']) ?></a></li>

#
#---------[ 75. FIND (line: 403 Second occurrence ]------------------------
#---------[ 75. TROUVER (ligne: 403 Seconde occurrence ]-------------------
#

			<li><span>»&#160;</span><a href="viewtopic.php?id=<?php echo $tid ?>"><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></a></li>

#
#---------[ 76. REPLACE WITH ]---------------------------------------------
#---------[ 76. REMPLACER PAR ]--------------------------------------------
#

			<li><span>»&#160;</span><a href="viewtopic.php?id=<?php echo $tid ?>"><?php echo (!empty($span_tag)) ? sprintf($tag_display_span, implode(', ', $span_tag)).pun_htmlspecialchars($cur_topic['subject']) : pun_htmlspecialchars($cur_topic['subject']) ?></a></li>

#
#---------[ 77. FIND ]-----------------------------------------------------
#---------[ 77. TROUVER ]--------------------------------------------------
#

		// Without redirection the old topics are removed
		if (!isset($_POST['with_redirect']))
			$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.implode(',', $topics).') AND id != '.$merge_to_tid) or error('Unable to delete old topics', __FILE__, __LINE__, $db->error());

#
#---------[ 78. REPLACE WITH ]---------------------------------------------
#---------[ 78. REMPLACER PAR ]--------------------------------------------
#

		// Without redirection the old topics are removed
		if (!isset($_POST['with_redirect']))
		{
			$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.implode(',', $topics).') AND id != '.$merge_to_tid) or error('Unable to delete old topics', __FILE__, __LINE__, $db->error());

			// Begin TopicTags
			// Delete tags
			$db->query('DELETE FROM '.$db->prefix.'tagged WHERE topic_id IN('.implode(',', $topics).') AND topic_id != '.$merge_to_tid) or error('Unable to delete topic tags', __FILE__, __LINE__, $db->error());
			// End TopicTags
		}

#
#---------[ 79. FIND ]-----------------------------------------------------
#---------[ 79. TROUVER ]--------------------------------------------------
#

		// Delete the topics and any redirect topics
		$db->query('DELETE FROM '.$db->prefix.'topics WHERE id IN('.$topics.') OR moved_to IN('.$topics.')') or error('Unable to delete topic', __FILE__, __LINE__, $db->error());

#
#---------[ 80. ADD AFTER ]------------------------------------------------
#---------[ 80. AJOUTER APRES ]--------------------------------------------
#

		// Begin TopicTags
		// Delete tags
		$db->query('DELETE FROM '.$db->prefix.'tagged WHERE topic_id IN('.$topics.')') or error('Unable to delete topic tags', __FILE__, __LINE__, $db->error());
		// End TopicTags

#
#---------[ 81. FIND ]-----------------------------------------------------
#---------[ 81. TROUVER ]--------------------------------------------------
#

	$button_status = '';
	$topic_count = 0;

#
#---------[ 82. ADD BEFORE ]-----------------------------------------------
#---------[ 82. AJOUTER AVANT ]--------------------------------------------
#

	// Begin TopicTags
	// Retrieve ALL tags (of all the topics)
	$span_tag = array();
	$res = $db->query('SELECT topic_id, tag_id FROM '.$db->prefix.'tagged WHERE topic_id IN ('.implode(', ', $topic_ids).')') or error('Unable to fetch topics tags', __FILE__, __LINE__, $db->error());
	while ($tag = $db->fetch_assoc($res))
		$span_tag[$tag['topic_id']][] = $topictags[$tag['tag_id']]['span'];
	// End TopicTags

#
#---------[ 83. FIND ]-----------------------------------------------------
#---------[ 83. TROUVER ]--------------------------------------------------
#

		if ($cur_topic['moved_to'] != 0)
		{
			$subject = '<a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
			$status_text[] = '<span class="movedtext">'.$lang_forum['Moved'].'</span>';
			$item_status .= ' imoved';
		}
		else if ($cur_topic['closed'] == '0')
			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
		else
		{
			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
			$status_text[] = '<span class="closedtext">'.$lang_forum['Closed'].'</span>';
			$item_status .= ' iclosed';
		}

#
#---------[ 84. REPLACE WITH ]---------------------------------------------
#---------[ 84. REMPLACER PAR ]--------------------------------------------
#

		$tagged_subject = (!empty($span_tag[$cur_topic['id']])) ? sprintf($tag_display_span, implode(', ', $span_tag[$cur_topic['id']])).pun_htmlspecialchars($cur_topic['subject']) : pun_htmlspecialchars($cur_topic['subject']);

		if ($cur_topic['moved_to'] != 0)
		{
			$subject = '<a href="viewtopic.php?id='.$cur_topic['moved_to'].'">'.$tagged_subject.'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
			$status_text[] = '<span class="movedtext">'.$lang_forum['Moved'].'</span>';
			$item_status .= ' imoved';
		}
		else if ($cur_topic['closed'] == '0')
			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.$tagged_subject.'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
		else
		{
			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.$tagged_subject.'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
			$status_text[] = '<span class="closedtext">'.$lang_forum['Closed'].'</span>';
			$item_status .= ' iclosed';
		}

#
#---------[ 85. OPEN ]-----------------------------------------------------
#---------[ 85. OUVRIR ]---------------------------------------------------
#

admin_reports.php

#
#---------[ 86. FIND ]-----------------------------------------------------
#---------[ 86. TROUVER ]--------------------------------------------------
#

$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_admin_common['Admin'], $lang_admin_common['Reports']);

#
#---------[ 87. ADD BEFORE ]-----------------------------------------------
#---------[ 87. AJOUTER AVANT ]--------------------------------------------
#

// Begin TopicTags
require PUN_ROOT.'include/topictags.php';
if (file_exists(FORUM_CACHE_DIR.'cache_topictags.php'))
	require FORUM_CACHE_DIR.'cache_topictags.php';
else
{
	generate_tag_cache();
	require FORUM_CACHE_DIR.'cache_topictags.php';
}
// End TopicTags

#
#---------[ 88. FIND (line: 69 First occurrence ]--------------------------
#---------[ 88. TROUVER (ligne: 69 Première occurrence ]-------------------
#

		$topic = ($cur_report['subject'] != '') ? '<span>»&#160;<a href="viewtopic.php?id='.$cur_report['topic_id'].'">'.pun_htmlspecialchars($cur_report['subject']).'</a></span>' : '<span>»&#160;'.$lang_admin_reports['Deleted'].'</span>';

#
#---------[ 89. REPLACE WITH ]---------------------------------------------
#---------[ 89. REMPLACER PAR ]--------------------------------------------
#

		if ($cur_report['subject'] != '')
		{
			// Retrieve tags (of the topic)
			$span_tag = array();
			$res = $db->query('SELECT tag_id FROM '.$db->prefix.'tagged WHERE topic_id='.$cur_report['topic_id']) or error('Unable to fetch topic tags', __FILE__, __LINE__, $db->error());
			while ($tag = $db->fetch_row($res))
				$span_tag[] = $topictags[$tag[0]]['span'];
			$topic = '<span>»&#160;<a href="viewtopic.php?id='.$cur_report['topic_id'].'">';
			if (!empty($span_tag))
				$topic .= sprintf($tag_display_span, implode(', ', $span_tag)).pun_htmlspecialchars($cur_report['subject']).'</a></span>';
			else
				$topic .= pun_htmlspecialchars($cur_report['subject']).'</a></span>';
		}
		else
			$topic = '<span>»&#160;'.$lang_admin_reports['Deleted'].'</span>';

#
#---------[ 90. FIND (line: 131 Second occurrence ]------------------------
#---------[ 90. TROUVER (ligne: 131 Seconde occurrence ]-------------------
#

		$topic = ($cur_report['subject'] != '') ? '<span>»&#160;<a href="viewtopic.php?id='.$cur_report['topic_id'].'">'.pun_htmlspecialchars($cur_report['subject']).'</a></span>' : '<span>»&#160;'.$lang_admin_reports['Deleted'].'</span>';

#
#---------[ 91. REPLACE WITH ]---------------------------------------------
#---------[ 91. REMPLACER PAR ]--------------------------------------------
#

		if ($cur_report['subject'] != '')
		{
			// Retrieve tags (of the topic)
			$span_tag = array();
			$res = $db->query('SELECT tag_id FROM '.$db->prefix.'tagged WHERE topic_id='.$cur_report['topic_id']) or error('Unable to fetch topic tags', __FILE__, __LINE__, $db->error());
			while ($tag = $db->fetch_row($res))
				$span_tag[] = $topictags[$tag[0]]['span'];
			$topic = '<span>»&#160;<a href="viewtopic.php?id='.$cur_report['topic_id'].'">';
			if (!empty($span_tag))
				$topic .= sprintf($tag_display_span, implode(', ', $span_tag)).pun_htmlspecialchars($cur_report['subject']).'</a></span>';
			else
				$topic .= pun_htmlspecialchars($cur_report['subject']).'</a></span>';
		}
		else
			$topic = '<span>»&#160;'.$lang_admin_reports['Deleted'].'</span>';

#
#---------[ 92. OPEN ]-----------------------------------------------------
#---------[ 92. OUVRIR ]---------------------------------------------------
#

include/functions.php

#
#---------[ 93. FIND ]-----------------------------------------------------
#---------[ 93. TROUVER ]--------------------------------------------------
#

	// Delete any subscriptions for this topic
	$db->query('DELETE FROM '.$db->prefix.'topic_subscriptions WHERE topic_id='.$topic_id) or error('Unable to delete subscriptions', __FILE__, __LINE__, $db->error());

#
#---------[ 94. ADD AFTER ]------------------------------------------------
#---------[ 94. AJOUTER APRES ]--------------------------------------------
#

	// Begin TopicTags
	// Delete tags
	$db->query('DELETE FROM '.$db->prefix.'tagged WHERE topic_id='.$topic_id) or error('Unable to delete topic tags', __FILE__, __LINE__, $db->error());
	// End TopicTags

#
#---------[ 95. OPEN ]-----------------------------------------------------
#---------[ 95. OUVRIR ]---------------------------------------------------
#

include/common_admin.php

#
#---------[ 96. FIND ]-----------------------------------------------------
#---------[ 96. TROUVER ]--------------------------------------------------
#

			// Delete subscriptions
			$db->query('DELETE FROM '.$db->prefix.'topic_subscriptions WHERE topic_id IN('.$topic_ids.')') or error('Unable to prune subscriptions', __FILE__, __LINE__, $db->error());

#
#---------[ 97. ADD AFTER ]------------------------------------------------
#---------[ 97. AJOUTER APRES ]--------------------------------------------
#

			// Begin TopicTags
			// Delete tags
			$db->query('DELETE FROM '.$db->prefix.'tagged WHERE topic_id IN('.$topic_ids.')') or error('Unable to prune topic tags', __FILE__, __LINE__, $db->error());
			// End TopicTags

#
#---------[ 98. SAVE / UPLOAD ]-------------------------------------------
#---------[ 98. ENREGISTRER / ENVOYER SUR LE SERVEUR ]--------------------
#

admin_reports.php
delete.php
edit.php
extern.php
misc.php
moderate.php
post.php
search.php
viewforum.php
viewtopic.php
include/functions.php
include/common_admin.php

"As code is more often read than written it's really important to write clean code." - Franz
Twitter: @adaurfr
Mon fork de FluxBB: FeatherBB

Hors ligne

#58 07-05-2014 18:03:23

Ba_Ko
Membre
Inscription : 24-12-2013
Messages : 40

Re : TopicTags

Merci beaucoup , sa fonctionne big_smile


Amicalement, Ba_Ko

Hors ligne

#59 04-11-2014 21:25:13

ColossusImba
Nouveau Membre
Inscription : 20-05-2012
Messages : 6

Re : TopicTags

Bonjour,

Est ce que ça serai possible de mettre a jour directement l'archive complète avec les fichiers modifié de FluxBB pour la dernière version (a savoir la 1.5.7), vu que mon forum est vierge actuellement (aucun mod installé), j'aimerai éviter de modifier toutes les lignes manuellement et remplacer juste les fichiers qui ont subi des modifications.

Merci d'avance.

Hors ligne

#60 05-11-2014 21:13:46

Megaz0rd
Nouveau Membre
Inscription : 22-10-2014
Messages : 4

Re : TopicTags

Je viens de faire l'installation grâce au fichier Readme de adaur. Merci pour le mod et les MAJ tout fonctionne au poil, au départ je comptais mettre des images devant les topics mais un système de tags est beaucoup plus léger et pertinent.

Petite question, comme cette personne
http://fluxbb.fr/forums/viewtopic.php?p … 76#p112376
j'aimerais intégrer les tags dans le mod Last topics comment dois-je procéder?
http://fluxbb.org/resources/mods/show-last-topics/
J'ai essayer comme je peux de reprendre le code de viewforum.php dans le readme et de l'insérer sur last-topics.php je me retrouve avec soit une page blanche soit rien d'afficher. peut-être qu'il est nécessaire de le modifier un peu. Je ne demande pas forcément une solution toute cuite dans le bec peut être une piste au moins ça aura le mérite de m'apprendre des choses. smile

Voici le code du fichier last-topics.php

<?php

//
// Last Topics mod by adaur
//

// Make sure no one attempts to run this script "directly"... it would be bad
if (!defined('PUN'))
	exit;
	
// Load the viewforum.php language file
if (file_exists(PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php'))
       require PUN_ROOT.'lang/'.$pun_user['language'].'/forum.php';
else
       require PUN_ROOT.'lang/English/forum.php';
	   
	$show = isset($show) ? $show : NULL;

    if ($show < '1' || $show > '50' || $show == '') $show = '5'; // Don't mess up with the numbers :P
    
	if ($pun_user['g_id'] == PUN_ADMIN)
    {
		$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.num_views, t.moved_to, t.forum_id, u.id AS uid, p.message FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) LEFT JOIN '.$db->prefix.'users AS u ON u.username = t.poster LEFT JOIN '.$db->prefix.'posts AS p ON p.id = t.first_post_id WHERE t.moved_to IS NULL ORDER BY t.last_post DESC LIMIT '.$show) or error('Unable to get the admin\'s topic list', __FILE__, __LINE__, $db->error());
    }   
	elseif ($pun_user['is_guest'])
	{
		$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.num_views, t.moved_to, t.forum_id, u.id AS uid, p.message FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) LEFT JOIN '.$db->prefix.'users AS u ON u.username = t.poster LEFT JOIN '.$db->prefix.'posts AS p ON p.id = t.first_post_id WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL ORDER BY t.last_post DESC LIMIT '.$show) or error('Unable to get the guest\'s topic list', __FILE__, __LINE__, $db->error());
	}
    else
    {
		$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.num_views, t.moved_to, t.forum_id, u.id AS uid, p.message FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') LEFT JOIN '.$db->prefix.'users AS u ON u.username = t.poster LEFT JOIN '.$db->prefix.'posts AS p ON p.id = t.first_post_id WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL ORDER BY t.last_post DESC LIMIT '.$show) or error('Unable to get the member\'s topic list', __FILE__, __LINE__, $db->error());
    }
	
	?>		
		<div id="idx1" class="blocktable">
		<div class="box">
		<div class="inbox">
    			<table cellspacing="0">
			<thead>
				<tr>
					<th class="tcl" scope="col"><?php echo $lang_common['Last topics'] ?></th>
					<th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>
					<?php if ($pun_config['o_topic_views'] == '1'): ?> <th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th> <?php endif; ?>
					<th class="tcr" scope="col"><?php echo $lang_common['Last post'] ?></th>
				</tr>
			</thead>
			<tbody>
		<?php
		while ($cur_topic = $db->fetch_assoc($result)){
		
			if ($pun_config['o_censoring'] == '1')
				$cur_topic['subject'] = censor_words($cur_topic['subject']);
				
			if(file_exists($pun_config['o_avatars_dir'].'/'.$cur_topic['uid'].'.png'))
			        $avatar = $pun_config['o_avatars_dir'].'/'.$cur_topic['uid'].'.png';
			elseif(file_exists($pun_config['o_avatars_dir'].'/'.$cur_topic['uid'].'.gif'))
			        $avatar = $pun_config['o_avatars_dir'].'/'.$cur_topic['uid'].'.gif';
			elseif(file_exists($pun_config['o_avatars_dir'].'/'.$cur_topic['uid'].'.jpg'))
			        $avatar = $pun_config['o_avatars_dir'].'/'.$cur_topic['uid'].'.jpg';
			else
			        $avatar = $pun_config['o_avatars_dir'].'/iceblock.png';				

			$date = format_time($cur_topic['posted']);
			
			$subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <br /> <span class="byuserlast">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
			
			if (!$pun_user['is_guest'])
			{
				$tracked_topics = get_tracked_topics();
			}
			
			if (!$pun_user['is_guest'] && $cur_topic['last_post'] > $pun_user['last_visit'] && (!isset($tracked_topics['topics'][$cur_topic['id']]) || $tracked_topics['topics'][$cur_topic['id']] < $cur_topic['last_post']) && (!isset($tracked_topics['forums'][$cur_topic['forum_id']]) || $tracked_topics['forums'][$cur_topic['forum_id']] < $cur_topic['last_post']) && $cur_topic['moved_to'] == null)
			{
				$item_status = ' inew';
				$icon_type = 'icon icon-new';
				$subject = '<strong>'.$subject.'</strong>';
			}
			else
			{
				$item_status = '';
				$icon_type = 'icon';
			}
				
			?>
			
					<tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
						<td class="tcl">
							<div class="intd">
								<div class="<?php echo $icon_type ?>"><div class="nosize"></div></div>
								<div class="tclconlast">
								<?php echo $avatar ?>
									<?php echo $subject."\n\t\t" ?>
								</div>
							</div>
						</td>
						<td class="tc2"><?php echo $cur_topic['num_replies'] ?></td>
						<?php if ($pun_config['o_topic_views'] == '1'): ?> <td class="tc3"><?php echo $cur_topic['num_views'] ?></td> <?php endif; ?>
						
						<td class="tcr"><?php echo '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']).'</span>'; ?></td>
					</tr>
		<?php
		} // That's all folks!
		?>
   </tbody></table></div></div></div>

Dernière modification par Megaz0rd (07-11-2014 11:50:49)

Hors ligne

#61 15-02-2015 03:01:44

Silverstar
Membre
Lieu : Mantes la Jolie
Inscription : 27-09-2014
Messages : 33

Re : TopicTags

Bonsoir,

J'ai installer topic tag (merci mpok) sur mon forum 1.5.7 et il est compatible avec flux rewriting de adaur après quelques modifications.

J'aimerais juste changer un détail graphique, en faite quand je coche "gras" pour mes tags, ils restent normaux sur mon forum, mais apparaissent bien  en gras quand on est dans le topic. Du coup les tags sont de la même taille que sur ce forum (fluxbb [résolu pas gras] blabla en gras)

C'est pas trop grave mais si vous avez une idée!

Hors ligne

Pied de page des forums