http://opensource.org/licenses/gpl-license.php GNU General Public License v2Quick Title EditionQuick Title EditionThat MOD aims to add an attribute, generally called tag or prefix, like [Solved], to the topics titles.Ce MOD permet d'ajouter un attribut, généralement appelé tag ou préfixe, comme [Réglé], aux titres de vos sujets.That MOD works on all database systems supported by phpBB3 and requires PHP 5.2.0 or greater.
If your webhost uses a lower version, an alternative fix is available in the "Support" part of the MOD.Ce MOD fonctionne sur tous les systèmes de base de données supportés par phpBB3 et requiert PHP 5.2.0 ou supérieur.
Si votre hébergeur utilise une version inférieure, un correctif alternatif est disponible dans la partie "Support" du MOD.Adrien BonnelABDevhttp://abdev.biz/Ewan MartinPastisDgeolim4http://geolim4.com/Jester-frhttp://jesterstyles.free.fr/Daniel ChalsècheDakin Queliahttp://www.danielchalseche.fr.cr/1.2.5advanced3.0.122013-12-261.2.5Geolim4 joined usFixed many issues in the moderator control panelFixed the issue on attributes keeping in the posting formAdded the attribute to the topic title in the page titleAdded an attribute permissions copy feature from a forum when creating a new forumCompliance with the new version of the french translationUpdated jQuery libraryUpdated JSColor elementgeolim4 nous rejointCorrection de plusieurs erreurs dans le panneau de modérationCorrection du problème de conservation des attributs dans le formulaire de saisie des messagesAjout de l'attribut au titre du sujet dans le titre de la pageAjout d'une fonction de copie de permissions d'attribut d'un forum lors de la création d'un nouveau forumMise en conformité par rapport à la nouvelle version de la traduction françaiseMise à jour de la bibliothèque jQueryMise à jour de l'élément JSColor2013-05-011.2.2Simplified the most complex code partsFixed uninstall issuesUpdated jQuery libraryUpdated JSColor elementSimplification des parties de code les plus complexesCorrection d'erreurs de désinstallationMise à jour de la bibliothèque jQueryMise à jour de l'élément JSColor2012-10-201.2.1Fixed found issues when validtingUpdated jQuery libraryCorrection des erreurs trouvées lors de la validationMise à jour de la bibliothèque jQuery2012-09-021.2.0Optimized the SQL queries for big boardsRevised the permissions systemPossibility to copy the permissions of another attributePossibility to define a default attribute per forum, whatever the user levelPossibility to prevent to remove topic attributes per forum, as the selected groupsFixed an issue when editing the imagesetsFixed an ID issue on the tables when using the extended permissions systemFixed and improved some language keysFixed the loss of the choice when previewing a topicAdded the attribute display when editing a first post, if it has one, and in the user activity on the main front of the user control panelRemoved the restriction of the attributs displaying in the search and sort functions, an user must be able to search and/or to sort as the attribute of his choice when he sees itUpdated jQuery libraryUpdated JSColor elementLight code reduction and installationRemoved the add-ons from the main archiveOptimisation des requêtes SQL pour les gros forumsRévision du système de permissionsPossibilité de copier les permissions d'un attribut existantPossibilité de définir un attribut par défaut par forum, quel que soit le niveau de permissions de l'utilisateurPossibilité d'empêcher la suppression d'un attribut par forum, selon les groupes sélectionnésCorrection d'un message d'erreur pouvant apparaître lors de l'édition des packs d'imagesCorrection d'un problème d'ID sur les tableaux lors de l'utilisation étendue des permissionsCorrections et améliorations de certaines clés de languesCorrection de la perte du choix lors de la prévisualisation d'un sujetAjout de l'affichage de l'attribut lors de l'édition du premier message, si celui-ci en possède un, ainsi que dans l'activité de l'utilisateur sur la page principale du panneau de l'utilisateurSuppression de la restriction de l'affichage des attributs dans les fonctions de recherche et de tri, un utilisateur doit pouvoir rechercher et/ou trier selon l'attribut de son choix dès lors que ce dernier lui est affichéMise à jour de la bibliothèque jQueryMise à jour de l'élément JSColorLégères simplifications de code et d'installationRetrait des add-ons de l'archive principale2012-06-151.1.1Added an option which allows to keep the attribute, if there is one, when editing the first postFixed the pagination when an attribute is used for the sort in a forumAttributes are now correctly applied on the shadow topicsAdded the “Support Toolkit” fixUpdated jQuery libraryUpdated JSColor elementAjout d'une option qui permet de conserver l'attribut, s'il y en a un, lors de l'édition du premier messageCorrection de la pagination quand un attribut est utilisé pour le tri dans un forumLes attributs sont maintenant correctement appliqués sur les sujet-traceursAjout du correctif pour “Support Toolkit”Mise à jour de la bibliothèque jQueryMise à jour de l'élément JSColor2011-08-261.1.0Updated jQuery librarySetting up a generic fix for the submit_post() functionFixed a mistake when topics mergingFixed a displaying mistake of the language keys in the moderation logsSome language keys were bad at spellingSome simplifications and optimizations of code, due to the alter_block_array() methodAdded a sort feature in the forumsAdded the attributes selector in the topics splitting panelThe attributes selector is now hidden in the topics merging panelReinforcement of the security on many pointsComplete rewriting of the administration fileImproved checkout of the usage of the %mod% and %date% argumentsAdded a column in the administration, which displays the usage rate of each attributeReplaced the phpBB's colour picker by JSColorMise à jour de la bibliothèque jQueryMise en place d'un correctif générique pour la fonction submit_post()Correction d'une erreur lors de la fusion de sujetsErreur d'affichage des clés de langues dans les journaux de modérationQuelques clés de langue comportaient des erreurs d'orthographeQuelques simplications et optimisations de code, grâce à la méthode alter_block_array()Ajout d'une fonctionnalité de tri dans les forumsAjout du sélecteur d'attributs dans le panneau de division des sujetsLe sélecteur d'attributs est désormais masqué dans le panneau de fusion des sujetsRenforcement de la sécurité à plusieurs niveauxRéécriture complète du fichier d'administrationVérification améliorée de l'utilisation des arguments %mod% et %date%Ajout d'une colonne dans l'administration, affichant le taux d'utilisation de chaque attributRemplacement de la palette de couleurs de phpBB par JSColor2010-12-121.0.0MOD submitted to validationMOD soumis à la validation2010-12-111.0.0 RC6Sixth public release candidateFixed issues for validationAdded the possibility to force attributes application per forum via a settingFixed an issue if Oracle database system is usedSuccessfully tested on the following database systems : MySQL, MySQLi, PostgreSQL, Oracle, SQLite, Firebird and MS SQL Server 2008 R2Sixième version publique admissibleCorrection d'erreurs pour la validationPossibilité de forcer l'application d'attributs par forum via un réglageCorrection d'une erreur si le système de base de données Oracle est utiliséFonctionne sur les systèmes de base de données suivants : MySQL, MySQLi, PostgreSQL, Oracle, SQLite, Firebird et MS SQL Server 2008 R22010-12-031.0.0 RC5Fifth public release candidateAdded the search featureChanged all files headers for validationMinor fixesCinquième version publique admissibleAjout de la fonction de rechercheModification de toutes les entêtes des fichiers pour la validationCorrections mineurs2010-12-011.0.0 RC4Fourth public release candidateRevized AutoMOD compatibilityNew permissions managerMinor fixesAdded a comment field in order to differentiate the attributes, if some have the same nameQuatrième version publique admissibleRévision de la compatibilité AutoMODNouveau gestionnaire de permissionsCorrections mineursAjout d'un champ de commentaire afin de différencier les attributs, si certains ont le même nom2010-11-231.0.0 RC3Third public release candidateGeneral update of the MOD, there are too changes to be listedMODX updatedSimplified installation through UMILAutoMOD compliantTroisième version publique admissibleMise à jour générale du MOD, il y a trop de changements pour pouvoir tout listerMise à jour de MODXInstallation simplifiée grâce à UMILCompatibilité avec AutoMOD2008-05-041.0.0 RC2Second public release candidateAdded: new attributes permissions manager for each forum and each levelFixed: mistake on attributes display from the search pagesFixed: the attributes displayed on first post of each pageFixed: lots of mistakes ...Revized: installation procedureRevized: installation procedure for "subsilver2" styleDeuxième version publique admissibleAjouté: nouveau gestionnaire de permissions des attributs pour chaque forum et chaque niveauCorrigé: erreur d'affichage sur les attributs depuis les résultats de rechercheCorrigé: les attributs s'affichaient sur le premier message de chaque pageCorrigé: plusieurs autres erreurs ...Revu: procédure d'installationRevu: procédure d'installation pour le style "subsilver2"2008-04-271.0.0 RC1First public release candidateAddded: "subsilver2" style supportFixed: attributes can now be applied from the moderator control panelFixed: attribute was lost when it was changed from the posting editorFixed: lots of mistakes ...Première version publique admissibleAjouté: support du style "subsilver2"Corrigé: les attributs peuvent maintenant être appliqués depuis le panneau de modérationCorrigé: l'attribut était perdu si celui-ci étant changé depuis l'éditeur de saisie des messagesCorrigé: plusieurs autres erreurs ...2008-04-121.0.0 Beta 2Second release (private)Fixed: users weren't allowed to apply attributesFixed: lots of mistakes ...Seconde version (privée)Corrigé: les utilisateurs n'étaient pas autorisés à appliquer des attributsCorrigé: plusieurs autres erreurs ...2008-02-281.0.0 Beta 1First release (private)Première version (privée)
Changes for "subsilver2" style
Language files for french boards
Changelogs list
Add-on for “MOD Version Check” MOD
Modifications à apporter pour le style "subsilver2"
Fichiers de langue pour les forums francophones
Liste des mises à jour
Contribution pour le MOD “MOD Version Check”
]]>]]> $user->add_lang('acp/forums');//-- mod : quick title edition -------------------------------------------------
//-- add
global $qte;
//-- fin mod : quick title edition --------------------------------------------- // No break here//-- mod : quick title edition -------------------------------------------------
//-- add
$forum_data += array(
'default_attr' => request_var('default_attr', 0),
'hide_attr' => request_var('hide_attr', array(0)),
);
//-- fin mod : quick title edition --------------------------------------------- // On add, add empty forum_options... else do not consider it (not updating it)//-- mod : quick title edition -------------------------------------------------
//-- add
$forum_data += array('force_attr' => request_var('force_attr', false));
//-- fin mod : quick title edition --------------------------------------------- $message = ($action == 'add') ? $user->lang['FORUM_CREATED'] : $user->lang['FORUM_UPDATED'];attr as $attr )
{
if ( $attr['attr_auths'] )
{
$attr['attr_auths'] = json_decode($attr['attr_auths'], true);
if ( !empty($attr['attr_auths'][0]['forums_ids']) && in_array($from_attr, $attr['attr_auths'][0]['forums_ids']) )
{
$attr['attr_auths'][0]['forums_ids'][] = $forum_data['forum_id'];
$sql_ary = array('attr_auths' => json_encode($attr['attr_auths']));
$sql = 'UPDATE ' . TOPICS_ATTR_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE attr_id = ' . (int) $attr['attr_id'];
$db->sql_query($sql);
}
}
}
$cache->destroy('_attr');
}
//-- fin mod : quick title edition ---------------------------------------------]]> $forum_data['forum_password_confirm'] = $forum_data['forum_password'];//-- mod : quick title edition -------------------------------------------------
//-- add
$forum_data += array('default_attr' => 0, 'hide_attr' => array());
//-- fin mod : quick title edition --------------------------------------------- }
}
$forum_rules_data = array(//-- mod : quick title edition -------------------------------------------------
//-- add
$forum_data += array('force_attr' => false);
//-- fin mod : quick title edition --------------------------------------------- return;
break;
case 'delete'://-- mod : quick title edition -------------------------------------------------
//-- add
// init ary
$tpl_fields = array();
if ( $action == 'edit' )
{
$qte->attr_default($forum_id, $forum_data['default_attr']);
$group_ids = unserialize(trim($forum_data['hide_attr']));
if ( $group_ids === false )
{
$group_ids = array();
}
$tpl_fields += array('S_GROUPS_HIDE_ATTR' => $qte->qte_group_select($group_ids));
}
$tpl_fields += array('S_FORCE_ATTR' => $forum_data['force_attr'] ? true : false);
// send to template
$template->assign_vars($tpl_fields);
//-- fin mod : quick title edition --------------------------------------------- validate_range($range_test_ary, $errors);//-- mod : quick title edition -------------------------------------------------
//-- add
if ( !empty($forum_data['hide_attr']) )
{
$forum_data['hide_attr'] = serialize($forum_data['hide_attr']);
}
else
{
$forum_data['hide_attr'] = '';
}
//-- fin mod : quick title edition --------------------------------------------- // Set up general vars//-- mod : quick title edition -------------------------------------------------
//-- add
$user->add_lang('mods/info_mcp_attributes');
//-- fin mod : quick title edition --------------------------------------------- // Execute overall actions//-- mod : quick title edition -------------------------------------------------
//-- add
if ( !isset($this->imageset_keys['custom']) )
{
$this->imageset_keys['custom'] = array();
}
$this->imageset_keys['custom'] += array_merge($this->imageset_keys['custom'], array('icon_topic_solved', 'icon_topic_cancel'));
//-- fin mod : quick title edition --------------------------------------------- $user->add_lang(array('viewtopic', 'viewforum'));
include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);//-- mod : quick title edition -------------------------------------------------
//-- add
global $qte;
//-- fin mod : quick title edition --------------------------------------------- $to_topic_id = request_var('to_topic_id', 0);mcp_attr_apply($attr_id, $topic_id_list);
}
//-- fin mod : quick title edition ---------------------------------------------]]> // Grab icons//-- mod : quick title edition -------------------------------------------------
//-- add
$forum_info['hide_attr'] = unserialize(trim($forum_info['hide_attr']));
if ( $forum_info['hide_attr'] === false )
{
$forum_info['hide_attr'] = array();
}
$qte->attr_select($forum_id, $user->data['user_id'], '', $forum_info['hide_attr']);
//-- fin mod : quick title edition --------------------------------------------- foreach ($topic_list as $topic_id)//-- mod : quick title edition -------------------------------------------------
//-- add
$qte->get_users_by_topic_id($topic_list);
//-- fin mod : quick title edition --------------------------------------------- $template->assign_block_vars('topicrow', $topic_row);//-- mod : quick title edition -------------------------------------------------
//-- add
if ( !empty($row['topic_attr_id']) )
{
$topic_row += array(
'S_TOPIC_ATTR' => true,
'TOPIC_ATTRIBUTE' => $qte->attr_display($row['topic_attr_id'], $row['topic_attr_user'], $row['topic_attr_time']),
);
}
//-- fin mod : quick title edition --------------------------------------------- $db->sql_query('INSERT INTO ' . TOPICS_TABLE . $db->sql_build_array('INSERT', $shadow));
// Shadow topics only count on new "topics" and not posts... a shadow topic alone has 0 posts//-- mod : quick title edition -------------------------------------------------
//-- add
$shadow += array(
'topic_attr_id' => (int) $row['topic_attr_id'],
'topic_attr_user' => (int) $row['topic_attr_user'],
'topic_attr_time' => (int) $row['topic_attr_time'],
);
//-- fin mod : quick title edition --------------------------------------------- $db->sql_query('INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
$new_topic_id = $db->sql_nextid();//-- mod : quick title edition -------------------------------------------------
//-- add
$sql_ary += array(
'topic_attr_id' => (int) $topic_row['topic_attr_id'],
'topic_attr_user' => (int) $topic_row['topic_attr_user'],
'topic_attr_time' => (int) $topic_row['topic_attr_time'],
);
//-- fin mod : quick title edition --------------------------------------------- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);//-- mod : quick title edition -------------------------------------------------
//-- add
global $qte;
//-- fin mod : quick title edition --------------------------------------------- break;
case 'unapproved_topics':
case 'unapproved_posts':get_users_by_topic_id(array($post_info['topic_id']));
$template->assign_vars(array(
'S_TOPIC_ATTR' => true,
'TOPIC_ATTRIBUTE' => $qte->attr_display($post_info['topic_attr_id'], $post_info['topic_attr_user'], $post_info['topic_attr_time']),
));
}
//-- fin mod : quick title edition ---------------------------------------------]]> $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
$rowset = array();//-- mod : quick title edition -------------------------------------------------
//-- add
$sql = str_replace(', t.topic_title AS post_subject', ', t.topic_title AS post_subject, t.topic_attr_id AS post_attr_id, t.topic_attr_user AS post_attr_user, t.topic_attr_time AS post_attr_time', $sql);
//-- fin mod : quick title edition --------------------------------------------- foreach ($rowset as $row)//-- mod : quick title edition -------------------------------------------------
//-- add
$topic_list = array();
foreach( $rowset as $row )
{
$topic_list[] = (int) $row['topic_id'];
}
$qte->get_users_by_topic_id($topic_list);
//-- fin mod : quick title edition --------------------------------------------- }
unset($rowset, $forum_names);
// Now display the pagealter_block_array('postrow', array(
'S_TOPIC_ATTR' => true,
'TOPIC_ATTRIBUTE' => $qte->attr_display($row['post_attr_id'], $row['post_attr_user'], $row['post_attr_time']),
), true, 'change');
}
//-- fin mod : quick title edition ---------------------------------------------]]> $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url());//-- mod : quick title edition -------------------------------------------------
//-- add
global $qte;
//-- fin mod : quick title edition --------------------------------------------- foreach ($rowset as $i => $row)//-- mod : quick title edition -------------------------------------------------
//-- add
$topic_list = array();
foreach( $rowset as $row )
{
$topic_list[] = (int) $row['topic_id'];
}
$qte->get_users_by_topic_id($topic_list);
//-- fin mod : quick title edition --------------------------------------------- // Display not already displayed Attachments for this post, we already parsed them. ;)alter_block_array('postrow', array(
'S_TOPIC_ATTR' => true,
'TOPIC_ATTRIBUTE' => $qte->attr_display($topic_info['topic_attr_id'], $topic_info['topic_attr_user'], $topic_info['topic_attr_time']),
), true, 'change');
}
//-- fin mod : quick title edition ---------------------------------------------]]> $s_hidden_fields = build_hidden_fields(array(
'st_old' => $sort_days,
'post_ids' => $post_id_list,
));//-- mod : quick title edition -------------------------------------------------
//-- add
if ( $action == 'split' )
{
$topic_info['hide_attr'] = unserialize(trim($topic_info['hide_attr']));
if ( $topic_info['hide_attr'] === false )
{
$topic_info['hide_attr'] = array();
}
$qte->attr_select($topic_info['forum_id'], $user->data['user_id'], '', $topic_info['hide_attr']);
}
//-- fin mod : quick title edition --------------------------------------------- $success_msg = $return_link = '';//-- mod : quick title edition -------------------------------------------------
//-- add
$s_hidden_fields .= build_hidden_fields(array('attr_id' => request_var('attr_id', 0)));
//-- fin mod : quick title edition --------------------------------------------- $sql = 'INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);
$to_topic_id = $db->sql_nextid();//-- mod : quick title edition -------------------------------------------------
//-- add
$attr_id = request_var('attr_id', 0);
if ( $attr_id == -1 )
{
$sql_ary += array('topic_attr_id' => 0, 'topic_attr_user' => 0, 'topic_attr_time' => 0);
}
else
{
$sql_ary += array(
'topic_attr_id' => $attr_id,
'topic_attr_user' => (int) $user->data['user_id'],
'topic_attr_time' => time(),
);
}
//-- fin mod : quick title edition --------------------------------------------- // generate a search_key from all the options to identify the results//-- mod : quick title edition -------------------------------------------------
// add
$attribute_id = 0;
if ( array_key_exists('attr_id', $id_ary) )
{
$attribute_id = (int) $id_ary['attr_id'];
unset($id_ary['attr_id']);
}
//-- fin mod : quick title edition --------------------------------------------- $sql_where_options .= (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';//-- mod : quick title edition -------------------------------------------------
//-- add
if ( $attribute_id )
{
$sql_where_options .= ' AND t.topic_attr_id = ' . (int) $attribute_id;
}
//-- fin mod : quick title edition --------------------------------------------- // generate a search_key from all the options to identify the results//-- mod : quick title edition -------------------------------------------------
// add
$attribute_id = 0;
if ( array_key_exists('attr_id', $id_ary) )
{
$attribute_id = (int) $id_ary['attr_id'];
unset($id_ary['attr_id']);
}
//-- fin mod : quick title edition --------------------------------------------- $sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';//-- mod : quick title edition -------------------------------------------------
//-- add
if ( $attribute_id )
{
$sql_author .= ' AND t.topic_attr_id = ' . (int) $attribute_id;
$firstpost_only = true;
}
//-- fin mod : quick title edition --------------------------------------------- break;
case 't'://-- mod : quick title edition -------------------------------------------------
//-- add
if ( $attribute_id )
{
$sql_sort_join .= ' AND t.topic_attr_id = ' . (int) $attribute_id;
}
//-- fin mod : quick title edition --------------------------------------------- break;
case 'f'://-- mod : quick title edition -------------------------------------------------
//-- add
if ( $attribute_id )
{
$sql_sort_join .= ' AND t.topic_attr_id = ' . (int) $attribute_id;
}
//-- fin mod : quick title edition ---------------------------------------------sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
$sql_time = $sort_days ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
// build sql strings for sorting
$sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
$sql_sort_table = $sql_sort_join = '';
switch ( $sql_sort[0] )
{
case 'u':
$sql_sort_table = USERS_TABLE . ' u, ';
$sql_sort_join = ' AND u.user_id = p.poster_id ';
break;
case 'f':
$sql_sort_table = FORUMS_TABLE . ' f, ';
$sql_sort_join = ' AND f.forum_id = p.forum_id ';
break;
}
if ( !sizeof($m_approve_fid_ary) )
{
$m_approve_fid_sql = ' AND p.post_approved = 1';
}
else if ( $m_approve_fid_ary == array(-1) )
{
$m_approve_fid_sql = '';
}
else
{
$m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
}
// if the cache was completely empty count the results
$calc_results = $total_results ? '' : 'SQL_CALC_FOUND_ROWS ';
$sql = "SELECT {$calc_results}t.topic_id
FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
WHERE $sql_attribute
$m_approve_fid_sql
$sql_fora
AND t.topic_id = p.topic_id
$sql_sort_join
$sql_time
GROUP BY t.topic_id
ORDER BY $sql_sort";
// only read one block of posts from the db and then cache it
$result = $db->sql_query_limit($sql, $config['search_block_size'], $start);
while ( $row = $db->sql_fetchrow($result) )
{
$id_ary[] = (int) $row['topic_id'];
}
$db->sql_freeresult($result);
if ( !$total_results )
{
$sql = 'SELECT FOUND_ROWS() as total_results';
$result = $db->sql_query($sql);
$total_results = (int) $db->sql_fetchfield('total_results');
$db->sql_freeresult($result);
if ( !$total_results )
{
return false;
}
}
if ( sizeof($id_ary) )
{
$id_ary = array_slice($id_ary, 0, $per_page);
return $total_results;
}
return false;
}
//-- fin mod : quick title edition ---------------------------------------------]]> // generate a search_key from all the options to identify the results//-- mod : quick title edition -------------------------------------------------
// add
$attribute_id = 0;
if ( array_key_exists('attr_id', $id_ary) )
{
$attribute_id = (int) $id_ary['attr_id'];
unset($id_ary['attr_id']);
}
//-- fin mod : quick title edition --------------------------------------------- if ($type == 'topics')//-- mod : quick title edition -------------------------------------------------
//-- add
if ( $attribute_id )
{
$sql_where[] = 't.topic_attr_id = ' . (int) $attribute_id;
}
//-- fin mod : quick title edition --------------------------------------------- // generate a search_key from all the options to identify the results//-- mod : quick title edition -------------------------------------------------
// add
$attribute_id = 0;
if ( array_key_exists('attr_id', $id_ary) )
{
$attribute_id = (int) $id_ary['attr_id'];
unset($id_ary['attr_id']);
}
//-- fin mod : quick title edition --------------------------------------------- $sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';//-- mod : quick title edition -------------------------------------------------
//-- add
if ( $attribute_id )
{
$sql_author .= ' AND t.topic_attr_id = ' . (int) $attribute_id;
$firstpost_only = true;
}
//-- fin mod : quick title edition --------------------------------------------- break;
case 'f'://-- mod : quick title edition -------------------------------------------------
//-- add
if ( $attribute_id )
{
$sql_sort_join .= ' AND t.topic_attr_id = ' . (int) $attribute_id;
}
//-- fin mod : quick title edition ---------------------------------------------sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
$sql_time = $sort_days ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
// build sql strings for sorting
$sql_sort = $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
$sql_sort_table = $sql_sort_join = '';
switch ( $sql_sort[0] )
{
case 'u':
$sql_sort_table = USERS_TABLE . ' u, ';
$sql_sort_join = ' AND u.user_id = p.poster_id ';
break;
case 'f':
$sql_sort_table = FORUMS_TABLE . ' f, ';
$sql_sort_join = ' AND f.forum_id = p.forum_id ';
break;
}
if ( !sizeof($m_approve_fid_ary) )
{
$m_approve_fid_sql = ' AND p.post_approved = 1';
}
else if ( $m_approve_fid_ary == array(-1) )
{
$m_approve_fid_sql = '';
}
else
{
$m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
}
$is_mysql = false;
// if the cache was completely empty count the results
if ( !$total_results )
{
switch ( $db->sql_layer )
{
case 'mysql4':
case 'mysqli':
$is_mysql = true;
break;
default:
if ( $db->sql_layer == 'sqlite' )
{
$sql = 'SELECT COUNT(topic_id) as total_results
FROM (SELECT DISTINCT t.topic_id';
}
else
{
$sql = 'SELECT COUNT(DISTINCT t.topic_id) as total_results';
}
$sql .= ' FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
WHERE $sql_attribute
$m_approve_fid_sql
$sql_fora
AND t.topic_id = p.topic_id
$sql_time" . (($db->sql_layer == 'sqlite') ? ')' : '');
$result = $db->sql_query($sql);
$total_results = (int) $db->sql_fetchfield('total_results');
$db->sql_freeresult($result);
if ( !$total_results )
{
return false;
}
break;
}
}
$sql = "SELECT t.topic_id
FROM " . $sql_sort_table . TOPICS_TABLE . ' t, ' . POSTS_TABLE . " p
WHERE $sql_attribute
$m_approve_fid_sql
$sql_fora
AND t.topic_id = p.topic_id
$sql_sort_join
$sql_time
GROUP BY t.topic_id, " . $sort_by_sql[$sort_key] . '
ORDER BY ' . $sql_sort;
// only read one block of posts from the db and then cache it
$result = $db->sql_query_limit($sql, $config['search_block_size'], $start);
while ( $row = $db->sql_fetchrow($result) )
{
$id_ary[] = (int) $row['topic_id'];
}
$db->sql_freeresult($result);
if ( !$total_results && $is_mysql )
{
// count rows for the executed queries
$sql = str_replace('SELECT t.topic_id', 'SELECT DISTINCT SQL_CALC_FOUND_ROWS p.post_id', $sql);
$db->sql_query($sql);
$db->sql_freeresult($result);
$sql = 'SELECT FOUND_ROWS() as total_results';
$result = $db->sql_query($sql);
$total_results = (int) $db->sql_fetchfield('total_results');
$db->sql_freeresult($result);
if ( !$total_results )
{
return false;
}
}
if ( sizeof($id_ary) )
{
$id_ary = array_slice($id_ary, 0, $per_page);
return $total_results;
}
return false;
}
//-- fin mod : quick title edition ---------------------------------------------]]> switch ($mode)//-- mod : quick title edition -------------------------------------------------
//-- add
global $qte;
//-- fin mod : quick title edition --------------------------------------------- foreach ($topic_list as $topic_id)//-- mod : quick title edition -------------------------------------------------
//-- add
$qte->get_users_by_topic_id($topic_list);
//-- fin mod : quick title edition --------------------------------------------- }
if ($config['load_user_activity'])//-- mod : quick title edition -------------------------------------------------
//-- add
if ( !empty($row['topic_attr_id']) )
{
$template->alter_block_array('topicrow', array(
'S_TOPIC_ATTR' => true,
'TOPIC_ATTRIBUTE' => $qte->attr_display($row['topic_attr_id'], $row['topic_attr_user'], $row['topic_attr_time']),
), true, 'change');
}
//-- fin mod : quick title edition --------------------------------------------- $table = ($mode == 'subscribed') ? TOPICS_WATCH_TABLE : BOOKMARKS_TABLE;//-- mod : quick title edition -------------------------------------------------
//-- add
global $qte;
//-- fin mod : quick title edition --------------------------------------------- }
}
}
?>//-- mod : quick title edition -------------------------------------------------
//-- add
if ( !empty($row['topic_attr_id']) )
{
$template->alter_block_array('topicrow', array(
'S_TOPIC_ATTR' => true,
'TOPIC_ATTRIBUTE' => $qte->attr_display($row['topic_attr_id'], $row['topic_attr_user'], $row['topic_attr_time']),
), true, 'change');
}
//-- fin mod : quick title edition ---------------------------------------------// Additional tables//-- mod : quick title edition -------------------------------------------------
//-- add
define('TOPICS_ATTR_TABLE', $table_prefix . 'topics_attr');
//-- fin mod : quick title edition --------------------------------------------- $result = $db->sql_query($sql);
$active_t_row['topic_title'] = (string) $db->sql_fetchfield('topic_title');//-- mod : quick title edition -------------------------------------------------
//-- delete
/*-MODMOD-*/
//-- add
$sql = str_replace('SELECT ', 'SELECT topic_attr_id, topic_attr_user, topic_attr_time, ', $sql);
$result = $db->sql_query_limit($sql, 1);
$active_t_row += $db->sql_fetchrow($result);
//-- fin mod : quick title edition --------------------------------------------- 'S_SHOW_ACTIVITY' => true)
);//-- mod : quick title edition -------------------------------------------------
//-- add
if ( !empty($active_t_row['topic_attr_id']) )
{
global $qte;
$qte->get_users_by_topic_id(array($active_t_id));
$template->assign_vars(array(
'S_TOPIC_ATTR' => true,
'TOPIC_ATTRIBUTE' => $qte->attr_display($active_t_row['topic_attr_id'], $active_t_row['topic_attr_user'], $active_t_row['topic_attr_time']),
));
}
//-- fin mod : quick title edition --------------------------------------------- // We do not handle erasing posts here//-- mod : quick title edition -------------------------------------------------
//-- add
global $qte;
//-- fin mod : quick title edition --------------------------------------------- $result = $db->sql_query($sql);
$topic_row = $db->sql_fetchrow($result);//-- mod : quick title edition -------------------------------------------------
//-- add
if ( defined('IN_STK') )
{
$sql = str_replace(', t.topic_approved', ', t.topic_approved, t.topic_attr_id, t.topic_attr_user, t.topic_attr_time', $sql);
}
//-- fin mod : quick title edition --------------------------------------------- }
// This variable indicates if the user is able to post or put into the queue - it is used later for all code decisions regarding approval//-- mod : quick title edition -------------------------------------------------
//-- add
if ( defined('IN_STK') )
{
if ( !empty($topic_row['topic_attr_id']) )
{
$data['attr_id'] = $topic_row['topic_attr_id'];
$data['attr_user'] = $topic_row['topic_attr_user'];
$data['attr_time'] = $topic_row['topic_attr_time'];
}
}
//-- fin mod : quick title edition --------------------------------------------- if ($update_message)
{
$sql_data[POSTS_TABLE]['sql']['post_text'] = $data['message'];
}//-- mod : quick title edition -------------------------------------------------
//-- add
if ( defined('IN_STK') )
{
if ( !isset($sql_data[TOPICS_TABLE]['sql']) )
{
$sql_data[TOPICS_TABLE]['sql'] = array();
}
$data['attr_id'] = isset($data['attr_id']) ? $data['attr_id'] : -1;
if ( $data['attr_id'] == -1 )
{
$sql_data[TOPICS_TABLE]['sql'] += array('topic_attr_id' => 0, 'topic_attr_user' => 0, 'topic_attr_time' => 0);
}
else
{
$sql_data[TOPICS_TABLE]['sql'] += array(
'topic_attr_id' => $data['attr_id'],
'topic_attr_user' => $data['attr_user'],
'topic_attr_time' => $data['attr_time'],
);
}
}
//-- fin mod : quick title edition ---------------------------------------------//-- mod : quick title edition -------------------------------------------------
//-- add
// generic fix for mods, which use that function ...
$data['attr_id'] = isset($data['attr_id']) ? $data['attr_id'] : -1;
if ( $data['attr_id'] != -2 )
{
if ( $data['attr_id'] == -1 )
{
$sql_data[TOPICS_TABLE]['sql'] += array('topic_attr_id' => 0, 'topic_attr_user' => 0, 'topic_attr_time' => 0);
}
else
{
$sql_data[TOPICS_TABLE]['sql'] += array(
'topic_attr_id' => $data['attr_id'],
'topic_attr_user' => (int) $user->data['user_id'],
'topic_attr_time' => $current_time,
);
}
}
//-- fin mod : quick title edition --------------------------------------------- // Correctly set back the topic replies and forum posts... only if the topic was approved before and now gets disapproved//-- mod : quick title edition -------------------------------------------------
//-- add
// ditto ...
$data['attr_id'] = isset($data['attr_id']) ? $data['attr_id'] : -1;
if ( $data['attr_id'] != -2 )
{
if ( $data['attr_id'] == -1 )
{
$sql_data[TOPICS_TABLE]['sql'] += array('topic_attr_id' => 0, 'topic_attr_user' => 0, 'topic_attr_time' => 0);
}
else
{
$sql_data[TOPICS_TABLE]['sql'] += array(
'topic_attr_id' => $data['attr_id'],
'topic_attr_user' => (int) $user->data['user_id'],
'topic_attr_time' => $current_time,
);
}
}
//-- fin mod : quick title edition --------------------------------------------- // Since we change every post by this author, we need to count this amount towards the anonymous user//-- mod : quick title edition -------------------------------------------------
//-- add
$sql = 'UPDATE ' . TOPICS_TABLE . '
SET topic_attr_user = ' . ANONYMOUS . '
WHERE topic_attr_user = ' . (int) $user_id;
$db->sql_query($sql);
//-- fin mod : quick title edition ---------------------------------------------img_icon_user_warn = icon_user_warn.gif*20*20img_icon_topic_cancel = icon_topic_cancel.gif*16*16
img_icon_topic_solved = icon_topic_solved.gif*16*16{topicrow.TOPIC_TITLE}]]>{topicrow.TOPIC_ATTRIBUTE} ]]>]]>]]>{POST_SUBJECT}]]>]]>{TOPIC_ATTRIBUTE} ]]>{postrow.POST_SUBJECT} ]]>]]>{postrow.TOPIC_ATTRIBUTE} ]]>
]]>]]>{postrow.POST_SUBJECT}]]>]]>{postrow.TOPIC_ATTRIBUTE} ]]>]]>]]>{TOPIC_TITLE}]]>]]>{TOPIC_ATTRIBUTE} ]]>{L_PREVIEW}: {PREVIEW_SUBJECT}]]>{TOPIC_ATTRIBUTE} ]]>]]>]]>{searchresults.TOPIC_TITLE} {searchresults.ATTACH_ICON_IMG}]]>{searchresults.TOPIC_ATTRIBUTE} ]]>{searchresults.POST_SUBJECT}]]>]]>{searchresults.TOPIC_ATTRIBUTE} ]]>{NEWEST_POST_IMG}{topicrow.TOPIC_TITLE}]]>]]>{topicrow.TOPIC_ATTRIBUTE} ]]>{NEWEST_POST_IMG}{topicrow.TOPIC_TITLE} ]]>]]>{topicrow.TOPIC_ATTRIBUTE} ]]>]]>]]>{TOPIC_ATTRIBUTE} ]]>{NEWEST_POST_IMG}{topicrow.TOPIC_TITLE}]]>]]>{topicrow.TOPIC_ATTRIBUTE} ]]> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;" title="{topicrow.TOPIC_FOLDER_IMG_ALT}">{NEWEST_POST_IMG}{topicrow.TOPIC_TITLE}]]>]]>{topicrow.TOPIC_ATTRIBUTE} ]]>{L_DISPLAY_TOPICS}: {S_SELECT_SORT_DAYS}]]>]]>{TOPIC_TITLE}]]>]]>{TOPIC_ATTRIBUTE} ]]>class="first"> {postrow.POST_SUBJECT}]]>]]>{postrow.TOPIC_ATTRIBUTE} ]]>]]>]]>@import url("colours.css");@import url("qte.css");?>//-- mod : quick title edition -------------------------------------------------
//-- add
require $phpbb_root_path . 'includes/functions_attributes.' . $phpEx;
// instantiate the class now !
if ( !empty($config['qte_version']) )
{
$qte = new qte();
}
//-- fin mod : quick title edition ---------------------------------------------// User own some drafts?//-- mod : quick title edition -------------------------------------------------
//-- add
if ( in_array($mode, array('edit', 'post')) )
{
$post_data['attr_id'] = request_var('attr_id', 0);
}
//-- fin mod : quick title edition --------------------------------------------- foreach ($hidden_fields as $name => $default)//-- mod : quick title edition -------------------------------------------------
//-- add
$hidden_fields += array('attr_id' => 0);
//-- fin mod : quick title edition --------------------------------------------- $post_data['enable_bbcode'] = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true;//-- mod : quick title edition -------------------------------------------------
//-- add
$post_data['attr_id'] = request_var('attr_id', 0);
if ( $post_data['attr_id'] != -2 )
{
if ( !empty($post_data['topic_attr_id']) )
{
if ( empty($post_data['attr_id']) )
{
$post_data['attr_id'] = $post_data['topic_attr_id'];
}
}
}
//-- fin mod : quick title edition --------------------------------------------- $error[] = $user->lang['EMPTY_SUBJECT'];
}add_lang('mods/attributes');
$error[] = $user->lang['QTE_ATTRIBUTE_UNSELECTED'];
// init the value
$post_data['attr_id'] = 0;
}
}
//-- fin mod : quick title edition ---------------------------------------------]]> // The last parameter tells submit_post if search indexer has to be run (int) $post_data['attr_id']);
//-- fin mod : quick title edition ---------------------------------------------]]> }
}
// Decode text for message displayget_users_by_user_id($user->data['user_id']);
$template->assign_vars(array(
'S_TOPIC_ATTR' => true,
'TOPIC_ATTRIBUTE' => $qte->attr_display($post_data['attr_id'], $user->data['user_id'], $current_time),
));
}
//-- fin mod : quick title edition ---------------------------------------------]]> $s_topic_icons = posting_gen_topic_icons($mode, $post_data['icon_id']);
}attr_select($forum_id, $user->data['user_id'], (int) $topic_attribute, $post_data['hide_attr']);
$template->assign_vars(array(
'S_POSTING' => true,
'IS_AUTHOR' => ($post_data['poster_id'] == $user->data['user_id']),
));
}
//-- fin mod : quick title edition ---------------------------------------------]]>// Build custom bbcodes arraydata['user_id'];
$post_data['topic_attr_time'] = (string) $current_time;
}
}
if ( $post_data['topic_attr_id'] != -1 )
{
$qte->get_users_by_topic_id(array($post_data['topic_id']));
$template->assign_vars(array(
'S_TOPIC_ATTR' => true,
'TOPIC_ATTRIBUTE' => $qte->attr_display($post_data['topic_attr_id'], $post_data['topic_attr_user'], $post_data['topic_attr_time']),
));
}
}
//-- fin mod : quick title edition ---------------------------------------------]]>// We put login boxes for the case if search_id is newposts, egosearch or unreadposts//-- mod : quick title edition -------------------------------------------------
//-- add
$attr_id = request_var('attr_id', 0);
$show_results = $attr_id ? 'topics' : $show_results;
//-- fin mod : quick title edition ---------------------------------------------gen_sort_selects(//-- mod : quick title edition -------------------------------------------------
//-- add
$submit |= $attr_id;
//-- fin mod : quick title edition --------------------------------------------- sort($author_id_ary);//-- mod : quick title edition -------------------------------------------------
//-- add
$id_ary += array('attr_id' => $attr_id);
//-- fin mod : quick title edition ---------------------------------------------Attention, it is here that the installation of the MOD is the most complex ! You must add the code just after the first found accolade !Attention, c'est ici que l'installation du MOD est la plus complexe ! Vous devez ajouter le code juste après la première accolade trouvée ! $total_match_count = $search->author_search(
}attribute_search($sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $id_ary, $start, $per_page);
}
//-- fin mod : quick title edition ---------------------------------------------]]> $sql_where .= $db->sql_in_set(($show_results == 'posts') ? 'p.post_id' : 't.topic_id', $id_ary);//-- mod : quick title edition -------------------------------------------------
//-- add
if ( $attr_id )
{
$sql_where .= (!empty($sql_where) ? ' AND ' : '') . 't.topic_attr_id = ' . (int) $attr_id;
}
//-- fin mod : quick title edition --------------------------------------------- foreach ($rowset as $row)//-- mod : quick title edition -------------------------------------------------
//-- add
$topic_list = array();
foreach ( $rowset as $row )
{
$topic_list[] = (int) $row['topic_id'];
}
$qte->get_users_by_topic_id($topic_list);
//-- fin mod : quick title edition --------------------------------------------- $template->assign_block_vars('searchresults', array_merge($tpl_ary, array(//-- mod : quick title edition -------------------------------------------------
//-- add
if ( !empty($row['topic_attr_id']) )
{
$tpl_ary += array(
'S_TOPIC_ATTR' => isset($row['post_id']) ? (($row['topic_first_post_id'] == $row['post_id']) ? true : false) : true,
'TOPIC_ATTRIBUTE' => $qte->attr_display($row['topic_attr_id'], $row['topic_attr_user'], $row['topic_attr_time']),
);
}
//-- fin mod : quick title edition ---------------------------------------------// only show recent searches to search administrators//-- mod : quick title edition -------------------------------------------------
//-- add
$qte->attr_search();
//-- fin mod : quick title edition ---------------------------------------------// Limit topics to certain time frame, obtain correct topic count//-- mod : quick title edition -------------------------------------------------
//-- add
$sort_attr = request_var('attr_id', 0);
$qte->attr_sort($forum_id, $sort_attr);
//-- fin mod : quick title edition --------------------------------------------- $result = $db->sql_query($sql);
$topics_count = (int) $db->sql_fetchfield('num_topics');//-- mod : quick title edition -------------------------------------------------
//-- add
if ( $sort_attr )
{
$sql .= 'AND topic_attr_id = ' . (int) $sort_attr;
}
//-- fin mod : quick title edition --------------------------------------------- // Make sure we have information about day selection ready
$template->assign_var('S_SORT_DAYS', true);
} ' . POST_GLOBAL . ' AND topic_attr_id = ' . (int) $sort_attr . ')
OR topic_type = ' . POST_ANNOUNCE . ')';
if ( !$auth->acl_get('m_approve', $forum_id) )
{
$sql .= 'AND topic_approved = 1';
}
$result = $db->sql_query($sql);
$topics_count = (int) $db->sql_fetchfield('num_topics');
$db->sql_freeresult($result);
if ( isset($_POST['sort']) )
{
$start = 0;
}
$sql_limit_time = '';
}
//-- fin mod : quick title edition ---------------------------------------------]]>$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);//-- mod : quick title edition -------------------------------------------------
//-- add
if ( $sort_attr )
{
$sql = str_replace($sql_where, $sql_where . ' AND t.topic_attr_id = ' . (int) $sort_attr, $sql);
}
//-- fin mod : quick title edition ---------------------------------------------// We need to readd the local announcements to the forums total topic count, otherwise the number is different from the one on the forum list
$total_topic_count = $topics_count + sizeof($announcement_list) - sizeof($global_announce_list); $s_type_switch = 0;//-- mod : quick title edition -------------------------------------------------
//-- add
$qte->get_users_by_topic_id($topic_list);
//-- fin mod : quick title edition --------------------------------------------- $s_type_switch = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0;//-- mod : quick title edition -------------------------------------------------
//-- add
if ( !empty($row['topic_attr_id']) )
{
$template->alter_block_array('topicrow', array(
'S_TOPIC_ATTR' => true,
'TOPIC_ATTRIBUTE' => $qte->attr_display($row['topic_attr_id'], $row['topic_attr_user'], $row['topic_attr_time']),
), true, 'change');
}
//-- fin mod : quick title edition ---------------------------------------------// Does this topic contain a poll?attr_apply($attr_id, $topic_id, $forum_id, $topic_data['topic_attr_id']);
}
// show the selector
$topic_data['hide_attr'] = unserialize(trim($topic_data['hide_attr']));
if ( $topic_data['hide_attr'] === false )
{
$topic_data['hide_attr'] = array();
}
$qte->attr_select($forum_id, $topic_data['topic_poster'], $topic_data['topic_attr_id'], $topic_data['hide_attr']);
$tpl_ary = array('S_QTE_FORM' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"));
if ( !empty($topic_data['topic_attr_id']) )
{
$qte->get_users_by_topic_id(array($topic_data['topic_id']));
$tpl_ary += array(
'S_TOPIC_ATTR' => true,
'TOPIC_ATTRIBUTE' => $qte->attr_display($topic_data['topic_attr_id'], $topic_data['topic_attr_user'], $topic_data['topic_attr_time']),
);
}
$template->assign_vars($tpl_ary);
//-- fin mod : quick title edition ---------------------------------------------]]> // Dump vars into template true,
'TOPIC_ATTRIBUTE' => $qte->attr_display($topic_data['topic_attr_id'], $topic_data['topic_attr_user'], $topic_data['topic_attr_time']),
);
}
//-- fin mod : quick title edition ---------------------------------------------]]>// Output the page//-- mod : quick title edition -------------------------------------------------
//-- add
$attribute_title = $qte->attr_title($topic_data['topic_attr_id'], $topic_data['topic_attr_user'], $topic_data['topic_attr_time']);
$topic_data['topic_title'] = $attribute_title . ' ' . $topic_data['topic_title'];
//-- fin mod : quick title edition ---------------------------------------------db_update.phpMake sure all files have been uploaded to the proper locations. Run the SQL install file, db_update.php, in your web browser and delete the file upon script completion. Clear your cache and refresh your imagesets from the administration control panel.
You will find the module in the "Posting" tab in the ACP.Assurez-vous que tous les fichiers ont bien été transférés dans les bons emplacements. Exécutez ensuite le fichier d'installation, intitulé db_update.php, dans votre navigateur Internet puis supprimez-le une fois l'installation effectuée. Enfin, purgez votre cache et rafraîchissez vos packs d'images depuis le panneau d'administration.
Le module se situe dans l'onglet "Messages" du panneau d'administration.