2008-03-25, 06:13 AM
From the MyBB Development Blog:
Do the new features mean it will be easy to run custom queries on the user data base?
If we have several custom user profile fields, then we could select all users who like a certain sport (for example)
Can the results be exported to a spreadsheet?
Can we email only the group of users selected by the query??
/I'm not expecting we can, just trying to understand what this is supposed to do.
Thank you very much.
Quote:This code is from MyBB 1.4 and it is of the new code in the ACP; specifically, the Users page in the ACP. I won’t go into detail about all the new code in the ACP but I’ll briefly cover what was shown in that picture.
The first thing you’ll notice is $form->output_row(…). What it does is fairly obvious but just in case, it outputs a row to your MyBB ACP page. The arguments for this function are as follows:
title - string The title of the row.
description - string The description of the row/field.
content - string The HTML content to show in the row.
label_for - string The ID of the control this row should be a label for.
options - array Array of options for the row cell.
row_options - array Array of options for the row container.
output_row(title, description="", content="", label_for="", options=array(), row_options=array())
Now you may be thinking we use pure HTML all the time in $form->output_row. As you look closer at the picture, however, you will also see $form->generate_select_box and $form->generate_check_box, the arguments of which are:
name - string The name of the select box.
option_list - array Array of options in key => val format.
selected - mixed Either a string containing the selected item or an array containing multiple selected items (options['multiple'] must be true)
options - array Array of options for the select box (multiple, class, id, size)
generate_select_box(name, option_list, selected=array(), options=array())
and
name - string The name of the check box.
value - string The value of the check box.
label - string The label of the check box if there is one.
options - array Array of options for the check box (id, class, checked)
generate_check_box(name, value="", label="", options=array())
Those are just two of several functions that allow you to generate code automatically for the new ACP.
Do the new features mean it will be easy to run custom queries on the user data base?
If we have several custom user profile fields, then we could select all users who like a certain sport (for example)
Can the results be exported to a spreadsheet?
Can we email only the group of users selected by the query??
/I'm not expecting we can, just trying to understand what this is supposed to do.
Thank you very much.