2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
$field=db_fetch_object(db_query("SELECT DISTINCT(f.fid), f.type, f.title, f.page FROM {profile_fields} f INNER JOIN {profile_values} v ON f.fid = v.fid WHERE f.name = '%s' AND v.value = '%s' ORDER BY f.category, f.weight",arg(1),$value));
$field=db_fetch_object(db_query("SELECT DISTINCT(fid), type, title, page FROM {profile_fields} WHERE name = '%s'",arg(1)));
if($field->fid){
// Compile a list of fields to show:
...
...
@@ -42,8 +40,21 @@ function profile_browse() {
$fields[]=$record;
}
// Determine what query to use:
switch($field->type){
case'checkbox':
$query='v.value = 1';
break;
case'selection':
$query="v.value = '".check_query(arg(2))."'";
break;
case'list':
$query="v.value LIKE '%".check_query(arg(2))."%'";
break;
}
// Extract the affected users:
$result=pager_query("SELECT u.uid FROM {users} u INNER JOIN {profile_values} v ON u.uid = v.uid WHERE v.fid = $field->fid AND v.value = '".check_query($value)."' ORDER BY u.changed DESC",20);
$result=pager_query("SELECT u.uid FROM {users} u INNER JOIN {profile_values} v ON u.uid = v.uid WHERE v.fid = $field->fid AND $query ORDER BY u.changed DESC",20);
$fields[$field->category].=form_textarea($field->title,$field->name,$edit[$field->name],60,5,$field->explanation." ".t('Put each entry on a separate line. No HTML allowed.'));
@@ -272,7 +294,7 @@ function _profile_field_form($type, $edit = array()) {
$output=form_group(t('Field settings'),$group);
$group='';
if($type=='selection'){
if($type=='selection'||$type=='list'){
$group.=form_textfield(t('Page title'),'page',$edit['page'],70,128,t("The title of the page showing all users with the specified field. The word <code>%value</code> will be substituted with the corresponding value. An example page title is 'People whose favorite color is %value'."));
}
else{
...
...
@@ -324,7 +346,7 @@ function theme_profile_profile($user, $fields = array()) {
$field=db_fetch_object(db_query("SELECT DISTINCT(f.fid), f.type, f.title, f.page FROM {profile_fields} f INNER JOIN {profile_values} v ON f.fid = v.fid WHERE f.name = '%s' AND v.value = '%s' ORDER BY f.category, f.weight",arg(1),$value));
$field=db_fetch_object(db_query("SELECT DISTINCT(fid), type, title, page FROM {profile_fields} WHERE name = '%s'",arg(1)));
if($field->fid){
// Compile a list of fields to show:
...
...
@@ -42,8 +40,21 @@ function profile_browse() {
$fields[]=$record;
}
// Determine what query to use:
switch($field->type){
case'checkbox':
$query='v.value = 1';
break;
case'selection':
$query="v.value = '".check_query(arg(2))."'";
break;
case'list':
$query="v.value LIKE '%".check_query(arg(2))."%'";
break;
}
// Extract the affected users:
$result=pager_query("SELECT u.uid FROM {users} u INNER JOIN {profile_values} v ON u.uid = v.uid WHERE v.fid = $field->fid AND v.value = '".check_query($value)."' ORDER BY u.changed DESC",20);
$result=pager_query("SELECT u.uid FROM {users} u INNER JOIN {profile_values} v ON u.uid = v.uid WHERE v.fid = $field->fid AND $query ORDER BY u.changed DESC",20);
$fields[$field->category].=form_textarea($field->title,$field->name,$edit[$field->name],60,5,$field->explanation." ".t('Put each entry on a separate line. No HTML allowed.'));
@@ -272,7 +294,7 @@ function _profile_field_form($type, $edit = array()) {
$output=form_group(t('Field settings'),$group);
$group='';
if($type=='selection'){
if($type=='selection'||$type=='list'){
$group.=form_textfield(t('Page title'),'page',$edit['page'],70,128,t("The title of the page showing all users with the specified field. The word <code>%value</code> will be substituted with the corresponding value. An example page title is 'People whose favorite color is %value'."));
}
else{
...
...
@@ -324,7 +346,7 @@ function theme_profile_profile($user, $fields = array()) {