View Full Version : Custom Admincp page help needed
jim6763nva
06-06-2006, 11:03 AM
Hi :)
I'm creating a custom admin page that allows the admin of my site to add urls to a database table. With this url, is other specific information, such as who was involved in the development of the pages and files within. This "add" page would be to allow additions to this site's "world list" http://www.friendship-cafe.com/ then scroll down to the middle of the page.
I've attached an image of what I have so far but I'd like to be able to construct something with check boxes that looks like this:
[ ] Developer1 [ ] Developer2 [ ] Developer3 [ ] Developer4
[ ] Developer5 [ ] Developer6 [ ] Developer7 [ ] Developer8
[ ] Developer9 [ ] Developer10 [ ] Developer11 [ ] Developer12
Each one of these is the name of a developer or specific user in the users table. I'm not sure if this is the best way to "assign" users or developers to a url though.
I would also be keeping track of url and developer since this is a many to many relationship with a join table.
Any help on this would be appreciated,
Jim
Antivirus
06-09-2006, 04:22 PM
I would suggest handling it with a print_input_select_row funcrion as opposed to many check boxes.
// ################################################## ###########################
/**
* Prints a row containing an <input type="text" /> and a <select>
*
* @param string Title for row
* @param string Name for input field
* @param string Value for input field
* @param string Name for select field
* @param array Array of options for select field - array(0 => 'No', 1 => 'Yes') etc.
* @param string Value of selected option for select field
* @param boolean Whether or not to htmlspecialchars the input field value
* @param integer Size for input field
* @param integer Size for select field (if not 0, is multi-row)
* @param integer Max length for input field
* @param string Text direction for input field
* @param mixed If specified, overrides the default CSS class for the input field
* @param boolean Allow multiple selections from select field?
*/
*/
function print_input_select_row($title, $inputname, $inputvalue = '', $selectname, $selectarray, $selected = '', $htmlise = true, $inputsize = 35, $selectsize = 0, $maxlength = 0, $direction = '', $inputclass = false, $multiple = false)
Create an array of all your usernames and ids which you want in the dropdown, then use the $selectarray var along with the arrays and it should be a bit more organized, as well as dynamic if the array is created based upon usergroup, etc... :)
jim6763nva
06-11-2006, 10:09 PM
I would suggest handling it with a print_input_select_row funcrion as opposed to many check boxes.
// ################################################## ###########################
/**
* Prints a row containing an <input type="text" /> and a <select>
*
* @param string Title for row
* @param string Name for input field
* @param string Value for input field
* @param string Name for select field
* @param array Array of options for select field - array(0 => 'No', 1 => 'Yes') etc.
* @param string Value of selected option for select field
* @param boolean Whether or not to htmlspecialchars the input field value
* @param integer Size for input field
* @param integer Size for select field (if not 0, is multi-row)
* @param integer Max length for input field
* @param string Text direction for input field
* @param mixed If specified, overrides the default CSS class for the input field
* @param boolean Allow multiple selections from select field?
*/
*/
function print_input_select_row($title, $inputname, $inputvalue = '', $selectname, $selectarray, $selected = '', $htmlise = true, $inputsize = 35, $selectsize = 0, $maxlength = 0, $direction = '', $inputclass = false, $multiple = false)
Create an array of all your usernames and ids which you want in the dropdown, then use the $selectarray var along with the arrays and it should be a bit more organized, as well as dynamic if the array is created based upon usergroup, etc... :)
Thanks for the tip! I'll give that a shot.
I'm running into a situation where I have a section of code similar to what I listed below and for some reason, processing falls through all of the code prior to the form being displayed. Does anyone have a simple example of doing this?
if ($_REQUEST['do']== "add" || $_REQUEST['do']== "edit" )
{
// display form here
}
if ($_POST['do'] == "doAddSave")
{
// Save form data to database
}
Thanks,
Jim
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.