Dear Max,
My problem is that I have informations in 3 tables stored and need a custom SQL read (Wordpress, user, user_blocked and user_meta).The user_meta table writes values to a user_id like this
id user_id valuename value
1 3 name Test
1 3 vorname Teo
1 2 name otto
The problem is that I can't build the querry via data read.
My Solutuion is to generate with PHP an string and save it as variable
$args = array(
'exclude' =>$blockedUser,
'role' => 'Berater',
'orderby' => 'user_nicename',
'order' => 'ASC'
);
$user = get_users( $args );
$counselors ="";
foreach($user as $key =>$councelor){
$counselors = $counselors . "\n" .$councelor->data->ID . " = " . $councelor->data->display_name;
}
$this->set("counselors", $counselors);
Use the multiline setting.
and then I have modifide chronoforms7\chronog3\admin\extensions\chronofc\behaviors\views\field_multiline_options\field_multiline_options_output.php to following
<?php
if(!empty($unit['multiline_options'])){
[color=rgb(255, 0, 0)][strong] $gtext=$unit['multiline_options'];
if( substr($unit['multiline_options'], 0, 5) === "{var:"){
$gtext = $this->controller->Parser->parse($unit['multiline_options']);
}[/strong][/color]
$lines = explode("\n", $gtext);
$lines = array_map('trim', $lines);
$lines = array_filter($lines, 'strlen');
foreach($lines as $line){
$option = [];
$odata = explode('=', $line);
$option = [
'value' => $odata[0],
'content' => $this->controller->Parser->parse($odata[1] ?? $odata[0]),
];
[br] $unit['foptions'][] = $option;[br] }[br] }
Feel free to use this solution