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

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Suggested Hosts
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
Post Reply
User avatar
imkingdavid
Former Team Member
Posts: 2664
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King
Contact:

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

Post by imkingdavid » Thu Nov 07, 2013 5:44 pm

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.
Remember, the enemy's gate is down.

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. » Fri Nov 08, 2013 1:56 am

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: 2664
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King
Contact:

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

Post by imkingdavid » Fri Nov 08, 2013 3:06 am

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.
Remember, the enemy's gate is down.

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. » Sat Nov 09, 2013 2:18 am

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: 2664
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King
Contact:

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

Post by imkingdavid » Sat Nov 09, 2013 3:33 am

Hey, no problem. :) Thanks for the comments!
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

User avatar
tmbackoff
Former Team Member
Posts: 6996
Joined: Thu Jun 04, 2009 1:41 am
Location: cheerleading practice
Name: Tabitha Backoff

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

Post by tmbackoff » Sat Nov 09, 2013 4:52 am

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: ).

User avatar
imkingdavid
Former Team Member
Posts: 2664
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King
Contact:

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

Post by imkingdavid » Sat Nov 09, 2013 5:30 am

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.
Remember, the enemy's gate is down.

User avatar
imkingdavid
Former Team Member
Posts: 2664
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King
Contact:

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

Post by imkingdavid » Sat Nov 09, 2013 8:15 am

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.
Remember, the enemy's gate is down.

User avatar
imkingdavid
Former Team Member
Posts: 2664
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King
Contact:

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

Post by imkingdavid » Fri Nov 29, 2013 6:24 pm

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.
Remember, the enemy's gate is down.

User avatar
imkingdavid
Former Team Member
Posts: 2664
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King
Contact:

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

Post by imkingdavid » Sat Nov 30, 2013 5:59 am

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.
Remember, the enemy's gate is down.

User avatar
tmbackoff
Former Team Member
Posts: 6996
Joined: Thu Jun 04, 2009 1:41 am
Location: cheerleading practice
Name: Tabitha Backoff

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

Post by tmbackoff » Sat Nov 30, 2013 10:05 am

I'll be testing later today! :)

User avatar
imkingdavid
Former Team Member
Posts: 2664
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King
Contact:

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

Post by imkingdavid » Sat Nov 30, 2013 5:10 pm

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.
Remember, the enemy's gate is down.

User avatar
watisnf.nl
Registered User
Posts: 605
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 » Sat Nov 30, 2013 6:35 pm

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: 2664
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King
Contact:

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

Post by imkingdavid » Sat Nov 30, 2013 6:47 pm

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.
Remember, the enemy's gate is down.

User avatar
watisnf.nl
Registered User
Posts: 605
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 » Sat Nov 30, 2013 6:56 pm

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

Post Reply

Return to “Extensions in Development”

Who is online

Users browsing this forum: oBot, rxu, Steve, Татьяна5 and 30 guests