[ABD] Custom Title MOD

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
spacefish
Registered User
Posts: 173
Joined: Mon Oct 09, 2006 8:48 am

Re: [BETA] Custom Title MOD

Post by spacefish »

A small typo in "adm/style/acp_users_profile.html"

The change there should be:

Code: Select all

	</dl>
	<dl>
		<dt><label for="custom_title">{L_CUSTOM_TITLE}:</label></dt>
		<dd><input type="text" id="custom_title" name="custom_title" value="{CUSTOM_TITLE}" /></dd>
Not:

Code: Select all

	</dl>
	<dl>
		<dt><label for="custom_title">{L_CUSTOM_TITLE}:</label></dt>
		<dd><input type="text" id="custom_title" value="{CUSTOM_TITLE}" /></dd>
Else the custom title doesn't make it into the db from ACP.

And a suggestion for user-friendliness - could the code changes be more in keeping with or less invasive to the existing code. Sorry, I wasn't quite sure how to phrase that so using the code above as an example, if we could instead find eg:

Code: Select all

		<dd><textarea id="interests" name="interests" rows="3" cols="30">{INTERESTS}</textarea></dd>
	</dl>
Add after:

Code: Select all

	<dl>
		<dt><label for="custom_title">{L_CUSTOM_TITLE}:</label></dt>
		<dd><input type="text" id="custom_title" name="custom_title" value="{CUSTOM_TITLE}" /></dd>
	</dl>
Or in: includes/acp/acp_board.php
Find:

Code: Select all

						'max_sig_img_height'	=> array('lang' => 'MAX_SIG_IMG_HEIGHT',	'validate' => 'int:0',	'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),

						'legend3'					=> 'ACP_SUBMIT_CHANGES',
					)
				);
			break;
Add after:

Code: Select all

			case 'custom_title':
				$display_vars = array(
					'title'	=> 'ACP_CUSTOM_TITLE_SETTINGS',
					'vars'	=> array(
						'legend1'					=> 'GENERAL_SETTINGS',
						'custom_title_mode'			=> array('lang' => 'CUSTOM_TITLE_MODE',			'validate' => 'int',	'type' => 'custom', 'method' => 'select_custom_title_mode', 'explain' => true),
						'custom_title_days'			=> array('lang' => 'CUSTOM_TITLE_DAYS',			'validate' => 'int', 	'type' => 'text:5:4', 'explain' => false),
						'custom_title_posts'		=> array('lang' => 'CUSTOM_TITLE_POSTS',		'validate' => 'int',	'type' => 'text:5:4', 'explain' => false),
						'custom_title_maxlength'	=> array('lang'	=> 'CUSTOM_TITLE_MAXLENGTH',	'validate' => 'int', 	'type' => 'text:5:4', 'explain' => true),
					)
				);
			break;
Maybe it's just me (yes I do everything manually), but it would be easier to make the file edits and to make future upgrades for core and MOD code changes easier too.

Otherwise, thanks for picking this up again! :)
User avatar
spacefish
Registered User
Posts: 173
Joined: Mon Oct 09, 2006 8:48 am

Re: [BETA] Custom Title MOD

Post by spacefish »

I also got the following debug info when sending a PM to a user who didn't have a custom title.
neo4u wrote:ok enabled debug in the cofig.php and got this:

Code: Select all

[phpBB Debug] PHP Notice: in file /includes/ucp/ucp_pm_viewmessage.php on line 179: Undefined index: custom_title
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3865: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3208)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3867: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3208)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3868: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3208)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3869: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3208)

In includes/ucp/ucp_pm_viewmessage.php changing this:

Code: Select all

		'CUSTOM_TITLE'		=> $user_info['custom_title'],
to this:

Code: Select all

		'CUSTOM_TITLE'		=> (isset($user_info['custom_title'])) ? $user_info['custom_title'] : '',
Removed the error - but I'm not sure if it should be isset or !empty. :)
Aexoden
Registered User
Posts: 364
Joined: Mon Jan 14, 2002 1:18 am
Location: Medical Lake, WA
Name: Jason Lynch
Contact:

Re: [BETA] Custom Title MOD

Post by Aexoden »

spacefish wrote:A small typo in "adm/style/acp_users_profile.html"
Thanks. I've fixed it and it'll make it into the next release (maybe this week).
spacefish wrote:And a suggestion for user-friendliness - could the code changes be more in keeping with or less invasive to the existing code.
Assuming I'm understanding you correctly, the problem is that the finds are now automatically generated by the MODX generator. I suppose I could go through them and clean them up slightly, but I almost want to actively discourage manual installations for most users (just because the same bad installation-related problems kept cropping up), and it would make it much harder for me to maintain. I'll think about it, but it might be better to get the MODX Generator to be smarter about that kind of thing.

As far as the PM thing goes, it'll only show up if you have the debug options enabled (which explains why I never saw it--guess I should enable those), but I'll put in a fix for that too. I'd probably go with isset over !empty (though I don't think it will matter in this case), but my actual fix might be a little different.
User avatar
Tophon
Registered User
Posts: 214
Joined: Wed Oct 22, 2008 12:19 am
Contact:

Re: [BETA] Custom Title MOD

Post by Tophon »

Aexoden, great mod, but on clicking 'The Team' link at the bottom of prosilver, now gives this error? Any ideas?

Code: Select all

General Error
SQL ERROR [ mysql4 ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM (phpbb_users u, phpbb_groups g) LEFT JOIN phpbb_user_group ug ON (ug.group_' at line 1 [1064]

SQL

SELECT u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_rank, u.user_posts, u.user_allow_pm, u.user_mood, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id, u.user_custom_title, FROM (phpbb_users u, phpbb_groups g) LEFT JOIN phpbb_user_group ug ON (ug.group_id = g.group_id AND ug.user_pending = 0 AND ug.user_id = 2) WHERE u.user_id IN (53, 193, 2, 61, 139, 173, 64) AND u.group_id = g.group_id ORDER BY g.group_name ASC, u.username_clean ASC

BACKTRACE

FILE: includes/db/mysql.php
LINE: 174
CALL: dbal->sql_error()

FILE: memberlist.php
LINE: 181
CALL: dbal_mysql->sql_query()
Aexoden
Registered User
Posts: 364
Joined: Mon Jan 14, 2002 1:18 am
Location: Medical Lake, WA
Name: Jason Lynch
Contact:

Re: [BETA] Custom Title MOD

Post by Aexoden »

Tophon wrote:Aexoden, great mod, but on clicking 'The Team' link at the bottom of prosilver, now gives this error? Any ideas?
Was this installation done manually or using AutoMOD? (If it's AutoMOD, there's a big problem.)

Otherwise, it looks like the SQL query in memberlist.php was modified incorrectly. Otherwise, go to approximately like 155 of memberlist.php (the exact line will vary depending on the MODs you have installed), and look for the line that starts with:

Code: Select all

'SELECT'        => 'u.user_id, u.group_id as default_group, u.username, u.username_clean
At the end of that line, you'll probably see something like

Code: Select all

u.user_custom_title,'
You could simply delete the comma there, which should fix the error. (It may make future upgrades more difficult, but I doubt it. The worst case is having to completely remodify the line from scratch. You could do that now to save yourself the potential headache later, but again, it's probably easier to just delete the comma.)

If that doesn't work, let me know. I just got up and am not at home so my brain's probably only working at half speed.

(By the way, to anyone who is interested, I was slightly delayed on the next beta to fix those outstanding bugs. Depending on how long I spend on testing the upgrade process, I'd like to get the release out in a few days. We'll see.)
Last edited by Aexoden on Tue Jun 22, 2010 6:18 pm, edited 1 time in total.
User avatar
Tophon
Registered User
Posts: 214
Joined: Wed Oct 22, 2008 12:19 am
Contact:

Re: [BETA] Custom Title MOD

Post by Tophon »

Thanks Aexoden, it was indeed the extra comma causing the issue.

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

Re: [BETA] Custom Title MOD

Post by Aexoden »

I have released version 2.0.0-b4 which fixes the two bugs spacefish reported a couple of weeks ago (in theory). As usual, testing is appreciated.

I have noticed a small issue that will need to be corrected, but it only affects the display of text in the UMIL installer file, so I've left it alone for now, as I only noticed after I'd already rolled the zip file. It doesn't affect anything important.

Upgrading manually is very easy, as there are only two changes that need to be made, and upgrade instructions are included. (You can optionally upload and run the install_custom_title_mod.php as well, but it doesn't make any changes to the database other than changing the installed version number.)

Upgrading with AutoMOD is also possible, but since AutoMOD seems to completely ignore the changes if you merely upload a new zip file, it's more difficult than it needs to be. Figuring this out more robustly for the final release would be a good thing.

I am considering dropping support for upgrading from the betas for the eventual final release, simply because maintaining them is becoming increasingly complicated, and users of beta software should expect to have to occasionally fix things up manually. The unusually lengthy beta cycle makes this more problematic, however. Comments are appreciated, in any case.
User avatar
Ashley.S.
Registered User
Posts: 469
Joined: Mon Aug 04, 2008 6:01 pm
Location: Falmouth, Cornwall, UK
Name: Ashley .S.
Contact:

Re: [BETA] Custom Title MOD

Post by Ashley.S. »

keep up the great work Aexoden, this really is a great mod! Can't wait to see it in the MODDB 8-)
Regards,
-Ashley.S. [ PurephpBB Founder ]
merfed
Registered User
Posts: 25
Joined: Sat Jul 10, 2010 12:05 pm

Re: [BETA] Custom Title MOD

Post by merfed »

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

Re: [BETA] Custom Title MOD

Post by Aexoden »

merfed wrote:Will the Parse BBCode in Custom Profile Fields work for this?
It doesn't seem like it, at least out of the box. It's unlikely I'm ever going to add BBCode support directly to this MOD, though I suppose it would depend on how difficult it would be to make useful and non-annoying. (You almost certainly wouldn't want users using flash BBCodes in their titles.)

Meanwhile, I haven't heard about any new bugs, so if I find a free minute or two, I may attempt to submit this to the MOD database as it is. I still need to look at my todo list, but I think everything is minor. However, I'm in the process of moving quite a distance, so finding that free minute for the next few weeks may prove difficult. We'll see.
Aexoden
Registered User
Posts: 364
Joined: Mon Jan 14, 2002 1:18 am
Location: Medical Lake, WA
Name: Jason Lynch
Contact:

Re: [RC] Custom Title MOD

Post by Aexoden »

I have finally released version 2.0.0-rc1 of the Custom Title MOD. There are no significant changes from the previous beta. In fact, the only changes affect installation and documentation. Given there have been two months without a bug report, I have moved to release candidate status. If no new bugs pop up within the next couple of weeks, I will consider this version final.

Again, please report any bugs you may find, but only if they are reproducible with an AutoMOD installation.
SuperFedya
Registered User
Posts: 253
Joined: Sun Jul 14, 2002 9:14 pm
Contact:

Re: [RC] Custom Title MOD

Post by SuperFedya »

Debug mode:

Code: Select all

[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1751: Undefined index: custom_title
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1751: Undefined index: custom_title
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1751: Undefined index: custom_title
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1751: Undefined index: custom_title
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1751: Undefined index: custom_title
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4448: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3546)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4450: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3546)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4451: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3546)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4452: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3546)
viewtopic.php line 1751:

Code: Select all

'CUSTOM_TITLE'		=> $user_cache[$poster_id]['custom_title'],	
User avatar
PCGUY112887
Registered User
Posts: 502
Joined: Thu Apr 01, 2004 12:39 am
Location: Illinois
Contact:

Re: [RC] Custom Title MOD

Post by PCGUY112887 »

Bump...

Will this ever be validated?
Sev12
Registered User
Posts: 55
Joined: Tue Sep 21, 2010 1:31 pm

Re: [RC] Custom Title MOD

Post by Sev12 »

I really love this Mod, its really excellent! Will this be ever validated?

also, i want to make so that my users wont be able to set custom message untill they read 100 Posts, where do i change this?
Aexoden
Registered User
Posts: 364
Joined: Mon Jan 14, 2002 1:18 am
Location: Medical Lake, WA
Name: Jason Lynch
Contact:

Re: [RC] Custom Title MOD

Post by Aexoden »

Sev12 wrote:I really love this Mod, its really excellent! Will this be ever validated?

also, i want to make so that my users wont be able to set custom message untill they read 100 Posts, where do i change this?
Perhaps if I ever get unlazy enough to submit it. (Which requires going through the packaging process again to bump the version, and it's more tedious than I'd like.) Every time I think about doing it, I then think that 3.1 will be here eventually anyway, and the MOD will probably not be compatible with that.

There's no way to control users editing their title based on the number of posts they've read. I don't think phpBB keeps track of such a thing in any case. You can, however, control the required number of posts they write, in the admin panel under "Custom title settings" under "Board Configuration", assuming everything was installed correctly.
Locked

Return to “[3.0.x] Abandoned MODs”