ok, up to, and including the above, i'm good with.codejunkie wrote:On the line just before the double parenthesis and semi-colon I added
Adding these two lines allows your template to be language independent again.Code: Select all
'FNAME' => 'Full Name', 'SORT_FNAME' => 'Full Name',
change what? where? i do not find that line in my membership_body file.codejunkie wrote:We can now change it to read asCode: Select all
<th><a href="{U_SORT_FNAME}#memberlist">{L_FNAME}</a></th>
i dropped that code in where it goes. pretty sure that 'that's' okay. i just changed FNAME to BIKE and fname to bike. anything i missed there?codejunkie wrote:Fortunately, we only need to modify one more file, memberlist.php, which is found in your root folder "/" of your installed phpbb forum.
Several places will need to be modified or added to. Starting at around line 900, I added
The SORT_FNAME matches the previous edit to the common.php file. The pf_fname is a field name as found in the profile_fields_data table. The fd. is for a future abbreviation in a SQL statement.Code: Select all
$sort_key_text['y'] = $user->lang['SORT_FNAME']; $sort_key_sql['y'] = 'fd.pf_fname';
but from that 'if' statement on, is where i know i'm missing something.codejunkie wrote:Now, scroll down to about line 1309 and look forAfter that line and depending on how many custom fields you wanted to add, you need to add some type of conditional statement. Since I only wanted to add one new field / column to my memberlist page, I chose an if statement.Code: Select all
// Get us some users :D
Code: Select all
if(isset($sort_key_sql['y'])) { $sql = "SELECT u.user_id FROM " . USERS_TABLE . " u $sql_from LEFT JOIN " . PROFILE_FIELDS_DATA_TABLE . " fd ON (u.user_id = fd.user_id) WHERE u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ") $sql_where ORDER BY $order_by"; } else {
i realize that the line numbers differ from style template to style template, but i'm still not sure where that closing bracket is supposed to go. tho, might be that once i'm clear on the above code itself, it'll be more obvious where to place the closing bracket.codejunkie wrote:Now, you need to add a closing bracket "}" after the previous SQL statement at about line 1325 to complete the if statement.Code: Select all
}
can this go anywhere within the 'U_SORT_' section?codejunkie wrote:One more addition is needed to get your link to show up on the column for sorting. At around line 1470 or so I addedCode: Select all
'U_SORT_FNAME' => $sort_url . '&sk=y&sd=' . (($sort_key == 'y' && $sort_dir == 'a') ? 'd' : 'a'),
Of course not.redryder wrote: i do not find that line in my membership_body file.
That's good to know.redryder wrote:the code changes from CodeJunkie has fixed my curly bracket issue already.
This bit of code is not currently in the memberlist.html file. That was what would have replaced the code brf used for your column header, which you state you have fixed already.redryder wrote: but here is where i seem to be confused . . .change what? where? i do not find that line in my membership_body file.codejunkie wrote:We can now change it to read asCode: Select all
<th><a href="{U_SORT_FNAME}#memberlist">{L_FNAME}</a></th>
As long as it is in the area of the other $sort_key_text[] variables, it should be fine.redryder wrote:
i dropped that code in where it goes. pretty sure that 'that's' okay. i just changed FNAME to BIKE and fname to bike. anything i missed there?codejunkie wrote:Fortunately, we only need to modify one more file, memberlist.php, which is found in your root folder "/" of your installed phpbb forum.
Several places will need to be modified or added to. Starting at around line 900, I added
The SORT_FNAME matches the previous edit to the common.php file. The pf_fname is a field name as found in the profile_fields_data table. The fd. is for a future abbreviation in a SQL statement.Code: Select all
$sort_key_text['y'] = $user->lang['SORT_FNAME']; $sort_key_sql['y'] = 'fd.pf_fname';
That is the SQL statement that is called when you select your new column for sorting. It goes right before the original SQL statement, which is found at line number 1298 in a clean memberlist.php file and right after the "//Get us some users " line. Here is the SQL code that it goes before.redryder wrote:codejunkie wrote:Now, scroll down to about line 1309 and look forAfter that line and depending on how many custom fields you wanted to add, you need to add some type of conditional statement. Since I only wanted to add one new field / column to my memberlist page, I chose an if statement.Code: Select all
// Get us some users :D
Code: Select all
if(isset($sort_key_sql['y'])) { $sql = "SELECT u.user_id FROM " . USERS_TABLE . " u $sql_from LEFT JOIN " . PROFILE_FIELDS_DATA_TABLE . " fd ON (u.user_id = fd.user_id) WHERE u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ") $sql_where ORDER BY $order_by"; } else {
Code: Select all
$sql = "SELECT u.user_id
FROM " . USERS_TABLE . " u
$sql_from
WHERE u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ")
$sql_where
ORDER BY $order_by";
I don't think so. I think that code will work for you as is.redryder wrote: but from that 'if' statement on, is where i know i'm missing something.
the above piece of code, am i to literally just copy and paste that, as is, where you said too? does something in there need to be changed for my specific memberlist fields?
That goes immediately after the SQL statement I just posted and before this code.redryder wrote:i realize that the line numbers differ from style template to style template, but i'm still not sure where that closing bracket is supposed to go. tho, might be that once i'm clear on the above code itself, it'll be more obvious where to place the closing bracket.codejunkie wrote:Now, you need to add a closing bracket "}" after the previous SQL statement at about line 1325 to complete the if statement.Code: Select all
}
Code: Select all
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
Yes, it can.redryder wrote:can this go anywhere within the 'U_SORT_' section?codejunkie wrote:One more addition is needed to get your link to show up on the column for sorting. At around line 1470 or so I addedCode: Select all
'U_SORT_FNAME' => $sort_url . '&sk=y&sd=' . (($sort_key == 'y' && $sort_dir == 'a') ? 'd' : 'a'),
Hopefully, this post will help you and others in the future. I'll try to upload a MODX for these changes later. This mod is my first one, EVER.redryder wrote:
thanks in advance for all the help with this . . i'm learning as i go! and while i really actually enjoy researching and figuring these things out on my own, as best i can, this is one thing i really need to get figured out as quickly as possible!
thanks again!
~ deanna ~
believe it or not, THAT was the only thing i had out of place and it was throwing everything off! so my column is showing, and sorting and is also in the drop down sort menu and i am one happy camper!codejunkie wrote:Code: Select all
}
oh i'm sure it will help many people!codejunkie wrote:Hopefully, this post will help you and others in the future. I'll try to upload a MODX for these changes later. This mod is my first one, EVER.
You could either comment out or delete the code in your memberlist_body.html file. The links would still work for sorting, but they would not be published and your members would need to manually surf to that url. If you wanted to go even further you could edit the memberlist.php file searching for 'd' where it points to the posts field, but the memberlist_body.html edit should do the job.redryder wrote:ok, one more quick question . . . just for future reference . . .
say i want to remove the post count column, not only from the memberlist page, but also from the sorting drop down menu . . . can i just remove those lines of code? turn them off? or is that even more involved than adding them in?
thanks so much!
~ deanna ~
Code: Select all
SQL ERROR [ mysql4 ]
Unknown column 'u.user_id' in 'on clause' [1054]
SQL
SELECT u.user_id FROM phpbb_users u , phpbb_user_group ug LEFT JOIN phpbb_profile_fields_data fd ON (u.user_id = fd.user_id) WHERE u.user_type IN (0, 3) AND ug.user_pending = 0 AND u.user_id = ug.user_id AND ug.group_id = 2 ORDER BY ug.group_leader DESC, u.user_regdate ASC LIMIT 25
BACKTRACE
FILE: includes/db/mysql.php
LINE: 158
CALL: dbal->sql_error()
FILE: includes/db/mysql.php
LINE: 205
CALL: dbal_mysql->sql_query()
FILE: includes/db/dbal.php
LINE: 157
CALL: dbal_mysql->_sql_query_limit()
FILE: memberlist.php
LINE: 1316
CALL: dbal->sql_query_limit()
Code: Select all
[ADMIN NAME] [ADMIN IP] Sat Aug 09, 2008 8:13 pm E-mail error
» EMAIL/PHP/mail()
/adm/index.php
Code: Select all
FROM (phpbb_users u , phpbb_user_group ug) LEFT JOIN
Does this just replaceBrf wrote:Some configurations of Mysql do not handle mixing implicit joins with explicit joins.
Try putting parenthesis here:
Code: Select all
FROM (phpbb_users u , phpbb_user_group ug) LEFT JOIN
Code: Select all
FROM " . USERS_TABLE . " u
$sql_from
LEFT JOIN
wait, forget that previous question. Codiejunkie's extra conditioncodejunkie wrote:Just discovered this over the weekend. I have not had a chance to look into it further. I think, if you put an additional check in the if statement where the sql statement is assigned to check if the mode is not equal to group, then it should work. I don't have access to my initial testing on a fix at the moment.
Code: Select all
if($mode != 'group' && isset($sort_key_sql['y'])) {
I believe that is what I came up with.richard lee wrote:wait, forget that previous question. Codiejunkie's extra conditioncodejunkie wrote:Just discovered this over the weekend. I have not had a chance to look into it further. I think, if you put an additional check in the if statement where the sql statement is assigned to check if the mode is not equal to group, then it should work. I don't have access to my initial testing on a fix at the moment.
Code: Select all
if($mode != 'group' && isset($sort_key_sql['y'])) {
You'll need to modify the memberlist.html file from your assigned style. There is a line regarding colspan.richard lee wrote: worked on the UCP Usergroups issue... except now it's throwing off table formatting.