Untitled diff

Created Diff never expires
<?php
<?php
/*
/*
_______________________________________________________
_______________________________________________________
| |
| |
| Name: ProStats 1.9.7 |
| Name: ProStats 1.9.7.1 |
| Type: MyBB Plugin |
| Type: MyBB Plugin |
| Author: SaeedGh (SaeehGhMail@Gmail.com) |
| Author: SaeedGh (SaeehGhMail@Gmail.com) |
| Author2: AliReza Tofighi (http://my-bb.ir) |
| Author2: AliReza Tofighi (http://my-bb.ir) |
| Support: http://prostats.wordpress.com/support/ |
| Support: http://prostats.wordpress.com/support/ |
| Last edit: May 31, 2016 |
| Last edit: Dec 25, 2018 |
|_______________________________________________________|
|_______________________________________________________|
Information of this version:
https://community.mybb.com/thread-220378-post-1320892.html#pid1320892


This program is free software: you can redistribute it and/or modify
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
(at your option) any later version.


This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU General Public License for more details.


You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <http://www.gnu.org/licenses/>.


*/
*/




function prostats_g()
function prostats_g()
{
{
global $mybb;
global $mybb;


$mybb->psga['prostats_version'] = '1.9.7';
$mybb->psga['prostats_version'] = '1.9.7';
$mybb->psga['update_popup_link'] = 'https://docs.google.com/uc?export=view&id=0B1io8D4cQytcemFVVFh3VXJzdWs';
$mybb->psga['update_popup_link'] = 'https://docs.google.com/uc?export=view&id=0B1io8D4cQytcemFVVFh3VXJzdWs';
$mybb->psga['surprise_link'] = 'https://docs.google.com/uc?export=view&id=0B1io8D4cQytcV0dPSTBYTTFNN00';
$mybb->psga['surprise_link'] = 'https://docs.google.com/uc?export=view&id=0B1io8D4cQytcV0dPSTBYTTFNN00';
}
}


if (!defined("IN_MYBB"))
if (!defined("IN_MYBB"))
{
{
die("Direct initialization of this file is not allowed.");
die("Direct initialization of this file is not allowed.");
}
}


$plugins->add_hook('global_start', 'prostats_run_global');
$plugins->add_hook('global_start', 'prostats_run_global');
$plugins->add_hook('pre_output_page', 'prostats_run_pre_output');
$plugins->add_hook('pre_output_page', 'prostats_run_pre_output');
$plugins->add_hook('index_start', 'prostats_run_index');
$plugins->add_hook('index_start', 'prostats_run_index');
$plugins->add_hook('portal_start', 'prostats_run_portal');
$plugins->add_hook('portal_start', 'prostats_run_portal');
$plugins->add_hook('xmlhttp', 'prostats_run_ajax');
$plugins->add_hook('xmlhttp', 'prostats_run_ajax');
$plugins->add_hook('admin_config_plugins_activate_commit', 'prostats_install_redirect');
$plugins->add_hook('admin_config_plugins_activate_commit', 'prostats_install_redirect');


function prostats_info()
function prostats_info()
{
{
global $mybb, $db;
global $mybb, $db;


$settings_link = '';
$settings_link = '';


$query = $db->simple_select('settinggroups', '*', "name='prostats'");
$query = $db->simple_select('settinggroups', '*', "name='prostats'");


if ($db->num_rows($query))
if ($db->num_rows($query))
{
{
$settings_link = '(<a href="index.php?module=config&action=change&search=prostats" style="color:#FF1493;">Settings</a>)';
$settings_link = '(<a href="index.php?module=config&action=change&search=prostats" style="color:#FF1493;">Settings</a>)';
}
}


prostats_g();
prostats_g();


//DO NOT EDIT/TRANSLATE THIS SECTION
//DO NOT EDIT/TRANSLATE THIS SECTION
return array(
return array(
'name' => '<img border="0" src="../images/prostats/prostats.png" align="absbottom" /> ProStats <span style="color:#000;">/proʊˈstæts/</span>',
'name' => '<img border="0" src="../images/prostats/prostats.png" align="absbottom" /> ProStats <span style="color:#000;">/proʊˈstæts/</span>',
'description' => 'Professional stats for MyBB. ' . $settings_link,
'description' => 'Professional stats for MyBB. ' . $settings_link,
'website' => 'http://prostats.wordpress.com',
'website' => 'http://prostats.wordpress.com',
'author' => '<a href="mailto:SaeedGhMail@Gmail.com">SaeedGh</a> and <a href="http://my-bb.ir">AliReza Tofighi</a>',
'author' => '<a href="mailto:SaeedGhMail@Gmail.com">SaeedGh</a> and <a href="http://my-bb.ir">AliReza Tofighi</a>',
'authorsite' => '',
'authorsite' => '',
'version' => $mybb->psga['prostats_version'], //*** ALSO IN THE SETTING "ps_version" ***
'version' => $mybb->psga['prostats_version'], //*** ALSO IN THE SETTING "ps_version" ***
'guid' => '124b68d05dcdaf6b7971050baddf340f',
'guid' => '124b68d05dcdaf6b7971050baddf340f',
'compatibility' => '18*'
'compatibility' => '18*'
);
);
}
}


function prostats_is_installed()
function prostats_is_installed()
{
{
global $db;
global $db;


$query = $db->simple_select('settinggroups', '*', "name='prostats'");
$query = $db->simple_select('settinggroups', '*', "name='prostats'");


if ($db->num_rows($query))
if ($db->num_rows($query))
{
{
return true;
return true;
}
}


return false;
return false;
}
}


function prostats_install()
function prostats_install()
{
{
global $mybb, $db;
global $mybb, $db;


$extra_cells = "select\n0=--\n1=Most replies\n2=Most reputations\n3=Most thanks\n4=Most viewed\n5=New members\n6=Top downloads\n7=Top posters\n9=Top Thread Posters\n8=Top referrers";
$extra_cells = "select\n0=--\n1=Most replies\n2=Most reputations\n3=Most thanks\n4=Most viewed\n5=New members\n6=Top downloads\n7=Top posters\n9=Top Thread Posters\n8=Top referrers";


prostats_uninstall();
prostats_uninstall();


prostats_g();
prostats_g();


$ps_group = array(
$ps_group = array(
'name' => "prostats",
'name' => "prostats",
'title' => "ProStats",
'title' => "ProStats",
'description' => "Professional stats for MyBB.",
'description' => "Professional stats for MyBB.",
'disporder' => 1,
'disporder' => 1,
'isdefault' => 1
'isdefault' => 1
);
);


$gid = $db->insert_query("settinggroups", $ps_group);
$gid = $db->insert_query("settinggroups", $ps_group);
$mybb->prostats_insert_gid = $gid;
$mybb->prostats_insert_gid = $gid;


$ps[]= array(
$ps[]= array(
'name' => "ps_enable",
'name' => "ps_enable",
'title' => "Enable",
'title' => "Enable",
'description' => "Do you want to enable the plugin?
'description' => "Do you want to enable the plugin?
<style type=\"text/css\">
<style type=\"text/css\">
#row_setting_ps_enable td.first,
#row_setting_ps_enable td.first,
#row_setting_ps_position td.first,
#row_setting_ps_position td.first,
#row_setting_ps_date_format_ty td.first,
#row_setting_ps_date_format_ty td.first,
#row_setting_ps_trow_message_pos td.first,
#row_setting_ps_trow_message_pos td.first,
#row_setting_ps_latest_posts_pos td.first,
#row_setting_ps_latest_posts_pos td.first,
#row_setting_ps_cell_6 td.first
#row_setting_ps_cell_6 td.first
{
{
border-bottom: 4px solid #0069B1;
border-bottom: 4px solid #0069B1;
padding-bottom: 40px;
padding-bottom: 40px;
border-left: 0px;
border-left: 0px;
border-right: 0px;
border-right: 0px;
background-repeat: no-repeat;
background-repeat: no-repeat;
background-position: bottom left;
background-position: bottom left;
}
}
#row_setting_ps_enable td.first {
#row_setting_ps_enable td.first {
background-image: url(../images/prostats/ps_settings_vp.png);
background-image: url(../images/prostats/ps_settings_vp.png);
}
}
#row_setting_ps_position td.first {
#row_setting_ps_position td.first {
background-image: url(../images/prostats/ps_settings_ga.png);
background-image: url(../images/prostats/ps_settings_ga.png);
}
}
#row_setting_ps_date_format_ty td.first {
#row_setting_ps_date_format_ty td.first {
background-image: url(../images/prostats/ps_settings_mb.png);
background-image: url(../images/prostats/ps_settings_mb.png);
}
}
#row_setting_ps_trow_message_pos td.first {
#row_setting_ps_trow_message_pos td.first {
background-image: url(../images/prostats/ps_settings_lp.png);
background-image: url(../images/prostats/ps_settings_lp.png);
}
}
#row_setting_ps_latest_posts_pos td.first {
#row_setting_ps_latest_posts_pos td.first {
background-image: url(../images/prostats/ps_settings_ec.png);
background-image: url(../images/prostats/ps_settings_ec.png);
}
}
#row_setting_ps_cell_6 td.first {
#row_setting_ps_cell_6 td.first {
background-image: url(../images/prostats/ps_settings_mc.png);
background-image: url(../images/prostats/ps_settings_mc.png);
}
}
#row_setting_ps_version {
#row_setting_ps_version {
display: none;
display: none;
}
}
.ec_div {
.ec_div {
width:98px;
width:98px;
height:43px;
height:43px;
overflow:hidden;
overflow:hidden;
text-direction:rtl;
text-direction:rtl;
margin-top:5px;
margin-top:5px;
}
}
</style>
</style>
<link type=\"text/css\" rel=\"stylesheet\" href=\"../floatstats.php?fs_action=css\" />
<link type=\"text/css\" rel=\"stylesheet\" href=\"../floatstats.php?fs_action=css\" />
<div id=\"float_notification\">
<div id=\"float_notification\">
<div id=\"close_float_note\" onclick=\"toggle_float_note();\">×</div>
<div id=\"close_float_note\" onclick=\"toggle_float_note();\">×</div>
<div id=\"help_float_note\" title=\"This helps you find a good balance between appearance and performance before you save the new settings. For more information click!\"><a style=\"color:#FFFFFF;\" target=\"_blank\" href=\"http://prostats.wordpress.com/features/\">?</a></div>
<div id=\"help_float_note\" title=\"This helps you find a good balance between appearance and performance before you save the new settings. For more information click!\"><a style=\"color:#FFFFFF;\" target=\"_blank\" href=\"http://prostats.wordpress.com/features/\">?</a></div>
<div style=\"float:left;margin:-4px 0 0 -5px;color:#FFFFFF;font-weight:bold;\">FloatStats</div>
<div style=\"float:left;margin:-4px 0 0 -5px;color:#FFFFFF;font-weight:bold;\">FloatStats</div>
<br /><br />
<br /><br />
<table class=\"fs_tbl\" cellspacing=\"0\" cellpadding=\"0\">
<table class=\"fs_tbl\" cellspacing=\"0\" cellpadding=\"0\">
<tr><td>User ID:</td><td><input id=\"fs_uid\" type=\"text\" class=\"textbox50\" /></td></tr>
<tr><td>User ID:</td><td><input id=\"fs_uid\" type=\"text\" class=\"textbox50\" /></td></tr>
<tr><td>Script:</td><td><select id=\"fs_script\" class=\"selectbox130\"><option value=\"index.php\">index.php</option><option value=\"portal.php\">portal.php</option><option value=\"showthread.php\">showthread.php</option></select></td></tr>
<tr><td>Script:</td><td><select id=\"fs_script\" class=\"selectbox130\"><option value=\"index.php\">index.php</option><option value=\"portal.php\">portal.php</option><option value=\"showthread.php\">showthread.php</option></select></td></tr>
<tr><td>URI:</td><td><select id=\"fs_key\" class=\"selectbox60\"><option value=\"tid\">tid</option><option value=\"pid\">pid</option></select> = <input id=\"fs_value\" type=\"text\" class=\"textbox50\" /></td></tr>
<tr><td>URI:</td><td><select id=\"fs_key\" class=\"selectbox60\"><option value=\"tid\">tid</option><option value=\"pid\">pid</option></select> = <input id=\"fs_value\" type=\"text\" class=\"textbox50\" /></td></tr>
</table>
</table>
<strong>
<strong>
<div id=\"fs_queries_count\">?</div><br />
<div id=\"fs_queries_count\">?</div><br />
No. DB Queries:<br />
No. DB Queries:<br />
<div id=\"fs_mem_usage\">?</div><br />
<div id=\"fs_mem_usage\">?</div><br />
Memory Usage:<br /><br />
Memory Usage:<br /><br />
<input style=\"float:left;\" type=\"checkbox\" id=\"fs_auto_refresh_chk\"><label for=\"fs_auto_refresh_chk\" style=\"float:left;margin-top:3px;\">Auto Refresh</label>
<input style=\"float:left;\" type=\"checkbox\" id=\"fs_auto_refresh_chk\"><label for=\"fs_auto_refresh_chk\" style=\"float:left;margin-top:3px;\">Auto Refresh</label>
<input type=\"submit\" value=\"Refresh\" onclick=\"fs_refresh();return false;\" style=\"width:80px;float:right;\" /><br /><br />
<input type=\"submit\" value=\"Refresh\" onclick=\"fs_refresh();return false;\" style=\"width:80px;float:right;\" /><br /><br />
</strong>
</strong>
</div>
</div>
<script type=\"text/javascript\">
<script type=\"text/javascript\">
var settings_options = [\"ps_enable\", \"ps_index\", \"ps_portal\", \"ps_global_tag\", \"ps_format_name\", \"ps_highlight\", \"ps_latest_posts\", \"ps_latest_posts_prefix\", \"ps_chkupdates\"];
var settings_options = [\"ps_enable\", \"ps_index\", \"ps_portal\", \"ps_global_tag\", \"ps_format_name\", \"ps_highlight\", \"ps_latest_posts\", \"ps_latest_posts_prefix\", \"ps_chkupdates\"];
var settings_text = [\"ps_subject_length\", \"ps_num_rows\", \"ps_date_format\", \"ps_date_format_ty\", \"ps_trow_message\", \"ps_latest_posts_cells\"];
var settings_text = [\"ps_subject_length\", \"ps_num_rows\", \"ps_date_format\", \"ps_date_format_ty\", \"ps_trow_message\", \"ps_latest_posts_cells\"];
var settings_select = [\"ps_trow_message_pos\", \"ps_latest_posts_pos\", \"ps_cell_1\", \"ps_cell_2\", \"ps_cell_3\", \"ps_cell_4\", \"ps_cell_5\", \"ps_cell_6\"];
var settings_select = [\"ps_trow_message_pos\", \"ps_latest_posts_pos\", \"ps_cell_1\", \"ps_cell_2\", \"ps_cell_3\", \"ps_cell_4\", \"ps_cell_5\", \"ps_cell_6\"];
var settings_selectforums = [\"ps_ignoreforums\"];
var settings_selectforums = [\"ps_ignoreforums\"];
</script>
</script>
<div id=\"preview_iframe_holder\">
<div id=\"preview_iframe_holder\">
<iframe id=\"preview_iframe\" name=\"preview_iframe\" src=\"../floatstats.php?fs_action=preview\" style=\"width:100%;border:0;height:inherit;\"></iframe>
<iframe id=\"preview_iframe\" name=\"preview_iframe\" src=\"../floatstats.php?fs_action=preview\" style=\"width:100%;border:0;height:inherit;\"></iframe>
<div id=\"preview_handle\" class=\"unselectable preview_handle\">Instant Preview</div>
<div id=\"preview_handle\" class=\"unselectable preview_handle\">Instant Preview</div>
</div>
</div>
<script type=\"text/javascript\" src=\"../floatstats.php?fs_action=js\"></script>
<script type=\"text/javascript\" src=\"../floatstats.php?fs_action=js\"></script>
",
",
'optionscode' => "yesno",
'optionscode' => "yesno",
'value' => ps_SetSettingsValue('ps_enable', '1'),
'value' => ps_SetSettingsValue('ps_enable', '1'),
'disporder' => 1,
'disporder' => 1,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_index",
'name' => "ps_index",
'title' => "Show in index",
'title' => "Show in index",
'description' => "Show the ProStats table in the index page.",
'description' => "Show the ProStats table in the index page.",
'optionscode' => "yesno",
'optionscode' => "yesno",
'value' => ps_SetSettingsValue('ps_index', '1'),
'value' => ps_SetSettingsValue('ps_index', '1'),
'disporder' => 3,
'disporder' => 3,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_portal",
'name' => "ps_portal",
'title' => "Show in portal",
'title' => "Show in portal",
'description' => "Show the ProStats table in the portal page.",
'description' => "Show the ProStats table in the portal page.",
'optionscode' => "yesno",
'optionscode' => "yesno",
'value' => ps_SetSettingsValue('ps_portal', '0'),
'value' => ps_SetSettingsValue('ps_portal', '0'),
'disporder' => 4,
'disporder' => 4,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_global_tag",
'name' => "ps_global_tag",
'title' => "Activate global tag",
'title' => "Activate global tag",
'description' => "So you can edit themes and insert &lt;ProStats&gt; tag wherever you want to show the stats.",
'description' => "So you can edit themes and insert &lt;ProStats&gt; tag wherever you want to show the stats.",
'optionscode' => "yesno",
'optionscode' => "yesno",
'value' => ps_SetSettingsValue('ps_global_tag', '0'),
'value' => ps_SetSettingsValue('ps_global_tag', '0'),
'disporder' => 5,
'disporder' => 5,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_hidefrombots",
'name' => "ps_hidefrombots",
'title' => "Hide from search bots",
'title' => "Hide from search bots",
'description' => "Using this option you can hide stats from all search bots you\'ve defined them in <strong><a href=\"index.php?module=config-spiders\" target=\"_blank\">Spiders/Bots</a></strong> page. This will save bandwidth and decrease server load.",
'description' => "Using this option you can hide stats from all search bots you\'ve defined them in <strong><a href=\"index.php?module=config-spiders\" target=\"_blank\">Spiders/Bots</a></strong> page. This will save bandwidth and decrease server load.",
'optionscode' => "yesno",
'optionscode' => "yesno",
'value' => ps_SetSettingsValue('ps_hidefrombots', '1'),
'value' => ps_SetSettingsValue('ps_hidefrombots', '1'),
'disporder' => 6,
'disporder' => 6,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_ignoreforums",
'name' => "ps_ignoreforums",
'title' => "Ignore list",
'title' => "Ignore list",
'description' => "Forums not to be shown on ProStats. To select multiple items hold down the Ctrl key, and click each of the items. To deselect items hold down the Ctrl key and click on them.",
'description' => "Forums not to be shown on ProStats. To select multiple items hold down the Ctrl key, and click each of the items. To deselect items hold down the Ctrl key and click on them.",
'optionscode' => "forumselect",
'optionscode' => "forumselect",
'value' => ps_SetSettingsValue('ps_ignoreforums', ''),
'value' => ps_SetSettingsValue('ps_ignoreforums', ''),
'disporder' => 7,
'disporder' => 7,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_position",
'name' => "ps_position",
'title' => "Table position in index and portal",
'title' => "Table position in index and portal",
'description' => "Position of stats in index and portal pages.",
'description' => "Position of stats in index and portal pages.",
'optionscode' => "select\n0=Top (Header)\n1=Bottom (Footer)",
'optionscode' => "select\n0=Top (Header)\n1=Bottom (Footer)",
'value' => ps_SetSettingsValue('ps_position', '1'),
'value' => ps_SetSettingsValue('ps_position', '1'),
'disporder' => 10,
'disporder' => 10,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_format_name",
'name' => "ps_format_name",
'title' => "Style usernames",
'title' => "Style usernames",
'description' => "Style the username in true color, font, etc.",
'description' => "Style the username in true color, font, etc.",
'optionscode' => "yesno",
'optionscode' => "yesno",
'value' => ps_SetSettingsValue('ps_format_name', '1'),
'value' => ps_SetSettingsValue('ps_format_name', '1'),
'disporder' => 20,
'disporder' => 20,
'gid' => $gid
'gid' => $gid
);
);


$ps[]= array(
$ps[]= array(
'name' => "ps_highlight",
'name' => "ps_highlight",
'title' => "Highlighting System",
'title' => "Highlighting System",
'description' => "Highlight soft-deleted threads, unapproved threads, and threads which are posted in forums moderated by current user.<br />
'description' => "Highlight soft-deleted threads, unapproved threads, and threads which are posted in forums moderated by current user.<br />
Color scheme: <span style=\"background-color:#E8DEFF;\">Deleted</span>, <span style=\"background-color:#FFDDE0;\">Unapproved</span>, <span style=\"background-color:#FFFE92;\">In moderation zone</span>, <span style=\"background-color:#FFDA91;\">Unapproved & In moderation zone</span> ",
Color scheme: <span style=\"background-color:#E8DEFF;\">Deleted</span>, <span style=\"background-color:#FFDDE0;\">Unapproved</span>, <span style=\"background-color:#FFFE92;\">In moderation zone</span>, <span style=\"background-color:#FFDA91;\">Unapproved & In moderation zone</span> ",
'optionscode' => "yesno",
'optionscode' => "yesno",
'value' => ps_SetSettingsValue('ps_highlight', '1'),
'value' => ps_SetSettingsValue('ps_highlight', '1'),
'disporder' => 25,
'disporder' => 25,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_subject_length",
'name' => "ps_subject_length",
'title' => "Subject length",
'title' => "Subject length",
'description' => "Maximum length of topic/post subjects. (Input 0 to remove the limitation)",
'description' => "Maximum length of topic/post subjects. (Input 0 to remove the limitation)",
'optionscode' => "text",
'optionscode' => "text",
'value' => ps_SetSettingsValue('ps_subject_length', '25'),
'value' => ps_SetSettingsValue('ps_subject_length', '25'),
'disporder' => 30,
'disporder' => 30,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_num_rows",
'name' => "ps_num_rows",
'title' => "Number of rows",
'title' => "Number of rows",
'description' => "How much items must be shown? Input an <strong style=\"color:red;\">odd</strong> number greater than or equal to 3.",
'description' => "How much items must be shown? Input an <strong style=\"color:red;\">odd</strong> number greater than or equal to 3.",
'optionscode' => "text",
'optionscode' => "text",
'value' => ps_SetSettingsValue('ps_num_rows', '11'),
'value' => ps_SetSettingsValue('ps_num_rows', '11'),
'disporder' => 41,
'disporder' => 41,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_date_format",
'name' => "ps_date_format",
'title' => "Date and Time format",
'title' => "Date and Time format",
'description' => "The format of Date and Time which would be used in stats. [<a href=\"http://php.net/manual/en/function.date.php\" target=\"_blank\">More Information</a>]",
'description' => "The format of Date and Time which would be used in stats. [<a href=\"http://php.net/manual/en/function.date.php\" target=\"_blank\">More Information</a>]",
'optionscode' => "text",
'optionscode' => "text",
'value' => ps_SetSettingsValue('ps_date_format', 'm-d, H:i'),
'value' => ps_SetSettingsValue('ps_date_format', 'm-d, H:i'),
'disporder' => 42,
'disporder' => 42,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_date_format_ty",
'name' => "ps_date_format_ty",
'title' => "Date and Time variable part",
'title' => "Date and Time variable part",
'description' => "A part of Date and Time format that must be replaced with \"Yesterday\" or \"Today\".",
'description' => "A part of Date and Time format that must be replaced with \"Yesterday\" or \"Today\".",
'optionscode' => "text",
'optionscode' => "text",
'value' => ps_SetSettingsValue('ps_date_format_ty', 'm-d'),
'value' => ps_SetSettingsValue('ps_date_format_ty', 'm-d'),
'disporder' => 43,
'disporder' => 43,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_trow_message",
'name' => "ps_trow_message",
'title' => "Message block",
'title' => "Message block",
'description' => "This is a block on top/bottom of the ProStats table that you can put your HTML contents in it. Leave it empty to hide it.",
'description' => "This is a block on top/bottom of the ProStats table that you can put your HTML contents in it. Leave it empty to hide it.",
'optionscode' => "textarea",
'optionscode' => "textarea",
'value' => ps_SetSettingsValue('ps_trow_message', ''),
'value' => ps_SetSettingsValue('ps_trow_message', ''),
'disporder' => 45,
'disporder' => 45,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_trow_message_pos",
'name' => "ps_trow_message_pos",
'title' => "Message block position",
'title' => "Message block position",
'description' => "The position of message block in the ProStats table.",
'description' => "The position of message block in the ProStats table.",
'optionscode' => "select\n0=Top\n1=Down (Default)",
'optionscode' => "select\n0=Top\n1=Down (Default)",
'value' => ps_SetSettingsValue('ps_trow_message_pos', '1'),
'value' => ps_SetSettingsValue('ps_trow_message_pos', '1'),
'disporder' => 46,
'disporder' => 46,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_latest_posts",
'name' => "ps_latest_posts",
'title' => "Show latest posts",
'title' => "Show latest posts",
'description' => "Show latest posts in the ProStats table.",
'description' => "Show latest posts in the ProStats table.",
'optionscode' => "yesno",
'optionscode' => "yesno",
'value' => ps_SetSettingsValue('ps_latest_posts', '1'),
'value' => ps_SetSettingsValue('ps_latest_posts', '1'),
'disporder' => 50,
'disporder' => 50,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_latest_posts_prefix",
'name' => "ps_latest_posts_prefix",
'title' => "Show prefix for latest posts",
'title' => "Show prefix for latest posts",
'description' => "Show prefixes in subject of latest posts (if there are any).",
'description' => "Show prefixes in subject of latest posts (if there are any).",
'optionscode' => "yesno",
'optionscode' => "yesno",
'value' => ps_SetSettingsValue('ps_latest_posts_prefix', '1'),
'value' => ps_SetSettingsValue('ps_latest_posts_prefix', '1'),
'disporder' => 52,
'disporder' => 52,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_latest_posts_cells",
'name' => "ps_latest_posts_cells",
'title' => "Stats of latest posts",
'title' => "Stats of latest posts",
'description' => "What type of stats you want to be shown for latest posts?<br />Your choices are: <strong>Latest_posts, Date, Starter, Last_sender, Forum</strong><br />Separate them by comma (\",\").",
'description' => "What type of stats you want to be shown for latest posts?<br />Your choices are: <strong>Latest_posts, Date, Starter, Last_sender, Forum</strong><br />Separate them by comma (\",\").",
'optionscode' => "text",
'optionscode' => "text",
'value' => ps_SetSettingsValue('ps_latest_posts_cells', 'Latest_posts, Date, Starter, Last_sender, Forum'),
'value' => ps_SetSettingsValue('ps_latest_posts_cells', 'Latest_posts, Date, Starter, Last_sender, Forum'),
'disporder' => 55,
'disporder' => 55,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_latest_posts_pos",
'name' => "ps_latest_posts_pos",
'title' => "Latest posts position",
'title' => "Latest posts position",
'description' => "The position of the Latest posts block.",
'description' => "The position of the Latest posts block.",
'optionscode' => "select\n0=Left\n1=Right",
'optionscode' => "select\n0=Left\n1=Right",
'value' => ps_SetSettingsValue('ps_latest_posts_pos', '0'),
'value' => ps_SetSettingsValue('ps_latest_posts_pos', '0'),
'disporder' => 60,
'disporder' => 60,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_cell_1",
'name' => "ps_cell_1",
'title' => "Extra cell 1 (Top-Left)",
'title' => "Extra cell 1 (Top-Left)",
'description' => "<div class=\"ec_div\"><img style=\"float:left;\" src=\"../images/prostats/ps_cells.gif\" /><img style=\"float:left;margin-top:-178px;margin-left:-28px;\" src=\"../images/prostats/ps_cells.gif\" /></div>",
'description' => "<div class=\"ec_div\"><img style=\"float:left;\" src=\"../images/prostats/ps_cells.gif\" /><img style=\"float:left;margin-top:-178px;margin-left:-28px;\" src=\"../images/prostats/ps_cells.gif\" /></div>",
'optionscode' => $extra_cells,
'optionscode' => $extra_cells,
'value' => ps_SetSettingsValue('ps_cell_1', '4'),
'value' => ps_SetSettingsValue('ps_cell_1', '4'),
'disporder' => 62,
'disporder' => 62,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_cell_2",
'name' => "ps_cell_2",
'title' => "Extra cell 2 (Bottom-Left)",
'title' => "Extra cell 2 (Bottom-Left)",
'description' => "<div class=\"ec_div\"><img style=\"float:left;\" src=\"../images/prostats/ps_cells.gif\" /><img style=\"float:left;margin-top:-159px;margin-left:-28px;\" src=\"../images/prostats/ps_cells.gif\" /></div>",
'description' => "<div class=\"ec_div\"><img style=\"float:left;\" src=\"../images/prostats/ps_cells.gif\" /><img style=\"float:left;margin-top:-159px;margin-left:-28px;\" src=\"../images/prostats/ps_cells.gif\" /></div>",
'optionscode' => $extra_cells,
'optionscode' => $extra_cells,
'value' => ps_SetSettingsValue('ps_cell_2', '2'),
'value' => ps_SetSettingsValue('ps_cell_2', '2'),
'disporder' => 64,
'disporder' => 64,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_cell_3",
'name' => "ps_cell_3",
'title' => "Extra cell 3 (Top-Middle)",
'title' => "Extra cell 3 (Top-Middle)",
'description' => "<div class=\"ec_div\"><img style=\"float:left;\" src=\"../images/prostats/ps_cells.gif\" /><img style=\"float:left;margin-top:-178px;margin-left:-14px;\" src=\"../images/prostats/ps_cells.gif\" /></div>",
'description' => "<div class=\"ec_div\"><img style=\"float:left;\" src=\"../images/prostats/ps_cells.gif\" /><img style=\"float:left;margin-top:-178px;margin-left:-14px;\" src=\"../images/prostats/ps_cells.gif\" /></div>",
'optionscode' => $extra_cells,
'optionscode' => $extra_cells,
'value' => ps_SetSettingsValue('ps_cell_3', '1'),
'value' => ps_SetSettingsValue('ps_cell_3', '1'),
'disporder' => 66,
'disporder' => 66,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_cell_4",
'name' => "ps_cell_4",
'title' => "Extra cell 4 (Bottom-Middle)",
'title' => "Extra cell 4 (Bottom-Middle)",
'description' => "<div class=\"ec_div\"><img style=\"float:left;\" src=\"../images/prostats/ps_cells.gif\" /><img style=\"float:left;margin-top:-159px;margin-left:-14px;\" src=\"../images/prostats/ps_cells.gif\" /></div>",
'description' => "<div class=\"ec_div\"><img style=\"float:left;\" src=\"../images/prostats/ps_cells.gif\" /><img style=\"float:left;margin-top:-159px;margin-left:-14px;\" src=\"../images/prostats/ps_cells.gif\" /></div>",
'optionscode' => $extra_cells,
'optionscode' => $extra_cells,
'value' => ps_SetSettingsValue('ps_cell_4', '7'),
'value' => ps_SetSettingsValue('ps_cell_4', '7'),
'disporder' => 68,
'disporder' => 68,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_cell_5",
'name' => "ps_cell_5",
'title' => "Extra cell 5 (Top-Right)",
'title' => "Extra cell 5 (Top-Right)",
'description' => "<div class=\"ec_div\"><img style=\"float:left;\" src=\"../images/prostats/ps_cells.gif\" /><img style=\"float:left;margin-top:-178px;margin-left:0px;\" src=\"../images/prostats/ps_cells.gif\" /></div>",
'description' => "<div class=\"ec_div\"><img style=\"float:left;\" src=\"../images/prostats/ps_cells.gif\" /><img style=\"float:left;margin-top:-178px;margin-left:0px;\" src=\"../images/prostats/ps_cells.gif\" /></div>",
'optionscode' => $extra_cells,
'optionscode' => $extra_cells,
'value' => ps_SetSettingsValue('ps_cell_5', '3'),
'value' => ps_SetSettingsValue('ps_cell_5', '3'),
'disporder' => 70,
'disporder' => 70,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_cell_6",
'name' => "ps_cell_6",
'title' => "Extra cell 6 (Bottom-Right)",
'title' => "Extra cell 6 (Bottom-Right)",
'description' => "<div class=\"ec_div\"><img style=\"float:left;\" src=\"../images/prostats/ps_cells.gif\" /><img style=\"float:left;margin-top:-159px;margin-left:0px;\" src=\"../images/prostats/ps_cells.gif\" /></div>",
'description' => "<div class=\"ec_div\"><img style=\"float:left;\" src=\"../images/prostats/ps_cells.gif\" /><img style=\"float:left;margin-top:-159px;margin-left:0px;\" src=\"../images/prostats/ps_cells.gif\" /></div>",
'optionscode' => $extra_cells,
'optionscode' => $extra_cells,
'value' => ps_SetSettingsValue('ps_cell_6', '5'),
'value' => ps_SetSettingsValue('ps_cell_6', '5'),
'disporder' => 72,
'disporder' => 72,
'gid' => $gid
'gid' => $gid
);
);


$ps[]= array(
$ps[]= array(
'name' => "ps_xml_feed",
'name' => "ps_xml_feed",
'title' => "Activate XML feed",
'title' => "Activate XML feed",
'description' => "Output the stats in XML format to show on other websites. [<a href=\"http://community.mybb.com/thread-48686.html\" target=\"_blank\">More Information</a>]",
'description' => "Output the stats in XML format to show on other websites. [<a href=\"http://community.mybb.com/thread-48686.html\" target=\"_blank\">More Information</a>]",
'optionscode' => "yesno",
'optionscode' => "yesno",
'value' => ps_SetSettingsValue('ps_xml_feed', '0'),
'value' => ps_SetSettingsValue('ps_xml_feed', '0'),
'disporder' => 78,
'disporder' => 78,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_chkupdates",
'name' => "ps_chkupdates",
'title' => "Check for updates",
'title' => "Check for updates",
'description' => "Turn this setting On and you\'ll be notified whenever a new version released. Notification will be shown above the ProStats\' table and would be visible only to Admins.",
'description' => "Turn this setting On and you\'ll be notified whenever a new version released. Notification will be shown above the ProStats\' table and would be visible only to Admins.",
'optionscode' => "yesno",
'optionscode' => "yesno",
'value' => ps_SetSettingsValue('ps_chkupdates', '1'),
'value' => ps_SetSettingsValue('ps_chkupdates', '1'),
'disporder' => 80,
'disporder' => 80,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_surprise",
'name' => "ps_surprise",
'title' => "Surprise!",
'title' => "Surprise!",
'description' => "This option may add a little fun to your forum sometimes! It would probably happen once or twice a year and only Admins can see the result.",
'description' => "This option may add a little fun to your forum sometimes! It would probably happen once or twice a year and only Admins can see the result.",
'optionscode' => "yesno",
'optionscode' => "yesno",
'value' => ps_SetSettingsValue('ps_surprise', '1'),
'value' => ps_SetSettingsValue('ps_surprise', '1'),
'disporder' => 85,
'disporder' => 85,
'gid' => $gid
'gid' => $gid
);
);
$ps[]= array(
$ps[]= array(
'name' => "ps_version",
'name' => "ps_version",
'title' => "ProStats Version",
'title' => "ProStats Version",
'description' => "DO NOT MODIFY THIS SETTING",
'description' => "DO NOT MODIFY THIS SETTING",
'optionscode' => "text",
'optionscode' => "text",
'value' => $mybb->psga['prostats_version'],
'value' => $mybb->psga['prostats_version'],
'disporder' => 90,
'disporder' => 90,
'gid' => $gid
'gid' => $gid
);
);
foreach ($ps as $p)
foreach ($ps as $p)
{
{
$db->insert_query("settings", $p);
$db->insert_query("settings", $p);
}
}
rebuild_settings();
rebuild_settings();
}
}




function ps_SetSettingsValue($setting_name, $default_value)
function ps_SetSettingsValue($setting_name, $default_value)
{
{
global $mybb;
global $mybb;
return $mybb->settings[$setting_name] ? $mybb->settings[$setting_name] : $default_value;
return $mybb->settings[$setting_name] ? $mybb->settings[$setting_name] : $default_value;
}
}




function prostats_activate()
function prostats_activate()
{
{
global $db;
global $db;
prostats_deactivate();
prostats_deactivate();
require_once MYBB_ROOT.'inc/adminfunctions_templates.php';
require_once MYBB_ROOT.'inc/adminfunctions_templates.php';
find_replace_templatesets('index', '#{\$header}(\r?)\n#', "{\$header}\n{\$ps_header_index}\n");
find_replace_templatesets('index', '#{\$header}(\r?)\n#', "{\$header}\n{\$ps_header_index}\n");
find_replace_templatesets('index', '#{\$forums}(\r?)\n#', "{\$forums}\n{\$ps_footer_index}\n");
find_replace_templatesets('index', '#{\$forums}(\r?)\n#', "{\$forums}\n{\$ps_footer_index}\n");
find_replace_templatesets('portal', '#{\$header}(\r?)\n#', "{\$header}\n{\$ps_header_portal}\n");
find_replace_templatesets('portal', '#{\$header}(\r?)\n#', "{\$header}\n{\$ps_header_portal}\n");
find_replace_templatesets('portal', '#{\$footer}(\r?)\n#', "{\$ps_footer_portal}\n{\$footer}\n");
find_replace_templatesets('portal', '#{\$footer}(\r?)\n#', "{\$ps_footer_portal}\n{\$footer}\n");
$extra_cells = "select\n0=--\n1=Most replies\n2=Most reputations\n3=Most thanks\n4=Most viewed\n5=New members\n6=Top downloads\n7=Top posters\n9=Top Thread Posters\n8=Top referrers";
$extra_cells = "select\n0=--\n1=Most replies\n2=Most reputations\n3=Most thanks\n4=Most viewed\n5=New members\n6=Top downloads\n7=Top posters\n9=Top Thread Posters\n8=Top referrers";


$templatearray = array(
$templatearray = array(
'title' => "prostats",
'title' => "prostats",
'template' => $db->escape_string(<<<EOT
'template' => $db->escape_string(<<<EOT
<script type="text/javascript">
<script type="text/javascript">
<!--
<!--


function prostats_reload()
function prostats_reload()
{
{
\$("#prostats_table").prepend('<div id="ps_reload_layer" class="tborder"><img src="{\$mybb->settings['bburl']}/images/spinner_big.gif" alt="spinner" /></div>');
\$("#prostats_table").prepend('<div id="ps_reload_layer" class="tborder"><img src="{\$mybb->settings['bburl']}/images/spinner_big.gif" alt="spinner" /></div>');
\$('#ps_reload_layer').css({
\$('#ps_reload_layer').css({
"height": \$('#prostats_table').find('table:first').height()+'px',
"height": \$('#prostats_table').find('table:first').height()+'px',
"width": \$('#prostats_table').find('table:first').width()+'px',
"width": \$('#prostats_table').find('table:first').width()+'px',
"top": \$('#prostats_table').offset().top,
"top": \$('#prostats_table').offset().top,
}).fadeTo(0, 0.1).fadeTo("slow" , 0.8);
}).fadeTo(0, 0.1).fadeTo("slow" , 0.8);
\$.ajax(
\$.ajax(
{
{
type: 'POST',
type: 'POST',
url: '{\$mybb->settings['bburl']}/xmlhttp.php?action=prostats_reload',
url: '{\$mybb->settings['bburl']}/xmlhttp.php?action=prostats_reload',
dataType: 'json',
dataType: 'json',
data: { ajax: 1, my_post_key: my_post_key },
data: { ajax: 1, my_post_key: my_post_key },
success: prostats_done
success: prostats_done
});
});
return false;
return false;
}
}


function prostats_done(data)
function prostats_done(data)
{
{
if(data.hasOwnProperty("errors"))
if(data.hasOwnProperty("errors"))
{
{
\$(".jGrowl").jGrowl("close");
\$(".jGrowl").jGrowl("close");


\$.each(data.errors, function(i, message)
\$.each(data.errors, function(i, message)
{
{
\$.jGrowl(message);
\$.jGrowl(message);
});
});
}
}
else if(data.html)
else if(data.html)
{
{
\$("#prostats_table").html(data.html);
\$("#prostats_table").html(data.html);
}
}
}
}
-->
-->
</script>
</script>
<style type="text/css">
<style type="text/css">
#ps_reload_layer {
#ps_reload_layer {
display: block;
display: block;
position: absolute;
position: absolute;
z-order:1000;
z-order:1000;
background: #fff;
background: #fff;
text-align: center;
text-align: center;
vertical-align: middle;
vertical-align: middle;
}
}


#ps_reload_layer img {
#ps_reload_layer img {
position: relative;
position: relative;
top: 30%;
top: 30%;
}
}


.ps_unapproved {
.ps_unapproved {
background-color:#FFDDE0;
background-color:#FFDDE0;
}
}


.ps_deleted {
.ps_deleted {
background-color:#E8DEFF;
background-color:#E8DEFF;
}
}


.ps_undermod {
.ps_undermod {
background-color:#FFFE92;
background-color:#FFFE92;
}
}


.ps_both {
.ps_both {
background-color:#FFDA91;
background-color:#FFDA91;
}
}


.ps_status {
.ps_status {
display: inline-block;
display: inline-block;
width: 16px;
width: 16px;
height: 16px;
height: 16px;
background-image: url({\$mybb->settings['bburl']}/images/prostats/status_sprite.png);
background-image: url({\$mybb->settings['bburl']}/images/prostats/status_sprite.png);
vertical-align: bottom;
vertical-align: bottom;
}
}


.ps_status.ps_minion {
.ps_status.ps_minion {
background-position: 0 0;
background-position: 0 0;
}
}


.ps_status.ps_minioff {
.ps_status.ps_minioff {
background-position: 0 -16px;
background-position: 0 -16px;
}
}


.ps_status.ps_miniofflock {
.ps_status.ps_miniofflock {
background-position: 0 -32px;
background-position: 0 -32px;
}
}


/* Fix bad border-radius */
/* Fix bad border-radius */
#prostats_table .tcat td,
#prostats_table .tcat td,
#prostats_table .trow1 td,
#prostats_table .trow1 td,
#prostats_table .trow2 td {
#prostats_table .trow2 td {
border-radius: 0;
border-radius: 0;
}
}


#prostats_table .thead {
#prostats_table .thead {
border-bottom-left-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
border-bottom-right-radius: 0;
}
}
</style>
</style>


<div id="prostats_table">
<div id="prostats_table">
{\$remote_msg}
{\$remote_msg}
<table width="100%" border="0" cellspacing="{\$theme[borderwidth]}" cellpadding="0" class="tborder">
<table width="100%" border="0" cellspacing="{\$theme['borderwidth']}" cellpadding="0" class="tborder">
<thead>
<thead>
<tr><td colspan="{\$num_columns}">
<tr><td colspan="{\$num_columns}">
<table border="0" cellspacing="0" cellpadding="{\$theme[tablespace]}" width="100%">
<table border="0" cellspacing="0" cellpadding="{\$theme['tablespace']}" width="100%">
<tr>
<tr>
<td class="thead">
<td class="thead">
<div class="float_{\$ps_ralign}"><a href="" onclick="return prostats_reload();">{\$lang->prostats_reload} <img src="{\$mybb->settings['bburl']}/images/prostats/ps_reload.png" style="vertical-align:middle;" alt="" /></a></div>
<div class="float_{\$ps_ralign}"><a href="" onclick="return prostats_reload();">{\$lang->prostats_reload} <img src="{\$mybb->settings['bburl']}/images/prostats/ps_reload.png" style="vertical-align:middle;" alt="" /></a></div>
<strong>{\$lang->prostats_prostats}</strong>
<strong>{\$lang->prostats_prostats}</strong>
</td>
</td>
</tr>
</tr>
</table>
</table>
</td>
</td>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
{\$trow_message_top}
{\$trow_message_top}
<tr valign="top">
<tr valign="top">
{\$prostats_content}
{\$prostats_content}
</tr>
</tr>
{\$trow_message_down}
{\$trow_message_down}
</tbody>
</tbody>
</table>
</table>
<br />
<br />
</div>
</div>
EOT
EOT
),
),
'sid' => "-1"
'sid' => "-1"
);
);
$db->insert_query("templates", $templatearray);
$db->insert_query("templates", $templatearray);
$templatearray = array(
$templatearray = array(
'title' => "prostats_readstate_icon",
'title' => "prostats_readstate_icon",
'template' => "<span class=\"ps_status ps_mini{\$lightbulb[\'folder\']}\"> </span>&nbsp;",
'template' => "<span class=\"ps_status ps_mini{\$lightbulb[\'folder\']}\"> </span>&nbsp;",
'sid' => "-1"
'sid' => "-1"
);
);
$db->insert_query("templates", $templatearray);
$db->insert_query("templates", $templatearray);
$templatearray = array(
$templatearray = array(
'title' => "prostats_newestposts",
'title' => "prostats_newestposts",
'template' => "<td class=\"{\$trow}\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"{\$theme[tablespace]}\">
'template' => "<td class=\"{\$trow}\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"{\$theme[\'tablespace\']}\">
<tr class=\"tcat smalltext\">
<tr class=\"tcat smalltext\">
<td colspan=\"{\$colspan}\">{\$lang->prostats_latest_posts}</td>
<td colspan=\"{\$colspan}\">{\$lang->prostats_latest_posts}</td>
</tr>
</tr>
<tr>
<tr>
<td colspan=\"{\$colspan}\">
<td colspan=\"{\$colspan}\">
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr class=\"{\$trow} smalltext\">
<tr class=\"{\$trow} smalltext\">
{\$newestposts_cols_name}
{\$newestposts_cols_name}
</tr>
</tr>
{\$newestposts_row}
{\$newestposts_row}
</table></td>
</table></td>
</tr>
</tr>
</table></td>",
</table></td>",
'sid' => "-1"
'sid' => "-1"
);
);
$db->insert_query("templates", $templatearray);
$db->insert_query("templates", $templatearray);
$templatearray = array(
$templatearray = array(
'title' => "prostats_newestposts_row",
'title' => "prostats_newestposts_row",
'template' => "<tr class=\"{\$trow} smalltext{\$highlight}\">
'template' => "<tr class=\"{\$trow} smalltext{\$highlight}\">
{\$newestposts_cols}
{\$newestposts_cols}
</tr>",
</tr>",
'sid' => "-1"
'sid' => "-1"
);
);
$db->insert_query("templates", $templatearray);
$db->insert_query("templates", $templatearray);
$templatearray = array(
$templatearray = array(
'title' => "prostats_newestposts_specialchar",
'title' => "prostats_newestposts_specialchar",
'template' => "<a href=\"{\$threadlink}\" style=\"text-decoration: none;\"><font face=\"arial\" style=\"line-height:10px;\">▼</font></a>",
'template' => "<a href=\"{\$threadlink}\" style=\"text-decoration: none;\"><font face=\"arial\" style=\"line-height:10px;\">▼</font></a>",
'sid' => "-1"
'sid' => "-1"
);
);
$db->insert_query("templates", $templatearray);
$db->insert_query("templates", $templatearray);
//Most Replies
//Most Replies
$templatearray = array(
$templatearray = array(
'title' => "prostats_mostreplies",
'title' => "prostats_mostreplies",
'template' => "<td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"{\$theme[tablespace]}\">
'template' => "<td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"{\$theme[\'tablespace\']}\">
<tr class=\"tcat smalltext\">
<tr class=\"tcat smalltext\">
<td colspan=\"2\">{\$lang->prostats_most_replies}</td>
<td colspan=\"2\">{\$lang->prostats_most_replies}</td>
</tr>
</tr>
<tr>
<tr>
<td colspan=\"2\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<td colspan=\"2\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
{\$mostreplies_row}
{\$mostreplies_row}
</table></td></tr>
</table></td></tr>
</table></td>",
</table></td>",
'sid' => "-1"
'sid' => "-1"
);
);
$db->insert_query("templates", $templatearray);
$db->insert_query("templates", $templatearray);
$templatearray = array(
$templatearray = array(
'title' => "prostats_mostreplies_row",
'title' => "prostats_mostreplies_row",
'template' => "<tr class=\"smalltext{\$highlight}\">
'template' => "<tr class=\"smalltext{\$highlight}\">
<td>{\$readstate_icon}<a href=\"{\$threadlink}\" title=\"{\$subject_long}\">{\$subject}</a></td>
<td>{\$readstate_icon}<a href=\"{\$threadlink}\" title=\"{\$subject_long}\">{\$subject}</a></td>
<td align=\"{\$ps_align}\"><a href=\"javascript:MyBB.whoPosted({\$tid});\">{\$replies}</a></td>
<td align=\"{\$ps_align}\"><a href=\"javascript:MyBB.whoPosted({\$tid});\">{\$replies}</a></td>
</tr>",
</tr>",
'sid' => "-1"
'sid' => "-1"
);
);
$db->insert_query("templates", $templatearray);
$db->insert_query("templates", $templatearray);
//Most Reputation
//Most Reputation
$templatearray = array(
$templatearray = array(
'title' => "prostats_mostreputation",
'title' => "prostats_mostreputation",
'template' => "<td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"{\$theme[tablespace]}\">
'template' => "<td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"{\$theme[\'tablespace\']}\">
<tr class=\"tcat smalltext\">
<tr class=\"tcat smalltext\">
<td colspan=\"2\">{\$lang->prostats_most_reputations}</td>
<td colspan=\"2\">{\$lang->p
</tr>
<tr>
<td colspan=\"2\"><table width=\"100%\" border=\"0\" cellspacing=\"0\"