【发布时间】:2015-10-22 18:10:49
【问题描述】:
我们有一个网站来监控客户网站的性能,我们正在使用商业智能 wordpress 插件来向客户展示性能。当一个新客户第一次登录并选择他的仪表板时,我们收到以下错误,当我们在数据库中更新时,错误消失了,但仪表板第一次应该显示自定义消息。 我正在使用以下 sql 查询
select lastsamplestatus,lasterrorat,avguptimeday,status from
selenium_script_data as ssd inner join selenium_scripts as ss
on ss.script_id=ssd.selenium_id inner join wp_users as wu on
wu.ID=ss.customer_id where wu.ID={{{user_ID}
注意:未定义变量:第 405 行 /home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/functions/functions.php 中的 label_x p>
注意:未定义变量:第 417 行 /home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/functions/functions.php 中的数据 p>
警告:第 417 行 /home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/functions/functions.php 中的 foreach() 参数无效
注意:试图在 /home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/resources/nvd3/wrappers/nvd3_lineChart.php 中获取非对象的属性第 60 行
注意:未定义变量:第 154 行 /home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/resources/nvd3/wrappers/nvd3_lineChart.php 中的 ds em>
注意:试图在 /home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/resources/nvd3/wrappers/nvd3_lineChart.php 中获取非对象的属性第 154 行
注意:未定义变量:/home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/functions/functions.php 第 158 行中的表 p>
注意:尝试在第 158 行的 /home/sgulechha/alert.com/wp-content/plugins/wp-business-intelligence-lite/functions/functions.php 中获取非对象的属性 em>
在管理员更新数据库之前,我们想为用户显示一条普通的自定义消息,我不知道在哪里自定义 functions.php,我从 wordpress 的商业智能插件中获得了这个文件。 我在下面粘贴了一部分代码,任何帮助将不胜感激。
//Assign values and labels
switch($wpbi_chart->type){
case chart::DONUT:
case chart::PIE: if(sizeof($label_x) > 0){
$wpbi_chart -> set_x_axis_labels($label_x,
$vo_chart->chart_x_labels_size,
$vo_chart->chart_x_labels_color);
}
foreach($data as $key => $value){
//Overwrite data value for pie chart in order to show labels (via pie_value object)
if(sizeof($label_x)>0){
for($idx = 0; $idx < sizeof($value); $idx++){
$value[$idx] = new pie_value($value[$idx], $label_x[$idx]);
}
}
$wpbi_chart -> set_tooltip($wpbi_dialog['charts']['pie']['tooltip']);
$wpbi_chart -> create_element($key, $value);
$wpbi_chart -> elements[$key] -> set_colours($wpbi_settings['pie-chart']['color-set']);
}
break;
case chart::BAR_STACKED: if(sizeof($label_x) > 0){
$wpbi_chart -> set_x_axis_labels($label_x,
$_POST[$wpbi_settings['parameter']['ch-x-label-size']],
$_POST[$wpbi_settings['parameter']['ch-x-label-color']]);
$wpbi_chart->x_axis_istime = (sizeof($istime_cols) > 0);
if($wpbi_chart->x_axis_istime){
$wpbi_chart->x_axis_labels->labels = $wpbi_chart->convert_to_time($wpbi_chart->x_axis_labels->labels);
}
}
$wpbi_chart-> set_y_axis_labels_color($_POST[$wpbi_settings['parameter']['ch-y-label-color']]);
$wpbi_chart-> set_y_axis_labels_size($_POST[$wpbi_settings['parameter']['ch-y-label-size']]);
foreach($data_stacked as $key => $value){
$wpbi_chart -> create_element('BAR_STACKED', $value);
$wpbi_chart -> elements['BAR_STACKED'] -> set_colours($stacked_label_color);
}
break;
case chart::STACKED_AREA:
case chart::LINE_AREA: if(sizeof($label_x) > 0){
$wpbi_chart -> set_x_axis_labels($label_x,
$vo_chart->chart_x_labels_size,
$vo_chart->chart_x_labels_color);
}
$wpbi_chart-> set_y_axis_labels_color($vo_chart->chart_y_labels_color);
$wpbi_chart-> set_y_axis_labels_size($vo_chart->chart_y_labels_size);
foreach($data as $key => $value){
$wpbi_chart -> create_element($key, $value);
$wpbi_chart -> elements[$key] -> set_colour($label_color[$key]);
$wpbi_chart -> elements[$key] -> set_fill_colour($label_color[$key]);
$wpbi_chart -> elements[$key] -> set_fill_alpha( 0.5 );
}
break;
case chart::RADAR: if(sizeof($label_x) > 0){
$wpbi_chart -> set_y_axis_labels($label_x,
$vo_chart->chart_y_labels_size,
$vo_chart->chart_y_labels_color);
}
foreach($data as $key => $value){
$wpbi_chart -> create_element($key, $value);
$wpbi_chart -> elements[$key] -> set_colour($label_color[$key]);
}
break;
case chart::BAR_HORIZONTAL: if(sizeof($label_x) > 0){
$wpbi_chart -> set_y_axis_labels($label_x,
$vo_chart->chart_y_labels_size,
$vo_chart->chart_y_labels_color);
}
$wpbi_chart-> set_x_axis_labels_color($vo_chart->chart_x_labels_color);
$wpbi_chart-> set_x_axis_labels_size($vo_chart->chart_x_labels_size);
foreach($data as $key => $value){
$wpbi_chart -> create_element($key, $value);
$wpbi_chart -> elements[$key] -> set_colour($label_color[$key]);
}
break;
default: if(sizeof($label_x) > 0){
$wpbi_chart -> set_x_axis_labels($label_x,
$vo_chart->chart_x_labels_size,
$vo_chart->chart_x_labels_color, sizeof($istime_cols) > 0);
$wpbi_chart->x_axis_istime = (sizeof($istime_cols) > 0);
echo "welcome";
} else {
$wpbi_chart->set_x_axis_labels_color($vo_chart->chart_x_labels_color);
$wpbi_chart->set_x_axis_labels_size($vo_chart->chart_x_labels_size);
}
$wpbi_chart-> set_y_axis_labels_color($vo_chart->chart_y_labels_color);
$wpbi_chart-> set_y_axis_labels_size($vo_chart->chart_y_labels_size);
foreach($data as $key => $value){
$wpbi_chart -> create_element($key, $value);
$wpbi_chart -> elements[$key] -> set_colour($label_color[$key]);
}
break;
}
【问题讨论】:
标签: php mysql wordpress plugins