[ABD] [3.1] [pre]fixed - Topic Prefixes extension

Any abandoned Extensions will be moved to this forum.

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

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
Locked
User avatar
imkingdavid
Former Team Member
Posts: 2673
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

[ABD] [3.1] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

Image
Topic Prefixes for phpBB 3.1

This extension aims to add topic prefix functionality to phpBB 3.1 boards.

Important notes:
  • This extension requires PHP 5.4 or greater. It will NOT work on 5.3 or below. This is due mainly to some new syntax features as well as a new data type I am using. Specifically, for the techies reading this, I am using traits as well as the new array syntax ([1,2,3] instead of array(1,2,3)). These are not backward compatible and will cause errors on any server using a version of PHP that is less than 5.4.
  • Do NOT use this on a live board. I provide limited support for BETA extensions, but cannot be held liable for anything that goes wrong because of this extension.
You can download the code and follow development at my GitHub repository. If you wish to contribute you are welcome to fork my repository, make a topic branch, commit your changes, and submit a pull request.

Please provide feature requests, functionality suggestions, etc. in this topic. While I do want to cater to those who will be using this extension, I am trying to keep it fairly lightweight. I am adding events, along with documentation for making your own extension use or extend mine.

Planned Features:
(Note: not all of these are necessarily complete, but they are planned for the first release, unless any are not yet possible due to limitations in phpBB core).
  • Manage topic prefixes in the ACP
  • Restrict prefixes to certain forums and for use by certain users or groups
  • Multiple prefixes may be applied to a single topic
  • Standard and custom BBCode is allowed for styling prefixes
  • Tokens can be used for dynamic prefixes (e.g. {POSTER} for username of poster, {DATE} for the date/time the prefix was added). Tokens may be added by other extensions, or may be requested for core inclusion.
  • Prefixes show in many locations across the board (viewforum, viewtopic, search, mcp). The list of locations will expand as the necessary template and PHP events are included into the phpBB codebase.
  • Click on a prefix in viewforum to filter on topics that have that prefix
Last edited by imkingdavid on Wed Sep 21, 2016 2:49 pm, edited 5 times in total.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
User avatar
Patrick W.
Registered User
Posts: 110
Joined: Wed Sep 26, 2007 9:02 pm

Re: [DEV] [pre]fixed - Topic Prefixes extension

Post by Patrick W. »

I am happy to see this in development already! I have installed it as a test for installing extensions and it went smoothly. Looking forward to the front and back end management pages to be completed and added.

One quick question, and I probably missed it in your OP, but will they show like the TMM did? And if you are taking feature requests;

I would like to see the option to add multiple prefixes to a single topic. I have been in the situation in the past where I need 2 or more prefixes for a single topic. If that can be added, great. If not, I understand as well. :)
Always use the Support Board for phpBB support. One PM answers one. One post answers many.
User avatar
imkingdavid
Former Team Member
Posts: 2673
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [DEV] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

Thanks for the response! I'll try to post here periodically as changes are made, but keep in mind that I work on this in my free time so it may be a little while. :)
One quick question, and I probably missed it in your OP, but will they show like the TMM did?
I'm not sure I understand the question. Do you mean show up the same on viewtopic? In any case, I am hoping to make this extension compatible with the prefixes that have already been made by TMM.
And if you are taking feature requests;
Sure thing, as long as it's reasonable.
I would like to see the option to add multiple prefixes to a single topic. I have been in the situation in the past where I need 2 or more prefixes for a single topic. If that can be added, great. If not, I understand as well. :)
Yes, just like with the current implementation in TMM, you will be able to select multiple prefixes for a single topic. I also plan to add the ability to sort and filter/search by prefix as well, though that might not make the first version.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
User avatar
Patrick W.
Registered User
Posts: 110
Joined: Wed Sep 26, 2007 9:02 pm

Re: [DEV] [pre]fixed - Topic Prefixes extension

Post by Patrick W. »

Thanks David. I misspoke in my previous post. The mod that I had been using was the Topic Prefix MOD. Sorry. :oops:

I am looking forward to the next development stage for this extension. :)
Always use the Support Board for phpBB support. One PM answers one. One post answers many.
User avatar
imkingdavid
Former Team Member
Posts: 2673
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [DEV] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

Hey, no problem. :) Thanks for the comments!
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
User avatar
tbackoff
Former Team Member
Posts: 7068
Joined: Thu Jun 04, 2009 1:41 am
Location: cheerleading practice
Name: Tabitha Backoff

Re: [DEV] [pre]fixed - Topic Prefixes extension

Post by tbackoff »

How about allowing only certain prefixes in forums, and which users can use which prefixes? I'm thinking, of course, along the lines of what QTE does (very large MOD :lol: ).
Flying is the second best thrill to cheerleaders; being caught is the first.
User avatar
imkingdavid
Former Team Member
Posts: 2673
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [DEV] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

Of course, that's already a feature in TMM and will be carried over. I'm not sure what QTE is, much less how it handles it, but what I have in mind is simple textboxes that will have a list of forum IDs, group IDs, and user IDs that can use the prefix.

EDIT: To clarify, that will likely be the extent of it for the initial version. Having a select list for forums and some autocomplete for usernamess and groups would be a great addition once I have a functioning version 1.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
User avatar
imkingdavid
Former Team Member
Posts: 2673
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [DEV] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

Just bumping with an update: today I was able to get a bit of work done on the "token" feature, making it extensible for other extensions to be able to add new tokens. Basically, you're able to put {USERNAME} (and a few others) in the prefix and it will be replaced when the prefix is added to a topic with the username of the person who applied the prefix. The other tokens currently available (but as of yet untested, this is all theory work right now) are {POSTER}, which is the username of the topic poster (mostly useless, imo, but it's something), and {DATE}, which is the date the prefix was applied. The latter can be provided an optional, specific date format in the form of {DATE|m/d/Y} following the formatting rules of the PHP date() function. The default is m/d/Y which translates to mm/dd/yyyy.

Another change is that instead of using raw CSS, I'm going to allow BBCode to be used in prefixes. That makes it easier for me to handle on the backend, and makes it more familiar for novice administrators who would be completely lost trying to add raw CSS. This change has not yet been fully implemented, but I've got it somewhat working.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
User avatar
imkingdavid
Former Team Member
Posts: 2673
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [DEV] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

As an update, I have implemented a jQuery UI Sortable/Draggable interface onto the posting screen, and adding/removing prefixes to/from topics now works (very basic testing has been done, more would be great if you don't mind). Note that you have to be posting a new topic or editing the first post of a topic in order to see the prefixes.

If anyone would be willing to make it look prettier, I'd greatly appreciate the help. I'm no designer so right now it looks a little bit ugly. Just fork my repository, make a topic branch, commit your changes, and send a pull request my way and I'll take a look. Any contributors will get their name in the credits.

I have not yet worked out allowing you to re-order the prefixes once they've been applied. Since it's in a sortable/draggable it shouldn't be too hard to just update the order each time the form is submitted, I'll have a look at it and let you know when that's done.

NOTE: I have decided that the posting interface on this extension will REQUIRE JavaScript to be enabled. There will NOT be a fallback for those browsing without JavaScript. Sorry for any inconvenience.

EDIT: I may have spoken too soon. It looks like there are some bugs when applying prefixes to a topic that I'll need to fix.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
User avatar
imkingdavid
Former Team Member
Posts: 2673
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [DEV] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

Alright, I just pushed a fix that allows you to re-order the individual prefixes applied to a topic, and adding/removing prefixes works better now as well. If you're willing to test, let me know if you see any major issues.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
User avatar
tbackoff
Former Team Member
Posts: 7068
Joined: Thu Jun 04, 2009 1:41 am
Location: cheerleading practice
Name: Tabitha Backoff

Re: [DEV] [pre]fixed - Topic Prefixes extension

Post by tbackoff »

I'll be testing later today! :)
Flying is the second best thrill to cheerleaders; being caught is the first.
User avatar
imkingdavid
Former Team Member
Posts: 2673
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [DEV] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

Thanks, I appreciate any feedback!

I have created several "tokens" that can be used in prefixes. So far I have only tested the {USERNAME} one, but they are as follows:
  • {USERNAME} - The username of the user that applied the prefix
  • {DATE} - The date the prefix was applied (format defaults to m/d/Y - see PHP date() reference)
  • {DATE|m/d/Y} - The date the prefix was applied, using a custom format
  • {POSTER} - The username of the topic poster (I'm not sure how practical this one is but it's there if needed)
If you don't mind testing those, that'd be great, and let me know if you can think of other peices of data that would be good as a token.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
User avatar
watisnf.nl
Registered User
Posts: 607
Joined: Sat Mar 13, 2010 12:53 pm
Location: The Netherlands
Name: David
Contact:

Re: [DEV] [pre]fixed - Topic Prefixes extension

Post by watisnf.nl »

I'm testing this for testing purposes only, I want to get to know the Extentions. When I open a new topic I can see the option Topic prefixes: besides that I see two blue squares, I don't see a drop down menu or selecting box or something like that. What can be the problem?

Another note, when I installed another Extention... I got the modules in the ACP automatically. With you Extention I had to add it manually. It might be a idea, to add them automatically.
Dutch Translator | Looking for, Dutch extensions translations
User avatar
imkingdavid
Former Team Member
Posts: 2673
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: [DEV] [pre]fixed - Topic Prefixes extension

Post by imkingdavid »

The ACP modules should appear automatically. I'll test a new installation and make sure it's working. Just to be sure, you looked in the Posting tab in the ACP, right?

Regarding the two blue squares, when you create a prefix in the ACP, and add the allowed forum and user or group IDs on the prefix form, you will see that prefix in the blue box on the left. To add it to the topic, drag it into the blue box on the right.

As I've mentioned before, that styling is not great. It's suitable for testing purposes but I'm hoping to have something better in the final release.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
User avatar
watisnf.nl
Registered User
Posts: 607
Joined: Sat Mar 13, 2010 12:53 pm
Location: The Netherlands
Name: David
Contact:

Re: [DEV] [pre]fixed - Topic Prefixes extension

Post by watisnf.nl »

Sorry my mistake, I didn't look at the posting tab only at the .Mod tab :oops: It was under the posting tab, thanks for the fast response.

Edit:

Well I have it working now, but I can't add a prefix on a new topic. I can only add a prefix to existing topic.
Dutch Translator | Looking for, Dutch extensions translations
Locked

Return to “Abandoned Extensions”