[SOLVED] Front end approval checkboxes

14 years 1 month ago #128160 by avalonglobal
[SOLVED] Front end approval checkboxes was created by avalonglobal
I need to change the default value of the check boxes to unchecked(when approving users on mod_comprofilermoderator front end Approval/Rejection module). Has anyone successfully been able to change this?

Post edited by: krileon, at: 2010/09/15 18:56

Please Log in to join the conversation.

14 years 1 month ago #128177 by krileon
Replied by krileon on topic Re:Front end approval checkboxes
This would require a core edit, which we do not support. Please see comprofiler.php and comprofiler.html.php for the location you many need to modify.

Post edited by: krileon, at: 2010/03/26 21:50


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 7 months ago #141553 by gussie
Replied by gussie on topic Re:Front end approval checkboxes
krileon wrote:

This would require a core edit, which we do not support. Please see comprofiler.php and comprofiler.html.php for the location you many need to modify

Thank you! This helped :)

I was able to do this by finding this line in comprofiler.html.php
[code:1]
echo "<td><input id='u".$users[$i]->id."' type=\"checkbox\" checked=\"checked\" name=\"uids[]\" value=\"".$users[$i]->id."\" /></td>";
[/code:1] and simply removing the = sign in the 'checked=\"checked\"' parameter to 'cancel' the forced checkbox.

I found the line in function pendingApprovalUsers at Line 1655

Does anyone know how I can change the sorting order of the Pending Approved User list? I would like the latest registrations to appear at the top.

The Loop where the line above appears is:
[code:1]
for($i = 0; $i < count($users); $i++) {
echo "<tr align='left' valign='middle'>";
echo "<td><input id='u".$users[$i]->id."' type=\"checkbox\" checked\"checked\" name=\"uids[]\" value=\"".$users[$i]->id."\" /></td>";
echo "<td><a href='".cbSef("index.php?option=com_comprofiler&task=userProfile&user=".$users[$i]->id.($Itemid ? "&Itemid=". (int) $Itemid : ""«»))."'>".getNameFormat($users[$i]->name,$users[$i]->username,$ueConfig). "</a></td>";
echo "<td>".$users[$i]->email."</td>";
echo "<td>".cbFormatDate($users[$i]->registerDate)."</td>";
echo "<td><textarea name='comment".$users[$i]->id."' cols='20' rows='3'></textarea></td>";
echo "</tr>";
}
[/code:1]
How would I make that first line 'go down' instead of up?

Post edited by: gussie, at: 2010/09/08 02:10

Post edited by: gussie, at: 2010/09/08 02:11

Please Log in to join the conversation.

13 years 7 months ago #141631 by krileon
Replied by krileon on topic Re:Front end approval checkboxes

Does anyone know how I can change the sorting order of the Pending Approved User list? I would like the latest registrations to appear at the top.

You'd need to adjust core database queries, please examine cbs libraries at administrator/com_comprofiler/library/cb/. May also want to review comprofiler.php.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

13 years 7 months ago #142005 by gussie
Replied by gussie on topic Re:Front end approval checkboxes
krileon wrote:

Does anyone know how I can change the sorting order of the Pending Approved User list? I would like the latest registrations to appear at the top.

You'd need to adjust core database queries, please examine cbs libraries at administrator/com_comprofiler/library/cb/. May also want to review comprofiler.php.

B) Good news! It isn't that complicated after all.

I accomplished this by adding ONE line of code as the first line in the FOR loop:
[code:1]$counterlatest = count($users) - $i - 1;[/code:1]
Then I had to change every instance of $i to $counterlatest so that the correct entry in the array is being listed. Notice how I had to add an extra " - 1" at the end of the $counterlatest line. This removes the extra step in the counter -- if you don't do this, then your table will begin with a row to a user that has not yet been defined.

Here is a sample of the new code with all the changes:
[code:1]for($i = 0; $i < count($users); $i++) {
$counterlatest = count($users) - $i - 1;
echo "<tr align='left' valign='middle'>";
echo "<td><input id='u".$users[$counterlatest]->id."' style='size: 150%' type=\"checkbox\" checked\"checked\" name=\"uids[]\" value=\"".$users[$counterlatest]->id."\" /></td>";
echo "<td><a style='font-size: 160%' href='".cbSef("index.php?option=com_comprofiler&amp;task=userProfile&amp;user=".$users[$counterlatest]->id.($Itemid ? "&amp;Itemid=". (int) $Itemid : ""«»))."'><B>".getNameFormat($users[$counterlatest]->name,$users[$counterlatest]->username,$ueConfig). "</b></a></td>";
echo "<td>".$users[$counterlatest]->email."</td>";
echo "<td>".cbFormatDate($users[$counterlatest]->registerDate)."</td>";
echo "<td><textarea name='comment".$users[$counterlatest]->id."' cols='10' rows='2'></textarea></td>";
echo "</tr><TR><TD COLSPAN=5><HR size=1></td></tr>";[/code:1]
You might notice I added an extra <TR> rows and some larger font styling to make the table prettier and easier to read. I also copied the APPROVE and REJECT buttons from below to the top. Since I'll focus on approving the latest registrations, no need to jump all the way down to the bottom of the list anymore :)

Now, every week, I can Reject the oldest stuff at the bottom whenever the Spirit moves me

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.228 seconds

Facebook Twitter LinkedIn