Custom Title MOD (problem whit the tilte_install.php)

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Custom Title MOD (problem whit the tilte_install.php)
0utk4s7
CZ Newbie
0utk4s7 has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Feb 06, 2005
0.00 posts per day
Posts: 9
Points: 616
   
Hy

I have 1 problem whit this mod.. [ Register or login to view links on this board. ]

When i run the title_install i have this error
Fatal error: [] operator not supported for strings in xxxxxxxxxxx\modules\Forums\title_install.php on line 116

This is the line 116
$sql[] = "ALTER TABLE " . USERS_TABLE . "


and the title_install
<?php
/***************************************************************************
*                             title_install.php
*                            -------------------
*   begin                : Wednesday, August 7, 2002
*   copyright            : (C) 2002 Jason Lynch
*   email                : [ Register or login to view links on this board. ]
*
*
***************************************************************************/

/***************************************************************************
*
*   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
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
***************************************************************************/

function _sql($sql, &$errored, &$error_ary, $echo_dot = true)
{
   global $db;

   if( !($result = $db->sql_query($sql)) )
   { 
      $errored = true;
      $error_ary['sql'][] = ( is_array($sql) ) ? $sql[$i] : $sql;
      $error_ary['error_code'][] = $db->sql_error();
   }

   if ( $echo_dot )
   {
      echo ".";
      flush();
   }

   return $result;
}

$installs_version = '1.0.1';
if (!eregi("modules.php", $PHP_SELF)) {
    die ("You can't access this file directly...");
}
if ($popup != "1"){
    $module_name = basename(dirname(__FILE__));
    require("modules/".$module_name."/nukebb.php");
}
else
{
    $phpbb_root_path = 'modules/Forums/';
}

define('IN_PHPBB', 1);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'config.'.$phpEx);
include('includes/constants.php');
include('includes/functions.php');
include('includes/functions_admin.php');
include('db/db.php');

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
<!--

font,th,td,p,body { font-family: "Courier New", courier; font-size: 11pt }

a:link,a:active,a:visited { color : #006699; }
a:hover      { text-decoration: underline; color : #DD6900;}

hr   { height: 0px; border: solid #D1D7DC 0px; border-top-width: 1px;}

.maintitle,h1,h2   {font-weight: bold; font-size: 22px; font-family: "Trebuchet MS",Verdana, Arial, Helvetica, sans-serif; text-decoration: none; line-height : 120%; color : #000000;}

.ok {color:green}

/* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */
@import url("templates/subSilver/formIE.css");
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#006699" vlink="#5584AA">

<table width="100%" border="0" cellspacing="0" cellpadding="10" align="center">
   <tr>
      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
         <tr>
            <td><img src="templates/subSilver/images/logo_phpBB.gif" border="0" alt="Forum Home" vspace="1" /></td>
            <td align="center" width="100%" valign="middle"><span class="maintitle">Aexoden's custom Title MOD: Database Updater</span></td>
         </tr>
      </table></td>
   </tr>
</table>

<br clear="all" />

<h2>Information</h2>

<?php

echo '<p>Database type    :: <b>' . SQL_LAYER . '</b><br />';

echo 'Aexoden\'s Custom Title Version:: <b>' . $installs_version . '</b></p>' ."\n";

echo '<p>This installs the necessary database schema for Aexoden\'s Custom Title MOD.  Currently, only the MySQL aspect has been tested.  If you\'re using any other database, please report your results to Aexoden.</p>' . "\n";

switch ( SQL_LAYER )
{
   case 'mysql':
   case 'mysql4':
      $sql[] = "ALTER TABLE " . USERS_TABLE . "
         ADD COLUMN user_custom_title varchar(255) NULL,
         ADD COLUMN user_custom_title_status tinyint(1) default '0' not null";
      break;
   case 'postgresql':
      $sql[] = "ALTER TABLE " . USERS_TABLE . "
         ADD COLUMN user_custom_title varchar(255) NULL";
      $sql[] = "ALTER TABLE " . USERS_TABLE . "
         ADD COLUMN user_custom_title_status int2";
      $sql[] = "ALTER TABLE " . USERS_TABLE . "
         ALTER COLUMN user_custom_title_status SET DEFAULT '0'";
      break;
   case 'mssql-odbc':
   case 'mssql':
      $sql[] = "ALTER TABLE " . USERS_TABLE . " ADD
         user_custom_title varchar(255) NULL";
      $sql[] = "ALTER TABLE " . USERS_TABLE . " ADD
         user_custom_title_status tinyint NOT NULL,
         CONSTRAINT [DF_" . $prefix . "_users_user_custom_title_status] DEFAULT (0) FOR [user_custom_title_status]";
      break;
   case 'msaccess':
      $sql[] = "ALTER TABLE " . USERS_TABLE . "
         ADD user_custom_title varchar(255) NULL";
      $sql[] = "ALTER TABLE " . USERS_TABLE . " ADD
         user_custom_title_status tinyint NOT NULL";
      break;
   default:
      die("No DB LAYER found!");
      break;
}

echo "<h2>Installing database schema</h2>\n";
echo "<p>Progress :: <b>";
flush();

$error_ary = array();
$errored = false;
if ( count($sql) )
{
   for($i = 0; $i < count($sql); $i++)
   {
      _sql($sql[$i], $errored, $error_ary);
   }

   echo "</b> <b class=\"ok\">Done</b><br />Result   :: \n";

   if ( $errored )
   {
      echo " <b>Some queries failed, the statements and errors are listing below</b>\n<ul>";

      for($i = 0; $i < count($error_ary['sql']); $i++)
      {
         echo "<li>Error :: <b>" . $error_ary['error_code'][$i]['message'] . "</b><br />";
         echo "SQL   :: <b>" . $error_ary['sql'][$i] . "</b><br /><br /></li>";
      }

      echo "</ul>\n<p>An error occured.</p>\n";
   }
   else
   {
      echo "<b>No errors</b>\n";
   }
}
else
{
   echo " No updates required</b></p>\n";
}

//
//
//
unset($sql);
$error_ary = array();
$errored = false;

echo "<h2>Updating data</h2>\n";
echo "<p>Progress :: <b>";
flush();

$sql = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value)
   VALUES ('custom_title_days', 0)";
   _sql($sql, $errored, $error_ary);

$sql = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value)
   VALUES ('custom_title_posts', 0)";
   _sql($sql, $errored, $error_ary);

$sql = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value)
   VALUES ('custom_title_mode', 0)";
   _sql($sql, $errored, $error_ary);

$sql = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value)
   VALUES ('custom_title_maxlength', 45)";
   _sql($sql, $errored, $error_ary);


      echo "</b> <b class=\"ok\">Done</b><br />Result   :: \n";

      if ( $errored )
      {
         echo " <b>Some queries failed, the statements and errors are listing below</b>\n<ul>";

         for($i = 0; $i < count($error_ary['sql']); $i++)
         {
            echo "<li>Error :: <b>" . $error_ary['error_code'][$i]['message'] . "</b><br />";
            echo "SQL   :: <b>" . $error_ary['sql'][$i] . "</b><br /><br /></li>";
         }

         echo "</ul>\n<p>An error occured.  Please PM Aexoden with the details of the error.</p>\n";
      }
      else
      {
         echo "<b>No errors</b>\n";
      }


echo "<h2>Install completed</h2>\n";
echo "\n<p>You should now delete this file.  Be sure to visit the Configuration section of General Admin to configure the Custom Title options.</p>\n";

?>

<br clear="all" />

</body>
</html>


Somebody can help ???
Thkz


Back to top Reply with quote
#2   re: Custom Title MOD (problem whit the tilte_install.php)
0utk4s7
CZ Newbie
0utk4s7 has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Feb 06, 2005
0.00 posts per day
Posts: 9
Points: 616
   
i did this but i have 1 problem

ALTER TABLE nuke_users
ADD COLUMN user_custom_title varchar(255) NULL,
ADD COLUMN user_custom_title_status tinyint(1) default '0' not null;
ALTER TABLE nuke_users
ADD COLUMN user_custom_title varchar(255) NULL;
ALTER TABLE nuke_users
ADD COLUMN user_custom_title_status int2;
ALTER TABLE nuke_users
ALTER COLUMN user_custom_title_status SET DEFAULT '0';
ALTER TABLE nuke_users ADD
user_custom_title varchar(255) NULL;
ALTER TABLE nuke_users ADD
user_custom_title_status tinyint NOT NULL,
CONSTRAINT [DF_nuke_users_user_custom_title_status] DEFAULT (0) FOR [user_custom_title_status];
ALTER TABLE nuke_users
ADD user_custom_title varchar(255) NULL;
ALTER TABLE nuke_users ADD
user_custom_title_status tinyint NOT NULL;
INSERT INTO nuke_bbconfig (config_name, config_value)
VALUES ('custom_title_days', 0);
INSERT INTO nuke_bbconfig (config_name, config_value)
VALUES ('custom_title_posts', 0);
INSERT INTO nuke_bbconfig (config_name, config_value)
VALUES ('custom_title_mode', 0);
INSERT INTO nuke_bbconfig (config_name, config_value)
VALUES ('custom_title_maxlength', 45);


problem
ALTER TABLE nuke_users ADD COLUMN user_custom_title varchar( 255 ) NULL

Mensagens do MySQL :


#1060 - Duplicate column name 'user_custom_title'

plz help


Back to top Reply with quote
#3   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
That means the field already exists. See if the mod functions ok.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#4   
0utk4s7
CZ Newbie
0utk4s7 has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Feb 06, 2005
0.00 posts per day
Posts: 9
Points: 616
   


Originally posted by Telli @ 23/02/2005, 06:01:45:

That means the field already exists. See if the mod functions ok.

Donīt work icon_cry.gif
Can you give me the sql comand plz???

Sorry my english iīm portuguese



Back to top Reply with quote
#5   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
You don't need the sql command the field is already there. What errors do you receive?




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#6   re: Custom Title MOD (problem whit the tilte_install.php)
0utk4s7
CZ Newbie
0utk4s7 has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Feb 06, 2005
0.00 posts per day
Posts: 9
Points: 616
   
Hi there the lang. files dont show and when i put the text dont show nothing .... not errors or the text icon_cry.gif my nuke is the 7.6 and bbnuke is 2.1.1

Sorry my english



Back to top Reply with quote
#7   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
Can you leave a link to your site I will try to load the pages.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#8   re: Custom Title MOD (problem whit the tilte_install.php)
0utk4s7
CZ Newbie
0utk4s7 has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Feb 06, 2005
0.00 posts per day
Posts: 9
Points: 616
   
Hi there

Itīs OK now but i have another problem icon_cry.gif

When i go t the admin painel and put Enable in the custom title works but when iīm going to the profile donīt show anything icon_eek.gif

I edit the profile_add_body.tpl and remove the

<!-- BEGIN switch_custom_title -->


<!-- END switch_custom_title -->


and now shows to everybody i cant resolve this problem

can you help me???

I hop you understand sorry my english


Back to top Reply with quote
#9   re: Custom Title MOD (problem whit the title_install.php)
christianb
CZ Newbie
christianb has been a member for over 19 year's 19 Year Member
usa.gif arkansas.gif
Occupation: Admin, ISP tech support
Age: 49
Gender: Male
Website:
Status: Offline
Joined: Jan 30, 2005
0.00 posts per day
Posts: 5
Points: 428
   
I am very much looking forward to this mod working - as I heard a great job was done on it. I've got the files edited and uploaded - that part was taken care of.
When I ran the title_install.php, all I got was


Information
Database type :: mysql
Aexoden's Custom Title Version:: 1.0.1

This installs the necessary database schema for Aexoden's Custom Title MOD. Currently, only the MySQL aspect has been tested. If you're using any other database, please report your results to Aexoden.
with nothing else. I feared it did not enter the information into the SQL. I used phpMyAdmin and manually entered in the information. The Forums confi shows correctly, and I'm assuming it works, however, the problem is that I have no way to edit a profile. When I go to the forums, then click on profile - forum-editprofile.html , the header is there, then that's it - its blank. Any thoughts?

I'm running 7.7 patched

TIA!



Back to top Reply with quote
#10   
christianb
CZ Newbie
christianb has been a member for over 19 year's 19 Year Member
usa.gif arkansas.gif
Occupation: Admin, ISP tech support
Age: 49
Gender: Male
Website:
Status: Offline
Joined: Jan 30, 2005
0.00 posts per day
Posts: 5
Points: 428
   
Update: I've found out - through the Forums control panel - Custom Titles DO work, but the editprofile is still not operating.



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum