Afficher les avatars dans la liste des membres

Started by titibobo, December 25, 2004, 07:08:55 AM

Previous topic - Next topic

titibobo

Bonjour  :)
Comment faire pour modifier les colonnes dans la liste de membres et plus particulierement affichier une colonne avec les avatars ?

Merci

Meriadoc

Dans Sources/memberlist.php recherche:
Quote// Set up the columns...
   $context['columns'] =
a ligne 83

et adjoute des code là.
puis, dans Themes/{ton theme}/memberlist.template.php recherche:
Quote// Assuming there are members loop through each one displaying their data.
   if (!empty($context['members']))
   {
      foreach ($context['members'] as $member)
et adjoute ton code dans le 'foreach()'

si tu a besoin de plus aide, me demande, mais aujourd'hui je n'est pas le temps pour les specifiques
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

titibobo


Alexandre P.

J'ai cherché la façon de procéder pour ajouter les avatars dans une colonne, malheureusement, je n'y suis pas arrivé.  Je vais demander de l'aide dans le forum anglophone: http://www.simplemachines.org/community/index.php?topic=22295.0
Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Meriadoc

#4
okay, j'ai trouvé le temps pour faire ce mod (mmm, directly translated english expressions... ;))

ceci beaucoup de code, mais c'est simple en actualment. J'ai juste utilise les recherche/remplace pour l'aise, mais il semble comme beaucoup de code. N'aie pas de peur! :)



Memberlist.php:

recherche:

// Set up the columns...
$context['columns'] = array(
'isOnline' => array(
'label' => $txt['online8'],
'width' => '20'
),

remplace avec:

// Set up the columns...
$context['columns'] = array(
'isOnline' => array(
'label' => $txt['online8'],
'width' => '20'
),
'avatar' => array(
'label' => 'Avatar',
'width' => '100',
),


recherche:

// List out the different sorting methods...
$sort_methods = array(
'isOnline' => array(
'down' => '(ISNULL(lo.logTime)' . (!allowedTo('moderate_forum') ? ' OR NOT mem.showOnline' : '') . ') ASC, realName ASC',
'up' => '(ISNULL(lo.logTime)' . (!allowedTo('moderate_forum') ? ' OR NOT mem.showOnline' : '') . ') DESC, realName DESC'
),

remplace avec:

// List out the different sorting methods...
$sort_methods = array(
'isOnline' => array(
'down' => '(ISNULL(lo.logTime)' . (!allowedTo('moderate_forum') ? ' OR NOT mem.showOnline' : '') . ') ASC, realName ASC',
'up' => '(ISNULL(lo.logTime)' . (!allowedTo('moderate_forum') ? ' OR NOT mem.showOnline' : '') . ') DESC, realName DESC'
),
'avatar' => array(
'down' => 'mem.avatar ASC',
'up' => 'mem.avatar DESC'
),


recherche:

// Select the members from the database.
$request = db_query("
SELECT
mem.memberName, mem.realName, mem.websiteTitle, mem.websiteUrl, mem.posts,
mem.ID_GROUP, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.emailAddress,
mem.hideEmail, mem.ID_MEMBER, IFNULL(lo.logTime, 0) AS isOnline,
IFNULL(mg.groupName, '') AS groupName, mem.showOnline, mem.dateRegistered
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
ORDER BY " . $sort_methods[$_REQUEST['sort']][$context['sort_direction']] . "
LIMIT $_REQUEST[start], $modSettings[defaultMaxMembers]", __FILE__, __LINE__);

remplace avec:

// Select the members from the database.
$request = db_query("
SELECT
mem.memberName, mem.realName, mem.websiteTitle, mem.websiteUrl, mem.posts,
mem.ID_GROUP, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.emailAddress,
mem.hideEmail, mem.avatar, mem.ID_MEMBER, IFNULL(lo.logTime, 0) AS isOnline,
IFNULL(mg.groupName, '') AS groupName, mem.showOnline, mem.dateRegistered
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
ORDER BY " . $sort_methods[$_REQUEST['sort']][$context['sort_direction']] . "
LIMIT $_REQUEST[start], $modSettings[defaultMaxMembers]", __FILE__, __LINE__);


recherche:

// Find the members from the database.
$request = db_query("
SELECT
memberName, realName, websiteTitle, websiteUrl, posts, mem.ID_GROUP, ICQ, AIM, YIM, MSN, emailAddress,
hideEmail, mem.ID_MEMBER, IFNULL(lo.logTime, 0) AS isOnline, IFNULL(mg.groupName, '') AS groupName,
mem.dateRegistered
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
WHERE " . implode(" $query OR ", $fields) . " $query$condition
LIMIT $_REQUEST[start], $modSettings[defaultMaxMembers]", __FILE__, __LINE__);

remplace avec:

// Find the members from the database.
$request = db_query("
SELECT
memberName, realName, websiteTitle, websiteUrl, posts, mem.ID_GROUP, ICQ, AIM, YIM, MSN, emailAddress,
hideEmail, mem.avatar, mem.ID_MEMBER, IFNULL(lo.logTime, 0) AS isOnline, IFNULL(mg.groupName, '') AS groupName,
mem.dateRegistered
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
WHERE " . implode(" $query OR ", $fields) . " $query$condition
LIMIT $_REQUEST[start], $modSettings[defaultMaxMembers]", __FILE__, __LINE__);


recherche:

$context['members'][$row['ID_MEMBER']] = array(
'username' => $row['memberName'],
'name' => $row['realName'],
'id' => $row['ID_MEMBER'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>',
'online' => array(
'is_online' => $is_online,
'text' => &$txt[$is_online ? 'online2' : 'online3'],
'href' => $scripturl . '?action=pm;sa=send;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=pm;sa=send;u=' . $row['ID_MEMBER'] . '">' . $txt[$is_online ? 'online2' : 'online3'] . '</a>',
'image_href' => $settings['images_url'] . ($is_online ? '/useron.gif' : '/useroff.gif'),
'label' => &$txt[$is_online ? 'online4' : 'online5']
),

remplace avec:

$context['members'][$row['ID_MEMBER']] = array(
'username' => $row['memberName'],
'name' => $row['realName'],
'id' => $row['ID_MEMBER'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>',
'online' => array(
'is_online' => $is_online,
'text' => &$txt[$is_online ? 'online2' : 'online3'],
'href' => $scripturl . '?action=pm;sa=send;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=pm;sa=send;u=' . $row['ID_MEMBER'] . '">' . $txt[$is_online ? 'online2' : 'online3'] . '</a>',
'image_href' => $settings['images_url'] . ($is_online ? '/useron.gif' : '/useroff.gif'),
'label' => &$txt[$is_online ? 'online4' : 'online5']
),
'avatar' => isset($row['avatar']) ? strstr($row['avatar'],'http://') ? '<img src="' . $row['avatar'] . '" width="65" height="65" />' : '<img src="' . $modSettings['avatar_url'] . '/' . $row['avatar'] . '" />' : '',
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

Meriadoc

Memberlist.template.php

recherche:

<td class="windowbg" align="left">', $member['link'], '</td>

remplace avec:

<td class="windowbg2" align="left">', $member['avatar'], '</td>
<td class="windowbg" align="left">', $member['link'], '</td>


recherche pour tous les phrase

colspan="12"

et change le 12 à 13 comme ça:

colspan="13"
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

Meriadoc

Desole, j'ai fait un petit faute.

le derniere cherche/remplace pour Memberlist.php etait pas juste. Je l'ai corrige mainenant (dans le meme message)

voici  le neuveau code

'avatar' => isset($row['avatar']) ? strstr($row['avatar'],'http://') ? '<img src="' . $row['avatar'] . '" width="65" height="65" />' : '<img src="' . $modSettings['avatar_url'] . '/' . $row['avatar'] . '" />' : '',
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien


titibobo

#8
arf j'ai bien la colonne mais avec des croix rouges :
[/img]
les liens de l'image est : hxxp:xxx.free.fr/forum/avatars/ [nonactive]

En fait leurs avatars sont uploadés à partir du disque dur et sont stockés dans  /forum/attachments/

et pas /forum/avatars/

Dans l'administration section avatars du forum j'ai changé les liens mais rien ne change, le lien de l'image est bien maintenant hxxp:xxxxx.free.fr/forum/attachments/ [nonactive] mais l'association pseudo et avatar ne marche pas dans cet écran ( dans les post c'est good)

Faut sans doute changer dans les fichiers *.php .... ???

titibobo

#9
le liens d'un avatar dans n'importe quelle section est :

hxxp:xxxx.free.fr/forum/index.php?action=dlattach;id=9;type=avatar [nonactive]


Infos sur la version:
Votre version du forum: SMF 1.0 RC2
Version courante de SMF: SMF 1.0 (preview)


Meriadoc

peux-j'avoir un liens à ton forum? par MP si tu veux. Je veux faire un compte pour verifier.
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien


Meriadoc

drat! j'ai testé en FireFox qui ne montre pas les petit X rouge ::)
Desole... je le fixe aujourd'hui, et aussi trouve un solution pour les uploaded avatars...
If I know the way home and am walking along it drunkenly, is it any less the right way because I am staggering from side to side? : Leo Tolstoy
Everything I know I learned from Calvin and Hobbes.
And patience is about the most useful thing you could ever have.  That and backups. : [Unknown]
If I choose to send thee, Tuor son of Huor, then believe not that thy one sword is not worth the sending. : Ulmo, Lord of the Waters - Unfinished Tales, by J.R.R. Tolkien

versus7


karl.kliem

Quote from: versus7 on September 29, 2005, 06:06:49 PM
How can i do this in 1.1 beta 3 ?

or in SMF 1.1 RC2? somehow the php code in memberlist.php changed a lot. as a non-php coder i just don't know where to start...

Advertisement: