ElkArte Community

Extending Elk => Addons => Topic started by: emanuele on May 15, 2014, 12:06:12 am

Title: [ADDON][beta] Topic Prefix
Post by: emanuele on May 15, 2014, 12:06:12 am
Topic Prefixes v0.0.3
Introduction
This addons introduces (guess what?) the topic prefixes feature.
Each topic can be "tagged" with a prefix that will be displayed next to the subject of the topic in several places around the forum.
The admin can create new prefixes and can apply custom styles to them (there is a simple web-interface for that, but it works only for the default theme of the board, and only if the "custom.css" file is present in the root of the theme).

The current version (v0.0.3) is still a beta, some things are not yet implemented (permissions) and others may be broken.

Currently working features are:
* adding/modifying prefixes to a topic
* showing prefixes in some places (MessageIndex and Display)
* list of topics with a certain prefix
* list of prefixes present in a certain board (above the list of messages)
* filter topics in a board by prefix (based on the list of prefixes in the board)
* admin interface to actually create and edit prefixes

Missing for first release:
* list of all prefixes (I'm working on that)
* permissions
* show prefixes "everywhere"

Future plans:
* multiple prefixes per topic
* merge with tags addon with a switch to decide if a tag is a prefix or a tag or something like that?
* any suggestion that would come up in the topic

If you are comfortable with development you are welcome to give your contribution! (In that case feel free to adapt the headers of the files accordingly.)

The repo is here at the moment:
https://github.com/emanuele45/TopicPrefix


License
o This ElkArte Addon is subject to the terms of the BSD "3-clause" license. You can obtain a copy of the License at http://opensource.org/licenses/BSD-3-Clause

Repository / Download
Title: Re: [ADDON][W.I.P.] Topic Prefix
Post by: Allan on May 15, 2014, 12:41:42 am
Great work, would there be a way to style the prefixes from the acp.
Title: Re: [ADDON][W.I.P.] Topic Prefix
Post by: meetdilip on May 15, 2014, 07:48:13 am
This deserves a like  8)
Title: Re: [ADDON][W.I.P.] Topic Prefix
Post by: emanuele on May 15, 2014, 08:40:47 am
Great work, would there be a way to style the prefixes from the acp.
I'm not yet sure.
TBH, I still have to find a proper way to solve the "theming issue" on any addon. The main problem I have in mind, is that I'd have to:
It looks like a lot of stuff to deal with for the users that want to style their own theme.

TL;DR: tes, I would do it, though "in a while".
At the moment the addon relies on an external css (rather simple for the start), and I think custom.css can be modified using the theme editor (even if the file doesn't exist? hmm... that may be a sort of bug, to be tracked.)
Title: Re: [ADDON][W.I.P.] Topic Prefix
Post by: Allan on May 15, 2014, 04:34:03 pm
TL;DR: tes, I would do it, though "in a while".
At the moment the addon relies on an external css (rather simple for the start), and I think custom.css can be modified using the theme editor (even if the file doesn't exist? hmm... that may be a sort of bug, to be tracked.)

Even being able to custom in css is great. This way user could add colors, borders, images to fit there needs.
Title: Re: [ADDON][W.I.P.] Topic Prefix
Post by: emanuele on November 10, 2014, 11:57:17 pm
First beta released. :D

The code is still messy and some features are missing, though if anyone has some time for testing it out and see what I missed as usual would be great! ;D
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on November 11, 2014, 08:24:26 am
I get an error when I try to install it

10.   Estrai File   ./themes/default/scripts/TopicPrefix.js   Errore durante il parsing della modifica

after click to continue

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 'NOT NULL auto_increment,
`prefix` varchar(30) NOT NULL default '',
`id_boards`' at line 3
File: ******sources/database/DbTable-mysql.php
Riga: 174

Nota: la versione del tuo database è 1.0.1.
Title: Re: [ADDON][beta] Topic Prefix
Post by: emanuele on November 11, 2014, 09:36:15 am
And I even wrote the package-info yesterday night...
I also likely forgot to add the tables to the install.

Big fail. :-[
Title: Re: [ADDON][beta] Topic Prefix
Post by: emanuele on November 11, 2014, 12:04:02 pm
Updated the package with the fixes and a couple of new features. ;D
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on November 14, 2014, 10:09:13 am
I just test it, but when I click filter I get double prefix. I attach an image

maybe is my installation which was first broken, I'll try on a fresh install
Title: Re: [ADDON][beta] Topic Prefix
Post by: emanuele on November 14, 2014, 11:25:35 am
At least is works! :P LOL

Interesting, I have to figure out how it is possible...
Title: Re: [ADDON][beta] Topic Prefix
Post by: emanuele on January 25, 2015, 10:30:08 pm
Some screeshots of the admin panel.
You can also see the "style picker" in a javascript/ajax-like version with a "live preview" of the result.
The main listing (screen_352) actually is not yet really in the final version, the "edit" buttons should disappear or become "advanced", I'm not yet sure.
Title: Re: [ADDON][beta] Topic Prefix
Post by: meetdilip on January 25, 2015, 10:37:09 pm
Cool !
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 25, 2015, 11:54:29 pm
I'll sure test this addon, thanks Emanuele!
Title: Re: [ADDON][beta] Topic Prefix
Post by: Mstcool on January 26, 2015, 04:32:25 am
Yo, why don't yall add this mod to this support sit? It'll make it easier for yall to know whether a support topic is solved or not. ;P
Title: Re: [ADDON][beta] Topic Prefix
Post by: emanuele on January 26, 2015, 08:33:14 pm
There is also a "mark solved" addon as well. :D

It would be cool a "right answer" (question&answer-like) addon. O:-)
Title: Re: [ADDON][beta] Topic Prefix
Post by: Mstcool on January 27, 2015, 02:10:11 pm
But a mark solved is soo mainstream. Make it something unique ;p

Oh, yeah, you can make it right answer. But it depends on who can mark it as a right answer because everyone's gonna mark their own threads as a right answer, whether it is right or no. :P
Title: Re: [ADDON][beta] Topic Prefix
Post by: emanuele on January 27, 2015, 02:26:18 pm
I think the biggest challenge with the "right answer" is that frequently it's not a single answer the "right one", but a combination of multiple... :-\
Title: Re: [ADDON][beta] Topic Prefix
Post by: Mstcool on January 28, 2015, 09:55:16 am
Omg, a cool thing would be that with every post, there is a button called "right answer" or something like that. And when you click on it, it adds that exact post (as a quote) into one main post. So the one main post can have all the combinations of right answers, in one answer. But wouldn't this feature be hard to implement?
Title: Re: [ADDON][beta] Topic Prefix
Post by: emanuele on January 31, 2015, 12:42:37 am
Yep, that could be idea too.
It wouldn't be much more difficult than a single answer, it may make the first post (or the corresponding area) a bit long depending on how many answers are picked. lol

A kind of more flexible solution, could be to pick one answer and then make that a sort of "wiki-article" where people can extend and improve it (well nothing too new because I think stackoverflow works somehow like that).
Title: Re: [ADDON][beta] Topic Prefix
Post by: Mstcool on January 31, 2015, 01:27:02 pm
Yep, that could be idea too.
It wouldn't be much more difficult than a single answer, it may make the first post (or the corresponding area) a bit long depending on how many answers are picked. lol

A kind of more flexible solution, could be to pick one answer and then make that a sort of "wiki-article" where people can extend and improve it (well nothing too new because I think stackoverflow works somehow like that).

So like a best answer kinda thing? In which you allow people to edit. :P
Title: Re: [ADDON][beta] Topic Prefix
Post by: emanuele on January 31, 2015, 02:12:19 pm
Yep.
Of course with tracked changes.

/me thinks it's about time to split the topic. :P
Title: Re: [ADDON][beta] Topic Prefix
Post by: Mstcool on January 31, 2015, 03:41:08 pm
Oh, Ok. That's cool :P
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 05, 2017, 08:34:43 pm
Some screeshots of the admin panel.
You can also see the "style picker" in a javascript/ajax-like version with a "live preview" of the result.
The main listing (screen_352) actually is not yet really in the final version, the "edit" buttons should disappear or become "advanced", I'm not yet sure.
Emanuele will you release this version? Last time I installed this addon it was different from the screenshots you published
Title: Re: [ADDON][beta] Topic Prefix
Post by: emanuele on January 06, 2017, 12:03:53 am
Pretty awesome! (If I'm allowed to say something like this to myself LOL)
If you download the "master" from github (the green button "clone or download" here (https://github.com/emanuele45/TopicPrefix) and then "download") should have all that admin panel.
TBH I'm not sure any more why I didn't pack it, so it may have bugz!... well, even the other may have pretty awesome bugs, so it doesn't really matter that much I guess. lol
Title: Re: [ADDON][beta] Topic Prefix
Post by: Jorin on January 06, 2017, 07:30:58 am
Will there ever be a bug free version?  ;)

@radu81: Did you experienced any problems with this addon?

Edit: Is it possible to move the "filter by prefix"-list in the theme, so it will be part of the standard filter list of the topic, where I can filter by topic name, date, author, etc.?
Title: Re: [ADDON][beta] Topic Prefix
Post by: Jorin on January 06, 2017, 08:22:09 am
Found a few bugs already!  :D

When I define the css of a prefix in the admin section the changed prefix is copied, I have two with the same name now, but the CSS change (I changed the background-color) is not shown anywhere.

And when I change the boards the prefix is shown in, the prefix is copied too!

And where can I delete the double (false) prefix? No option for that. De-selecting all boards the prefix is shown in leads to an error message.  :o

And: In one board the buttons have no background and border, in another board they have (in boardindex).

Since the installation of the addon I can't use the quick edit anymore. I can quickedit a post, but I can't save it then. Nothings happening when I click on "save", the editor is still shown, the edit is not saved.

Conclusion: It seems every change in the prefixes (no matter what changes) copies them. Plus there are design flaws and quickedit isn't functioning anymore!  :o  >:(

I have to deinstall the addon...  :(
Title: Re: [ADDON][beta] Topic Prefix
Post by: emanuele on January 06, 2017, 11:51:12 am
Ohh... that may be the reason I didn't make a release with this new interface... :-[
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 06, 2017, 12:02:33 pm
Will there ever be a bug free version?  ;)

@radu81: Did you experienced any problems with this addon?
I only installed and did some quick tests in localhost, I should install the new version and test it
Title: Re: [ADDON][beta] Topic Prefix
Post by: Trekkie101 on January 06, 2017, 11:01:08 pm
Core feature 1.2 great idea.
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 12, 2017, 05:12:02 pm
If you download the "master" from github (the green button "clone or download" here (https://github.com/emanuele45/TopicPrefix) and then "download") should have all that admin panel.
I just tried that but I still see the old version

edit: it was not a clean install, I uninstalled the old version, I removed the old package and installed the new version
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 06, 2018, 02:41:44 am
Core feature 1.2 great idea.
I vote for this!
In the meantime @emanuele‍ do you have any plans to update this for elkarte 1.1?
Title: Re: [ADDON][beta] Topic Prefix
Post by: ahrasis on January 06, 2018, 02:46:09 am
This is an addon I have overlooked. I vote for this as a feature too.
Title: Re: [ADDON][beta] Topic Prefix
Post by: emanuele on January 06, 2018, 06:31:22 pm
In the meantime @emanuele‍ do you have any plans to update this for elkarte 1.1?
I guess that means it doesn't work, right? xD
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 06, 2018, 06:46:23 pm
I installed the add-on on Elkarte 1.1 using the emulating mode, but when I go to ACP -> Post and topic -> Prefixes I get this error:



In error logs of elkarte I see:

Code: [Select]
Type of error: General
Warning: filemtime(): stat failed for /themes/default/scripts/TopicPrefix.js
http://test.sss.ovh/skoda/index.php?action=admin;area=postsettings;sa=prefix;S8pcnEv=gZotfnpY7AtFRo6iANOV9aBvpMFwjjL2
File: /sources/SiteCombiner.class.php
Line: 348
Title: Re: [ADDON][beta] Topic Prefix
Post by: ahrasis on January 07, 2018, 12:06:46 am
In the meantime @emanuele‍ do you have any plans to update this for elkarte 1.1?
I guess that means it doesn't work, right? xD
He means "please update this @emanuele." :D
Title: Re: [ADDON][beta] Topic Prefix
Post by: emanuele on January 08, 2018, 01:07:27 pm
Code: [Select]
Type of error: General
Warning: filemtime(): stat failed for /themes/default/scripts/TopicPrefix.js
http://test.sss.ovh/skoda/index.php?action=admin;area=postsettings;sa=prefix;S8pcnEv=gZotfnpY7AtFRo6iANOV9aBvpMFwjjL2
File: /sources/SiteCombiner.class.php
Line: 348

Ohh... that's easy: I forgot to put the TopicPrefix.js file in the package-info.xml and so it's not copied into the theme. O:-)
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 08, 2018, 02:34:32 pm
Ok, downloaded the .js file from github and uploaded to themes/default/js and I am able to access the Prefixes in ACP. I am able to add prefixes and assign them to a board, but if I edit a topic and assign a prefix I get this error:

count(): Parameter must be an array or an object that implements Countable

In elkarte logs I have 2 errors:
Code: [Select]
Type of error: General
Warning: count(): Parameter must be an array or an object that implements Countable
File: sources/subs/TopicPrefixTcCRUD.class.php
Line: 209
and:
Code: [Select]
Type of error: Non specificato
Notice: Undefined index: is_first_post
iindex.php?action=quotefast;quote=66659;modify;xml
File: sources/TopicPrefix.integrate.php
Line: 77

Another error: when you edit a prefix, the custom css is not saved.
Title: Re: [ADDON][beta] Topic Prefix
Post by: emanuele on March 11, 2018, 05:47:56 pm
Uploaded a version that should fix all these little bugs.
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on March 11, 2018, 11:17:36 pm
Thanks for watching into this, there is still an old bug that editing a prefix will get a copy of that prefix.
Title: Re: [ADDON][beta] Topic Prefix
Post by: emanuele on March 12, 2018, 12:08:06 am
O:-)

I forgot it was the prefixes, I thought it was another addon...
Title: Re: [ADDON][beta] Topic Prefix
Post by: Jorin on October 26, 2018, 07:40:42 am
This is an addon I have overlooked. I vote for this as a feature too.

+1!  ;)
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on October 30, 2018, 08:57:29 am
@emanuele‍ I know you are busy writing the SEF part for Elkarte, but when you get some free time please have a look at this add-on.

there is still an old bug that editing a prefix will get a copy of that prefix.

Also will be nice to see an option under the Quick moderation so you can apply prefixes from board view to multiple topics. This will be useful for an old forum with some topics.
 
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 07, 2020, 01:02:27 am
Some time ago @vbgamer45‍ made some edits and corrected some bugs on this add-on, @emanuele‍ maybe you want to merge them
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 07, 2020, 09:29:32 am
I started using this add-on but it's still buggy.

The big bug is that a prefix cannot be edited, if you go to topic view and click "Edit" there is no prefix displayed, if I change the prefix I get The database value you're trying to insert does not exist: new_prefix.

X
In the image above there are 2 ways to select a prefix, clicking in prefix list (1) or near a topic title (2)
The first one will get you to /index.php?action=prefix;sa=prefixedtopics;id=2;board=12
The second one to /index.php?action=prefix;sa=prefixedtopics;id=2
Don't know if this is intended...
If you click the first link the breadcrumb looks like this:
X
If I click where the red arrow is I get a database error:
Too few arguments to function TopicPrefix_PxCRUD::count(), 1 passed in sources/subs/TopicPrefixPxCRUD.class.php on line 38 and exactly 2 expected

Second scenario, link /index.php?action=prefix;sa=prefixedtopics;id=2 which I guess displays all topics from all boards
X
if I click the right arrow I get
Too few arguments to function TopicPrefix_PxCRUD::count(), 1 passed in /public/sources/subs/TopicPrefixPxCRUD.class.php on line 38 and exactly 2 expected
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 09, 2020, 01:28:45 pm
Another problem with this add-an, @emanuele‍ don't hate me ;D
In topic list, if you select a prefix and there is more than one page of topics with the same prefix, the link to page number is not working
Title: Re: [ADDON][beta] Topic Prefix
Post by: Spuds on January 14, 2020, 04:31:47 am
Still very much a [WIP] but here are some updates ... this is for 1.1 only.  This is for testing and bug feedback only.
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 14, 2020, 11:21:48 pm
Thanks for your help Spuds!
This add-on is getting better, tomorrow I will report a couple of small bugs ;) one is this:
In topic list, if you select a prefix and there is more than one page of topics with the same prefix, the link to page number is not working

 probably "board view" is more appropriate than "topic list"
Title: Re: [ADDON][beta] Topic Prefix
Post by: Spuds on January 15, 2020, 01:19:31 am
Cool ... find them and I'll try to fix them.  The page index is now fixed on my local
Title: Re: [ADDON][beta] Topic Prefix
Post by: Spuds on January 16, 2020, 04:31:25 pm
Latest updates, this should have the page issue fixed and added the delete function to the ACP plus some tweaks here and there.  Again 1.1 only

ETA: updated package in follow on posts
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 18, 2020, 10:56:27 am
Sorry for the late reply, I had a very busy week. I installed and tested the add-on, here is what I found:
I have this scenario:  10 prefixes, all applied to a few boards.

1.
If I go to a board and select a prefix from the list, I see correctly the first page with filtered topics, but I also get the page number to see other pages. The page number should not be present since there are less than 10 topics with that prefix from that board. If I click on next page I get the other topics with the same prefix but from other boards. 
Here a screenshot, as you can see there are only two topics with selected prefix, and I get seven pages of results.
X

2.
In board view, if I select a prefix from a topic (see the red arrow) I get as results topics from all boards:
X

3.
Imho the links from prefixes should all have the "nofollow" attribute, this is not a bug and I could add it myself. Don't know if this was intended or not.

4.
I get a few errors in Elkarte log:

Guest
Type: Not specified
Notice: Undefined index: view_num_guests
/index.php?action=prefix;sa=prefixedtopics;id=12
/public/themes/default/MessageIndex.template.php
Line: 85

Member
Tipo di errore: Non specificato
Notice: Undefined index: is_first_post
/index.php?action=quotefast;quote=233513;xml;pb=message;mode=0
/public/sources/subs/TopicPrefix.class.php
Line: 55

The second error has "action=quotefast" which could be related to Quick quote add-on https://www.elkarte.net/community/index.php?topic=3456.0

I also see that you corrected some bugs like the prefix not set when editing the first post of a topic and I confirm is working fine. Not tested the red icon "Delete" prefix since it's in my live forum.

Thanks again for watching this add-on Spuds.
Title: Re: [ADDON][beta] Topic Prefix
Post by: Spuds on January 19, 2020, 07:49:05 pm
1.
If I go to a board and select a prefix from the list, I see correctly the first page with filtered topics, but I also get the page number to see other pages. The page number should not be present since there are less than 10 topics with that prefix from that board. If I click on next page I get the other topics with the same prefix but from other boards.
Here a screenshot, as you can see there are only two topics with selected prefix, and I get seven pages of results.
[attach type=thumb]6413[/attach]
I could not repo this one ... but I could have been doing things wrong as well.  Please also check your topic_prefix table and make sure there are not duplicate topics, I did see that happen on my local but I thought it was a debug/testing issue.

The only way you should see multiple boards listed is when you select the "Prefix List" from the bread crumbs, for there you can list all topics, across boards, that a prefix was used on.  Once in a board the filtering should be for that board only.
2.
In board view, if I select a prefix from a topic (see the red arrow) I get as results topics from all boards:
[attach type=thumb]6415[/attach]
This should be fixed now
3.
Imho the links from prefixes should all have the "nofollow" attribute, this is not a bug and I could add it myself. Don't know if this was intended or not.
No opinion either way, but I added them ;)
4.
I get a few errors in Elkarte log:

Guest
Type: Not specified
Notice: Undefined index: view_num_guests
/index.php?action=prefix;sa=prefixedtopics;id=12
/public/themes/default/MessageIndex.template.php
Line: 85

Member
Tipo di errore: Non specificato
Notice: Undefined index: is_first_post
/index.php?action=quotefast;quote=233513;xml;pb=message;mode=0
/public/sources/subs/TopicPrefix.class.php
Line: 55

The second error has "action=quotefast" which could be related to Quick quote add-on https://www.elkarte.net/community/index.php?topic=3456.0
The first one should be fixed now


Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 19, 2020, 11:29:41 pm
There is something wrong with the version you just posted, I got a db error when I try to enter in a board or view a topic, I get a white screen with this message:
Code: [Select]
  Fatal error: Uncaught Elk_Exception: The database value you're trying to insert does not exist: group_list in /....//public/sources/database/Db-abstract.class.php:404 Stack trace: #0 /....//public/sources/database/Db-abstract.class.php(102): Database_Abstract->error_backtrace('The database va...', 'The database va...', 256, '/srv/users/serv...', 1231) #1 [internal function]: Database_Abstract->replacement__callback(Array) #2 /....//public/sources/database/Db-mysql.class.php(180): preg_replace_callback('~{([a-z_]+)(?::...', Array, '\n\t\tSELECT b.id_...') #3 /....//public/sources/Security.php(1231): Database_MySQL->query('', '\n\t\tSELECT b.id_...', Array) #4 /....//public/sources/subs/Moderation.subs.php(250): boardsAllowedTo(Array) #5 /....//public/themes/default/Theme.php(847): loadModeratorMenuCounts() #6 /srv/users/serverpilot/apps/sko in /....//public/sources/database/Db-abstract.class.php on line 404
I removed the full path to my forum

In elkarte log I have:
Type of error: Critical
Database error, given array of integer values is empty. (current_topic)
Function: topicAttribute
/index.php?topic=1688.msg233434;topicseen
File: /sources/subs/Topic.subs.php
Line: 1962

== edit ==
I checked the table topic_prefix and there are no duplicates (exported in csv then checked with Libreoffice Calc)
Title: Re: [ADDON][beta] Topic Prefix
Post by: Spuds on January 19, 2020, 11:58:13 pm
Replace your TopicPrefix.class.php file (in subs) with this one and see if that clears it up.
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 20, 2020, 12:11:21 am
I did, but nothing changed, I got the same error.
Title: Re: [ADDON][beta] Topic Prefix
Post by: Spuds on January 20, 2020, 01:20:25 am
Well that makes no sense .... I protected that function, maybe its some stupid PHP level issue, try this one.
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 20, 2020, 08:46:36 am
The same problem ::)
Title: Re: [ADDON][beta] Topic Prefix
Post by: Spuds on January 20, 2020, 03:41:43 pm
Well TBH at the moment I can't see how that is even possible ... I've removed the package since its broken, but I'm not seeing any errors on my install sooooo I'm at a dead end.
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 20, 2020, 05:59:51 pm
I really don't know ::)
If could be useful, I can setup a test forum, and give you access.
Title: Re: [ADDON][beta] Topic Prefix
Post by: Spuds on January 20, 2020, 06:09:34 pm
I think I found it .... its a stupid error made when editing the MessageIndex.controller.php

Open that file and go to line 714 ... you should see a } ... just delete that as there are 1 to many now.

I've attached a new version which fixes the above error, so uninstall, delete and use this package instead.  It has a couple of the other improvements as well.
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 20, 2020, 09:32:18 pm
Yep, I confirm that the version you just posted solves my problem 8)

But the problem I mentioned at post n° 50 (https://www.elkarte.net/community/index.php?topic=1424.msg40535#msg40535)is still present. To explain it better you can see it in my live forum.
Go to skodaclub.it/index.php?board=12.0
as you can see there are less than 30 topics
if on that board you select first prefix called "motore" (link skodaclub.it/index.php?action=prefix;sa=prefixedtopics;id=1;board=12 ) you will see that there are only 2 topics with that prefix, but there are also 7 pages available. If you click on page 2 (link skodaclub.it/index.php?action=prefix;sa=prefixedtopics;id=1.%1$d;start=15 ) you will see a list of topics with the same prefix called "motore" but from other boards.
X
I don't know if this is intended or not, I hope not  ::)

=== edit ===
I think I found another one, If I have a topic with a prefix, and I edit the first post choosing "no prefix" and save, I still see the old prefix applied.
On the same topic if I try to change the prefix editing the first post I get an error "The database value you're trying to insert does not exist: new_prefix". In elkarte log I see:
Type of error: Critical
The database value you're trying to insert does not exist: new_prefix
Function: runQuery
File: /sources/subs/TopicPrefixTcCRUD.class.php
Line: 84

IIRC this was working on the previous version, but I'm not 100% sure.
Title: Re: [ADDON][beta] Topic Prefix
Post by: Spuds on January 20, 2020, 11:56:52 pm
I see that .... humm .... Well thats a bit of a bugger.  Clearly a glutton for punishment so try this.
Title: Re: [ADDON][beta] Topic Prefix
Post by: Spuds on January 21, 2020, 12:05:05 am
=== edit ===
I think I found another one, If I have a topic with a prefix, and I edit the first post choosing "no prefix" and save, I still see the old prefix applied.
Just did this on my local and the prefix was removed as expected :(
On the same topic if I try to change the prefix editing the first post I get an error "The database value you're trying to insert does not exist: new_prefix". In elkarte log I see:
Type of error: Critical
The database value you're trying to insert does not exist: new_prefix
Function: runQuery
File: /sources/subs/TopicPrefixTcCRUD.class.php
Line: 84

IIRC this was working on the previous version, but I'm not 100% sure.
That error I also see  :'(
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 21, 2020, 12:12:53 am
It's getting better with every update, I confirm that the problem with page numbers and topics from other boards is now solved. 8)

For the other error I am almost sure it worked on the previous version. Thanks again for your help.
Title: Re: [ADDON][beta] Topic Prefix
Post by: Spuds on January 21, 2020, 12:49:44 am
It's getting better with every update, I confirm that the problem with page numbers and topics from other boards is now solved. 8)

For the other error I am almost sure it worked on the previous version. Thanks again for your help.
I almost think I'm spinning my wheels LOL, glad you think its getting better.  Here is a version that should fix the removing / editing of prefixes from the post page.

ETA: Updates Below
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 21, 2020, 02:22:48 am
I confirm, changing or removing the prefix from first post edit is working fine now. 8)
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 21, 2020, 11:19:22 pm
Spuds, don't hate me, but I found another one ::)
To replicate it:
- go to skodaclub.it/index.php?board=19.0
- choose the first prefix called "motore"
- you will see 3 pages of results and that should be correct
- click on page 2, you will get a page without topics, and the total pages are now 8 (8 pages of results are probably all topics from all boards with that prefix)
Title: Re: [ADDON][beta] Topic Prefix
Post by: Spuds on January 29, 2020, 01:38:45 am
And once more .... I did find a couple of additional issues that were certainly causing pagination issues .... could be more though !
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on January 30, 2020, 12:26:38 am
I thought you forgot about this :D  I confirm that the last bug is gone now, thanks again for your help.
Title: Re: [ADDON][beta] Topic Prefix
Post by: Spuds on January 30, 2020, 12:46:05 am
I thought you forgot about this :D  I confirm that the last bug is gone now, thanks again for your help.
Nah .. I just had to look away for a short while :D
Title: Re: [ADDON][beta] Topic Prefix
Post by: radu81 on February 12, 2020, 11:24:56 pm
What do you think about adding the prefix in topic view (index.php?topic=x) near to the title and also on the list of unread posts and replies?