[2.0.6] Custom Title MOD

The cleanup is complete. This forum is now read only.
Post Reply
Aexoden
Registered User
Posts: 364
Joined: Mon Jan 14, 2002 1:18 am
Location: Medical Lake, WA
Name: Jason Lynch
Contact:

Post by Aexoden » Tue Nov 11, 2003 11:50 pm

Tracey wrote: Can this mod work on a number of styles/themes?
e.g. I have 2.0.6 with the default theme working with the mod, and I also have substyles working for 3 of the forums in my phpBB. The mod doesn't work with the 3 substyles, and I have gotten error (see above a few posts) when trying to install it seperately on each style and then run the title_install.php


title_install.php only needs to be run once. All it does is make modifications to the database, and doesn't affect any files. For different themes... it's just a matter of adding the right HTML to the theme. If you know HTML at all, this is probably a rather trivial task... otherwise, it could probably be a pain. Generally, search for similar lines. For instance, in profile_add_body.tpl, I think I put the custom title code after the interests code.. so just find the similar section in the other theme and put it in.

Another way to make it so only admins can change it is to set the required days or posts prohibitively high, such as a billion posts. No one's going to get that, so in effect, only people you specifically allow can set their own title.. and if you don't specifically allow anyone, only admins or moderators will be able to do it.

User avatar
Tracey
Registered User
Posts: 38
Joined: Thu Apr 04, 2002 11:33 pm
Location: a u s t r a l i a
Contact:

Post by Tracey » Wed Nov 12, 2003 5:23 am

Aexoden wrote:
Tracey wrote:Can this mod work on a number of styles/themes?
e.g. I have 2.0.6 with the default theme working with the mod, and I also have substyles working for 3 of the forums in my phpBB. The mod doesn't work with the 3 substyles, and I have gotten error (see above a few posts) when trying to install it seperately on each style and then run the title_install.php


title_install.php only needs to be run once. All it does is make modifications to the database, and doesn't affect any files. For different themes... it's just a matter of adding the right HTML to the theme. If you know HTML at all, this is probably a rather trivial task... otherwise, it could probably be a pain. Generally, search for similar lines. For instance, in profile_add_body.tpl, I think I put the custom title code after the interests code.. so just find the similar section in the other theme and put it in.

Another way to make it so only admins can change it is to set the required days or posts prohibitively high, such as a billion posts. No one's going to get that, so in effect, only people you specifically allow can set their own title.. and if you don't specifically allow anyone, only admins or moderators will be able to do it.


Thanks for the reply, I did add the right HTML to the themes a couple of times to check - but it didn't seem to work. The custom rank field appears in the profile and admin but doesn't show under the name in the topic (which is the easiest part of the mod really ain't it?)

I'll try once more i guess!
sh1ft.org/mb (phpBB)

romans1423
Registered User
Posts: 1552
Joined: Sat Nov 02, 2002 4:44 pm
Location: Connersville, IN
Name: Rick Beckman
Contact:

Post by romans1423 » Wed Nov 12, 2003 6:15 am

morpheus2matrix wrote:
Zoombini wrote: However, how can it be made so that only Admin & Supermoderators group have access to change the title text?


Un-done the changes you've made in usercp_register.php and profile_add_body.tpl


Or add switches to enclose those changes in profile_add_body.tpl to allow them to only show up for Admins or Mods or whatever...

Daz has a tutorial on how to add Admin and Mod switches... Do similar to add functionality for Super Mods.

gigantus
Registered User
Posts: 4
Joined: Wed Nov 12, 2003 1:53 pm

umm problem

Post by gigantus » Wed Nov 12, 2003 2:01 pm

i cant see the place to edit the settings on my general admin/configuration area

and i followed the manual instructions

was it something i did wrong?

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Re: umm problem

Post by morpheus2matrix » Wed Nov 12, 2003 2:06 pm

gigantus wrote: i cant see the place to edit the settings on my general admin/configuration area

and i followed the manual instructions

was it something i did wrong?


it's not in your admin/configuration area : you can change the title of an user in Admin->USer Management
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

varda elentari
Registered User
Posts: 7
Joined: Sat Nov 08, 2003 8:44 pm
Location: Shooting through the stars tonight..
Contact:

Post by varda elentari » Wed Nov 12, 2003 2:54 pm

Hi Aexoden, I'm not sure if this is the same problem as Tracey's but I tried installing title_install.php and ran the file. Nothing worked, and I received errors messages, so I deleted it and re-installed it again. I still got errors:
title_install.php
File Type: PHP script text

--------------------------------------------------------------------------------

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.2';

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

?>

Aexoden's custom Title MOD: Database Updater



Information

' . $installs_version . '' ."\n";

echo '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.' . "\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_" . $table_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 "Installing database schema\n";
echo "Progress :: ";
flush();

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

echo " DoneResult :: \n";

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

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

echo "\nAn error occured.\n";
}
else
{
echo "No errors\n";
}
}
else
{
echo " No updates required\n";
}

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

echo "Updating data\n";
echo "Progress :: ";
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 " DoneResult :: \n";

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

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

echo "\nAn error occured. Please PM Aexoden with the details of the error.\n";
}
else
{
echo "No errors\n";
}


echo "Install completed\n";
echo "\nYou should now delete this file. Be sure to visit the Configuration section of General Admin to configure the Custom Title options.\n";

?>


Do you know what I may have done wrong? And does it matter if the template files I edited weren't the subSilver templates, or does it have to be subSilver for it to work?

Thankyou in advance. :)
"We are the music-makers
& we
are the dreamers of dreams." - Arthur O'Shaughnessy

Zoombini
Registered User
Posts: 128
Joined: Fri Apr 04, 2003 6:51 pm
Location: In front of my PC.

Post by Zoombini » Wed Nov 12, 2003 4:07 pm

morpheus2matrix wrote:
Zoombini wrote: However, how can it be made so that only Admin & Supermoderators group have access to change the title text?


Un-done the changes you've made in usercp_register.php and profile_add_body.tpl


So you are saying that If I put the backups of these 2 files back or just remove those files changes then the users will not be able to access the custom title field, but Admins will be able to.

OK I will try that then thankyou.
No longer bothering with forums.
Too much hassle.

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix » Wed Nov 12, 2003 6:38 pm

Zoombini wrote: So you are saying that If I put the backups of these 2 files back or just remove those files changes then the users will not be able to access the custom title field, but Admins will be able to.


yes, that's why i was saying
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

gigantus
Registered User
Posts: 4
Joined: Wed Nov 12, 2003 1:53 pm

Post by gigantus » Thu Nov 13, 2003 12:52 am

i still cant find it :oops:

is it the one that says special rank assigned

Aexoden
Registered User
Posts: 364
Joined: Mon Jan 14, 2002 1:18 am
Location: Medical Lake, WA
Name: Jason Lynch
Contact:

Post by Aexoden » Thu Nov 13, 2003 4:52 am

varda elentari wrote: Hi Aexoden, I'm not sure if this is the same problem as Tracey's but I tried installing title_install.php and ran the file. Nothing worked, and I received errors messages, so I deleted it and re-installed it again. I still got errors:
Those are some strange errors that I've never seen. For some reason, your server is just printing off the text instead of running the script? I hate to ask the stupid question, but are you running this from your web browser? Does phpBB work at all? Just trying to get an idea...

gigantus: If the MOD is installed properly, two different areas will become accessible in the admin panel. The first is under General Admin->Configuration. Somewhere, there should be a section called "Custom Title Settings". If there isn't, this indicates a problem with the modification of either admin_board.php or board_config_body.tpl

The second is under User Admin->Management, where you select a user and then you can edit their title and what their title status is. This not appearing would be a problem with admin_users.php or user_edit_body.tpl.

gigantus
Registered User
Posts: 4
Joined: Wed Nov 12, 2003 1:53 pm

Post by gigantus » Thu Nov 13, 2003 8:51 am

:oops:

i uploaded the admin thingy into the wrong folder

my bad

now the mod works like a charm

:)

Zoombini
Registered User
Posts: 128
Joined: Fri Apr 04, 2003 6:51 pm
Location: In front of my PC.

Post by Zoombini » Thu Nov 13, 2003 1:02 pm

Making it so that users cannot access thier custom title, as instructed above worked like a charm,

I'd suggest that as an option in the install as I can see more not wanting users to be able to access the title.

Thankyou.
No longer bothering with forums.
Too much hassle.

DarkSquall
Registered User
Posts: 53
Joined: Wed Nov 12, 2003 1:06 pm
Contact:

Post by DarkSquall » Fri Nov 14, 2003 2:00 am

I just installed this mod, with no problems..well, one!!

It has done absolutely nothing to my site, cant find the bit in the admin panel nor in the users profile there is no bit for the user to choose a custom name..

Any ideas people??

P.S. Title_Install worked fine..and there is no visible chnages/errors on my site.

Cheers

gigantus
Registered User
Posts: 4
Joined: Wed Nov 12, 2003 1:53 pm

Post by gigantus » Fri Nov 14, 2003 5:20 am

did you upload the admin/ files to the right folder

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix » Fri Nov 14, 2003 5:53 pm

DarkSquall wrote: It has done absolutely nothing to my site, cant find the bit in the admin panel nor in the users profile there is no bit for the user to choose a custom name..



have you check your modifications in admin_users.php and admin_edit_users.tpl ?
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

Post Reply

Return to “[2.0.x] MOD Database Cleanup”