function UserAttributeValue($user = 0, $attribute = 0) { # workaround for integration webbler/phplist global $table_prefix, $tables; if (!isset($table_prefix)) { $table_prefix = "phplist_"; } if (!$user || !$attribute) { return; } if (isset($tables["attribute"])) { $att_table = $tables["attribute"]; $user_att_table = $tables["user_attribute"]; } else { $att_table = "attribute"; $user_att_table = "user_attribute"; } $att = Sql_Fetch_array_Query("select * from {$att_table} where id = {$attribute}"); switch ($att["type"]) { case "checkboxgroup": # print "select value from $user_att_table where userid = $user and attributeid = $attribute"; $val_ids = Sql_Fetch_Row_Query("select value from {$user_att_table} where userid = {$user} and attributeid = {$attribute}"); if ($val_ids[0]) { # print '<br/>1 <b>'.$val_ids[0].'</b>'; if (function_exists('cleancommalist')) { $val_ids[0] = cleanCommaList($val_ids[0]); } ## make sure the val_ids as numbers $values = explode(',', $val_ids[0]); $ids = array(); foreach ($values as $valueIndex) { $iValue = sprintf('%d', $valueIndex); if ($iValue) { $ids[] = $iValue; } } if (!sizeof($ids)) { return ''; } $val_ids[0] = join(',', $ids); # print '<br/>2 <b>'.$val_ids[0].'</b>'; $value = ''; $res = Sql_Query("select {$table_prefix}" . "listattr_" . $att["tablename"] . ".name\n from {$user_att_table},{$table_prefix}" . "listattr_" . $att["tablename"] . "\n where {$user_att_table}" . ".userid = " . $user . " and\n {$table_prefix}" . "listattr_" . $att["tablename"] . ".id in ({$val_ids['0']}) and\n {$user_att_table}" . ".attributeid = " . $attribute); while ($row = Sql_Fetch_row($res)) { $value .= $row[0] . "; "; } $value = substr($value, 0, -2); } else { $value = ""; } break; case "select": case "radio": $res = Sql_Query("select {$table_prefix}" . "listattr_" . $att["tablename"] . ".name\n from {$user_att_table},{$table_prefix}" . "listattr_" . $att["tablename"] . "\n where {$user_att_table}" . ".userid = " . $user . " and\n {$table_prefix}" . "listattr_" . $att["tablename"] . ".id = {$user_att_table}" . ".value and\n {$user_att_table}" . ".attributeid = " . $attribute); $row = Sql_Fetch_row($res); $value = $row[0]; break; default: $res = Sql_Query(sprintf('select value from %s where userid = %d and attributeid = %d', $user_att_table, $user, $attribute)); $row = Sql_Fetch_row($res); $value = $row[0]; } return stripslashes($value); }
$subqueries[$i]['query'] = sprintf('select userid from %s where attributeid = %d and value != "" and value %s "%s" ', $GLOBALS['tables']['user_attribute'], $crit_data['attribute'], $dateoperator, $date_value); break; default: if (isset($where_clause)) { $where_clause .= " {$mainoperator} "; $select_clause .= " left join {$tables['user_attribute']} as table{$tc} on table0.userid = table{$tc}.userid "; } else { $select_clause = " table{$tc}.userid from {$tables['user_attribute']} as table{$tc} "; } $where_clause .= " ( table{$tc}.attributeid = " . $crit_data["attribute"] . " and table{$tc}.value "; if ($crit_data["operator"] == "isnot") { $where_clause .= ' not in ('; } else { $where_clause .= ' in ('; } $where_clause .= cleanCommaList($crit_data["values"]) . ") )"; $subqueries[$i]['query'] = sprintf('select userid from %s where attributeid = %d and value %s in (%s) ', $GLOBALS['tables']['user_attribute'], $crit_data['attribute'], $crit_data["operator"] == "isnot" ? 'not' : '', $crit_data["values"]); } $tc++; } } $existing_criteria = ''; if (sizeof($subqueries)) { # $count_query = "select distinct $select_clause where $where_clause"; # $count_query = addslashes($count_query); if (!empty($_GET["calculate"])) { ob_end_flush(); # print "<h1>$count_query</h1>"; print "<p>" . $GLOBALS['I18N']->get("calculating") . " ...";
FCKConfig.TemplateReplaceCheckbox = true ; FCKConfig.ToolbarLocation = 'In' ; FCKConfig.ToolbarSets["Default"] = [ ['Source','PasteWord','Link','Unlink'], ['Bold','Italic','Underline'], ['OrderedList','UnorderedList'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], ['Image','FontFormat','About'] <?php $editor_secondrow = getConfig('editortoolbar_row2'); if (!empty($editor_secondrow)) { print ",'/',\n"; $tools = cleanCommaList($editor_secondrow); $tools = str_replace("'", "\\'", $tools); print "['" . implode("','", explode(',', $tools)) . "']"; } ?> ] ; FCKConfig.ToolbarSets["Basic"] = [ ['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About'] ] ; FCKConfig.EnterMode = 'p' ; // p | div | br FCKConfig.ShiftEnterMode = 'br' ; // p | div | br FCKConfig.Keystrokes = [
function UserAttributeValue($user = 0, $attribute = 0) { # workaround for integration webbler/phplist global $table_prefix, $tables; if (!isset($table_prefix)) { $table_prefix = "phplist_"; } # if (!$user || !$attribute) return; if (isset($tables["attribute"])) { $att_table = $tables["attribute"]; $user_att_table = $tables["user_attribute"]; } else { $att_table = "attribute"; $user_att_table = "user_attribute"; } $att = Sql_Fetch_array_Query("select * from {$att_table} where id = {$attribute}"); switch ($att["type"]) { case "checkboxgroup": $val_ids = Sql_Fetch_Row_Query("select value from {$user_att_table} where userid = {$user} and attributeid = {$attribute}"); if ($val_ids[0]) { if (function_exists('cleancommalist')) { $val_ids[0] = cleanCommaList($val_ids[0]); } $value = ''; $res = Sql_Query("select {$table_prefix}" . "listattr_" . $att["tablename"] . ".name\n from {$user_att_table},{$table_prefix}" . "listattr_" . $att["tablename"] . "\n where {$user_att_table}" . ".userid = " . $user . " and\n {$table_prefix}" . "listattr_" . $att["tablename"] . ".id in ({$val_ids['0']}) and\n {$user_att_table}" . ".attributeid = " . $attribute); while ($row = Sql_Fetch_row($res)) { $value .= $row[0] . "; "; } $value = substr($value, 0, -2); } else { $value = ""; } break; case "select": case "radio": $res = Sql_Query("select {$table_prefix}" . "listattr_" . $att["tablename"] . ".name\n from {$user_att_table},{$table_prefix}" . "listattr_" . $att["tablename"] . "\n where {$user_att_table}" . ".userid = " . $user . " and\n {$table_prefix}" . "listattr_" . $att["tablename"] . ".id = {$user_att_table}" . ".value and\n {$user_att_table}" . ".attributeid = " . $attribute); $row = Sql_Fetch_row($res); $value = $row[0]; break; default: $res = Sql_Query("select value from {$user_att_table} where\n {$user_att_table}" . ".userid = " . $user . " and attributeid =\n " . $attribute); $row = Sql_Fetch_row($res); $value = $row[0]; } return $value; }