Skip to Content Skip to Menu

Displaying custom fields in CB Workflows module

  • LordFede
  • LordFede
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
10 years 9 months ago - 10 years 9 months ago #239250 by LordFede
Hello, I was trying to figure out how to display a custom field made by me, on the list of unaproved users that CB Workflows module shows.

For example, I don't want to show a list like this:
[img


I want to show "occupation" field instead of that Email field, and another custom field like "Age" instead of that "Date Registered" field.

How can I do that?

Thanks in advance!
Last edit: 10 years 9 months ago by LordFede.

Please Log in or Create an account to join the conversation.

  • LordFede
  • LordFede
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
10 years 8 months ago - 10 years 8 months ago #240206 by LordFede
Come on! Any clue?

I found this code in comprofiler.html.php file:
Code:
<div class='contentheading'><?php echo _UE_USERAPPROVAL_MODERATE; ?></div><br /> <form action='<?php echo cbSef("index.php?option=$option".($Itemid ? "&amp;Itemid=". (int) $Itemid : "")); ?>' method='post' id='adminForm' name='adminForm'> <table width='100%' border='0' cellpadding='4' cellspacing='2'> <thead><tr align='left'> <th>&nbsp;</th> <th><?php echo _UE_USER; ?></th> <th><?php echo _UE_EMAIL; ?></th> <th><?php echo _UE_REGISTERDATE; ?></th> <th><?php echo _UE_COMMENT; ?></th> </tr></thead> <?php for($i = 0; $i < count($users); $i++) { echo "<tr align='left' valign='middle'>"; echo "<td><input id='u".$users[$i]->id."' type=\"checkbox\" name=\"uids[]\" value=\"".$users[$i]->id."\" /></td>"; echo "<td><a href='".cbSef("index.php?option=com_comprofiler&amp;task=userProfile&amp;user=".$users[$i]->id.($Itemid ? "&amp;Itemid=". (int) $Itemid : ""))."'>".getNameFormat($users[$i]->name,$users[$i]->username,$ueConfig['name_format']). "</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>"; } echo '<tr align="center" valign="middle"><td colspan="5">' .'<input class="button" style="background-color:#CFC;" onclick="this.form.task.value=\'approveUser\';this.form.submit();" type="button" value="'._UE_APPROVE.'" />' .'&nbsp;&nbsp;&nbsp;' .'<input class="button" style="background-color:#FCC;" onclick="this.form.task.value=\'rejectUser\';this.form.submit();" type="button" value="'._UE_REJECT.'" /></td></tr>'; echo "</table>\n"; echo "<input type='hidden' name='task' value='' />\n"; echo "<input type='hidden' name='option' value='".$option."' />\n"; echo cbGetSpoofInputTag( 'pendingApprovalUsers' ); echo "</form></div>\n"; }

I need to replace these fields:
Code:
echo "<td>".$users[$i]->email."</td>"; echo "<td>".cbFormatDate($users[$i]->registerDate)."</td>";
with cb_class field and cb_ilvl field.
Something like this:
Code:
echo "<td>".$users[$i]->cb_class."</td>"; echo "<td>".$users[$i]->cb_ilvl."</td>"; // the raw html output should be: //<td>Class value</td> //<td>ilvl value</td>

But I'm not an expert at PHP, I'm a total beginner.

If somebody can explain me a bit about the code, or just make the snippet yourself, I'll be very grateful.
Just if needed, these are the ids for those custom fields:
cb_class = 55
cb_ilvl = 60
Last edit: 10 years 8 months ago by LordFede.

Please Log in or Create an account to join the conversation.

  • LordFede
  • LordFede
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
10 years 7 months ago #242716 by LordFede
1 month, and I didn't get support yet.... :angry:

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
10 years 7 months ago #242720 by nant

LordFede wrote: 1 month, and I didn't get support yet.... :angry:


These free forum areas are meant for users to help themselves - they are very sparsely monitored by CB Team members.

You are right, you would need to make changes to the code and it looks like you have found the right area to make these hacks.

But we do not support hacking so you are really on your own here.

Please Log in or Create an account to join the conversation.

  • LordFede
  • LordFede
  • OFFLINE
  • Posts: 7
  • Thanks: 0
  • Karma: 0
10 years 7 months ago #242760 by LordFede

nant wrote: You would have to code this feature.

The workflow module was never meant to handle pages and pages of moderation requests.

Well... No offense meant, but this is going to be my last time and first review to the extension in few minutes.

Money, money, money... Its all about money, and you pretend to make money with a super limited and old-coded (the source is incredibly ridiculous in some parts, no "views/controllers" files and html tables everywhere) JOOMLA extension.
Now you dare to fail at support, this team has a lot to learn from other developers out there.

The good thing, I already know where to spend my money for a community-like extension, and it isn't CB.

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
10 years 7 months ago #242763 by nant

LordFede wrote:

nant wrote: You would have to code this feature.

The workflow module was never meant to handle pages and pages of moderation requests.

Well... No offense meant, but this is going to be my last time and first review to the extension in few minutes.

Money, money, money... Its all about money, and you pretend to make money with a super limited and old-coded (the source is incredibly ridiculous in some parts, no "views/controllers" files and html tables everywhere) JOOMLA extension.
Now you dare to fail at support, this team has a lot to learn from other developers out there.

The good thing, I already know where to spend my money for a community-like extension, and it isn't CB.


Hello again.

I don't see anything wrong with the code that you proposed.

Did you try it?

Regarding my last statement, I did not ask, propose or infer that paying would help us help you to perform hacks. We cannot support hacking so we do not encourage it. We prefer to propose clean if possible.

Regarding your use case, please note that your moderators can just click on the username link to visit each profile and see all the information before approving or rejecting.

Also, you can modify the language strings of CB to add extra fields that should be included in the email messages your moderation team receives (without need for hacking).

I have sent you a PM with additional information - please check.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum