Avatar on Member List

Started by Gary, April 25, 2007, 03:29:12 PM

Previous topic - Next topic

BHashman

#60
Quote from: MarkRH on May 16, 2007, 12:13:09 AM
I am getting the following error when clicking on "Avatar" in the Memberlist to sort by it:

Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 30' at line 5
File: /(path...)/Sources/Memberlist.php
Line: 345

Anyone else having this issue?


Quote from: Gazmanafc on May 16, 2007, 11:19:45 AM
Yeah, I know about that. I'm not sure if its possible to fix, but I'll look into it some day, I mean, how can you sort avatars, they're just pictures. :P

-ALM

Gazmanafc, in your mod you may want to fix this so at least it does not throw the error.  They can be sorted because every avatar has a filename or a url tag of some sort.  This is what is used to display the avatars and keep them stored in the database.  The end result my not be what the user wants as avatars are typically stored with the file name "avatar_$1.jpg" where $1 equals the member ID number that is assigned when the user registered.

Thus you can fix this by adding code to the $sort_methods array that is part of the MLAll function that starts on line 148 and ends on line 361 of the Memberlist.php file. 

Thus to fix this issue:
Open the Memberlist.php file located in the Sources folder

Search for this string

// List out the different sorting methods...

It will be around line 264 in the Memberlist.php file.

Right below that you will see the $sort_methods array.  Inside this array is where you need to add some code so avatars can be sorted to. 

Your Mod placed the avatar in the Memberlist between the websiteUrl and the ICQ column in the Memberlist display.  Let's keep the avatar sort in the same relative position in the sort_methods array.

Thus after

'websiteUrl' => array(
'down' => 'LENGTH(mem.websiteURL) > 0 DESC, ISNULL(mem.websiteURL) ASC, mem.websiteURL ASC',
'up' => 'LENGTH(mem.websiteURL) > 0 ASC, ISNULL(mem.websiteURL) DESC, mem.websiteURL DESC'
),


Let's insert this code:

'avatar' => array(
'down' => 'LENGTH(mem.avatar) > 0 DESC, ISNULL(mem.avatar) ASC, mem.avatar ASC',
'up' => 'LENGTH(mem.avatar) > 0 ASC, ISNULL(mem.avatar) DESC, mem.avatar DESC'
),


Now the user can sort by avatar (avatar name) and at least not get an error.  But the avatars won't really be sorted...  Maybe that is what you were referring to?   :D


keywords: avatar sorting Memberlist broken

Gary

I'll look into it when I'm not using my PSP
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

OmaPie

Hi there, Gazmanafc!
Hey, I gotta tell you I love this mod. I tend to be visually-oriented & get bogged down in text. This mod helps me quickly sort who's who, so thank you for your efforts. I'm sorry you have to deal with rude people. Seems pretty obvious that if you aren't interested in something you just keep movin' on; no need to get rude about it. Anyway, thank you for your efforts and for maintaining support in this column. Some of us really DO appreciate it!
;D

I'm getting the following error in my Forum Error Log:
/forum/index.php?action=mlist
8: Undefined index: avatar
File: /forum/Sources/Memberlist.php
Line: 121


No other errors. I've looked at that line & it tells me nothing.

I'm using SMF 1.1.4 & TinyPortal v0.9.8 and multitude of mods. Don't know if listing those mods will help or not.

What other info can I tell you that will help you help me!?  :-\

Many TIA!   ;)

BTW & FWIW, no problem with installation.
Come visit me anytime at:
DFW CFS/ME & FM Information Distribution Services: http://dfwcfids.net [nofollow]
JMHS Alumni: http://jmhs-classmates.org  --.net
The AzleZoo: http://azlezoo.com [nofollow]

You can also visit me at:
GerdieB.: http://gerdieb.blogspot.com [nofollow]
My Flickr Photos!: http://www.flickr.com/photos/azlezoo [nofollow]

A Life? Cool!
Where can I download one of those from??
unknown

Gary

That seems to be because the $txt['avatar'] is not in Modifications.language.php, and if it is, it could be after the closing ?>
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

OmaPie

Okay, Gazmanafc, I am not even finding that file. Not in the Sources directory or in the Themes/default/languages directory (or subdirectories). Where do I find this file please?

Yes. Am sure it's obvious. I'm a pretty big noob to SMF, php, etc. I've worked with the files and got the mods put into places within the different themes, etc. ... regardless... still lots to learn! LOL

Bottom line: I'm not finding that file... ???

Help!?! TIA! ;)

Lori
Come visit me anytime at:
DFW CFS/ME & FM Information Distribution Services: http://dfwcfids.net [nofollow]
JMHS Alumni: http://jmhs-classmates.org  --.net
The AzleZoo: http://azlezoo.com [nofollow]

You can also visit me at:
GerdieB.: http://gerdieb.blogspot.com [nofollow]
My Flickr Photos!: http://www.flickr.com/photos/azlezoo [nofollow]

A Life? Cool!
Where can I download one of those from??
unknown

Gary

You find it in the Themes/default/languages directory. It's not actually called Modifications.language.php, you have to substitute "language" for your language, eg, It'd actually be: Modifications.english.php

I just use language refer to every language at once. :P
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

MissyNL

hello...

is it also compatible with 1.1.4 ?
Sorry for my poor English, but i think it's probably better then your Dutch :)

Gary

Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

MissyNL

oke.. it worked :D Theonly thin gis that i can not controle the size.. :(  so now my page looks not so nice, so i had to uninstall it...
Sorry for my poor English, but i think it's probably better then your Dutch :)

Gary

I gave instructions on how to manage the sizes.

http://www.simplemachines.org/community/index.php?topic=167413.msg1087510#msg1087510

It's doable, just not in the admin center. :P
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

MissyNL

oke... thanks! i will add it :D
Sorry for my poor English, but i think it's probably better then your Dutch :)

OmaPie

Quote from: Gazmanafc on May 02, 2008, 07:24:07 AM
That seems to be because the $txt['avatar'] is not in Modifications.language.php, and if it is, it could be after the closing ?>

Yes. I'm just NOW getting around to fixing this... but... it appears to have fixed the problem.

Again... thank you! ;)

Lori
Come visit me anytime at:
DFW CFS/ME & FM Information Distribution Services: http://dfwcfids.net [nofollow]
JMHS Alumni: http://jmhs-classmates.org  --.net
The AzleZoo: http://azlezoo.com [nofollow]

You can also visit me at:
GerdieB.: http://gerdieb.blogspot.com [nofollow]
My Flickr Photos!: http://www.flickr.com/photos/azlezoo [nofollow]

A Life? Cool!
Where can I download one of those from??
unknown

callteg4


mikamean

Does this work with SMF 1.1.6 and TinyPortal v1.0.5 beta 1© Bloc??
Whe use the mod "Gender on the Memberlist"

/Mikaela

http://custom.simplemachines.org/mods/index.php?mod=1301

QuoteDescription:
Link to Modification

Package Information
Latest Version: 1.2
Created by: ccbtimewiz
Built for: SMF 1.1.5 and below
Package: Gender on Memberlist

What is this? SPARTAAAAAAA

This is a modification that will add member gender to the memberlist. You can also sort by male/female or female/male.
Members with no gender get stacked in the middle if you sort by gender, however.

Alteration Log

[!] Version 1.2 released. Bug fixes in $txt[] strands. *
[!] Fixed multiple errors on the XML file. Repaired row and colspan data.
[!] Released on July 23, 2008

Gary

You'll most likely need to change the colspans on the memberlist page to work properly, but other than that it should work.

Though will will get fails on MemberList.template.php which you can ignore.
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

OmaPie

Hey again, Gary. ;)
Well.. it WAS working perfectly... but it isn't now. I can't track the exact date but I believe the difference happened when I updated to 1.1.6 ... but it may be one of the mods ... or maybe some change I made of course!

Here's the details:
I'm using SMF 1.1.6 & TinyPortal v0.9.8 and multitude of mods. Don't know if listing those mods will help or not.

The errors I'm getting are:
Quote
../forum/index.php?action=mlist;sort=registered;start=0 [nofollow]
8: Undefined index: avatar
../forum/Sources/Memberlist.php
Line: 121
   
../forum/index.php?action=mlist;sort=ID_GROUP;start=0 [nofollow]
8: Undefined index: avatar
../forum/Sources/Memberlist.php
Line: 121
   
../forum/index.php?action=mlist;sort=realName;start=50 [nofollow]
8: Undefined index: avatar
../forum/Sources/Memberlist.php
Line: 121
   
../forum/index.php?action=mlist [nofollow]
8: Undefined index: avatar
../forum/Sources/Memberlist.php
Line: 121

../forum/index.php?action=mlist;sort=emailAddress;start=0 [nofollow]
8: Undefined index:  avatar
../forum/Sources/Memberlist.php
Line: 121

I'm guessing these are the mlist sorted by "x," "y," or "z" (realName, emailAddress, etc.)



I had thought these would be errors with basis same as last time... $txt['avatar'] not in the  Modifications.language.php but it's there.


I also noticed just now when I replicated the problem that it only lists 63 of 81 total members (11 are banned but I don't know what happened to the rest)

What other info can I tell you that will help you help me!?  :-

Many TIA!

Lori

btw... Again, thank you for your efforts and for maintaining support for this. I really DO appreciate it!
Come visit me anytime at:
DFW CFS/ME & FM Information Distribution Services: http://dfwcfids.net [nofollow]
JMHS Alumni: http://jmhs-classmates.org  --.net
The AzleZoo: http://azlezoo.com [nofollow]

You can also visit me at:
GerdieB.: http://gerdieb.blogspot.com [nofollow]
My Flickr Photos!: http://www.flickr.com/photos/azlezoo [nofollow]

A Life? Cool!
Where can I download one of those from??
unknown

happyfeet

Quote from: Gazmanafc on May 10, 2007, 03:48:23 PM
For sizes try:

<td class="windowbg2"><img src="', $member['avatar']['href'], '" width="40" height="40" alt="" /></td>
in Memberlist.template.php and change the width/height.

What would be the proper code for SMF 1.1.7? I would like to keep my overall avatar size at 65x65 but have the avatar display at 32x32 when on the Memberlist page.

Thanks in advance...

Gary

The code would be the same, except you use 32 instead of 40.
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

happyfeet

#78
Thanks for the sanity check. I am guessing that I foobarred the code snippet and did not close a tag the first time around.

<td class="windowbg2"><img src="', $member['avatar']['href'], '" width="32" height="32" alt="" /></td>

Seems to work well!

Thanks


Advertisement: