Raised This Month: $ Target: $400
 0% 

anybody with knoqledge in modding forums


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
coca-cola
BANNED
Join Date: Dec 2007
Location: I got caught by Roach be
Old 03-17-2008 , 02:25   Re: anybody with knoqledge in modding forums
Reply With Quote #4

i also need some help with this new mod. usualy when im installing forum mods, i have to do this

Code:
CREATE TABLE phpbb_karma_comments (
   karma_id mediumint(8) NOT NULL auto_increment,
   karma_to mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
   karma_from mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
   karma_desc char(255) NOT NULL,
   karma_date int(11) DEFAULT '0' NOT NULL,
   karma_key tinyint(1) DEFAULT '0' NOT NULL,
   karma_viewed tinyint(1) DEFAULT '0' NOT NULL,
   PRIMARY KEY (karma_id)
);

INSERT INTO `phpbb_config` SET `config_name`='karma_comments', `config_value`='0';
INSERT INTO `phpbb_config` SET `config_name`='karma_comments_obligatory', `config_value`='0';
INSERT INTO `phpbb_config` SET `config_name`='karma_comments_max', `config_value`='3';
INSERT INTO `phpbb_config` SET `config_name`='karma_onoff', `config_value`='1';
INSERT INTO `phpbb_config` SET `config_name`='simple_karma', `config_value`='0';
INSERT INTO `phpbb_config` SET `config_name`='time_between_karma', `config_value`='24';
INSERT INTO `phpbb_config` SET `config_name`='admin_karma', `config_value`='1';
INSERT INTO `phpbb_config` SET `config_name`='min_post_karma', `config_value`='0';
INSERT INTO `phpbb_config` SET `config_name`='lag_karmer', `config_value`='1';
ALTER TABLE `phpbb_users` ADD `karma_plus` MEDIUMINT DEFAULT '0' NOT NULL ;
ALTER TABLE `phpbb_users` ADD `karma_minus` MEDIUMINT DEFAULT '0' NOT NULL ;
ALTER TABLE `phpbb_users` ADD `karma_time` BIGINT DEFAULT '0' NOT NULL ;
but now it wants me to run these 2 files:

Code:
<?php
//copyright © 2004 IdleVoid & brustverein
//copyright © 2003 Volodymy (CLowN) Skoryk
//this update template copyright © 2006 Anton Granik

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);

if( !$userdata['session_logged_in'] )
{
   $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
   header($header_location . append_sid("login.$phpEx?redirect=reputation_mod_install_db_v100.$phpEx", true));
   exit;
}

if( $userdata['user_level'] != ADMIN )
{
   message_die(GENERAL_MESSAGE, 'You are not authorised to access this page');
}

$page_title = 'Setting the database for Reputation Mod v.1.0.0 by Anton Granik';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
echo '<tr><th>Setting the database for Reputation Mod v.1.0.0 by Anton Granik</th></tr><tr><td><span class="genmed"><ul>';

$sql = array();
$sql[] = "    CREATE TABLE `" . $table_prefix . "reputation` (
            `user_id` mediumint(8) NOT NULL default '0',
            `user_id_2` mediumint(8) NOT NULL default '0',
            `post_id` mediumint(8) NOT NULL default '0',
            `rep_sum` FLOAT NOT NULL default '0',
            `rep_neg` tinyint(1) NOT NULL default '0',
            `rep_comment` varchar(200) NOT NULL default '',
            `rep_time` int(11) NOT NULL default '0',
            KEY `user_id` (`user_id`)
            ) TYPE=MyISAM;";
$sql[] = "    CREATE TABLE `" . $table_prefix . "reputation_config` (
              `config_name` VARCHAR( 255 ) NOT NULL ,
            `config_value` VARCHAR( 255 ) NOT NULL 
            ) TYPE=MyISAM;";
$sql[] = "    ALTER TABLE `" . $table_prefix . "users` ADD `user_reputation` FLOAT DEFAULT '0' NOT NULL";
$sql[] = "    ALTER TABLE `" . $table_prefix . "users` ADD `user_rep_last_time` INT( 11 ) NOT NULL AFTER `user_reputation`";
$sql[] = "    INSERT INTO `" . $table_prefix . "reputation_config` VALUES ('posts_to_earn', '50')";
$sql[] = "    INSERT INTO `" . $table_prefix . "reputation_config` VALUES ('rep_disable', '0')";
$sql[] = "    INSERT INTO `" . $table_prefix . "reputation_config` VALUES ('days_to_earn', '30')";
$sql[] = "    INSERT INTO `" . $table_prefix . "reputation_config` VALUES ('flood_control_time', '30')";
$sql[] = "    INSERT INTO `" . $table_prefix . "reputation_config` VALUES ('graphic_version', '1')";
$sql[] = "    INSERT INTO `" . $table_prefix . "reputation_config` VALUES ('medal4_to_earn', '10')";
$sql[] = "    INSERT INTO `" . $table_prefix . "reputation_config` VALUES ('medal3_to_earn', '50')";
$sql[] = "    INSERT INTO `" . $table_prefix . "reputation_config` VALUES ('medal2_to_earn', '100')";
$sql[] = "    INSERT INTO `" . $table_prefix . "reputation_config` VALUES ('medal1_to_earn', '200')";
$sql[] = "    INSERT INTO `" . $table_prefix . "reputation_config` VALUES ('given_rep_to_earn', '20')";
$sql[] = "    INSERT INTO `" . $table_prefix . "reputation_config` VALUES ('show_stats_to_mods', '0')";
$sql[] = "    INSERT INTO `" . $table_prefix . "reputation_config` VALUES ('repsum_limit', '0')";
$sql[] = "    INSERT INTO `" . $table_prefix . "reputation_config` VALUES ('pm_notify', '1')";
$sql[] = "    INSERT INTO `" . $table_prefix . "reputation_config` VALUES ('default_amount', '0')";

$errors = 0;
for( $i = 0; $i < count($sql); $i++ )
{
   if( !$result = $db->sql_query ($sql[$i]) )
   {
      $error = $db->sql_error();
      echo '<li>' . $sql[$i] . '<br /> +++ <font color="#FF0000"><b>Error:</b></font> ' . $error['message'] . '</li><br />';
   }
   else
   {
      echo '<li>' . $sql[$i] . '<br /> +++ <font color="#00AA00"><b>Successfull</b></font></li><br />';
   }
}

if ($errors == 0)
echo '<tr><th>Finish</th></tr><tr><td><span class="med">Now run <a href="reputation_mod_install_users_v100.php">reputation_mod_install_users_v100.php</a> to create reputations for users with default settings. Or go to the admin panel -> reputation and change the config values according to what you want on your board and run the file after that.</span></td></tr></table>';

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>
and

Code:
<?php
//copyright © 2004 IdleVoid & brustverein
//copyright © 2003 Volodymy (CLowN) Skoryk
//this update template copyright © 2006 Anton Granik

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'reputation_common.'.$phpEx);

$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);

if( !$userdata['session_logged_in'] )
{
   $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
   header($header_location . append_sid("login.$phpEx?redirect=reputation_mod_install_users_v100.$phpEx", true));
   exit;
}

if( $userdata['user_level'] != ADMIN )
{
   message_die(GENERAL_MESSAGE, 'You are not authorised to access this page');
}

$page_title = 'Setting the users reputations for Reputation Mod v.1.0.0 by Anton Granik';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
echo '<tr><th>Setting the users reputations for Reputation Mod v.1.0.0 by Anton Granik</th></tr><tr><td><span class="genmed"><ul type="circle">';

$sql = "SELECT * FROM " . USERS_TABLE . "
        ORDER BY user_id";
if ( !($result = $db->sql_query($sql)) )
{
    message_die(GENERAL_ERROR, "Could not obtain reputation data for this user", '', __LINE__, __FILE__, $sql);
}
while ($row = $db->sql_fetchrow($result))
{
    echo "<strong>" . $row['username'] . "</strong>";
    $dif = time() - $row['user_regdate'];
    $a = ($dif/60/60/24) / $rep_config['days_to_earn'];
    $b = $row['user_posts'] / $rep_config['posts_to_earn'];
    $c = $a + $b;
    echo " (" . round($c,4) . "), ";
    $sql = "UPDATE " . USERS_TABLE . "
            SET user_reputation = $c, user_rep_last_time = " . time() . "
            WHERE user_id = " . $row['user_id'];
    if ( !$db->sql_query($sql) )
    {
        message_die(GENERAL_ERROR, "Could not update reputation for the user", '', __LINE__, __FILE__, $sql);
    }
}

if ($errors == 0)
echo '<tr><th>Finish</th></tr><tr><td><span class="med">Installation is now finished. Please be sure to <strong>delete these files</strong> now: <ul><li>reputation_mod_db_install_v100.php,</li><li>reputation_mod_users_install_v100.php</li></ul></span></td></tr></table>';

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>

if its possible to convert the second 2 to look like the first one, that would be great, cause my forums are down till i figure it out
coca-cola is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode