Dear MyBB community,
ProStats -
MyProfile
Recently I've tried to add two plugins that do not seem to work and I hope there is a solution to make it work.
MyProfile
Basically I was able to install and activate the plugin. However, on my profile it does not show anything about comments whatsoever.
Only functionality that shows up is the 'referred by' and 'members referred'.
ProStats
Whenever I 'enable' the ProStats plugin it will give me the following error:
Warning [2] Illegal string offset 'Latest_posts' - Line: 1247 - File: inc/plugins/prostats.php PHP 7.1.22 (Linux)
File Line Function
/inc/plugins/prostats.php 1247 errorHandler->error
/inc/plugins/prostats.php 1837 ps_GetNewestPosts
/inc/plugins/prostats.php 1203 ps_MakeTable
/inc/class_plugins.php 142 prostats_run_pre_output
/floatstats.php
Thank you for reading and hopefully someone is able to help out.
Regards,
playerNumOne
For prostats you can try googling that php error, and try to apply to the plugin file. It gives you the line number where the problem is - 1247.
For the ProStats error line:
case "Latest_posts" :
[1247] $active_cells['Latest_posts']=1;
eval("\$newestposts_cols_name .= \"".$templates->get("prostats_newestposts_head_latest_posts")."\";");
$cell_order[$colspan]='Latest_posts';
break;
So it happens to all lines that include ->
$active_cells['...']=1;
case "Latest_posts" :
$active_cells['Latest_posts']=1;
eval("\$newestposts_cols_name .= \"".$templates->get("prostats_newestposts_head_latest_posts")."\";");
$cell_order[$colspan]='Latest_posts';
break;
case "Date" :
$active_cells['Date']=1;
eval("\$newestposts_cols_name .= \"".$templates->get("prostats_newestposts_head_date")."\";");
$cell_order[$colspan]='Date';
break;
case "Starter" :
$active_cells['Starter']=1;
eval("\$newestposts_cols_name .= \"".$templates->get("prostats_newestposts_head_starter")."\";");
$cell_order[$colspan]='Starter';
break;
case "Last_sender" :
$active_cells['Last_sender']=1;
eval("\$newestposts_cols_name .= \"".$templates->get("prostats_newestposts_head_last_sender")."\";");
$cell_order[$colspan]='Last_sender';
break;
case "Forum" :
$active_cells['Forum']=1;
eval("\$newestposts_cols_name .= \"".$templates->get("prostats_newestposts_head_forum")."\";");
$cell_order[$colspan]='Forum';
break;
Now the issue seems to be solved but got a different error for the same lines now:
Warning [2] Cannot use a scalar value as an array - Line: 1261 - File: inc/plugins/prostats.php PHP 7.1.22 (Linux)
{
case "Latest_posts" :
$active_cells = 1;
eval("\$newestposts_cols_name .= \"".$templates->get("prostats_newestposts_head_latest_posts")."\";");
$cell_order[$colspan]='Latest_posts';
break;
case "Date" :
This line-> $active_cells["Date"]=1;
eval("\$newestposts_cols_name .= \"".$templates->get("prostats_newestposts_head_date")."\";");
$cell_order[$colspan]='Date';
break;
case "Starter" :
This line-> $active_cells["Starter"]=1;
eval("\$newestposts_cols_name .= \"".$templates->get("prostats_newestposts_head_starter")."\";");
$cell_order[$colspan]='Starter';
break;
case "Last_sender" :
This line-> $active_cells["Last_sender"]=1;
eval("\$newestposts_cols_name .= \"".$templates->get("prostats_newestposts_head_last_sender")."\";");
$cell_order[$colspan]='Last_sender';
break;
case "Forum" :
This line-> $active_cells["Forum"]=1;
eval("\$newestposts_cols_name .= \"".$templates->get("prostats_newestposts_head_forum")."\";");
$cell_order[$colspan]='Forum';
break;
default: --$colspan;
}
And
Warning [2] A non-numeric value encountered - Line: 2113 - File: inc/plugins/prostats.php PHP 7.1.22 (Linux)
This line-> $date = gmdate($format, $stamp + ($offset * 3600));
if ($format && $ty)
{
$stamp = TIME_NOW;
This line-> $todaysdate = gmdate($format, $stamp + ($offset * 3600));
This line-> $yesterdaysdate = gmdate($format, ($stamp - 86400) + ($offset * 3600));
For MyProfile, make sure
{$myprofile_comments}
exists in member_profile template.
EDIT: Okay, try
this modified file. It should fix those lingering "Warning [2] Cannot use a scalar value as an array - Line: 1261" errors
.