Les archives de FluxBB.fr
Vous n'êtes pas identifié(e).
Pages : 1
voila j ai instal ce mod et tous fonctionne très bien a part que je voudrai que ce mod soi accessible pour que tout les membres puis faire la recherche sur tout les membre et la c pas la cas seulement les admin et modo peuve le faire
voila le fichier txt
##
##
## Mod title: search user's topics
##
## Mod version: 0.1
## Works on PunBB: 1.2.x
## Release date: 2006-20-06
## Author: Smartys & agravetoncas
##
## Description: A few modification to a few files and let
## your users use a new link in users
## profiles pages : 'search user's topic',
## next to 'search user's posts' liink.
##
## Affected files: profile.php
## search.php
## lang/A_Language/profile.php
## lang/A_Language/search.php
##
## Affects DB: no
##
## Notes: As this mod is mainly based on a
## query string made by Smartys,
## thank you Smartys
##
## DISCLAIMER: PunBB staff does not officialy
## support usage of this mod..
## Install at your own risk.
##
###
#---------[ 1. OPEN ]---------------------------------------------------------
#profile.php
#
#---------[ 2. FIND (line: 1071) ]--------------------------------------------
#if ($pun_user['g_id'] == PUN_ADMIN)
$posts_field = '<label>'.$lang_common['Posts'].'<br /><input type="text" name="num_posts" value="'.$user['num_posts'].'" size="8" maxlength="8" /><br /></label><p><a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
else if ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST)
$posts_field = '<p>'.$lang_common['Posts'].': '.$user['num_posts'].' - <a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";
else
$posts_field = '<p><a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a></p>'."\n";#
#---------[ 3. REPLACE WITH ]-------------------------------------------------
#//MOD:search user threads
if ($pun_user['g_id'] == PUN_ADMIN)
$posts_field = '<label>'.$lang_common['Posts'].'<br /><input type="text" name="num_posts" value="'.$user['num_posts'].'" size="8" maxlength="8" /><br /></label><p><a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a><br /><a href="search.php?action=show_user_topics&user_id='.$id.'">'.$lang_profile['Show topics'].'</a></p>'."\n";
else if ($pun_config['o_show_post_count'] == '1' || $pun_user['g_id'] < PUN_GUEST)
$posts_field = '<p>'.$lang_common['Posts'].': '.$user['num_posts'].' - <a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a><br /><a href="search.php?action=show_user_topics&user_id='.$id.'">'.$lang_profile['Show topics'].'</a></p>'."\n";
else
$posts_field = '<p><a href="search.php?action=show_user&user_id='.$id.'">'.$lang_profile['Show posts'].'</a><br /><a href="search.php?action=show_user_topics&user_id='.$id.'">'.$lang_profile['Show topics'].'</a></p>'."\n";
//MOD:end#
#---------[ 4. OPEN ]---------------------------------------------------------
#search.php
#
#---------[ 5. FIND (line: 1071) ]--------------------------------------------
#// If it's a user search (by id)
else if ($action == 'show_user')#
#---------[ 6. REPLACE WITH ]-------------------------------------------------
#//MOD:search user topics
// If it's a user search (by id)
else if ($action == 'show_user' || $action == 'show_user_topics')#
#---------[ 7. FIND (line: 1071) ]--------------------------------------------
#else if ($action == 'show_new' || $action == 'show_24h' || $action == 'show_user' || $action == 'show_subscriptions' || $action == 'show_unanswered')
#
#---------[ 8. REPLACE WITH ]-------------------------------------------------
#//MOD:search user topics
else if ($action == 'show_new' || $action == 'show_24h' || $action == 'show_user' || $action == 'show_subscriptions' || $action == 'show_unanswered' || $action == 'show_user_topics')#
#---------[ 9. FIND (line: 1071) ]--------------------------------------------
#// If it's a search for posts by a specific user ID
else if ($action == 'show_user')
{
$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id 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 p.poster_id='.$user_id.' GROUP BY t.id') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
$num_hits = $db->num_rows($result);if (!$num_hits)
message($lang_search['No user posts']);
}#
#---------[ 10. AFTER, ADD ]--------------------------------------------------
#//MOD:search user topics
// If it's a search for topics by a specific user ID
else if ($action == 'show_user_topics')
{
$result = $db->query('SELECT t.id FROM '.$db->prefix.'users AS u, '.$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.poster= u.username AND u.id = '.$user_id.' GROUP BY t.id') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
$num_hits = $db->num_rows($result);
if (!$num_hits)
message($lang_search['No user topics']);
}
//MOD:end#
#---------[ 11. OPEN ]--------------------------------------------------------
#lang/a_language/profile.php
#
#---------[ 12. FIND (line: 1071) ]-------------------------------------------
#'Show posts' => 'Show all posts',
#
#---------[ 13. AFTER, ADD ]--------------------------------------------------
#//MOD:search user topics
'Show topics' => 'Show user topics',#
#---------[ 14. OPEN ]--------------------------------------------------------
#lang/a_language/search.php
#
#---------[ 15. FIND (line: 1071) ]-------------------------------------------
#'No user posts' => 'There are no posts by this user in this forum.',
#
#---------[ 16. AFTER, ADD ]--------------------------------------------------
#'No user topics' => 'There are no topics by this user in this forum.',
#
#---------[ 17. SAVE/UPLOAD ]-------------------------------------------------
#Enjoy another open source fine mod :)profile.php
search.php
lang/a_language/profile.php
lang/a_language/search.php#
#---------[ 18. SAVE/UPLOAD ]-------------------------------------------------
#profile.php
search.php
lang/a_language/profile.php
lang/a_language/search.php
Enjoy another open source fine mod#
#---------[ 19. AFTER, ADD ]--------------------------------------------------
#//MOD:search user topics
// If it's a search for topics by a specific user ID
else if ($action == 'show_user_topics')
{
$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id INNER JOIN '.$db->prefix.'posts AS p ON (p.topic_id = t.id AND p.posted = t.posted) 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 p.poster_id = '.$user_id.' GROUP BY t.id') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
$num_hits = $db->num_rows($result);
if (!$num_hits)
message($lang_search['No user topics']);
}
//MOD:end
Hors ligne
Personnellement je vois pas trop l'utilité de cette mod.
Lorsque tu effectues une recherche, il suffit de taper le nom de l'utilisateur dans "Rechercher un auteur" ...
A moins que j'ai mal compris et cette mod permets de faire autre chose...
Mais mets le lien de ton forum car c'est bien de voir la mod en question aussi.
Hors ligne
Je crois qu'il ne vaudrait mieux pas pour lui... 
Enfin à part que si je ne me trompa pas, un lien vers son forum serait contraire au règlement de fluxBB.fr, le fait de modifier le copyright de manière à ce qu'il semble qu'il revienne à une autre personne est contraire à la licence d'utilisation et donc à la loi (et c'est aussi un manque de respect pour les développeurs).
=> Plugins | Modifications | Liens utiles <=
.._ -Pandark- _..
Serial Dreamer
Hors ligne
Pages : 1