vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   create multiple checkbox with [print_checkbox_row] (https://vborg.vbsupport.ru/showthread.php?t=314549)

omardealo 09-28-2014 02:02 AM

create multiple checkbox with [print_checkbox_row]
 
Hello ,

i have a problem with [print_checkbox_row] when create multiple checkbox from array
Shows only one checkbox !

PHP Code:

$fantasy $db->query_first("SELECT * FROM " TABLE_PREFIX " quiz_fantasy ");
// data in column "playerarray" : ahmed,mohamed,omar
$playerarray explode(",",$fantasy[playerarray]);
// note : when print_r($playerarray);
// output : Array ( [0] => ahmed [1] => mohamed [2] => omar )
print_checkbox_row('This is a checkbox row''inputname'2$playerarray); 


Lynne 09-28-2014 04:27 PM

print_checkbox_row prints a SINGLE row/checkbox. It won't print from an array. You'll need to put that into a loop.

omardealo 09-28-2014 06:09 PM

Quote:

Originally Posted by Lynne (Post 2516771)
print_checkbox_row prints a SINGLE row/checkbox. It won't print from an array. You'll need to put that into a loop.

yeah i know , i can loop it

PHP Code:

 foreach($playerarray as $player)
{
print_checkbox_row($player'inputname'$player); 
 } 

but i search about a good and another solution , i want all checkbox on one only row and Every two or three in each line, like as
print_radio_row OR print_membergroup_row ..
is there another solution ?!
thnx ,Lynne

kh99 09-28-2014 06:59 PM

Those functions are in includes/adminfunctions.php, and they're pretty simple. Maybe what you could do is copy one of them and change it to do what you want. print_checkbox_row() puts each one in a div tag, which puts them on separate lines by default. So maybe you could copy that function, put in a loop to go through an array, take out the <div> (or change the display type to inline), and output a <br> tag when you want a new row.

omardealo 09-28-2014 09:29 PM

Quote:

Originally Posted by kh99 (Post 2516782)
Those functions are in includes/adminfunctions.php, and they're pretty simple. Maybe what you could do is copy one of them and change it to do what you want. print_checkbox_row() puts each one in a div tag, which puts them on separate lines by default. So maybe you could copy that function, put in a loop to go through an array, take out the <div> (or change the display type to inline), and output a <br> tag when you want a new row.

i saw a functions in includes/adminfunctions.php already
maybe that's a good way , but i see the loop is esay for me
thnx anyway for your help, kh99


All times are GMT. The time now is 05:36 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01569 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete