(2010-11-25, 01:01 AM)mazin46 Wrote: [ -> ]Thx for answer Aquilez:
yes i updated the plugin from a previous version 0.4 to 0.6 ...
what i must to do know >?! how can solve that ?!
Save this code into a file "update.php". Upload it to your MyBB root installation and execute it (yourforum.com/example/update.php)
<?php
/**
* MyBB 1.4
* Copyright © 2008 MyBB Group, All Rights Reserved
*
* ProfileComments by Santiago Dimattia
* http://www.teleportz.com.ar
*
*/
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'update.php');
require_once "./global.php";
$lang->load('profilecomments');
// New comments alert
$db->write_query("ALTER TABLE `".TABLE_PREFIX."users` DROP `visiteprofile`;");
$db->write_query("ALTER TABLE `".TABLE_PREFIX."users` ADD `newcomments` INT(10) NOT NULL DEFAULT '0';");
// New group-based permissions! :)
$db->write_query("ALTER TABLE `".TABLE_PREFIX."usergroups` ADD `cansendcomments` INT(1) NOT NULL DEFAULT '0';");
$db->write_query("ALTER TABLE `".TABLE_PREFIX."usergroups` ADD `caneditselfcomments` INT(1) NOT NULL DEFAULT '0';");
$db->write_query("ALTER TABLE `".TABLE_PREFIX."usergroups` ADD `candeleteselfcomments` INT(1) NOT NULL DEFAULT '0';");
// Give access to send and edit own comments to ALL USERGROUPS
$db->write_query('UPDATE '.TABLE_PREFIX.'usergroups SET canmanagecomments = "0", cansendcomments = "1", caneditselfcomments = "1"');
// Give access to EDIT & DELETE (all comments) to Administrators
$db->write_query('UPDATE '.TABLE_PREFIX.'usergroups SET canmanagecomments = "1", candeleteselfcomments = "1" WHERE gid = "4"');
// Delete all access for guests
$db->write_query('UPDATE '.TABLE_PREFIX.'usergroups SET cansendcomments = "0", caneditselfcomments = "0" WHERE gid = "1"');
// Delete all access for banned users
$db->write_query('UPDATE '.TABLE_PREFIX.'usergroups SET cansendcomments = "0", caneditselfcomments = "0" WHERE gid = "7"');
// Delete all access for 'awaiting activation' users
$db->write_query('UPDATE '.TABLE_PREFIX.'usergroups SET cansendcomments = "0", caneditselfcomments = "0" WHERE gid = "5"');
// Update usergroups cache
$cache->update_usergroups();
$query = $db->simple_select('settinggroups', 'gid', 'name="profilecomments"');
$group = $db->fetch_field($query, 'gid');
// Create new values
$new_config = array();
$new_config[] = array(
'name' => 'profilecomments_allow_html',
'title' => $db->escape_string($lang->profile_comments_allow_html),
'description' => $db->escape_string($lang->profile_comments_allow_html_info),
'optionscode' => 'yesno',
'value' => '0',
'disporder' => 6,
'gid' => $group
);
$new_config[] = array(
'name' => 'profilecomments_allow_smilies',
'title' => $db->escape_string($lang->profile_comments_allow_smilies),
'description' => $db->escape_string($lang->profile_comments_allow_smilies_info),
'optionscode' => 'yesno',
'value' => '1',
'disporder' => 7,
'gid' => $group
);
$new_config[] = array(
'name' => 'profilecomments_allow_bbcode',
'title' => $db->escape_string($lang->profile_comments_allow_bbcode),
'description' => $db->escape_string($lang->profile_comments_allow_bbcode_info),
'optionscode' => 'yesno',
'value' => '1',
'disporder' => 8,
'gid' => $group
);
$new_config[] = array(
'name' => 'profilecomments_allow_imgcode',
'title' => $db->escape_string($lang->profile_comments_allow_imgcode),
'description' => $db->escape_string($lang->profile_comments_allow_imgcode_info),
'optionscode' => 'yesno',
'value' => '1',
'disporder' => 9,
'gid' => $group
);
$new_config[] = array(
'name' => 'profilecomments_filter_badwords',
'title' => $db->escape_string($lang->profile_comments_filter_badwords),
'description' => $db->escape_string($lang->profile_comments_filter_badwords_info),
'optionscode' => 'yesno',
'value' => '1',
'disporder' => 10,
'gid' => $group
);
$new_config[] = array(
'name' => 'profilecomments_show_editor',
'title' => $db->escape_string($lang->profile_comments_show_editor),
'description' => $db->escape_string($lang->profile_comments_show_editor_info),
'optionscode' => 'yesno',
'value' => '0',
'disporder' => 10,
'gid' => $group
);
foreach($new_config as $array => $content)
{
$db->insert_query("settings", $content);
}
rebuild_settings();
echo 'New settings in ProfileComments 0.6.0 were created.<br /><span style="display: block; font-size: 24px; color: #F00; margin-top: 20px;">Don\' forget to delete this file.</span>';