News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

ssi_fetchGroupMembers

Started by mirahalo, March 12, 2009, 07:50:32 PM

Previous topic - Next topic

mirahalo

Hi, I was wondering...

how can I included the number of post and the karma of the user in the ssi_fetchGroupMembers

in 1.1.x there was a nice tutorial: http://www.simplemachines.org/community/index.php?topic=125401.msg1714408#msg1714408


but I cant do the changes in 2.0RC1  :'(

thanks in advance :)

mirahalo


!wooha

Quote from: 130860 on March 13, 2009, 09:17:59 AM
bump !!!


no one ???

...yes there is some one!

(and that someone is YOU! :D)

dont be shy or afraid.

Even though it is more typing, I will show you how to do it (learn to fish) vs just throwing you a fish.

1. the mod pulls the data from the member table (for SMF 1.1x) but the SMF layout for 2x is a little different (some field names have changed) so you need to map the old names to the new names.

2. The differences are easy to see (mostly changes to lowercase and stuff like that)

Here are some of the most relevant fields out of the member table

id_member
member_name
date_registered
posts
id_group
last_login
real_name
instant_messages smallint(5) NO   0
unread_messages smallint(5) NO   0
email_address tinytext NO    
personal_text tinytext NO    
gender tinyint(4) unsigned NO   0
birthdate date NO MUL 0001-01-01
website_title tinytext NO    
website_url tinytext NO    
location tinytext NO    
icq tinytext NO    
aim varchar(16) NO    
yim varchar(32) NO    
msn tinytext NO    
hide_email tinyint(4) NO   0
show_online tinyint(4) NO   1
time_format varchar(80) NO    
avatar tinytext NO    
pm_email_notify tinyint(4) NO   0
karma_bad smallint(5) unsigned NO   0
karma_good smallint(5) unsigned NO   0
usertitle tinytext NO    
id_post_group smallint(5) unsigned NO MUL 0
total_time_logged_in int(10) unsigned NO   0


(Btw, this edited list of fields was generated by the mySQL query, "SHOW COLUMNS FROM `smf_members` ")

so now you have the list of fields, look at the query itself, and SUBSTITUTE THE 1.1x FIELD NAMES with the 2.x FIELD NAMES

example:

SELECT ID_MEMBER, realname, ID_GROUP


stuff like that will be changed to
Quote
SELECT id_member, real_name, id_group

Yağız...

Find in ../SSI.php:
<br />', $query_members[$member]['avatar']['image'], '
Replace with:
<br />', $query_members[$member]['avatar']['image'];
// Is karma display enabled?  Total or +/-?
if ($modSettings['karmaMode'] == '1')
echo '
<br />', $modSettings['karmaLabel'], ' ', $query_members[$member]['karma']['good'] - $query_members[$member]['karma']['bad'];
elseif ($modSettings['karmaMode'] == '2')
echo '
<br />', $modSettings['karmaLabel'], ' +', $query_members[$member]['karma']['good'], '/-', $query_members[$member]['karma']['bad'];
echo '

I didn't try but it should be something like this.

mirahalo

#4
thank you very much both of you !!!!!

!wooha  thanks for show me how to  fish...


Advertisement: