Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Diego Andrés on May 11, 2015, 10:37:35 PM

Title: SMF Post Prefix
Post by: Diego Andrés on May 11, 2015, 10:37:35 PM
Link to the mod (https://custom.simplemachines.org/index.php?mod=4038)

(https://smftricks.com/logos/logo.png) (https://smftricks.com/)

(https://img.shields.io/badge/License-MPL%202.0-248049) (https://img.shields.io/badge/Hooks%20Only-Yes-6041a3) (https://img.shields.io/badge/SMF-2.1-3f73a0)

SMF Post Prefix
Developed by Diego Andrés (https://smftricks.com/index.php?action=profile;u=1)



Introduction
SMF Post Prefix mod allows you to set prefixes for your topics and easily customize them with colors and icons.

Features

Localization
(https://www.simplemachines.org/site_images/lang/english.gif) English
(https://www.simplemachines.org/site_images/lang/spanish_es.gif) Spanish
(https://www.simplemachines.org/site_images/lang/russian.gif) Russian
(https://www.simplemachines.org/site_images/lang/turkish.gif) Turkish
(https://www.simplemachines.org/site_images/lang/french.gif) French
(https://www.simplemachines.org/site_images/lang/italian.gif) Italian



Crowdin (https://crowdin.com/project/smf-post-prefix-mod)
Changelog (https://github.com/SMFTricks/SMF-Post-Prefix/blob/master/CHANGELOG.md)
GitHub (https://github.com/SMFTricks/SMF-Post-Prefix)
Title: Re: SMF Post Prefix
Post by: br360 on May 12, 2015, 02:40:24 AM
Thanks for submitting this- it's nice to finally see a topic prefix mod on the smf site.

Works great, but am getting a "Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/xxxxx/public_html/mysite/Sources/Recent.php on line 342" when I press either the "Show unread posts since last visit." and "Show new replies to your posts." links.

I got the same parse error on two different test sites (same line 342) with different mods on each site.

Here is my recent.php-




),
'topic' => $row['id_topic'],
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#msg' . $row['id_msg'],
'link' => ($row['id_msg'] == $row['id_first_msg'] ? PostPrefix::formatPrefix($row['id_prefix']) : ''). ' <a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#msg' . $row['id_msg'] . '" rel="nofollow">' . $row['subject'] . '</a>'
(line 342----->>>)   'start' => $row['num_replies'],
'subject' => $row['subject'],
'time' => timeformat($row['poster_time']),
'timestamp' => forum_time(true, $row['poster_time']),
Title: Re: SMF Post Prefix
Post by: margarett on May 12, 2015, 04:06:10 AM
Try to add a comma "," at the end of the previous line ;)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on May 12, 2015, 07:54:39 AM
LOL I have fixed that like three times, I need to pay more attention :P
Updated and fixed
Title: Re: SMF Post Prefix
Post by: br360 on May 12, 2015, 12:06:37 PM
Works great now. Thank you both. :)

Title: Re: SMF Post Prefix
Post by: Suriya-DsR on May 12, 2015, 03:00:55 PM
I am very excited about this mod, but there seems to be an issue with the install?

   1.    Replace    ./Sources/ManagePermissions.php    Test failed
Quote
Code: (Find) [Select]
'send_mail',
      'approve_posts',


Code: (Replace) [Select]

'send_mail',
      'approve_posts',
      'manage_prefixes',
      'set_prefix',


   4.    Execute Modification    ./Sources/Subs-Post.php    Test failed
Quote

Code: (Find) [Select]

$topicOptions['sticky_mode'] = isset($topicOptions['sticky_mode']) ? $topicOptions['sticky_mode'] : null;

   // This is longer than it has to be, but makes it so we only set/change what we have to.

Code: (Replace) [Select]
$topicOptions['sticky_mode'] = isset($topicOptions['sticky_mode']) ? $topicOptions['sticky_mode'] : null;
   $topicOptions['id_prefix'] = isset($topicOptions['id_prefix']) ? $topicOptions['id_prefix'] : null;

   // This is longer than it has to be, but makes it so we only set/change what we have to.



   5.    Execute Modification    ./Sources/Display.php    Test failed
Quote
Code: (Find) [Select]

t.num_replies, t.num_views, t.locked, ms.subject, t.is_sticky, t.id_poll,

Code: (Replace) [Select]

t.num_replies, t.num_views, t.locked, ms.subject, t.is_sticky, t.id_poll, t.id_prefix,


I am running the correct version of the forum for the mod, I was wondering if there was a way to fix this?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on May 12, 2015, 04:25:43 PM
Try manual parsing, on a clean install shouldn't be any problems.
Title: Re: SMF Post Prefix
Post by: Bigguy on May 12, 2015, 07:16:17 PM
Nice mod, very good work. Thanks. :)
Title: Re: SMF Post Prefix
Post by: Alanar on May 25, 2015, 11:07:37 AM
Hey there and thanks for a mod I've been waiting a long time for!

Just a note that it is not compatible with this Like Posts mod: http://custom.simplemachines.org/mods/index.php?mod=3708 (http://custom.simplemachines.org/mods/index.php?mod=3708)

The color selection doesn't work when both are installed. However, I ditched that mod for this one because it's just perfect. :)
Title: Re: SMF Post Prefix
Post by: Alanar on May 25, 2015, 12:30:12 PM
Could this mod be changed to work with inherited permissions? Right now it only works if you have the user's primary member group set to one of the member groups with a unique permission set.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on May 25, 2015, 12:58:17 PM
Quote from: Alanar on May 25, 2015, 11:07:37 AM
Hey there and thanks for a mod I've been waiting a long time for!

Just a note that it is not compatible with this Like Posts mod: http://custom.simplemachines.org/mods/index.php?mod=3708 (http://custom.simplemachines.org/mods/index.php?mod=3708)

The color selection doesn't work when both are installed. However, I ditched that mod for this one because it's just perfect. :)

I'll take a look to see if there's something I can do. Thank you

Quote from: Alanar on May 25, 2015, 12:30:12 PM
Could this mod be changed to work with inherited permissions? Right now it only works if you have the user's primary member group set to one of the member groups with a unique permission set.

Could you leave an example of this problem, e.g
User 1 is on primary group 1, and additional group 1
And prefixes and be used by additional group but the user cannot because primary can't, is hat what you meant?
Title: Re: SMF Post Prefix
Post by: Alanar on May 25, 2015, 01:46:38 PM
Quote from: Diego Andrés on May 25, 2015, 12:58:17 PM
Could you leave an example of this problem, e.g
User 1 is on primary group 1, and additional group 1
And prefixes and be used by additional group but the user cannot because primary can't, is hat what you meant?
Member groups that have a unique permission set that show up in permissions are able to use prefixes if that member group is set as their primary.

If I make a member group that inherits the permissions of that group and set it as primary, then it doesn't work, even if I still have the working group as an additional group.

Only member groups with a unique set of permissions are shown in the options so only they work with the prefixes.
Title: Re: SMF Post Prefix
Post by: Alanar on May 26, 2015, 02:23:13 PM
Never mind and sorry for the trouble.

Enabling post count membergroup permissions let me use these. However, it just shows a blank box to check which allows anyone to use that prefix regardless of their membergroup.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on May 26, 2015, 04:38:42 PM
Just read this morning that you enabled post group permission and it worked, is that okay then?
If not, did you try with Allow/Deny permissions?
Title: Re: SMF Post Prefix
Post by: Alanar on May 26, 2015, 04:42:58 PM
Yeah, sorry I deleted that as it still isn't working correctly. The allow/deny wasn't what made it work, it was enabling post count group permissions. That just let everyone use the prefixes regardless of their other groups.

Everything else inherits fine except for permissions for this mod.

Only membergroups that do not inherit permissions from another group are showing up in the options for the mod and only they work with it correctly and only if they're set as the primary membergroup for a user.

Edit: And allow/deny permissions still don't make it work correctly.
Title: Re: SMF Post Prefix
Post by: Alanar on May 26, 2015, 06:32:14 PM
What I guess I was asking for is a way to manage all membergroups to use or not use prefixes like how the modify board page is done. This way, I can set basic permissions for a certain group and then divy them up into a more specific subset like the forums is set up. On that page, every membergroup is listed even if it's based off another, less-specific one.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on May 27, 2015, 01:15:36 AM
Sorry I forgot about this, will try to check it tomorrow.
The thing is about showing all the groups right?
Title: Re: SMF Post Prefix
Post by: Alanar on May 27, 2015, 01:17:25 AM
Well, if they work, yes. If you can't do that, no worries. It's still an amazing free mod. :)
Title: Re: SMF Post Prefix
Post by: FireDitto on May 31, 2015, 04:02:11 AM
Hi! I have two quick questions,

1. Would it be possible to add the ability to choose a font colour as well as a background colour? Maybe check boxes for bold and italic as well?
2. Would it be possible to add the ability to call images instead of using font?

Thank you for your time!
Title: Re: SMF Post Prefix
Post by: Diego Andrés on May 31, 2015, 10:41:22 PM
Quote from: Alanar on May 27, 2015, 01:17:25 AM
Well, if they work, yes. If you can't do that, no worries. It's still an amazing free mod. :)

Hi, I just checked this today, I'm going to work on it tomorrow as I found another small bug on the mod. Not related to this one though.

Thanks.

Quote from: FireDitto on May 31, 2015, 04:02:11 AM
Hi! I have two quick questions,

1. Would it be possible to add the ability to choose a font colour as well as a background colour? Maybe check boxes for bold and italic as well?
2. Would it be possible to add the ability to call images instead of using font?

Thank you for your time!

1- Sure
2- For sure

But I'm not going to work on that features for now, maybe for next month  ;D

Thank you for the suggestions.
Title: Re: SMF Post Prefix
Post by: br360 on May 31, 2015, 10:54:46 PM
If you're taking suggestions, one other one that I think might be pretty cool is to be able to search by prefix. So for example; if a prefix was say "Information", all topics with that prefix could be found doing a specific prefix search.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 01, 2015, 12:15:13 AM
Quote from: br360 on May 31, 2015, 10:54:46 PM
If you're taking suggestions, one other one that I think might be pretty cool is to be able to search by prefix. So for example; if a prefix was say "Information", all topics with that prefix could be found doing a specific prefix search.

Yes I have also thought in this one, would be nice. I will see what can I do.




@Alanar I just got some time and as I see it, the only way it could work is this one:
Sources/PostPrefixAdmin.php
Code (Search) Select
WHERE mg.id_group NOT IN (1, 3)
AND mg.id_parent = {int:not_inherited}' . (empty($modSettings['permission_enable_postgroups']) ? '

Code (Replace) Select
WHERE mg.id_group NOT IN (1, 3)' . (empty($modSettings['permission_enable_postgroups']) ? '

Try and then tell me if that works, so I can update the mod.
Title: Re: SMF Post Prefix
Post by: Alanar on June 01, 2015, 12:46:43 AM
Quote from: Diego Andrés on June 01, 2015, 12:15:13 AM
Try and then tell me if that works, so I can update the mod.
It does indeed work now! Thank you very much! :)
Title: Re: SMF Post Prefix
Post by: br360 on June 01, 2015, 01:09:33 AM
Quote from: Diego Andrés on June 01, 2015, 12:15:13 AM
Quote from: br360 on May 31, 2015, 10:54:46 PM
If you're taking suggestions, one other one that I think might be pretty cool is to be able to search by prefix. So for example; if a prefix was say "Information", all topics with that prefix could be found doing a specific prefix search.

Yes I have also thought in this one, would be nice. I will see what can I do.

Thanks for considering it. :)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 01, 2015, 11:57:35 AM
Mod updated to 1.0.1

Quote1.0.1 - 31 May 2015
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmftricks.com%2FThemes%2FSMFTricks%2Fimages%2Fchangelog%2Fbug--minus.png&hash=193021b52e1a966929e8e36330ff0bcc4df04d41) Now showing inherit groups while adding/editing a prefix.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmftricks.com%2FThemes%2FSMFTricks%2Fimages%2Fchangelog%2Fbug--minus.png&hash=193021b52e1a966929e8e36330ff0bcc4df04d41) Fixed an issue on quick edit.
Title: Re: SMF Post Prefix
Post by: Circa on July 09, 2015, 08:51:43 AM
I can't seem to find the settings for this in my Admin center. I installed it correctly, but can't find settings anywhere.
Title: Re: SMF Post Prefix
Post by: Steve on July 09, 2015, 09:22:32 AM
Admin -> Forum -> PostPrefix
Title: Re: SMF Post Prefix
Post by: Circa on July 09, 2015, 09:41:11 AM
Not there. It told me it installed correctly. I suppose I could try reinstalling. There was only one file that the test failed on, so I did it manually for that one file.

EDIT: Reinstalling doesn't work. Any ideas why? I have a custom theme, but switching to the default theme doesn't help.
Title: Re: SMF Post Prefix
Post by: berkcet on July 09, 2015, 11:54:39 AM
Great mod. Works perfectly as intended.

Thanks a bunch
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 09, 2015, 02:09:07 PM
Quote from: Circa on July 09, 2015, 09:41:11 AM
Not there. It told me it installed correctly. I suppose I could try reinstalling. There was only one file that the test failed on, so I did it manually for that one file.

EDIT: Reinstalling doesn't work. Any ideas why? I have a custom theme, but switching to the default theme doesn't help.

Make sure that every file was uploaded successfully
Title: Re: SMF Post Prefix
Post by: Circa on July 09, 2015, 02:11:01 PM
Quote from: Diego Andrés on July 09, 2015, 02:09:07 PM
Quote from: Circa on July 09, 2015, 09:41:11 AM
Not there. It told me it installed correctly. I suppose I could try reinstalling. There was only one file that the test failed on, so I did it manually for that one file.

EDIT: Reinstalling doesn't work. Any ideas why? I have a custom theme, but switching to the default theme doesn't help.

Make sure that every file was uploaded successfully
It said that everything was successful.
Title: Re: SMF Post Prefix
Post by: margarett on July 09, 2015, 04:46:55 PM
But have you checked yourself? ;)
Messed permissions (in your file system, not the forum) can cause some reported changes as completed when they were actually skipped...
Title: Re: SMF Post Prefix
Post by: Circa on July 09, 2015, 05:30:46 PM
Quote from: margarett on July 09, 2015, 04:46:55 PM
But have you checked yourself? ;)
Messed permissions (in your file system, not the forum) can cause some reported changes as completed when they were actually skipped...
Hmm. Yes, just checked. All files were uploaded, and all files were edited correctly. Not sure what's going on. If it helps, I'm on 2.0.10. I assumed this would be compatible but you never know. Feels like it just isn't installing the link to the Admin settings in the Admin control panel or something. What's the link to the settings via URL? Maybe I can check that way.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 09, 2015, 06:05:40 PM
Maybe hooks weren't added
Try uploading the hooks.php file to the root of your forum, and then access it from your browser.
Title: Re: SMF Post Prefix
Post by: Circa on July 09, 2015, 07:31:07 PM
Quote from: Diego Andrés on July 09, 2015, 06:05:40 PM
Maybe hooks weren't added
Try uploading the hooks.php file to the root of your forum, and then access it from your browser.
Doesn't look like anything happened after doing that. Blank web page. Still nothing in the Admin CP.
Title: Re: SMF Post Prefix
Post by: yakyakyak on July 10, 2015, 05:44:56 PM
Installs just fine on my test system but on the live one, it needs two files to be edited. one is straightforward just adding a variable but the other ( Subs-Post.php ) looks a bit more confusing as the edit conflicts with a pre installed mod. would you be able to take a look for me if i attach it. ?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 10, 2015, 11:24:02 PM
Sure, just leave what instruction was and I'll do the changes for you.
Title: Re: SMF Post Prefix
Post by: adamtwar on July 13, 2015, 08:32:23 AM
I have one feature request: the mod should insert a class "postprefix" for any span it creates. This way, I could customize the font, size etc. of the post prefix span easily. I actually did this modification myself, and you can see one such customized post prefix on
http://forum.fontlab.com/b13/
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 14, 2015, 02:49:34 PM
Great idea! I will add a class followed by the prefix id.
But definitely it's going to be available on the next release.
Title: Re: SMF Post Prefix
Post by: Circa on July 14, 2015, 04:27:30 PM
If I give temporary admin to you Diego, do you think you could check out my issue? Not sure what else to do here.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 14, 2015, 06:01:09 PM
Send me a pm
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 15, 2015, 02:18:35 PM
New version 2.0!
Quote2.0 - 15 July 2015
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmftricks.com%2FThemes%2FSMFTricks%2Fimages%2Fchangelog%2Ftag--pencil.png&hash=5de0b06bfe982ea5c2d695e1dd548e76ef3e5f20) Now you can decide to use text or show an icon.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmftricks.com%2FThemes%2FSMFTricks%2Fimages%2Fchangelog%2Ftag--plus.png&hash=69bce614dcce8586709629a7ce4a7b9e535aff80) Search topics by prefix.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmftricks.com%2FThemes%2FSMFTricks%2Fimages%2Fchangelog%2Ftag--plus.png&hash=69bce614dcce8586709629a7ce4a7b9e535aff80) Filter topics by prefix inside a board.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmftricks.com%2FThemes%2FSMFTricks%2Fimages%2Fchangelog%2Ftag--plus.png&hash=69bce614dcce8586709629a7ce4a7b9e535aff80) Added Spanish translation.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmftricks.com%2FThemes%2FSMFTricks%2Fimages%2Fchangelog%2Ftag--plus.png&hash=69bce614dcce8586709629a7ce4a7b9e535aff80) Each prefix now has an unique ID, and all of them have a general class so you can customize them using CSS.

Please report any issues  ;D
Title: Re: SMF Post Prefix
Post by: br360 on July 15, 2015, 02:57:21 PM
Awesome Diego, thanks for the updates. :)

I have tried installing 2.0 on two different sites though, and am getting the same error after I try to install-

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 default '500',
PRIMARY KEY (id)) ENGINE=MyISAM' at line 13
File: /home/genxcomm/public_html/test/Packages/temp/install.php
Line: 97
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 15, 2015, 03:07:07 PM
Sorry, my fault. I haven't slep since monday  :P
Try the new file, it should work now
Title: Re: SMF Post Prefix
Post by: br360 on July 15, 2015, 03:12:56 PM
Just tried the new file and still the same thing- same errors on different sites.

This mod is great and with the additions you made is going to be awesome. Get some sleep first though, as I can wait. ;)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 15, 2015, 03:17:50 PM
Quote from: br360 on July 15, 2015, 03:12:56 PM
Get some sleep first though, as I can wait. ;)

Probably I should. In fact, the issue is very stupid  :P
This time it SHOULD DEFINITELY work.

And thank you I hope everyone likes it.
Title: Re: SMF Post Prefix
Post by: br360 on July 15, 2015, 03:20:34 PM
Yup, this time it installed without issue. Thank you. :)

Now, get some sleep...pretty sure you've earned it. ;)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 15, 2015, 05:50:14 PM
Hey I just noticed another issue  :(
I forgot to actually update the PostPrefix.template.php

The package is already updated. If someone doesn't want to uninstall and install again, you can only replace the template and that's all.

Sorry about that.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 15, 2015, 06:36:10 PM
Well, this is awkward  :-[
I introduced a bug in the 2.0 version, so I just released the 2.0.1 which this time I'm 100% sure is DEFINITELY the good one.

Again, is not necessary to update if you already have the 2.0 version with the PostPrefix.template.php file replaced
The only thing you have to do is
Code (find in Sources/Subs-PostPrefix.php) Select
'. ($all = true ? '' : '
Code (replace in Sources/Subs-PostPrefix.php) Select
'. ($all == true ? '' : '

This time the only thing I can say is: enjoy!
Title: Re: SMF Post Prefix
Post by: br360 on July 15, 2015, 09:45:04 PM
I've been playing with the new version, and it works great. Thanks again.

I was wondering though if there was a way to have the prefixes appear alphabetically in both the "Select Prefix" drop down list, as well as the filter by prefix section-instead of by when the prefixes were added.
Title: Re: SMF Post Prefix
Post by: Geor'G on July 17, 2015, 09:49:38 PM
Error while searching
'time' => timeformat($message['first_poster_time']),
'timestamp' => forum_time(true, $message['first_poster_time']),
'subject' => $message['first_subject'],
// Prefixes
2013 => 'prefix' => PostPrefix::formatPrefix($message['id_prefix']),
'href' => $scripturl . '?topic=' . $message['id_topic'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $message['id_topic'] . '.0">' . $message['first_subject'] . '</a>',


Ru:
Ошибка при поиске
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 17, 2015, 10:24:27 PM
Quote from: br360 on July 15, 2015, 09:45:04 PM
I've been playing with the new version, and it works great. Thanks again.

I was wondering though if there was a way to have the prefixes appear alphabetically in both the "Select Prefix" drop down list, as well as the filter by prefix section-instead of by when the prefixes were added.

Sure it's doable, I'll add it for 2.2 as it is a mid improvement because it will have a new settings so you can choose how to order them.

Quote from: Geor'G on July 17, 2015, 09:49:38 PM
Error while searching
'time' => timeformat($message['first_poster_time']),
'timestamp' => forum_time(true, $message['first_poster_time']),
'subject' => $message['first_subject'],
// Prefixes
2013 => 'prefix' => PostPrefix::formatPrefix($message['id_prefix']),
'href' => $scripturl . '?topic=' . $message['id_topic'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $message['id_topic'] . '.0">' . $message['first_subject'] . '</a>',


Ru:
Ошибка при поиске

Thanks for reporting, I'll take a look.

also for 2.2, fixed a little bug related with the permissions page.
Title: Re: SMF Post Prefix
Post by: Amargedon on July 22, 2015, 02:08:29 PM
First of all; thanks for this mod and you're work so far! I find the filter and search option a good one and was thinking/looking for a long time for a mod who could do that.

I tried to install the mod today and found the following two points:
1) Creating prefix works. However, when assigning the groups who can use it I used the "select all option" at the bottom of the list with groups. There was no change in the radio buttons, so it seems the javascript is broken? Tried it in Chrome and Internet Explorer without luck.
Workaround is to click each radiobutton to the desired option, but with 8 groups and a lot of prefixes (when using the mod later on) this would be nice to have working.

2) After creating the prefix I tried to create a topic. There was no drop-down box for the prefix selection. I added the prefix on all boards, so that should not be the issue. I switched to the default theme, also didn't make a difference.

Looked inside the source and investigated what was going on; found that the following line in Post.template.php is failing:
if (!empty($context['prefix']['post']) && $context['is_first_post'])
The context['prefix']['post'] is empty. Strange thing is that when I include debug in the sources (getPrefix function in Subs-PostPrefix.php) I can see that it's filled in (I see the prefix I added previously) based on the account, group and board where I want to create a topic.

Any idea?

ps; I can create the translation to Dutch if you're interested?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 22, 2015, 02:13:07 PM
There are no related issues as far as I know.
Have you tried the mod on a test site?

Translations are always welcome.
Title: Re: SMF Post Prefix
Post by: Amargedon on July 22, 2015, 02:20:57 PM
Quote from: Diego Andrés on July 22, 2015, 02:13:07 PM
There are no related issues as far as I know.
Have you tried the mod on a test site?

Translations are always welcome.
Yes, I have a testsite running on a local system where I test everything before I put it on the live environment.

Ok; will look into finishing the translation.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 27, 2015, 08:29:26 PM
Quote from: Geor'G on July 17, 2015, 09:49:38 PM
Error while searching
'time' => timeformat($message['first_poster_time']),
'timestamp' => forum_time(true, $message['first_poster_time']),
'subject' => $message['first_subject'],
// Prefixes
2013 => 'prefix' => PostPrefix::formatPrefix($message['id_prefix']),
'href' => $scripturl . '?topic=' . $message['id_topic'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $message['id_topic'] . '.0">' . $message['first_subject'] . '</a>',


Ru:
Ошибка при поиске

I can't reproduce this, can you show me how to get that?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 27, 2015, 11:45:03 PM
New version 2.0.2!

Quote2.0.2 - 27 July 2015
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmftricks.com%2FThemes%2FSMFTricks%2Fimages%2Fchangelog%2Ftag--plus.png&hash=69bce614dcce8586709629a7ce4a7b9e535aff80) Added two new settings for selecting how to order the list of prefixes.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmftricks.com%2FThemes%2FSMFTricks%2Fimages%2Fchangelog%2Fbug--minus.png&hash=193021b52e1a966929e8e36330ff0bcc4df04d41) Fixed the way permissions were added.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmftricks.com%2FThemes%2FSMFTricks%2Fimages%2Fchangelog%2Fbug--minus.png&hash=193021b52e1a966929e8e36330ff0bcc4df04d41) Fixed the empty list of prefixes in search page.

Please report any issues  :)
Title: Re: SMF Post Prefix
Post by: br360 on July 27, 2015, 11:57:40 PM
Thanks for adding the ASC and DESC sort Diego. It works great when setting Name and ID in Prefix order. However, when setting it as Date, I get this error-

Unknown column 'p.date' in 'order clause'
File: /home/xxx/public_html/xxx/Sources/Subs-PostPrefix.php
Line: 241



233:              ORDER by p.{raw:order} {raw:dir}'),
234: array(
235: 'id_group' => $group,
236: 'post_group' => $postg,
237: 'board' => $board,
238: 'order' => $order,
239: 'dir' => $dir,
240: )
==>241: );
242: while ($row = $smcFunc['db_fetch_assoc']($request))
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 28, 2015, 12:22:20 AM
Sorry I thought I updated that
The error is in line 214 (Subs-PostPrefix.php)
Change date to added.

I just updated the package
Title: Re: SMF Post Prefix
Post by: br360 on July 28, 2015, 01:37:02 AM
Thanks Diego. Works great...and thanks again for this excellent mod.
Title: Re: SMF Post Prefix
Post by: Alanar on July 30, 2015, 07:14:20 PM
Hi, Diego. With the new version, I'm getting an "Error: The database value you're trying to insert does not exist: id_board" when I try to post a new topic.

I don't get it any other time. I can make posts, delete topics, edit things, etc. I just can't post new topics.

When I uninstall the mod, I don't get the error.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 30, 2015, 10:16:39 PM
Can you check the error in the errors log, maybe there will tell you more information about the issue.
Title: Re: SMF Post Prefix
Post by: Alanar on July 30, 2015, 10:51:18 PM
I fixed it, thanks.

Apparently the last version I had installed and uninstalled didn't remove the previous lines of code. I had duplicates everywhere. Cleared them all up and it's running fine!
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 30, 2015, 10:54:03 PM
Nice! Enjoy the mod :)
Title: Re: SMF Post Prefix
Post by: Alanar on July 30, 2015, 11:02:58 PM
And I'm back. Last errors it's throwing are undefined indexes on lines 208 and 216 of Subs-Postprefix.php

This one I'm not sure how to fix as it's happening on my test server and the live one.


196: {
197: $group = '';
198: $postg = '';
199: }
200: else
201: {
202: loadMemberContext($user_info['id']);
203: $group = (int) $memberContext[$user_info['id']]['group_id'];
204: $postg = (int) $user_settings['id_post_group'];
205: }
206:
207: // Order by thing
208: $orderby = $modSettings['PostPrefix_select_order'];
209: if ($orderby == 0)
210: $order = 'name';
211: elseif ($orderby == 1)
212: $order = 'id';
213: elseif ($orderby == 2)
214: $order = 'added';
215: // Direction
==>216: $direction = $modSettings['PostPrefix_select_order_dir'];
217: if ($direction == 0)
218: $dir = 'DESC';
219: else
220: $dir = 'ASC';
221:
222: $context['prefix']['post'] = array();
223: if (allowedTo('set_prefix') || allowedTo('manage_prefixes'))
224: {
225: $request = $smcFunc['db_query']('', '
226: SELECT p.id, p.status, p.name, p.added, p.boards, p.member_groups, p.deny_member_groups
227: FROM {db_prefix}postprefixes AS p
228: WHERE p.status = 1'. ($user_info['is_admin'] || allowedTo('manage_prefixes') ? '' : ('
229: AND (FIND_IN_SET({int:id_group}, p.member_groups) OR FIND_IN_SET({int:post_group}, p.member_groups))' . (!empty($modSettings['permission_enable_deny']) ? ('
230: AND (NOT FIND_IN_SET({int:id_group}, p.deny_member_groups) AND NOT FIND_IN_SET({int:post_group}, p.deny_member_groups))') : '') . '')) . '
231: '. ($all == true ? '' : '
232: AND FIND_IN_SET({int:board}, p.boards)
233: ORDER by p.{raw:order} {raw:dir}'),
234: array(
235: 'id_group' => $group,
236: 'post_group' => $postg,
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 30, 2015, 11:06:39 PM
Yes :( it's probably because I didn't add those "order" settings to the db. So it will show up until you go to the settings page and click save.

I'll upload a new package where it is corrected. It won't be a new version (no need to update) as it can be fixed manually through the prefix settings as I stated.
Title: Re: SMF Post Prefix
Post by: Alanar on July 30, 2015, 11:11:49 PM
Gotcha. I just had to change the option and then change it back. Thanks a lot. I hate to annoy people, but I'm not very adept at PHP so I rely on these mods. :)

Thanks again!
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 30, 2015, 11:14:40 PM
Yeah no problem! We are here to help ;D
Title: Re: SMF Post Prefix
Post by: Alanar on August 01, 2015, 10:24:11 PM
Last thing I'm noticing. When a user searches for something using the search feature and doesn't select a prefix to search for (leaves it on [No Prefix]), I'm getting an undefined error in Search.php on line 2013 for id_prefix.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 02, 2015, 10:03:30 AM
I'll take a look tomorrow, thank you.
Title: Re: SMF Post Prefix
Post by: musicus on August 06, 2015, 05:08:00 PM
After I install made a repair of my forum and had set back all the mods with "fix_packages.php", I have installed latest version of "SMF Post Prefix" had, came first, no error. But when I click "Prefixes" in the configuration, this message appears:

Unknown column 'icon' in 'field list'
Datei: /homepages/14/d562938237/htdocs/musociety/Sources/PostPrefixAdmin.php
Zeile: 296


and when I open the file listed above, I see this:

// Get a list of all the item
$result = $smcFunc['db_query']('', '
SELECT id, name, status, color, added, member_groups, deny_member_groups, boards, icon, icon_url
FROM {db_prefix}postprefixes
ORDER by {raw:sort}
LIMIT {int:start}, {int:maxindex}',
array(
'start' => $start,
'maxindex' => $items_per_page,
'sort' => $sort,


How do I fix the error

Sorry my bad english
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 06, 2015, 05:14:35 PM
You need to add that column manually into the post prefixes table
Title: Re: SMF Post Prefix
Post by: musicus on August 06, 2015, 05:36:31 PM
Thank you, I have uninstalled for now the addon. Too bad, was quite usable. But it is more important that my forum without any problems works. Better luck with the next update
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 06, 2015, 05:39:42 PM
It is working just fine.
But in some cases that column won't be added, so you have actually two options:
1- Add the column manually
2- When uninstalling the old version you must check the "Delete all data" thing. If you don't want to lose your prefixes, just make a backup of that table before the uninstall
Title: Re: SMF Post Prefix
Post by: Juvept on August 11, 2015, 08:44:38 AM
Hi,

After i install this mod (without any problem), and i go to Admin > Forum > Postprefix this error appears:


QuoteFatal error: Cannot call method self::general() or method does not exist in /home/a6532119/public_html/Sources/PostPrefixAdmin.php on line 59

Can anyone tell me who to solve please?
Title: Re: SMF Post Prefix
Post by: DarkTexas on August 21, 2015, 09:01:57 PM
(i hope i'm at the right place!)

I've recently installed a mod "SMF Post Frefix". After that I couldn't access the forums anymore, that means it shows the following message:

Unknown column 'p.icon' in 'field list'
File: C:\Inetpub\vhosts\glj-ps2.de\forum.glj-ps2.de\Sources\Subs-PostPrefix.php
Line: 139

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.10, while your database is at version 2.0.9. The above error might possibly go away if you execute the latest version of upgrade.php.

Can anyone help me?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 21, 2015, 09:34:37 PM
Previously commented above and I left a few solutions.
Title: Re: SMF Post Prefix
Post by: DarkTexas on August 22, 2015, 03:27:05 AM
Quote from: Diego Andrés on August 21, 2015, 09:34:37 PM
Previously commented above and I left a few solutions.

What and where do I need to add or delete something? - im sorry, I'm not an expert with that. :(
That is our Clan-Forum and that's a huge Problem when that's messed up >.<. On my test-Forums it worked -_-
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 22, 2015, 12:23:29 PM
Yeah, as I said above it's probably because you had installed the previous version so the columns weren't added when installing the new one.
Try this:
1- Upload the attachment to the root of your forum
2- Go to forumurl.com/postprefix_fix_2.0.2.php
3- Delete the file
4- Check that it fixed the issue nicely
Title: Re: SMF Post Prefix
Post by: Goten22 on September 06, 2015, 03:11:41 AM
Can I somehow check if topic has prefix? And display all topics with prefixes? (I don't mean url ";prefix=1")
Something like :
if ($topic[prefix]){
echo' $topic[name] $topic['link'] etc';}
Title: Re: SMF Post Prefix
Post by: Goten22 on September 21, 2015, 06:50:25 AM
I've got this error in logs. How can I fix it?

QuoteXXXXX?topic=3.0
8: Undefined index: id_prefix
File: /home/user/public_html/Sources/Display.php
Title: Re: SMF Post Prefix
Post by: Adonix on September 26, 2015, 11:08:23 AM
Error on following things ! ( In SMF 2.0.11 )

Find
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#msg' . $row['id_msg'] . '" rel="nofollow">' . $row['subject'] . '</a>'
Replace
'link' => ($row['id_msg'] == $row['id_first_msg'] ? PostPrefix::formatPrefix($row['id_prefix']) : ''). ' <a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#msg' . $row['id_msg'] . '" rel="nofollow">' . $row['subject'] . '</a>'

Find
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['first_subject'] . '</a>'
Replace
'link' => PostPrefix::formatPrefix($row['id_prefix']). ' <a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['first_subject'] . '</a>'

Excited to use this mod but have errors while installing :(
Title: Re: SMF Post Prefix
Post by: ArkServer on October 27, 2015, 06:48:05 PM
Hi, i just installed it and it seems to work almost fine, the prefix shows up in the topic http://blushyface.com/community/news-and-updates/test-topic/ but NOT in the message index http://blushyface.com/community/news-and-updates/ , anyone know what file i need to look at or change to fix this?
Title: Re: SMF Post Prefix
Post by: br360 on October 27, 2015, 06:55:13 PM
Does your custom theme you are using have its own MessageIndex.template.php, and if so, do the prefixes show up on the message index of the default theme?
Title: Re: SMF Post Prefix
Post by: ArkServer on October 27, 2015, 07:06:38 PM
Quote from: br360 on October 27, 2015, 06:55:13 PM
Does your custom theme you are using have its own MessageIndex.template.php, and if so, do the prefixes show up on the message index of the default theme?

both no to that, all themes dont show the prefix on the message index but when u look at the post it does show there
Title: Re: SMF Post Prefix
Post by: br360 on October 27, 2015, 07:10:14 PM
Can you go through the parse instructions and make sure the code for messageindex.template.php is there?

Find:
?>

Add before:
function template_filterPrefix()
{
global $context, $modSettings, $scripturl, $txt;

// Prefix
if (!empty($modSettings['PostPrefix_enable_filter']) && !empty($context['prefix']['post']))
{

echo'
<div class="cat_bar">
<h3 class="catbg">
', $txt['PostPrefix_filter'],'
</h3>
</div>
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="content">';

// Show all the prefixes for this board.
foreach ($context['prefix']['post'] as $prefix)
echo'
<a href="' . $scripturl . '?board=' . $context['current_board'] . '.0;prefix=' . $prefix['id'] . '">' . PostPrefix::formatPrefix($prefix['id']) . '</a>, ';

echo'
<a href="', $scripturl, '?board=', $context['current_board'], '.0;prefix=0">', $txt['PostPrefix_filter_noprefix'], '</a>,
<a href="', $scripturl, '?board=', $context['current_board'], '.0">', $txt['PostPrefix_filter_all'], '</a>
</div>
<span class="botslice"><span></span></span>
</div>
<br class="clear" />';
}
}
Title: Re: SMF Post Prefix
Post by: ArkServer on October 27, 2015, 07:21:31 PM
I can confirm the code is added in messageindex.template.php

//edit this is my messageindex

<?php
/**
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines
 * @copyright 2011 Simple Machines
 * @license http://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.0
 */

function template_main()
{
global $context$settings$options$scripturl$modSettings$txt;

echo '
<a id="top"></a>'
;

if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0))
{
echo '
<div class="tborder childboards" id="board_'
$context['current_board'], '_childboards">
<div class="cat_bar">
<h3 class="catbg">'
$txt['parent_boards'], '</h3>
</div>
<div class="table_frame">
<table class="table_list">
<tbody id="board_'
$context['current_board'], '_children" class="content">';

foreach ($context['boards'] as $board)
{
echo '
<tr id="board_'
$board['id'], '" class="windowbg2">
<td class="icon windowbg"'
, !empty($board['children']) ? ' rowspan="2"' '''>
<a href="'
, ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl '?action=unread;board=' $board['id'] . '.0;children'), '">';

// If the board or children is new, show an indicator.
if ($board['new'] || $board['children_new'])
echo '
<img src="'
$settings['images_url'], '/' .$context['theme_variant_url'], 'on'$board['new'] ? '' '2''.png" alt="'$txt['new_posts'], '" title="'$txt['new_posts'], '" />';
// Is it a redirection board?
elseif ($board['is_redirect'])
echo '
<img src="'
$settings['images_url'], '/' .$context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
// No new posts at all! The agony!!
else
echo '
<img src="'
$settings['images_url'], '/' .$context['theme_variant_url'], 'off.png" alt="'$txt['old_posts'], '" title="'$txt['old_posts'], '" />';

echo '
</a>
</td>
<td class="info">
<a class="subject" href="'
$board['href'], '" name="b'$board['id'], '">'$board['name'], '</a>';

// Has it outstanding posts for approval?
if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
echo '
<a href="'
$scripturl'?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 'topics' 'posts'), ';brd='$board['id'], ';'$context['session_var'], '='$context['session_id'], '" title="'sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';

echo '

<p>'
$board['description'] , '</p>';

// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
if (!empty($board['moderators']))
echo '
<p class="moderators">'
count($board['moderators']) === $txt['moderator'] : $txt['moderators'], ': 'implode(', '$board['link_moderators']), '</p>';

// Show some basic information about the number of posts, etc.
echo '
</td>
<td class="stats windowbg">
<p>'
comma_format($board['posts']), ' '$board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />
'
$board['is_redirect'] ? '' comma_format($board['topics']) . ' ' $txt['board_topics'], '
</p>
</td>
<td class="lastpost">'
;

if (!$modSettings['disable_avatar'])
echo '<div style="float: left; margin-right: 6px;">'$board['last_post']['member']['avatar'], '</div>';

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
echo '
<p><strong>'
$txt['last_post'], '</strong>  '$txt['by'], ' '$board['last_post']['member']['link'], '<br />
'
$txt['in'], ' '$board['last_post']['link'], '<br />
'
$txt['on'], ' '$board['last_post']['time'],'
</p>'
;

echo '
</td>
</tr>'
;

// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children']) && !$modSettings['display_childboards'])
{
// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child)
{
if (!$child['is_redirect'])
$child['link'] = '<a href="' $child['href'] . '" ' . ($child['new'] ? 'class="new_posts" ' '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' $txt['board_topics'] . ': ' comma_format($child['topics']) . ', ' $txt['posts'] . ': ' comma_format($child['posts']) . ')">' $child['name'] . ($child['new'] ? '</a> <a href="' $scripturl '?action=unread;board=' $child['id'] . '" title="' $txt['new_posts'] . ' (' $txt['board_topics'] . ': ' comma_format($child['topics']) . ', ' $txt['posts'] . ': ' comma_format($child['posts']) . ')"><img src="' $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />' '') . '</a>';
else
$child['link'] = '<a href="' $child['href'] . '" title="' comma_format($child['posts']) . ' ' $txt['redirects'] . '">' $child['name'] . '</a>';

// Has it posts awaiting approval?
if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
$child['link'] .= ' <a href="' $scripturl '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 'topics' 'posts') . ';brd=' $child['id'] . ';' $context['session_var'] . '=' $context['session_id'] . '" title="' sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';

$children[] = $child['new'] ? '<strong>' $child['link'] . '</strong>' $child['link'];
}
echo '
<tr id="board_'
$board['id'], '_children"><td colspan="3" class="children windowbg"><strong>'$txt['parent_boards'], '</strong>: 'implode(', '$children), '</td></tr>';
}
}
echo '
</tbody>
</table>
</div>
</div>'
;
}

if (!empty($options['show_board_desc']) && $context['description'] != '')
echo '
<p class="description_board">'
$context['description'], '</p>';

// Create the button set...
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new''text' => 'new_topic''image' => 'new_topic.gif''lang' => true'url' => $scripturl '?action=post;board=' $context['current_board'] . '.0''active' => true),
'post_poll' => array('test' => 'can_post_poll''text' => 'new_poll''image' => 'new_poll.gif''lang' => true'url' => $scripturl '?action=post;board=' $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify''text' => $context['is_marked_notify'] ? 'unnotify' 'notify''image' => ($context['is_marked_notify'] ? 'un' ''). 'notify.gif''lang' => true'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"''url' => $scripturl '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' 'on') . ';board=' $context['current_board'] . '.' $context['start'] . ';' $context['session_var'] . '=' $context['session_id']),
'markread' => array('text' => 'mark_read_short''image' => 'markread.gif''lang' => true'url' => $scripturl '?action=markasread;sa=board;board=' $context['current_board'] . '.0;' $context['session_var'] . '=' $context['session_id']),
);

// They can only mark read if they are logged in and it's enabled!
if (!$context['user']['is_logged'] || !$settings['show_mark_read'])
unset($normal_buttons['markread']);

// Allow adding new buttons easily.
call_integration_hook('integrate_messageindex_buttons', array(&$normal_buttons));

if (!$context['no_topic_listing'])
{
echo '
<div class="pagesection">
<div class="pagelinks floatleft">'
$txt['pages'], ': '$context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><strong>' $txt['go_down'] . '</strong></a>' '''</div>
'
template_button_strip($normal_buttons'right'), '
</div>'
;

// If Quick Moderation is enabled start the form.
if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > && !empty($context['topics']))
echo '
<form action="'
$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], '" method="post" accept-charset="'$context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">';

echo '
<div class="tborder topic_table" id="messageindex">
<table class="table_grid" cellspacing="0">
<thead>
<tr class="catbg">'
;

// Are there actually any topics to show?
if (!empty($context['topics']))
{
echo '
<th scope="col" class="first_th" width="8%" colspan="2">&nbsp;</th>
<th scope="col" class="lefttext"><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=subject'$context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ';desc' '''">'$txt['subject'], $context['sort_by'] == 'subject' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a> / <a href="'$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=starter'$context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ';desc' '''">'$txt['started_by'], $context['sort_by'] == 'starter' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></th>
<th scope="col" width="14%"><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=replies'$context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ';desc' '''">'$txt['replies'], $context['sort_by'] == 'replies' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a> / <a href="'$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=views'$context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ';desc' '''">'$txt['views'], $context['sort_by'] == 'views' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></th>';
// Show a "select all" box for quick moderation?
if (empty($context['can_quick_mod']))
echo '
<th scope="col" class="lefttext last_th" width="26%"><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=last_post'$context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ';desc' '''">'$txt['last_post'], $context['sort_by'] == 'last_post' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></th>';
else
echo '
<th scope="col" class="lefttext" width="26%"><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=last_post'$context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ';desc' '''">'$txt['last_post'], $context['sort_by'] == 'last_post' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></th>';

// Show a "select all" box for quick moderation?
if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1)
echo '
<th scope="col" class="last_th" width="24"><input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check" /></th>'
;

// If it's on in "image" mode, don't show anything but the column.
elseif (!empty($context['can_quick_mod']))
echo '
<th class="last_th" width="4%">&nbsp;</th>'
;
}
// No topics.... just say, "sorry bub".
else
echo '
<th scope="col" class="first_th" width="8%">&nbsp;</th>
<th colspan="3"><strong>'
$txt['msg_alert_none'], '</strong></th>
<th scope="col" class="last_th" width="8%">&nbsp;</th>'
;

echo '
</tr>
</thead>
<tbody>'
;

/* START COMMENT OUT BY List Of Users in Boards and Topics
if (!empty($settings['display_who_viewing']))
{
echo '
<tr class="windowbg2 whos_viewing">
<td colspan="', !empty($context['can_quick_mod']) ? '6' : '5', '" class="smalltext">';
if ($settings['display_who_viewing'] == 1)
echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members'];
else
echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) or $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], '
</td>
</tr>';
}
/* END COMMENT OUT BY List Of Users in Boards and Topics */

// If this person can approve items and we have some awaiting approval tell them.
if (!empty($context['unapproved_posts_message']))
{
echo '
<tr class="windowbg2">
<td colspan="'
, !empty($context['can_quick_mod']) ? '6' '5''">
<span class="alert">!</span> '
$context['unapproved_posts_message'], '
</td>
</tr>'
;
}

$stickybar false;
$normalbar false;
foreach ($context['topics'] as $topic)
{
if ($topic['is_sticky'] && !$stickybar)
{
echo '
<tr class="titlebg">
<td colspan="'
, empty($options['display_quick_mod']) ? '7' '8''">
<strong>'
$txt['costa_topico_fixo'], '</strong>
</td>
</tr>
'
;
$stickybar true;
}
elseif (!$topic['is_sticky'] && $stickybar && !$normalbar)
{
echo '
<tr class="titlebg">
<td colspan="'
, empty($options['display_quick_mod']) ? '7' '8''">
<strong>'
$txt['costa_topico_normal'], '</strong>
</td>
</tr>
'
;
$normalbar true;
}
// Is this topic pending approval, or does it have any posts pending approval?
if ($context['can_approve_posts'] && $topic['unapproved_posts'])
$color_class = !$topic['approved'] ? 'approvetbg' 'approvebg';
// We start with locked and sticky topics.
elseif ($topic['is_sticky'] && $topic['is_locked'])
$color_class 'stickybg locked_sticky';
// Sticky topics should get a different color, too.
elseif ($topic['is_sticky'])
$color_class 'stickybg';
// Locked topics get special treatment as well.
elseif ($topic['is_locked'])
$color_class 'lockedbg';
// Last, but not least: regular topics.
else
$color_class 'windowbg';

// Some columns require a different shade of the color class.
$alternate_class $color_class '2';

echo '
<tr>
<td class="icon1 '
$color_class'">
<img src="'
$settings['images_url'], '/topic/'$topic['class'], '.gif" alt="" />
</td>
<td class="icon2 '
$color_class'">
<img src="'
$topic['first_post']['icon_url'], '" alt="" />
</td>
<td class="subject '
$alternate_class'">
<div '
, (!empty($topic['quick_mod']['modify']) ? 'id="topic_' $topic['first_post']['id'] . '" onmouseout="mouse_on_div = 0;" onmouseover="mouse_on_div = 1;" ondblclick="modify_topic(\'' $topic['id'] . '\', \'' $topic['first_post']['id'] . '\');"' ''), '>
'
$topic['is_sticky'] ? '<strong>' '''<span id="msg_' $topic['first_post']['id'] . '">'$topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' $txt['awaiting_approval'] . ')</em>' ''), '</span>'$topic['is_sticky'] ? '</strong>' '';

// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="'
$topic['new_href'], '" id="newicon' $topic['first_post']['id'] . '"><img src="'$settings['lang_images_url'], '/new.gif" alt="'$txt['new'], '" /></a>';

echo '
<p>'
$txt['started_by'], ' '$topic['first_post']['member']['link'], '
<small id="pages' 
$topic['first_post']['id'] . '">'$topic['pages'], '</small>
</p>
</div>
</td>
<td class="stats '
$color_class'">
'
$topic['replies'], ' '$txt['replies'], '
<br />
'
$topic['views'], ' '$txt['views'], '
</td>
<td class="lastpost '
$alternate_class'">
<a href="'
$topic['last_post']['href'], '"><img src="'$settings['images_url'], '/icons/last_post.gif" alt="'$txt['last_post'], '" title="'$txt['last_post'], '" /></a>
'
;
if (!$modSettings['disable_avatar'])
echo '<div style="float: left; margin-right: 4px;">'$topic['last_post']['member']['avatar'], '</div>';
echo '
'
$topic['last_post']['time'], '<br />
'
$txt['by'], ' '$topic['last_post']['member']['link'], '
</td>'
;

// Show the quick moderation options?
if (!empty($context['can_quick_mod']))
{
echo '
<td class="moderation '
$color_class'" align="center">';
if ($options['display_quick_mod'] == 1)
echo '
<input type="checkbox" name="topics[]" value="'
$topic['id'], '" class="input_check" />';
else
{
// Check permissions on each and show only the ones they are allowed to use.
if ($topic['quick_mod']['remove'])
echo '<a href="'$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], ';actions['$topic['id'], ']=remove;'$context['session_var'], '='$context['session_id'], '" onclick="return confirm(\''$txt['quickmod_confirm'], '\');"><img src="'$settings['images_url'], '/icons/quick_remove.gif" width="16" alt="'$txt['remove_topic'], '" title="'$txt['remove_topic'], '" /></a>';

if ($topic['quick_mod']['lock'])
echo '<a href="'$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], ';actions['$topic['id'], ']=lock;'$context['session_var'], '='$context['session_id'], '" onclick="return confirm(\''$txt['quickmod_confirm'], '\');"><img src="'$settings['images_url'], '/icons/quick_lock.gif" width="16" alt="'$txt['set_lock'], '" title="'$txt['set_lock'], '" /></a>';

if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
echo '<br />';

if ($topic['quick_mod']['sticky'])
echo '<a href="'$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], ';actions['$topic['id'], ']=sticky;'$context['session_var'], '='$context['session_id'], '" onclick="return confirm(\''$txt['quickmod_confirm'], '\');"><img src="'$settings['images_url'], '/icons/quick_sticky.gif" width="16" alt="'$txt['set_sticky'], '" title="'$txt['set_sticky'], '" /></a>';

if ($topic['quick_mod']['move'])
echo '<a href="'$scripturl'?action=movetopic;board='$context['current_board'], '.'$context['start'], ';topic='$topic['id'], '.0"><img src="'$settings['images_url'], '/icons/quick_move.gif" width="16" alt="'$txt['move_topic'], '" title="'$txt['move_topic'], '" /></a>';
}
echo '
</td>'
;
}
echo '
</tr>'
;
}

if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == && !empty($context['topics']))
{
echo '
<tr class="titlebg">
<td colspan="6" align="right">
<select class="qaction" name="qaction"'
$context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' '''>
<option value="">--------</option>'
$context['can_remove'] ? '
<option value="remove">' 
$txt['quick_mod_remove'] . '</option>' ''$context['can_lock'] ? '
<option value="lock">' 
$txt['quick_mod_lock'] . '</option>' ''$context['can_sticky'] ? '
<option value="sticky">' 
$txt['quick_mod_sticky'] . '</option>' ''$context['can_move'] ? '
<option value="move">' 
$txt['quick_mod_move'] . ': </option>' ''$context['can_merge'] ? '
<option value="merge">' 
$txt['quick_mod_merge'] . '</option>' ''$context['can_restore'] ? '
<option value="restore">' 
$txt['quick_mod_restore'] . '</option>' ''$context['can_approve'] ? '
<option value="approve">' 
$txt['quick_mod_approve'] . '</option>' ''$context['user']['is_logged'] ? '
<option value="markread">' 
$txt['quick_mod_markread'] . '</option>' '''
</select>'
;

// Show a list of boards they can move the topic to.
if ($context['can_move'])
{
echo '
<select class="qaction" id="moveItTo" name="move_to" disabled="disabled">'
;

foreach ($context['move_to_boards'] as $category)
{
echo '
<optgroup label="'
$category['name'], '">';
foreach ($category['boards'] as $board)
echo '
<option value="'
$board['id'], '"'$board['selected'] ? ' selected="selected"' '''>'$board['child_level'] > str_repeat('=='$board['child_level'] - 1) . '=&gt;' ''' '$board['name'], '</option>';
echo '
</optgroup>'
;
}
echo '
</select>'
;
}

echo '
<input type="submit" value="'
$txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' &amp;&amp; confirm(\''$txt['quickmod_confirm'], '\');" class="button_submit qaction" />
</td>
</tr>'
;
}

echo '
</tbody>
</table>
</div>
<a id="bot"></a>'
;

// Finish off the form - again.
if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > && !empty($context['topics']))
echo '
<input type="hidden" name="' 
$context['session_var'] . '" value="' $context['session_id'] . '" />
</form>'
;

echo '
<div class="pagesection">
'
template_button_strip($normal_buttons'right'), '
<div class="pagelinks">'
$txt['pages'], ': '$context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#top"><strong>' $txt['go_up'] . '</strong></a>' '''</div>
</div>'
;
}

// Show breadcrumbs at the bottom too.
theme_linktree();

// Show everybody who has viewed this topic within the last 15 minutes:
if (isset($context['view_members_list']))
{
echo '
<div class="cat_bar"><h3 class="catbg">' 
$txt['who_title'] . '</h3></div>
<div class="plainbox">' 
$txt['users_browsing_board'] . ':<br/>';

// Show the actual people viewing the topic
echo empty($context['view_members_list']) ? '0 ' $txt['members'] : implode(', '$context['view_members_list']) . ((empty($context['view_num_hidden']) || $context['can_moderate_forum']) ? '' ' (+ ' $context['view_num_hidden'] . ' ' $txt['hidden'] . ')');

// Now show how many guests are here too.
echo $txt['who_and'], $context['view_num_guests'], ' '$context['view_num_guests'] == $txt['guest'] : $txt['guests'];

echo '</div>';
}

echo '
<div class="tborder" id="topic_icons">
<div class="description">
<p class="floatright" id="message_index_jump_to">&nbsp;</p>'
;

if (!$context['no_topic_listing'])
echo '
<p class="floatleft smalltext">'
, !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? '
<img src="' 
$settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' $txt['participation_caption'] . '<br />' '''
<img src="' 
$settings['images_url'] . '/topic/normal_post.gif" alt="" align="middle" /> ' $txt['normal_topic'] . '<br />
<img src="' 
$settings['images_url'] . '/topic/hot_post.gif" alt="" align="middle" /> ' sprintf($txt['hot_topics'], $modSettings['hotTopicPosts']) . '<br />
<img src="' 
$settings['images_url'] . '/topic/veryhot_post.gif" alt="" align="middle" /> ' sprintf($txt['very_hot_topics'], $modSettings['hotTopicVeryPosts']) . '
</p>
<p class="smalltext">
<img src="' 
$settings['images_url'] . '/icons/quick_lock.gif" alt="" align="middle" /> ' $txt['locked_topic'] . '<br />' . ($modSettings['enableStickyTopics'] == '1' '
<img src="' 
$settings['images_url'] . '/icons/quick_sticky.gif" alt="" align="middle" /> ' $txt['sticky_topic'] . '<br />' '') . ($modSettings['pollMode'] == '1' '
<img src="' 
$settings['images_url'] . '/topic/normal_poll.gif" alt="" align="middle" /> ' $txt['poll'] : '') . '
</p>'
;

echo '
<script type="text/javascript"><!-- // --><![CDATA[
if (typeof(window.XMLHttpRequest) != "undefined")
aJumpTo[aJumpTo.length] = new JumpTo({
sContainerId: "message_index_jump_to",
sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">'
$context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
iCurBoardId: '
$context['current_board'], ',
iCurBoardChildLevel: '
$context['jump_to']['child_level'], ',
sCurBoardName: "'
$context['jump_to']['board_name'], '",
sBoardChildLevelIndicator: "==",
sBoardPrefix: "=> ",
sCatSeparator: "-----------------------------",
sCatPrefix: "",
sGoButtonLabel: "'
$txt['quick_mod_go'], '"
});
// ]]></script>
<br class="clear" />
</div>
</div>'
;

// Javascript for inline editing.
echo '
<script type="text/javascript" src="' 
$settings['default_theme_url'] . '/scripts/topic.js"></script>
<script type="text/javascript"><!-- // --><![CDATA[

// Hide certain bits during topic edit.
hide_prefixes.push("lockicon", "stickyicon", "pages", "newicon");

// Use it to detect when we\'ve stopped editing.
document.onclick = modify_topic_click;

var mouse_on_div;
function modify_topic_click()
{
if (in_edit_mode == 1 && mouse_on_div == 0)
modify_topic_save("'
$context['session_id'], '", "'$context['session_var'], '");
}

function modify_topic_keypress(oEvent)
{
if (typeof(oEvent.keyCode) != "undefined" && oEvent.keyCode == 13)
{
modify_topic_save("'
$context['session_id'], '", "'$context['session_var'], '");
if (typeof(oEvent.preventDefault) == "undefined")
oEvent.returnValue = false;
else
oEvent.preventDefault();
}
}

// For templating, shown when an inline edit is made.
function modify_topic_show_edit(subject)
{
// Just template the subject.
setInnerHTML(cur_subject_div, \'<input type="text" name="subject" value="\' + subject + \'" size="60" style="width: 95%;" maxlength="80" onkeypress="modify_topic_keypress(event)" class="input_text" /><input type="hidden" name="topic" value="\' + cur_topic_id + \'" /><input type="hidden" name="msg" value="\' + cur_msg_id.substr(4) + \'" />\');
}

// And the reverse for hiding it.
function modify_topic_hide_edit(subject)
{
// Re-template the subject!
setInnerHTML(cur_subject_div, \'<a href="'
$scripturl'?topic=\' + cur_topic_id + \'.0">\' + subject + \'<\' +\'/a>\');
}

// ]]></script>'
;
}
function 
template_filterPrefix()
{
global $context$modSettings$scripturl$txt;

// Prefix
if (!empty($modSettings['PostPrefix_enable_filter']) && !empty($context['prefix']['post']))
{

echo'
<div class="cat_bar">
<h3 class="catbg">
'
$txt['PostPrefix_filter'],'
</h3>
</div>
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="content">'
;

// Show all the prefixes for this board.
foreach ($context['prefix']['post'] as $prefix)
echo'
<a href="' 
$scripturl '?board=' $context['current_board'] . '.0;prefix=' $prefix['id'] . '">' PostPrefix::formatPrefix($prefix['id']) . '</a>, ';

echo'
<a href="'
$scripturl'?board='$context['current_board'], '.0;prefix=0">'$txt['PostPrefix_filter_noprefix'], '</a>, 
<a href="'
$scripturl'?board='$context['current_board'], '.0">'$txt['PostPrefix_filter_all'], '</a>
</div>
<span class="botslice"><span></span></span>
</div>
<br class="clear" />'
;
}
}
?>
Title: Re: SMF Post Prefix
Post by: br360 on October 27, 2015, 08:42:37 PM
Odd. Ok, did you have any errors when installing this? Can you go through the file edits to make sure that the code was in fact added to all of the templates and source files.

Look for "Manual Install Instructions for SMF", and then click the parse button- http://custom.simplemachines.org/mods/index.php?mod=4038
Title: Re: SMF Post Prefix
Post by: ArkServer on October 28, 2015, 08:32:16 AM
Quote from: br360 on October 27, 2015, 08:42:37 PM
Odd. Ok, did you have any errors when installing this? Can you go through the file edits to make sure that the code was in fact added to all of the templates and source files.

Look for "Manual Install Instructions for SMF", and then click the parse button- http://custom.simplemachines.org/mods/index.php?mod=4038

yes i did the edits that failed after i installed it but it didn't work as i hoped so i went ahead and did every file manually and its fixed now. (afaik)
Title: Re: SMF Post Prefix
Post by: Dreadaxe on November 04, 2015, 11:42:28 AM
SMF Post Prefix
"Fatal error: Cannot call method self::settings() or method does not exist in /home/assoston/www/taverne/Sources/PostPrefixAdmin.php on line 59"
Can you help me?
Title: Re: SMF Post Prefix
Post by: Dreadaxe on November 06, 2015, 05:30:18 AM
Quote from: Juvept on August 11, 2015, 08:44:38 AM
Hi,

After i install this mod (without any problem), and i go to Admin > Forum > Postprefix this error appears:


QuoteFatal error: Cannot call method self::general() or method does not exist in /home/a6532119/public_html/Sources/PostPrefixAdmin.php on line 59

Can anyone tell me who to solve please?

Same problem
Title: Re: SMF Post Prefix
Post by: piiero on November 06, 2015, 11:29:33 AM
I've a little problem when I want to install the mod, there is an error in the test and when I install it, I have no access on topics of my forum and I like to know how I could solve this problem... Here are two screen of my problem
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fnsa37.casimages.com%2Fimg%2F2015%2F11%2F06%2F151106051326730592.png&hash=32c831aeefc390523dcb25e2cfbe2288aad8f6cb)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fnsa37.casimages.com%2Fimg%2F2015%2F11%2F06%2F151106051626864905.png&hash=6dba0d28d93303d19b28d42a80ea379092effd30)
Title: Re: SMF Post Prefix
Post by: Kindred on November 06, 2015, 02:42:58 PM
why do people continue to install mods when there are errors in the tests -- and a big red warning that continuing will cause problems?

also, why does no one actually read the FAQ/wiki?
Specifically: http://wiki.simplemachines.org/smf/Error_in_mod_installation

if you installed the mod, despite the failures and the big red warning, then you have to MANUALLY apply the change(s) in the bits that failed the test for automatic code install.
Title: Re: SMF Post Prefix
Post by: Jade Elizabeth on December 06, 2015, 09:52:01 AM
Just wanted to pop in and give you a huge thanks for making this. It's absolutely beautiful. You've done a really really fantastic job. I hope one day I can make mods this clean and efficient, but until then I will just stand by and appreciate your work ;D.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on December 06, 2015, 07:26:51 PM
Thanks!
Title: Re: SMF Post Prefix
Post by: Jade Elizabeth on December 07, 2015, 02:10:16 AM
Actually there's a bit of a problem I'm having here lol. In the boards where a prefix is required (or used) replies to the first posts have "Re: <span class=" as their subject. Also the quick reply has what I am assuming is a partially hidden field showing...it's showing the title after the quick reply description. In my case it's "Free Inspirational poster "everything will be okay" coloring page" />" (or in the screenshot "paid test" but paid is the prefix)

I've also included a screenshot because I am having a hard time explaining. I've double checked the files and everything seems fine. I'm not sure what's causing this. No errors in the logs. I've tried uninstalling and reinstalling (uninstalling fixed the issue and reinstalling put it back).

I've only got these installed:
@mention members 1.1.2
SMF Post Prefix 2.0.3
Simple Audio Video Embedder 3.5.1
Social Login 3.4
httpBL 2.5.1
Stop Spammer 2.3.9
Title: Re: SMF Post Prefix
Post by: Jade Elizabeth on December 07, 2015, 09:26:50 AM
Upon further investigation it seems to only happen on the Redsy theme and it's happening no matter what I do. If you have any idea what could be causing it to play up like this I would really appreciate it :).
Title: Re: SMF Post Prefix
Post by: +Nachi+ on December 09, 2015, 05:48:50 PM
Thanks for the awesome mod!

I was wondering if in future you're thinking of adding an option of adding more than one prefix to the topic (preferably I'd need at east two) and/or is that's already possible if some simple changes?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on December 09, 2015, 10:39:58 PM
Quote from: Jade Elizabeth on December 07, 2015, 09:26:50 AM
Upon further investigation it seems to only happen on the Redsy theme and it's happening no matter what I do. If you have any idea what could be causing it to play up like this I would really appreciate it :).

Have you checked the changes in Redsy for the display?? Could be the problem  :P




Quote from: +Nachi+ on December 09, 2015, 05:48:50 PM
Thanks for the awesome mod!

I was wondering if in future you're thinking of adding an option of adding more than one prefix to the topic (preferably I'd need at east two) and/or is that's already possible if some simple changes?

I do have thought on it. Currently I'm not sure if it should be in the same mod and if it worth the effort. Anyway, this mod won't have any more features until I can work on it for SMF 2.1

Thanks
Title: Re: SMF Post Prefix
Post by: Jade Elizabeth on December 09, 2015, 11:06:26 PM
Actually Gluz figured it out, he's pretty amazing! I edited the wrong part completely because Redsy moves the linktree into the index template and does it all there, I didn't know I was editing the wrong bit because I didn't compare where the mod should have edited on the default to where I edited...which sounds like such a blonde thing to do LOL :D

FOR ANYONE USING REDSY HERE ARE THE CUSTOMISATIONS NEEDED TO GET THIS MOD WORKING ON IT:
http://www.simplemachines.org/community/index.php?topic=541827.0
Title: Re: SMF Post Prefix
Post by: Jade Elizabeth on April 04, 2016, 05:17:52 AM
Hey so I dunno if I am the only one with this problem...but EVERY time I add a membergroup I have to alter the database to include it in the prefixes...

Can I just turn the membergroup requirement off? There's hundreds of prefixes and I can't manage them one by one that's not intuitive. There's no "bulk add" a membergroup or board option and there's no listing of prefixes on the boards or membergroups (which could be nice but again I probably have 200 by now lol).
Title: Re: SMF Post Prefix
Post by: Diego Andrés on April 04, 2016, 06:43:44 AM
Yeah I have found that annoying too as an admin.
I haven't really looked into it but I'm thinking the best way to add some sort of option for it.

Regards
Title: Re: SMF Post Prefix
Post by: Jade Elizabeth on April 04, 2016, 07:57:09 AM
Turns out I have 50 prefixes ha ha...sure felt like 200 though!

If you want someone to help test it I'd be happy to help :D. It might be easier to just add bulk actions to the screen - "apply to all prefixes" or "apply to selected"...displaying 50 prefixes would be taxing.
Title: Re: SMF Post Prefix
Post by: Coyote Keith on May 27, 2016, 07:21:42 PM
Just installed this mod on my site 2.0.11 with no errors or issues. The mod works fine but I noticed I'm now getting a logged error every time a search is made. The error is in the attach pic

The line of code in question is

'prefix' => PostPrefix::formatPrefix($message['id_prefix']),

Appreciate any help.



Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 02, 2016, 12:33:29 AM
Quote from: Coyote Keith on May 27, 2016, 07:21:42 PM
Just installed this mod on my site 2.0.11 with no errors or issues. The mod works fine but I noticed I'm now getting a logged error every time a search is made. The error is in the attach pic

The line of code in question is

'prefix' => PostPrefix::formatPrefix($message['id_prefix']),

Appreciate any help.

I will take a look
Title: Re: SMF Post Prefix
Post by: Jade Elizabeth on June 24, 2016, 08:54:12 AM
I'd love to suggest a "remove prefix" option....if you move a topic to a board without prefixes, or the prefix it has is not enabled there it would be great if it would be stripped....and if not if there was a remove prefix option shown it would be super helpful too :D.
Title: Re: SMF Post Prefix
Post by: MarkieNKV on June 26, 2016, 03:14:36 AM
Hi Diego,

First of all, what a great modification you've created. Really like it. But i am missing something about it, i want to set the permission to view a topic based on the used prefix.

For example, i got 3 usergroups named:

- Patient
- Parents
- Partners

I got 7 prefixes named:

- [Patient]
- [Parents]
- [Partners]
- [Patient, Parents]
- [Patient, Partners]
- [Patient, Parents, Partners]
- [Parents, Partners]


All those usergroups can create a topic and they use the prefix to set the visibility of the topic. So if a member of the usergroup "Patient" creates a topic with the prefix [Patient, Parents, Partners] then the usergroups Patient, Parents and Partners can view (and reply on) the topic.

But if a member of the usergroup "Patient" creates a topic with the prefix [Patient, Partners], then only the usergroups Patient and Partners can view (and reply on) the topic. The usergroup Parents shouldn't see the topic at all.

Is this possible to add this function?
Title: Re: SMF Post Prefix
Post by: Kindred on June 26, 2016, 08:29:07 AM
This mod adds text...   adding permissions based on that text would be a huge change....  basically a completely new mod.
Title: Re: SMF Post Prefix
Post by: MarkieNKV on June 27, 2016, 03:49:14 AM
Then i must look for another solution.

Really can't understand why you only would like to add text and do nothing further with that. But that's my opinion ofcourse. Or i must find someone who could make it for us.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 27, 2016, 12:16:48 PM
Quote from: MarkieNKV on June 27, 2016, 03:49:14 AM
Then i must look for another solution.

Really can't understand why you only would like to add text and do nothing further with that. But that's my opinion ofcourse. Or i must find someone who could make it for us.

Pure organization and esthetic and can save you from adding useless forums/categories, you can just use prefixes instead
Title: Re: SMF Post Prefix
Post by: MarkieNKV on June 27, 2016, 12:28:24 PM
Oke, i can understand that. Same thing is what i want to do with our forum.

Currently we got a seperate board for Patients, a seperate board for Parents and a seperate board for Partners.

I want to get rid of that, but the wish from our members is that they can ask questions directly to some usergroups. Therefor i came at your mod, because it fits most of the things that i was looking for except that it doesn't got the extra permission settings i was looking for.

I've created a Mod Request here (http://www.simplemachines.org/community/index.php?topic=546981.0). It would be wonderfull if you would make a Paid Pro version of your currect mod that does support the permission settings i'm looking for.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 27, 2016, 12:45:40 PM
Sorry but as @Kindred said, this mod is just a prefix mod  :P
btw, you may want to search for "private topics", that could possibly fit your needs
Title: Re: SMF Post Prefix
Post by: ndmccain on July 04, 2016, 11:42:13 AM
First, thank you for this great mod!

I'm using the SMF4Mobile theme and the latest release of SMF. I was hoping you could point me in the right direction on how to enable prefixes on the forum view (page that shows all the topics)? The MessageIndex.template is below.

<?php
// Version: 2.0 RC2; MessageIndex

function template_main()
{
global $context$settings$options$scripturl$modSettings$txt$board_info$user_info;

if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0))
{
echo '
<ul data-role="listview" style="margin-bottom: 0;" class="ui-base-link ui-page-theme-b">
<li>
<h3>'
$txt['parent_boards'], '</h3>
</li>'
;

foreach ($context['boards'] as $board)
{
echo '
<li'
, !$board['new'] ? ' class="ui-link-read"' '''>
<a href="'
$board['href'], '" name="b'$board['id'], '"'$board['is_redirect'] ? ' rel="external"' '''>
<h3>'
$board['name'], '</h3>';

if (!empty($board['description']))
echo '
<p>
<strong>'
strip_tags($board['description']), '</strong>
</p>'
;

if (!empty($board['last_post']['id']))
echo '
<p class="last_post">
'
$txt['last_post'], ': '$board['last_post']['subject'], ' '$txt['by'], ' '$board['last_post']['member']['name'], ' '$txt['on'], ' '$board['last_post']['time'], '
</p>'
;

echo '
</a>
</li>'
;

if (!empty($board['children']))
foreach ($board['children'] as $child)
echo '
<li class="child_board'
, !$child['new'] ? ' ui-li-fade' '''">
<a href="'
$child['href'], '">
'
$child['name'], '
</a>
</li>'
;
}

echo '
</ul>'
;
}

if (!empty($modSettings['topbottomEnable']))
{
echo '
'
, empty($context['boards']) ? '' '<br />''
<a data-role="button" class="goDown" data-icon="arrow-d" data-inline="true" style="margin-top: '
, empty($context['boards']) ? '-0.3em' '-0.5em'';">Go Down</a><br />',
(empty($context['boards']) ? '<br />' '');
}
echo '
<ul data-role="listview"'
, !empty($context['boards']) && $context['start'] == ' style="margin-top: 0;"' ''' class="ui-base-link">
<li>
<h3>'
$board_info['name'], '</h3>
</li>
<li><p>'
$context['description'], '</p></li>';

// No topics.... just say, "sorry bub".
if (empty($context['topics']))
echo '
<li><p class="ui-li-desc">'
$txt['msg_alert_none'], '</p><li>';

$sticky_title_shown false;
$normal_title_shown false;
foreach ($context['topics'] as $topic)
{
// Is the topic sticky and no title has been shown yet?
if ($topic['is_sticky'] && !$sticky_title_shown)
{
$sticky_title_shown true;
echo '
<li>'
$txt['sticky_topics'], '</li>';
}
elseif (!$topic['is_sticky'] && $sticky_title_shown && !$normal_title_shown)
{
$normal_title_shown true;
echo '
<li>'
$txt['topics'], '</li>';
}

echo '
<li class="ui-page-theme-b'
, !$topic['new'] || $user_info['is_guest'] ? ' ui-link-read' '''"">
<a href="'
$topic['first_post']['href'], '">
<p style="word-wrap: break-word; width: 50%; margin-top: 0;">
<strong>'
$topic['first_post']['member']['name'], '</strong> '$txt['on'], ' '$topic['first_post']['time'], '
</p>
<p class="ui-li-aside" style="width: 45%;">
'
$txt['views'], ': '$topic['views'], ', '$txt['replies'], ': '$topic['replies'], '
</p>
<h3>'
$topic['first_post']['subject'], empty($topic['approved']) ? ' (' $txt['awaiting_approval'] . ')' '''</h3>';

if (!empty($topic['last_post']['id']) && $topic['last_post']['id'] != $topic['first_post']['id'])
echo '
<p class="ui-li-desc last_post">'
$txt['last_post'], ' '$txt['by'], ' '$topic['last_post']['member']['name'], ' '$txt['on'], ' '$topic['last_post']['time'], '</p>';

echo '
</a>'
;
// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="'
strip_hash($topic['new_href']), '" data-scrollto="'get_hash($topic['new_href']), '" id="newicon' $topic['first_post']['id'] . '"></a>';

echo '
</li>'
;
}

echo '
</ul><br />'
;

if (!empty($modSettings['topbottomEnable']))
{
echo '
<a data-role="button" class="goUp" data-icon="arrow-u" data-inline="true">Go Up</a>'
;
}

// Create the button set...
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new''text' => 'new_topic''icon' => 'plus''url' => $scripturl '?action=post;board=' $context['current_board'] . '.0'),
'post_poll' => array('test' => 'can_post_poll''text' => 'new_poll''icon' => 'plus''url' => $scripturl '?action=post;board=' $context['current_board'] . '.0;poll'),
'notify' => array('test' => 'can_mark_notify''text' => $context['is_marked_notify'] ? 'unnotify' 'notify''icon' => ($context['is_marked_notify'] ? 'minus' 'star'), 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"''url' => $scripturl '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' 'on') . ';board=' $context['current_board'] . '.' $context['start'] . ';' $context['session_var'] . '=' $context['session_id']),
'markread' => array('text' => 'mark_read_short''icon' => 'check''url' => $scripturl '?action=markasread;sa=board;board=' $context['current_board'] . '.0;' $context['session_var'] . '=' $context['session_id']),
);

// They can only mark read if they are logged in and it's enabled!
if (!$context['user']['is_logged'] || !$settings['show_mark_read'])
unset($normal_buttons['markread']);

template_button_strip($normal_buttons);
}

function 
template_filterPrefix()
{
global $context$modSettings$scripturl$txt;

// Prefix
if (!empty($modSettings['PostPrefix_enable_filter']) && !empty($context['prefix']['post']))
{

echo'
<ul class="ui-base-link ui-page-theme-b">
<li class="ui-boardindex-whos"> <h4>
'
$txt['PostPrefix_filter'],'
</h4>'
;



// Show all the prefixes for this board.
foreach ($context['prefix']['post'] as $prefix)
echo'
<a href="' 
$scripturl '?board=' $context['current_board'] . '.0;prefix=' $prefix['id'] . '">' PostPrefix::formatPrefix($prefix['id']) . '</a>, ';

echo'
<a href="'
$scripturl'?board='$context['current_board'], '.0;prefix=0">'$txt['PostPrefix_filter_noprefix'], '</a>, 
<a href="'
$scripturl'?board='$context['current_board'], '.0">'$txt['PostPrefix_filter_all'], '</a>
</li></ul>
<br class="clear" />'
;
}
}

?>


I've added the prefixes to every other template but can't figure that one out!

Any help is great! Thanks!
Title: Re: SMF Post Prefix
Post by: MarkieNKV on July 12, 2016, 04:22:41 AM
Quote from: Diego Andrés on June 27, 2016, 12:45:40 PM
Sorry but as @Kindred said, this mod is just a prefix mod  :P
btw, you may want to search for "private topics", that could possibly fit your needs
Sorry for the late reply, but private topics ain't it either.
Title: Re: SMF Post Prefix
Post by: RDXing - VC-MP on September 08, 2016, 03:46:48 PM
Hello i got an error here

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi.imgur.com%2Fr3fQkBo.png&hash=c062cbc072a5f86f39be7e4acd3415bc31e629ea)
Title: Re: SMF Post Prefix
Post by: DenDen60 on November 03, 2016, 09:31:33 AM
I would like to see a forum that uses this MOD. Can anyone share a link? Thanks
Title: Re: SMF Post Prefix
Post by: Jade Elizabeth on November 15, 2016, 11:12:04 PM
I use it and I LOVE it.

http://www.colormeforum.com/f/coloring-toolbox/ <Lots of colors
http://www.colormeforum.com/f/other-crafts/ <Two colors
http://www.colormeforum.com/f/other-relaxation/ <One color

Keep in mind my forum has its own styling so yours and mine may look different, but mine shouldn't change it that much. You may wish to fiddle with yours.
Title: Re: SMF Post Prefix
Post by: Black Tiger on December 01, 2016, 08:38:32 AM
I would like to use this mod on a forum, but have a couple of questions.

1.) Is this mod working flawlesly now without any issues and without errors in logs?
2.) Would it work on most styles (on a 2.012 forum)
3.) The forum is from a friend of mine. He has several subforums from which he wants to move all threads to 1 other subforum.
Before the moving threads to the single subforum he wants to give a prefix to all posts in all subforums via an sql command.

For example, these are subforums:
- rainy
- misty
- snow
- wind

Say he wants to make 1 subforum called "wheather conditions" and move all posts of the above subforums in there.
But before doing that, he want's to make 4 prefixes, so all threads in the above subforums will get
[rainy]
[misty]
[snow]
[wind]
as prefix. Since these subforums contain a lot of posts, he wants to do this via a mysql command.

He has daily backups. Is this possible and if yes, what is the correct sql command to do this without breaking things (like other forums or subforums or threads).
Title: Re: SMF Post Prefix
Post by: Adz. on January 15, 2017, 10:32:35 AM
how do i make the prefix box smaller? It's quite big for a prefix lol
Title: Re: SMF Post Prefix
Post by: Dreadaxe on January 24, 2017, 06:56:28 PM
After i install this mod (without any problem), and i go to Admin > Forum > Postprefix this error appears:
QuoteFatal error: Cannot call method self::general() or method does not exist in /home/a6532119/public_html/Sources/PostPrefixAdmin.php on line 59

Can anyone tell me who to solve please?
Title: Re: SMF Post Prefix
Post by: Dreadaxe on January 30, 2017, 06:43:09 PM
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimageshack.com%2Fa%2Fimg921%2F519%2FJnVJNM.png&hash=a9deee1cc65aea76d592e38a74cdf83b2638e8ee)
Title: Re: SMF Post Prefix
Post by: Dreadaxe on January 31, 2017, 04:12:49 PM
Part of problem solve.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimageshack.com%2Fa%2Fimg924%2F8508%2FazR3eT.png&hash=1e1107ad56b5ca494801fc2be042acce9094e1d2)

with theme AlphaCentury I have a show problem
Title: Re: SMF Post Prefix
Post by: landyvlad on February 01, 2017, 09:09:35 AM
Installed this today.  Works perfectly. Bloody fantastic ! Top job !
Title: Re: SMF Post Prefix
Post by: Coyote Keith on February 20, 2017, 08:32:13 PM
Quote from: Diego Andrés on June 02, 2016, 12:33:29 AM
Quote from: Coyote Keith on May 27, 2016, 07:21:42 PM
Just installed this mod on my site 2.0.11 with no errors or issues. The mod works fine but I noticed I'm now getting a logged error every time a search is made. The error is in the attach pic

The line of code in question is

'prefix' => PostPrefix::formatPrefix($message['id_prefix']),

Appreciate any help.

I will take a look

Did you check on this yet? I just did a fresh forum install today 2/0/13 and with no other mods, this mod causes errors on every search. If I remove the mod, the errors go away.

Here is an error from the log.

     
8: Undefined index: id_prefix
Apply Filter: Only show the errors from this file
File: /home/xxxxx/public_html/xxxx.com/Sources/Search.php
Line: 2013

This does not happen when using the home page search box but always happens when using the advanced search from the main menu (where the Prefix drop down is)

Love the mod but can't have all the errors on this install. Thanks
Title: Re: SMF Post Prefix
Post by: AnilK on March 15, 2017, 04:01:32 AM
Same here, great mod but I'm getting lots of errors:

8: Undefined index: id_prefix
File: /home/******/public_html/Sources/Search.php
Line: 2018

8: Undefined index: id_prefix
File: /home/******/public_html/Sources/Post.php
Line: 789
Title: Re: SMF Post Prefix
Post by: GL700Wing on March 19, 2017, 06:35:28 AM
Quote8: Undefined index: id_prefix
Apply Filter: Only show the errors from this file
File: /home/xxxxx/public_html/xxxx.com/Sources/Search.php
The fix for this issue is as follows:

In the file ./Sources/Search.php
Find:
t.id_topic, t.is_sticky, t.locked, t.id_poll, t.num_replies, t.num_views,

Replace with
t.id_topic, t.is_sticky, t.locked, t.id_poll, t.num_replies, t.num_views, t.id_prefix,

The search now works without throwing errors but the PostPrefix bit doesn't work in the search (ie, it doesn't actually search using the prefix if one is specified) - someone else can fix that!

Title: Re: SMF Post Prefix
Post by: GL700Wing on March 20, 2017, 12:24:41 AM
Quote from: GL700Wing on March 19, 2017, 06:35:28 AM
The search now works without throwing errors but the PostPrefix bit doesn't work in the search (ie, it doesn't actually search using the prefix if one is specified) - someone else can fix that!
My bad - the Postrefix search does work but it doesn't show the PostPrefix as part of the topic title.
Title: Re: SMF Post Prefix
Post by: phoxim on April 12, 2017, 12:05:23 AM
very cool mod, it rans perfectly under 1.1.x.
we upgraded to SMF 2.0.13 and now we are facing some problems with the mod:

installation was fine.
while adding prefixes to a specified board the mod starts setting these prefixes to many threads im various boards randomly.

any suggestions please!

wolfgang
Title: Re: SMF Post Prefix
Post by: landyvlad on April 12, 2017, 05:53:04 AM
I've not had that issue at all.

As you've upgraded SMF versions, I suggest you uninstall, then reinstall the mod.
(It's likely, or even certain, the mod has been updated since you originally installed it)
Title: Re: SMF Post Prefix
Post by: phoxim on April 13, 2017, 12:14:33 AM
Quote from: landyvlad on April 12, 2017, 05:53:04 AM
I've not had that issue at all.

As you've upgraded SMF versions, I suggest you uninstall, then reinstall the mod.
(It's likely, or even certain, the mod has been updated since you originally installed it)

that is exactly what I did!
w.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on April 26, 2017, 08:25:58 AM
I'm sorry, I haven't been around for a while, can you please update me on the issue you were having? Or did you fixed it already?
And was it a mod failure? So I can update it.
Thanks :)
Title: Re: SMF Post Prefix
Post by: edi1967 on April 30, 2017, 09:12:46 AM
very nice mod but i want ask this:

Is possible have Prefix instead of begin of title at the end ?

i means instead of this:

[PREFIX] Topic Title

have this

Topic Title [PREFIX]

Thx for your help
Title: Re: SMF Post Prefix
Post by: Arantor on April 30, 2017, 09:55:47 AM
Then it's not really a prefix, is it? It's also more likely to not be noticed by users if done that way.
Title: Re: SMF Post Prefix
Post by: AnilK on May 12, 2017, 06:20:44 AM
Quote from: Diego Andrés on April 26, 2017, 08:25:58 AM
I'm sorry, I haven't been around for a while, can you please update me on the issue you were having? Or did you fixed it already?
And was it a mod failure? So I can update it.
Thanks :)
Hi, I don't know if it is a mod failure or not, but here is the error log:

8: Undefined index: id_prefix
File: /home/******/public_html/Sources/Post.php
Line: 789 ( $context['id_prefix'] = $row['id_prefix']; )
Title: Re: SMF Post Prefix
Post by: Jackmoon on June 10, 2017, 07:18:10 PM
Hello, how can I make the background color that I select or the box is smaller uses reseller and the size is too with browser F12 and how to do and edit but I do not know where I can do it because I do not find any CSS file, help?
Title: Re: SMF Post Prefix
Post by: GL700Wing on June 12, 2017, 08:57:11 PM
Fixed a bug that occurred when using 'Search in topic subjects only' (mostly I was getting an 'Undefined index: prefix' error in Search.php but occasionally I was also getting a database error relating to SQL syntax in Search.php).

In ./Sources/Search.php
Find:
$subject_query['where'][] = 't.id_prefix ' . $search_params['prefix'];
Replace with:
$subject_query['where'][] = 't.id_prefix = ' . $search_params['prefix'];
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 04, 2017, 08:50:12 PM
Quote from: GL700Wing on June 12, 2017, 08:57:11 PM
Fixed a bug that occurred when using 'Search in topic subjects only' (mostly I was getting an 'Undefined index: prefix' error in Search.php but occasionally I was also getting a database error relating to SQL syntax in Search.php).

In ./Sources/Search.php
Find:
$subject_query['where'][] = 't.id_prefix ' . $search_params['prefix'];
Replace with:
$subject_query['where'][] = 't.id_prefix = ' . $search_params['prefix'];

Thanks! I missed that one I guess, will update it shortly
Title: Re: SMF Post Prefix
Post by: confuseamuse on August 07, 2017, 04:05:02 AM
I can't see anywhere in the mod files how I'd change the CSS appearance of the prefixes. Need some help with eyesight.
Title: Re: SMF Post Prefix
Post by: d3vcho on August 07, 2017, 06:07:12 AM
What would you like to change exactly?
Title: Re: SMF Post Prefix
Post by: confuseamuse on August 07, 2017, 06:54:34 AM
I realised that you can CSS the changes, you just need to use '!important' override the inline CSS.
Title: Re: SMF Post Prefix
Post by: jammydodge on January 27, 2018, 10:48:12 AM
Hi can we change the order of the prefixes in the site search function? They are displayed by prefix ID rather than name.
Title: Re: SMF Post Prefix
Post by: jammydodge on January 27, 2018, 04:54:23 PM
Also is it correct that the prefix mod does not work for guests? I'd rather it did  ;D By not working, I mean the filter doesn't show up, nor does the list of prefixes in the search function. My install of the mod was a bit hacky but after checking the code I can't see any errors.
Title: Re: SMF Post Prefix
Post by: landyvlad on January 28, 2018, 09:19:44 AM
G'day

I've been getting a lot of these

Quote
http://gsx1400owners.org/forum/index.php?action=search2
8: Undefined index: id_prefixApply
File: /home3/gsxowner/public_html/forum/Sources/Search.php
Line: 2013

This seems to be slightly different to errors noted previously though same file, different line number.

Would the fix still be as per GL700Wing's suggestion here:
https://www.simplemachines.org/community/index.php?topic=536401.msg3931072#msg3931072
?

-----

forum: http://gsx1400owners.org/forum
PHP 5.6
SMF ver 2.0.15  (recent upgrade from 2.0.13)
SMF Post Prefix ver 2.0.3
Title: Re: SMF Post Prefix
Post by: juliereader on January 29, 2018, 06:11:25 AM
got this error with 2.0.15


Replace    ./Sources/Subs-Post.php    Test failed
Title: Re: SMF Post Prefix
Post by: juliereader on February 14, 2018, 08:08:38 AM
Any help with this mod ?

got this error with 2.0.15

Replace    ./Sources/Subs-Post.php    Test failed
Title: Re: SMF Post Prefix
Post by: -Rock Lee- on February 14, 2018, 08:23:36 AM
Quote from: juliereader on February 14, 2018, 08:08:38 AM
Any help with this mod ?

got this error with 2.0.15

Replace    ./Sources/Subs-Post.php    Test failed

Simply the mod does not find the line that was specified for the change possibly by another modification what is altering it must only do the manual modification of the file and then proceed to install it ...


Regards!
Title: Re: SMF Post Prefix
Post by: juliereader on February 14, 2018, 08:48:20 AM
Quote from: Rock Lee on February 14, 2018, 08:23:36 AM
Quote from: juliereader on February 14, 2018, 08:08:38 AM
Any help with this mod ?

got this error with 2.0.15

Replace    ./Sources/Subs-Post.php    Test failed

Simply the mod does not find the line that was specified for the change possibly by another modification what is altering it must only do the manual modification of the file and then proceed to install it ...


Regards!


can you please explain a little bit more..what to do where to edit etc

i am not good with coding :)
Title: Re: SMF Post Prefix
Post by: Steve on February 14, 2018, 08:58:17 AM
On the test failed line to the left is a clipboard icon. Click it and a new window will open showing you what it's looking for in that file and what it wants to replace it with.

You might want to read this: http://wiki.simplemachines.org/smf/Error_in_mod_installation
Title: Re: SMF Post Prefix
Post by: -Rock Lee- on February 14, 2018, 09:03:46 AM
Quote from: juliereader on February 14, 2018, 08:48:20 AM
can you please explain a little bit more..what to do where to edit etc

i am not good with coding :)

Ah excuse the step to the biggest before going to the file you mark and then edit it with some editor by the notebook exemplko ++ or the editor that gives you the cocktail if you do it online ...
   
$topicOptions['sticky_mode'] !== null || $topicOptions['lock_mode'] !== null || $topicOptions['poll'] !== null
change it for
$topicOptions['sticky_mode'] !== null || $topicOptions['lock_mode'] !== null || $topicOptions['poll'] !== null || $topicOptions['id_prefix'] != null

id_poll = {raw:id_poll}
change it for
id_prefix = {raw:id_prefix}, id_poll = {raw:id_poll}

But attach your ./Sources/Subs-Post.php because they are several modifications, but looking at the parse of the mod you can see in this same site of mods and go see line by line ...


Regards!

Title: Re: SMF Post Prefix
Post by: landyvlad on March 14, 2018, 11:41:30 PM
Is there a version of this mod for SMF 2.1 on the way ?  Please !

This is the MOST functional mod I have on my forum.
I NEED it, I love it. My members love it, and use it.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 15, 2018, 09:37:24 AM
Quote from: landyvlad on March 14, 2018, 11:41:30 PM
Is there a version of this mod for SMF 2.1 on the way ?  Please !

This is the MOST functional mod I have on my forum.
I NEED it, I love it. My members love it, and use it.

Not atm, but eventually once the RC1 is released.
Title: Re: SMF Post Prefix
Post by: landyvlad on March 15, 2018, 08:52:19 PM
thank you :)
Title: Re: SMF Post Prefix
Post by: glamfelix on March 24, 2018, 10:32:19 AM
So, I am using 2.0.11 and these tests fail:
./Sources/ManagePermissions.php
./Sources/Subs-Post.php
./Sources/MessageIndex.php

I went ahead (After backing up lol) and installed to see what would happen, and the prefix itself worked, however what happened was all of our boards that were children of another could not be linked to. Their links just took to a blank screen. The threads within could be accessed but only via a direct link rather than the board display. Do you know what causes that problem?
Title: Re: SMF Post Prefix
Post by: Kindred on March 24, 2018, 06:58:21 PM
You have to manually apply the code tha failed to auto install.
Title: Re: SMF Post Prefix
Post by: Steve on March 25, 2018, 07:47:39 PM
http://wiki.simplemachines.org/smf/Error_in_mod_installation
Title: Re: SMF Post Prefix
Post by: njtweb on May 11, 2018, 08:12:27 AM
I have the subs-recent test failure.

The manual change instructs to find this

m.poster_time, m.subject, m.id_topic, m.id_member, m.id_msg,

In my subs-recent file it looks like this.

m.poster_time, ms.subject, m.id_topic, m.id_member, m.id_msg, b.id_board, b.name AS board_name,

I am currently running 2.0.15
Title: Re: SMF Post Prefix
Post by: Kindred on May 11, 2018, 09:55:30 AM
looks like another mod may have already added extra code...  which is the typical issue.

so, manually make the changes.
Title: Re: SMF Post Prefix
Post by: njtweb on May 11, 2018, 11:48:42 AM
Quote from: Kindred on May 11, 2018, 09:55:30 AM
looks like another mod may have already added extra code...  which is the typical issue.

so, manually make the changes.

The only problem I see is in my subs.recent code it says ms.subject, (below)

m.poster_time, [b]ms.subject,[/b] m.id_topic, m.id_member, m.id_msg, b.id_board, b.name AS board_name,

The manual change for the mod tells me to look for the code below but the code below doesn't have ms.subject and neither does the manual update it says to change to. I'm guessing whatever other mod I have changed m.subject to ms.subject and I can't change that or it'll break something??
m.poster_time, m.subject, m.id_topic, m.id_member, m.id_msg,



Title: Re: SMF Post Prefix
Post by: Kindred on May 11, 2018, 12:29:12 PM
that would likely be correct.
Title: Re: SMF Post Prefix
Post by: njtweb on May 11, 2018, 12:42:00 PM
Quote from: Kindred on May 11, 2018, 12:29:12 PM
that would likely be correct.

Ok good. Glad I didn't change anything then. I'll just prefix posts people make for tournaments, clinics or tryouts on my own by editing them.

Thanks again!
Title: Re: SMF Post Prefix
Post by: landyvlad on May 21, 2018, 09:38:00 PM
I've had an unusual issue reported by one of my members who uses an iMac.
He is unable to access the drop down menu when creating or modifying the OP in a thread.

My other admins report that it works fine on their iPads and iPhones, so it might be something specific to the iMac

Any ideas?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on May 22, 2018, 09:31:01 PM
2.1 - 22 May 2018
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmftricks.com%2FThemes%2FSMFTricks%2Fimages%2Fchangelog%2Fbug--minus.png&hash=193021b52e1a966929e8e36330ff0bcc4df04d41) Finally adressed the issues in Search.php.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmftricks.com%2FThemes%2FSMFTricks%2Fimages%2Fchangelog%2Fbug--minus.png&hash=193021b52e1a966929e8e36330ff0bcc4df04d41) Fixed a small bug preventing the mod from previweing boards/groups in the settings.
Title: Re: SMF Post Prefix
Post by: landyvlad on May 23, 2018, 02:29:51 AM
Hmm OK trying to install v 2.1

When I go to upload the mod package to SMF, I get the message:
"The file you are uploading already exists on the server. Please delete it first then try again."

In fact I currently have version 2.0.3, and I have not uploaded ver 2.1 previously.

Any idea what would be causing this or how to fix it?

I tried to uninstall v 2.0.3 and there are several errors thrown in the test parser, for replacements in ./Sources/Subs-Post.php and ./Sources/Search.php

What's the best course of action?
1. Press uninstall anyway, then find the ones it missed and edit manually? OR
2. Do all edits manually to remove the code?

Naturally I want to ensure that whatever way I approach it does NOT lose any of the existing prefix types, boards, etc.

Would love if you could help. Thanks  :)

http://gsx1400owners.org/forum


Title: Re: SMF Post Prefix
Post by: Diego Andrés on May 23, 2018, 02:34:40 AM
You can just do the edits left on previous replies.
https://www.simplemachines.org/community/index.php?topic=536401.msg3918941#msg3918941
https://www.simplemachines.org/community/index.php?topic=536401.msg3931072#msg3931072

And replace the files from Sources folder.
Title: Re: SMF Post Prefix
Post by: pocttopus on May 23, 2018, 04:56:41 AM
This is great mod and I like it a lot.  :D
After updating from 2.0.3 version to 2.1 version, there is 2.0.3 still present.
Is this normal behavior? ???

Thanks! :)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on May 23, 2018, 09:13:51 AM
Quote from: pocttopus on May 23, 2018, 04:56:41 AM
This is great mod and I like it a lot.  :D
After updating from 2.0.3 version to 2.1 version, there is 2.0.3 still present.
Is this normal behavior? ???

Thanks! :)

Nope, I just forgot to edit the version number inside the package.
Title: Re: SMF Post Prefix
Post by: landyvlad on May 23, 2018, 10:40:02 AM
Diego I'm not sure what you mean - just do those edits / replace files.
Do you mean to run the uninstaller despite the errors, and then do those edits?

and when you say "And replace the files from Sources folder." - which files from where to where?

Sorry I'm a bit confused and

It won't let me upload the new version to SMF at all, which seems unrelated to the edits you suggest ?

Thank you for your patience.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on May 23, 2018, 11:52:52 AM
I meant to update it doing that, instead of uninstalling it and installing it again.

Regards
Title: Re: SMF Post Prefix
Post by: njtweb on June 22, 2018, 03:58:58 PM
Do prefixes have anything to do with the URL? I have a couple which I'd like to modify the prefix name, as long as changing it doesn't screw up the URL after it's changed.
Title: Re: SMF Post Prefix
Post by: Kindred on June 23, 2018, 10:38:39 PM
Not unless you use pretty urls
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 05, 2018, 02:01:52 AM
2.1.1 - 05 July 2018
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmftricks.com%2FThemes%2FSMFTricks%2Fimages%2Fchangelog%2Fbug--minus.png&hash=193021b52e1a966929e8e36330ff0bcc4df04d41) Fixed a minor issue when posting events in the calendar. Thanks to @GL700Wing for reporting and suggesting a solution.
Title: Re: SMF Post Prefix
Post by: jack208 on July 15, 2018, 10:03:37 AM
Got this installed on my ver 2.0.15 forum. No issue on the installation. Works as described. Great job here, Diego.

Have a usage question. I notice there are two ways one can assign permissions - 1) n the Permissions page and 2) in the Prefix Edit page.

1) (Generic) Permissions page
Here you can edit the Manage Prefixes and Use Prefixes permissions for each membergroup.

2) Prefix Edit page
However if you add or edit a prefix, in the Prefix Edit page, you can also assign "Allowed groups" permissions which said "Groups allowed to use the prefix".

My question is how does the (1) Use Prefixes permissions differ or overlap with the (2) Allowed groups permissions?
Title: Re: SMF Post Prefix
Post by: landyvlad on July 18, 2018, 08:56:16 PM
Umm, I have a question.  The mod is .rar but the package manager won't accept RAR files to upload. It chucks this error:

Quote
An Error Has Occurred!
The Package Manager currently allows only these file types: zip, tgz, tar.gz.

So I'm more than a little bit confused now.
Title: Re: SMF Post Prefix
Post by: GigaWatt on July 19, 2018, 05:04:40 PM
It's probably just a mistake on the author's part ;).

Extract the content in a folder, compress the content in a zip archive (no subdirectories, just the content), name the file however you like, as long as it ends with .zip, upload it via the package manager ;).
Title: Re: SMF Post Prefix
Post by: landyvlad on July 19, 2018, 08:28:38 PM
Diego - sorry to keep hassling you on this.
Presumably the edits you noted earlier to update don't equate to the latest version (2.1.1).
I love this mod so I want to be absolutely sure I am doing it correctly. 

What's the best way to proceed as we stand now please?
Title: Re: SMF Post Prefix
Post by: confuseamuse on July 20, 2018, 06:11:45 AM
Quote from: GigaWatt on July 19, 2018, 05:04:40 PM
It's probably just a mistake on the author's part ;).

Extract the content in a folder, compress the content in a zip archive (no subdirectories, just the content), name the file however you like, as long as it ends with .zip, upload it via the package manager ;).

This is what I had to do when I was using it.
Title: Re: SMF Post Prefix
Post by: GigaWatt on July 20, 2018, 11:03:45 AM
Quote from: landyvlad on July 19, 2018, 08:28:38 PM
Presumably the edits you noted earlier to update don't equate to the latest version (2.1.1).

install.xml and package-info.xml have been modified on 07.05.‎2018.
Title: Re: SMF Post Prefix
Post by: jack208 on August 01, 2018, 02:32:44 PM
Am experiencing some issues when I filter a board by a prefix.
If I cleared the filter (select Show All Topics), things go back to normal.

The screenshot I've is on the STUDIO (responsive) theme but I tested this on the Default Curve theme with the same results. If you need to access my site, I can provide you with a dummy acct.

Hope to hear from Diego - or anyone who have some idea why this is happening? Thanks
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 01, 2018, 06:50:17 PM
Seems to be an issue never noticed.
I'll look into it
Title: Re: SMF Post Prefix
Post by: StarredSkies on August 04, 2018, 06:51:52 PM
I've had the same problem as Jack today, actually! It fixed itself after awhile, but I'd definitely take a look at it when you have time.

Side note: Is there any possibility of adding the option to have more than one prefix in the future? This would be SUPER helpful.
Title: Re: SMF Post Prefix
Post by: landyvlad on August 08, 2018, 02:15:16 AM
You mean more than one prefix per thread title? That'd be a visual nightmare IMHO.
It's not designed as a tag system which seems like what you are wanting.
Title: Re: SMF Post Prefix
Post by: landyvlad on August 08, 2018, 02:21:14 AM
A note of thanks to Diego Andrés

Diego, aside from anti-spam,  this is hands down the most useful mod I have on my forum.  It's perfect for my forum with technical threads, how to's, and the sale forums as well.

Let's just say that I won't be upgrading to 2.1 until (and unless) a 2.1 version is ultimately available. :D

(Fully understand you'd want to wait until RC at least, before tackling that). This is just encouragement to assure you it will be worthwhile :)

Thanks again.

(https://media.giphy.com/media/MUeQeEQaDCjE4/giphy.gif)

Title: Re: SMF Post Prefix
Post by: StarredSkies on August 13, 2018, 09:13:55 PM
Yep, exactly what I meant. Visual nightmare indeed haha.

<333 thank you
Title: Re: SMF Post Prefix
Post by: Dreadaxe on August 14, 2018, 05:59:09 AM
Quote from: StarredSkies on August 04, 2018, 06:51:52 PMSide note: Is there any possibility of adding the option to have more than one prefix in the future? This would be SUPER helpful.
Approved this idea too
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 14, 2018, 03:54:09 PM
I've thought about the multiple prefixes.
It's possible but that would turn it into a label mod or similar.
Could be included as a feature or a whole different thing.

Quote from: landyvlad on August 08, 2018, 02:21:14 AM
A note of thanks to Diego Andrés

(Fully understand you'd want to wait until RC at least, before tackling that). This is just encouragement to assure you it will be worthwhile :)

Thanks again.

Thanks a lot.
A version for 2.1 is already done for the most part since this mod uses hooks, but of course it's been a while so I'll have to update it again. But yes, won't be available until the RC version of 2.1 :P




About the issue mentioned I haven't been ale to reproduce it but there might be something so I'll try to do some more tests.
Title: Re: SMF Post Prefix
Post by: jack208 on August 14, 2018, 09:55:06 PM
Quote from: Diego Andrés on August 14, 2018, 03:54:09 PM
About the issue mentioned I haven't been ale to reproduce it but there might be something so I'll try to do some more tests.
Would getting access to my site helps?
Title: Re: SMF Post Prefix
Post by: StarredSkies on August 17, 2018, 06:33:58 PM
That'd definitely be a helpful modification... maybe in the future? ;)
Title: Re: SMF Post Prefix
Post by: Cathal on September 07, 2018, 04:59:41 PM
Is it possible to remove the option of no prefix so they have to select a prefix - I have a coupla forums where they should select a prefix
Title: Re: SMF Post Prefix
Post by: Diego Andrés on September 07, 2018, 09:44:13 PM
Quote from: Cathal on September 07, 2018, 04:59:41 PM
Is it possible to remove the option of no prefix so they have to select a prefix - I have a coupla forums where they should select a prefix

Put those boards in the require prefix section and it will force users to select one.

Regards
Title: Re: SMF Post Prefix
Post by: Cathal on October 15, 2018, 04:12:59 PM
Quote from: Diego Andrés on September 07, 2018, 09:44:13 PM
Quote from: Cathal on September 07, 2018, 04:59:41 PM
Is it possible to remove the option of no prefix so they have to select a prefix - I have a coupla forums where they should select a prefix

Put those boards in the require prefix section and it will force users to select one.

Regards

I have the board selected under that section but still get No Prefix option
Title: Re: SMF Post Prefix
Post by: GL700Wing on October 15, 2018, 05:38:38 PM
Quote from: Cathal on September 07, 2018, 04:59:41 PM
Is it possible to remove the option of no prefix so they have to select a prefix - I have a coupla forums where they should select a prefix
Yes - I've done this on my forums for the same reason (it didn't make sense to me to have a 'No Prefix' option if a prefix is required - as opposed to being optional - for a specific board).

In ./Themes/default/Post.template.php
Find:
<select name="id_prefix" id="id_prefix">
<optgroup label="', $txt['PostPrefix_select_prefix'], '">
<option value="0"', ($context['id_prefix'] == 0) ? ' selected' : '' ,'>', $txt['PostPrefix_prefix_none'], '</option>';



Replace With:
<select name="id_prefix" id="id_prefix">',
// Only add the "[No Prefix]" option if a prefix is NOT required.
($_SESSION['require_prefix'] == 0) ? '<optgroup label="' . $txt['PostPrefix_select_prefix'] . '">
<option value="0"' . ($context['id_prefix'] == 0) ? ' selected' : '' . '>' . $txt['PostPrefix_prefix_none'] . '</option>' : '';


Title: Re: SMF Post Prefix
Post by: Cathal on October 16, 2018, 01:19:26 PM
Thanks GL700Wing, that's done the job
Title: Re: SMF Post Prefix
Post by: Cathal on November 06, 2018, 04:45:31 PM
Is it possible to have groups of prefixes i.e. for one board  there is certain prefixes but for another board there is another group of prefixes
Title: Re: SMF Post Prefix
Post by: StarredSkies on November 06, 2018, 08:16:34 PM
If you mean dedicating a certain prefix to a certain board, yes. When adding your prefix, click on the 'Usable in:' option and select the board you would like to use that prefix in. Repeat this step with the others.
Title: Re: SMF Post Prefix
Post by: landyvlad on January 21, 2019, 06:28:45 AM
Quote from: Diego Andrés on August 14, 2018, 03:54:09 PM

A version for 2.1 is already done for the most part since this mod uses hooks, but of course it's been a while so I'll have to update it again. But yes, won't be available until the RC version of 2.1 :P

Hmm RC1 is happening (admittedly it's not the ACTUAL RC1 it's the nightly github updates BUT it's getting close) so have you considered releasing a 2.1 version as a test/beta  version ?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 24, 2019, 06:37:33 PM
I will release it once I get a chance to update the build, shouldn't take that long.

Regards
Title: Re: SMF Post Prefix
Post by: landyvlad on January 27, 2019, 06:10:56 AM
Cool thanks for letting me know.
It's one of my "must have" mods it's fantastic 👍
Title: Re: SMF Post Prefix
Post by: landyvlad on February 06, 2019, 06:03:21 AM
Woohoo - RC1 formally released !

Waiting with bated breath

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2F1.bp.blogspot.com%2F-Jq6owX0G_uo%2FUIHMUS8e8-I%2FAAAAAAAAAeg%2FWw3CooB4Erw%2Fs1600%2FHold-Your-Breath.jpg&hash=7d7939c988e19dea9439507bf681cd5da54a506c)

I'm just keen, but not expecting you to drop everything to update the mod.
"It'll happen when it happens" is fine by me mate :)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on February 06, 2019, 11:10:27 AM
Yeah, hopefully this month  :P
Title: Re: SMF Post Prefix
Post by: landyvlad on February 06, 2019, 05:06:50 PM
Cool. Thanks Diego
Title: Re: SMF Post Prefix
Post by: landyvlad on April 09, 2019, 01:54:10 AM
FYI I did up this guide on using prefixes from a forum member's point of view (i.e. user rather than admin)
http://gsx1400owners.org/forum/index.php?topic=482.0

Diego feel free to copy it all, or steal the images or whatever, if they are of any use to you.

For that matter - anyone can if they like, if it helps explain it to their members.

Cheers
Title: Re: SMF Post Prefix
Post by: tjrpcaft on April 11, 2019, 04:02:45 AM
Is it possible to aloud the users to change the prefixe of past posts?
Title: Re: SMF Post Prefix
Post by: landyvlad on April 11, 2019, 08:14:45 AM
If they have permission to edit the post then they can change the prefix. Otherwise no.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 15, 2019, 01:41:54 AM
Version for 2.1 will be out this year I promise  :-[
Title: Re: SMF Post Prefix
Post by: landyvlad on July 15, 2019, 10:18:26 AM
Quote from: Diego Andrés on July 15, 2019, 01:41:54 AM
Version for 2.1 will be out this year I promise  :-[

(https://media.makeameme.org/created/ok-i-believe.jpg)

All good mate - life gets in the way of these things I know.
It'll come when it comes, but it really is one of the most useful (and most used) mods on my forum.  Great work.
Title: Re: SMF Post Prefix
Post by: dendemeier on August 14, 2019, 04:40:55 AM
Is there a way, to show the prefix within the recent posts?

I am working with post prefixes in the forum, but unfortunately the prefix aren´t shown there. So it get´s a little bit confusing.

I tried to edit the Boardindex.template.php for my theme, but nothing worked.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 15, 2019, 12:06:12 PM
Do you mean the recent posts in the boardindex?
Title: Re: SMF Post Prefix
Post by: dendemeier on August 16, 2019, 02:55:15 AM
Yes, exactly.

In our forum we have 2 subboards with exactly the same topic title within the subboards. (It´s a forum for a sim racing league with 2 divisions). In the recent posts section at the board index we want to see at first sight, which post belongs to which subboard. That´s why we are using the postprefix.

So the topic titles look like this:

[Prefix 1] Topic Name
[Prefix 2] Topic Name

Within the recent posts it is both shown as
Topic Name
Topic Name
and therefore you can´t recognize at the first sight, which topic belongs to which subboard.

Fun Fact: When i opend a new topic, the prefix is shown within the recent posts. When somebody answered to a post, the prefix is gone  ???
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 16, 2019, 03:18:14 AM
It's because only the first post (the topic) gets a prefix.
Title: Re: SMF Post Prefix
Post by: dendemeier on August 16, 2019, 03:27:29 AM
Ah alright. Can I change it anyhow, so that every post will get a prefix?

Or is it possible to show not the post title but the topic title within the recent topics?
Title: Re: SMF Post Prefix
Post by: chinaren on November 03, 2019, 07:32:15 AM

This is a great mod, exactly what I need!  Thank you!  The only thing is, my new board is RC2, or whatever the latest release is, so...

Quote from: Diego Andrés on July 15, 2019, 01:41:54 AM
Version for 2.1 will be out this year I promise  :-[


Pleeeese!   ;D
Title: Re: SMF Post Prefix
Post by: landyvlad on December 18, 2019, 12:21:33 AM
Diego I see the changelog hasn't ben updated since 2018 (bit much more important, the mod has :) )

In any event that leas me to ask - what PHP version is this mod compatible with? 7.1? 7.2 ?
Title: Re: SMF Post Prefix
Post by: GL700Wing on December 18, 2019, 01:01:00 AM
Quote from: landyvlad on December 18, 2019, 12:21:33 AM
Diego I see the changelog hasn't ben updated since 2018 (bit much more important, the mod has :) )

In any event that leas me to ask - what PHP version is this mod compatible with? 7.1? 7.2 ?

From  php 7.1 going away soon (https://www.simplemachines.org/community/index.php?topic=569552.0):

Quote from: Illori on September 08, 2019, 10:24:34 AM
SMF 2.0.15 will never support php 7.2. we dont apply patches to already existing releases.

we are working on SMF 2.0.16 which will have basic support for php 7.2.

we dont have a release date yet for 2.0.16. it will be ready when it is ready.

Title: Re: SMF Post Prefix
Post by: landyvlad on December 19, 2019, 08:18:41 PM
Umm, let me clarify mate.

I know that about SMF 2.0.x

I gather that the mod is being rewritten to be SMF 2.1.x compatible, and am therefore wondering what version of PHP will be required to ensure the Post Prefix mod works.

Assuming that's even relevant, of course. Maybe it's just implied that the new mod version for SMF2.1 (pending) will be compliant with 7.? and more.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on December 27, 2019, 02:37:26 PM
The mod only makes some tweaks and file edits (some avoided using hooks) so really would be compatible to whatever version SMF 2.1 is compatible with at the time is released or upgraded.
Title: Re: SMF Post Prefix
Post by: landyvlad on January 04, 2020, 10:23:36 AM
Thanks Diego (and GL700wing)
Title: Re: SMF Post Prefix
Post by: Gandrel on January 12, 2020, 09:23:35 PM
Hey everyone. I'm trying to figure out why I'm getting the error that I posted in this other topic (see URL below). I had posted it there because that's where I saw that others were having similar issues, but I think I should probably be posting here as I now believe the issue may be related to this mod. In the search query, I think the issue may be related to the following line having nothing after the "=":
AND t.id_prefix =
It is really supposed to be something like the following when you don't select a prefix to search by?:
AND t.id_prefix = ""

I'm not certain if that's it, but I do know that when I manually run the full query in phpMyAdmin without the "AND t.id_prefix =" line included, the query runs successfully.

See the following for the full query output from the error log:
https://www.simplemachines.org/community/index.php?topic=561137.msg4043333#msg4043333 (https://www.simplemachines.org/community/index.php?topic=561137.msg4043333#msg4043333)
Title: Re: SMF Post Prefix
Post by: landyvlad on March 05, 2020, 01:49:53 AM
Quote from: Diego Andrés on July 15, 2019, 01:41:54 AM
Version for 2.1 will be out this year I promise  :-[
:P

Hey mate with 2.1 RC3 edging ever closer is there any likelihood of a compatible version of this mod soon?
(Not having a go at you of course mate. Consider it a gentle reminder / nudge)

As I said before this is my favourite mod and I use it to great effect on my forum.  :) :) :) :)


Title: Re: SMF Post Prefix
Post by: wylekk on March 07, 2020, 04:00:16 AM
I use this mod on SMF 2.1 RC2  :)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on April 21, 2020, 03:01:08 PM
Quote from: landyvlad on March 05, 2020, 01:49:53 AM
Quote from: Diego Andrés on July 15, 2019, 01:41:54 AM
Version for 2.1 will be out this year I promise  :-[
:P

Hey mate with 2.1 RC3 edging ever closer is there any likelihood of a compatible version of this mod soon?
(Not having a go at you of course mate. Consider it a gentle reminder / nudge)

As I said before this is my favourite mod and I use it to great effect on my forum.  :) :) :) :)

Yes, new version basically finished but only 2.1 RC3 compatible because of a tiny change in a hook that isn't there on RC2.

Also atm mod doesn't add prefixes to Recent Posts anymore as it requires files to be edited or a poor performance via hooks. I can add these file modifications to the mod if you guys really want it, or I can just share the steps for people interested on that once it's available.

Aaaalsoooo search feature has been dropped due to the same reason, and because the filter box on boards already accomplish same results (but only per board) and it's more accurate and less broken than it is on SMF 2.0 version of the mod.
Title: Re: SMF Post Prefix
Post by: landyvlad on April 22, 2020, 12:05:02 AM
Thanks Diego that's welcome news !
Title: Re: SMF Post Prefix
Post by: pocttopus on May 20, 2020, 06:01:34 AM
Hello,

This is a nice mod, is there any chance to be available for 2.1rc2 version?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on May 20, 2020, 09:54:22 AM
Yes on Github you can find 3.0 version of the mod.
However, it's only compatible with current SMF 2.1 GitHub build or future RC3.
Title: Re: SMF Post Prefix
Post by: pocttopus on May 20, 2020, 10:22:51 AM
There will be RC3? Do you know when? Is it better to wait or should I use RC2?
I am still localhost with RC2 before going live so that's why I'm asking about RC3 release.

Thanks.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on May 20, 2020, 10:26:57 AM
It will be released when it's ready.
And it's up to you, both are RC versions and you can also use the current github, but like I said mod won't work properly on RC2 if that's what you really need. That's why this version of the mod is not on the modsite, there's no SMF version for it yet.
Title: Re: SMF Post Prefix
Post by: pocttopus on May 20, 2020, 10:29:03 AM
Ok @Diego Andrés, thanks a lot. ;)
Cheers and keep it up.  :)
Title: Re: SMF Post Prefix
Post by: landyvlad on June 02, 2020, 08:58:40 PM
I've come across an issue where some members are unable to add a prefix in our for sale forum, but others are able to.

All members are 'no primary membergroup' and permissions are set up appropriately.
Some members who used to be able to add prefixes are now unable to do so when creating a thread.

I've made no changes to installed mods or anything like that - the ONLY change made to the forum since this mod was lasty fully working is the upgrade path through to 2.0.17 (from 2.0.15 & 16)

Any ideas what I should be looking at to diagnose this please?


Edit: Oh just checked and I'm running version 2.0.3 of the mod and just noticed that the current version is 2.1.1 !
(stupid package manager is inaccurate when it comes to saying if mod islatest version apparently).

So that's probbaly the best place to start....

Title: Re: SMF Post Prefix
Post by: landyvlad on June 02, 2020, 09:11:14 PM
Went to uninstall the mod, so I could instal the new version. The following tests failed.
Quote
Type Action Description
12. Execute Modification ./Sources/Subs-Post.php Test failed

   1. Replace ./Sources/Subs-Post.php Test successful
   2. Replace./Sources/Subs-Post.php Test successful
   3. Replace ./Sources/Subs-Post.php Test successful
   4. Replace ./Sources/Subs-Post.php Test successful
   5. Replace ./Sources/Subs-Post.php Test successful
   6. Replace ./Sources/Subs-Post.php Test successful
   7. Replace ./Sources/Subs-Post.php Test successful
   8. Replace ./Sources/Subs-Post.php Test failed


19.
Execute Modification ./Sources/Search.php Test failed

   1. Replace ./Sources/Search.php Test successful
   2. Replace ./Sources/Search.php Test successful
   3. Replace ./Sources/Search.php Test successful
   4. Replace ./Sources/Search.php Test failed
   5. Replace ./Sources/Search.php Test successful
   6. Replace ./Sources/Search.php Test successful
   7. Replace ./Sources/Search.php Test successful
   8. Replace ./Sources/Search.php Test successful


I'm at a loss as to what exactly I need to do to uninstall this mod properly (and retain data) so that I can install the latest version.

Help appreciated.  :)


----


If I parse the mod install - looking at item 12 - the edits to Sources/Subs-Post.php there are 8 items in there.
Am I correct to assume the order of uninstall would be the same as the install - that is an error at number 8 would be the last change made as shown when parsing the install?
Namely -
QuoteFind: [Select]
$topicOptions['sticky_mode'] = isset($topicOptions['sticky_mode']) ? $topicOptions['sticky_mode'] : null;

   // This is longer than it has to be, but makes it so we only set/change what we have to.
Replace With: [Select]
$topicOptions['sticky_mode'] = isset($topicOptions['sticky_mode']) ? $topicOptions['sticky_mode'] : null;
   $topicOptions['id_prefix'] = isset($topicOptions['id_prefix']) ? $topicOptions['id_prefix'] : null;

   // This is longer than it has to be, but makes it so we only set/change what we have to.

in which case do I need to go to the file and see if I can find the code

$topicOptions['sticky_mode'] = isset($topicOptions['sticky_mode']) ? $topicOptions['sticky_mode'] : null;
$topicOptions['id_prefix'] = isset($topicOptions['id_prefix']) ? $topicOptions['id_prefix'] : null;

// This is longer than it has to be, but makes it so we only set/change what we have to.

to see whether it may have been changed by some other mod?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 02, 2020, 10:18:33 PM
Ehhh it's been a really long time since I checked that version of the mod but I'm certain that the file edits only changed for the search files in any update for the 2.0 version, so you're probably safe.
One of the fixes is here https://www.simplemachines.org/community/index.php?topic=536401.msg3931072#msg3931072
And for the rest were fixes in the Source files of the prefix mod, so you could backup both files and replace them with the current ones and see if you get it working fine.

The bug you describe has never been mentioned so it's probably new.
Also you should check each prefix and see if the post groups these users belong to are checked, this is a strange behavior I never fixed.
Title: Re: SMF Post Prefix
Post by: landyvlad on June 03, 2020, 02:57:04 AM
Yeah I looked at the changelog and you're right none of the changes in versions have anything which should have impacted this. as far as I can tell.

backup which files? subs-post.php and search.php?  After or before I uninstall, with errors?

and when you say replace them with the current versions.... from where - smf core?
(Not sure if any of my other mods will have made changes but it's probable I reckon)







Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 03, 2020, 09:52:28 AM
I'm referring to Subs-PostPrefix.php and PostPrefixAdmin.php
Title: Re: SMF Post Prefix
Post by: landyvlad on June 04, 2020, 01:29:00 AM
Um Ok can I be stupid and ask for a 1,2,3 guide as to exactly what I should be doing on this? Please.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 04, 2020, 01:37:59 PM
Do this: https://www.simplemachines.org/community/index.php?topic=536401.msg3931072#msg3931072
Then backup Sources/Subs-PostPrefix.php and Sources/PostPrefixAdmin.php

Then download the current package and extract the files mentioned above, and you'll replace those in your forum as I don't remember the specific changes for those files. This will get your mod updated with the latest version in terms of modifications/bugs fixed.

However, none of the past patches are related to your reported bug. I would need more information about that as it has never been reported before.
Title: Re: SMF Post Prefix
Post by: landyvlad on June 04, 2020, 10:34:35 PM
thanks I appreciate that. I'll see what else I can discover, if anything :)
Title: Re: SMF Post Prefix
Post by: Dreadaxe on July 28, 2020, 06:34:11 AM
Install the last version but I have
(https://i.imgur.com/935Gh93.png)
Title: Re: SMF Post Prefix
Post by: Dreadaxe on July 28, 2020, 06:49:29 AM
bank screen problem to sub forum
https://www.youtube.com/watch?v=PzOOBcvFdQ0

Help! :(
Title: Re: SMF Post Prefix
Post by: shawnb61 on August 25, 2020, 02:23:09 PM
Could you take a look at this item from the support forum?
https://www.simplemachines.org/community/index.php?topic=574448.msg4065999#msg4065999

Of note:
QuoteINSERT IGNORE INTO smf_log_search_results
(id_search, id_topic, relevance, id_msg, num_matches)
SELECT
17,
t.id_topic,
1000 * (
15 / (t.num_replies + 1) +
0 * CASE WHEN t.id_first_msg < 539465 THEN 0 ELSE (t.id_first_msg - 539465) / 231200 END +
0 * CASE WHEN t.num_replies < 200 THEN t.num_replies / 200 ELSE 1 END +
55 +
0 * t.is_sticky
) / 100 AS relevance,
t.id_first_msg,
1
FROM smf_topics AS t
INNER JOIN smf_log_search_subjects AS subj1 ON (subj1.id_topic = t.id_topic)
INNER JOIN smf_log_search_subjects AS subj2 ON (subj2.id_topic = subj1.id_topic)
WHERE t.approved = 1
AND subj1.word LIKE '%top%'
AND subj2.word LIKE '%gun%'
AND t.id_board != 49
AND t.id_prefix =
LIMIT 6000

Fichier: /home/******/public_html/*****/Sources/Search.php
Ligne: 1120

Thanks,
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 27, 2020, 04:03:14 PM
I'll no be around that much till next month but I'll make sure to take a look!
Title: Re: SMF Post Prefix
Post by: Dreadaxe on September 22, 2020, 06:48:14 AM
3.1 - 26 May 2020 > https://smftricks.com/index.php?topic=795.0

Last Modified: April 22, 2020, 02:27:27 PM > Latest Version: 2.1.1 > https://custom.simplemachines.org/mods/index.php?mod=4038

So simplemachines.org don't have the last version. version 2.1.1 (05 July 2018)

Is it right?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on September 22, 2020, 09:48:59 AM
Correct, version 3.0+ is only for SMF RC3 and above, but it's not released yet  :laugh:
If you wanna play around with both, it's on GitHub.
Title: Re: SMF Post Prefix
Post by: Dreadaxe on September 24, 2020, 08:34:42 AM
Quote from: Diego Andrés on September 22, 2020, 09:48:59 AM
Correct, version 3.0+ is only for SMF RC3 and above, but it's not released yet  :laugh:
If you wanna play around with both, it's on GitHub.

Too risk for my poor skills ^^
Wich version can I install on SMF SMF 2.0.17?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on September 24, 2020, 11:26:32 AM
The one in the modsite
Title: Re: SMF Post Prefix
Post by: StarredSkies on September 30, 2020, 07:16:59 PM
Hey Diego! As always, I'm in love with your modification as it makes sorting topics/threads so much easier. It's a blessing, really. Nevertheless, I am having an issue.

So when clicking on a prefix in the 'filter by prefix' bar, I get limited results. For example, the first and second pages of this prefix will have information, BUT when I click on the third page seen here (https://i.imgur.com/HTmxu34.png), no results will show. You can also see that the second page (here) (https://i.imgur.com/qTcyINb.png) and the fourth page (here) (https://i.imgur.com/ykfJ27E.png) have a significant gap between posts, noting that these posts (despite having a prefix) are lost. How can I fix this issue?

Alternatively, if I were to uninstall and reinstall this to figure out the issue, would my prefixes be removed completely or would they restore themselves?
Title: Re: SMF Post Prefix
Post by: Dreadaxe on October 05, 2020, 05:19:03 AM
Is it possible to have many prefix? Example "[Prefix A][Prefix B] Topic name"
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 05, 2020, 05:32:41 PM
Quote from: Dreadaxe on October 05, 2020, 05:19:03 AM
Is it possible to have many prefix? Example "[Prefix A][Prefix B] Topic name"

No it's not possible.




Quote from: StarredSkies on September 30, 2020, 07:16:59 PM
Hey Diego! As always, I'm in love with your modification as it makes sorting topics/threads so much easier. It's a blessing, really. Nevertheless, I am having an issue.

So when clicking on a prefix in the 'filter by prefix' bar, I get limited results. For example, the first and second pages of this prefix will have information, BUT when I click on the third page seen here (https://i.imgur.com/HTmxu34.png), no results will show. You can also see that the second page (here) (https://i.imgur.com/qTcyINb.png) and the fourth page (here) (https://i.imgur.com/ykfJ27E.png) have a significant gap between posts, noting that these posts (despite having a prefix) are lost. How can I fix this issue?

Alternatively, if I were to uninstall and reinstall this to figure out the issue, would my prefixes be removed completely or would they restore themselves?

I fixed this issue in the future version for SMF 2.1, but I'll look into this and see what's causing this behavior and try to fix it for another release.
Title: Re: SMF Post Prefix
Post by: Dreadaxe on October 06, 2020, 06:32:05 AM
Quote from: Diego Andrés on October 05, 2020, 05:32:41 PM
Quote from: Dreadaxe on October 05, 2020, 05:19:03 AM
Is it possible to have many prefix? Example "[Prefix A][Prefix B] Topic name"

No it's not possible.
No to the ToDoList?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 06, 2020, 10:49:49 AM
Quote from: Dreadaxe on October 06, 2020, 06:32:05 AM
Quote from: Diego Andrés on October 05, 2020, 05:32:41 PM
Quote from: Dreadaxe on October 05, 2020, 05:19:03 AM
Is it possible to have many prefix? Example "[Prefix A][Prefix B] Topic name"

No it's not possible.
No to the ToDoList?

Not really because it's a prefix mod, not a label or tags mod  ;D
Title: Re: SMF Post Prefix
Post by: StarredSkies on October 07, 2020, 02:27:38 AM
I would really appreciate it, thank you! Do you know what's causing the issue exactly? I could possibly look into a fix myself too. <3
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 27, 2020, 03:28:14 PM
3.1.2 - 27 October 2020
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Fixed typos in English language file.
(https://smftricks.com/Themes/SMFTricks/images/changelog/language.png) Added Spanish translation.

3.1.1 - 27 October 2020
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Fixed undefined error.

3.1 - 26 May 2020
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Issue when having multiple groups assigned to the use prefix permission.
(https://smftricks.com/Themes/SMFTricks/images/changelog/tag--plus.png) Small code improvements.

3.0 - 21 April 2020
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Filter prefixes box on boards revamped.
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Huge performance fixes and improvements.
(https://smftricks.com/Themes/SMFTricks/images/changelog/tag--plus.png) Code improvements and tweaks.
(https://smftricks.com/Themes/SMFTricks/images/changelog/tag--plus.png) Only hooks, no file edits.
(https://smftricks.com/Themes/SMFTricks/images/changelog/tag--plus.png) Compatible with SMF 2.1.x.




Quote from: StarredSkies on October 07, 2020, 02:27:38 AM
I would really appreciate it, thank you! Do you know what's causing the issue exactly? I could possibly look into a fix myself too. <3

No update on this yet, hopefully soon
Title: Re: SMF Post Prefix
Post by: chinaren on October 27, 2020, 03:42:11 PM
Hello DA!


Thank you for updating this mod, been waiting a while to use it, so was very happy to see this.   ;D


However, when I installed it (and it installed all okay), I kept getting HPT 500 errors on my board, mostly when I went to sub-boards.


When I looked at the error log, it said:





8192: Non-static method PostPrefix\Manage::prefixes() should not be called statically
http://xxx.com/index.php?action=admin;area=postprefix;sa=prefixes;added
/home/xxx/public_html/Sources/Subs.php (Line 5092)



Is there any quick fix for this, oh mighty one?  I thank you in advance, and in arrears.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 27, 2020, 03:50:25 PM
Quote from: chinaren on October 27, 2020, 03:42:11 PM
However, when I installed it (and it installed all okay), I kept getting HPT 500 errors on my board, mostly when I went to sub-boards.

When I looked at the error log, it said:



8192: Non-static method PostPrefix\Manage::prefixes() should not be called statically
http://xxx.com/index.php?action=admin;area=postprefix;sa=prefixes;added
/home/xxx/public_html/Sources/Subs.php (Line 5092)



What version of PHP?
And you're running RC3 right?
Title: Re: SMF Post Prefix
Post by: chinaren on October 27, 2020, 03:52:17 PM
Sorry, my bad, was going to post that info.  I'm running SMF 2.1 RC3.


Oh wait!  The PHP running on the server?  Ahhhhh.  That may be out of date.  I've had messages on my Wordpress software about that, and waiting for my hosting company to upgrade, so it may be that, although I'm not sure what versions we're talking about.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 27, 2020, 03:55:24 PM
Try replacing this file in /sources/postprefix

Title: Re: SMF Post Prefix
Post by: chinaren on October 27, 2020, 04:11:26 PM
 :-[   No, afraid that made no difference.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 27, 2020, 04:18:35 PM
I'm afraid I'm unable to replicate the issue atm and I don't have many PHP versions on my local to test this, I'll try to look into it
Title: Re: SMF Post Prefix
Post by: chinaren on October 27, 2020, 04:20:59 PM
Quote from: Diego Andrés on October 27, 2020, 04:18:35 PM
I'm afraid I'm unable to replicate the issue atm and I don't have many PHP versions on my local to test this, I'll try to look into it


Thanks for your help DA.  Much appreciated.  I'll stand by.   ::) :D
Title: Re: SMF Post Prefix
Post by: Arantor on October 27, 2020, 04:37:44 PM
This isn't a PHP version problem as such; this is a 'newer versions of PHP actually care that you use static correctly' problem.

PostPrefix\Settings defines Manage::prefixes as the function to call. The problem is that you're calling it as a static method this way (i.e. calling it as a function that exists in the class without having first instantiated it), but that prefixes() isn't a static method, the presumption is that it expects an instance of the class to call it against.

Since 2.1's Admin function routes it to call_helper you should be able to append a # to tell it to instantiate the Manage class first and then call the now non-static version - or you leave the caller as is and change the declaration of Manage::prefixes to be a public static function (i.e. callable without needing an instance of the class)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 27, 2020, 05:02:25 PM
Thanks for the information, I'll try to fix soonish
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 27, 2020, 08:30:44 PM
@chinaren Could you try the new package and let me know if it fixes your issue :D
Title: Re: SMF Post Prefix
Post by: chinaren on October 28, 2020, 04:03:26 AM
Quote from: Diego Andrés on October 27, 2020, 08:30:44 PM
@chinaren Could you try the new package and let me know if it fixes your issue :D


Hello DA.


Thanks for you quick response!  However, I tried the new one 3.2, and the same thing still happens I'm afraid.  Just in case I also cleared the cache and so on first.


It installs with no errors, and I can go to the settings okay, and add Prefixes fine etc, and I can see the main index page of my board.  I can also jump to the topics directly no problem.  However, when I try going from the main page (or anywhere) to one of the boards, then I get the http 500 error.  Also happens if I try replying to a subject.


One change this time though: I no longer get the error message in my admin error log!  So... Improvement?  :D
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 28, 2020, 11:37:38 AM
Is it the same error or a different one?
Title: Re: SMF Post Prefix
Post by: chinaren on October 28, 2020, 12:08:30 PM
Exactly the same, in the same places etc.  Except the lack of error in the error log.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 28, 2020, 02:16:34 PM
3.2.1 - 28 October 2020
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Fixed buggy subject on topics after adding the prefix to the title.

3.2 - 27 October 2020
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Fixed issues with Manage class.
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Fixed typo that caused undefined errors and unexpected behavior.
Title: Re: SMF Post Prefix
Post by: StarredSkies on January 22, 2021, 11:56:27 AM
I believe I found an issue for 2.0.17's version. Despite requiring a prefix on a board, users (with or without permissions to override) are able to post without a prefix. Is this a known glitch or something I could possibly fix?
Title: Re: SMF Post Prefix
Post by: GL700Wing on January 27, 2021, 05:48:56 AM
Quote from: StarredSkies on January 22, 2021, 11:56:27 AM
I believe I found an issue for 2.0.17's version. Despite requiring a prefix on a board, users (with or without permissions to override) are able to post without a prefix. Is this a known glitch or something I could possibly fix?
If the problem is caused by '[No Prefix]' being added to the list of options when a prefix is required you can make a small change to prevent this from happening - see https://www.simplemachines.org/community/index.php?topic=536401.msg3992189#msg3992189
Title: Re: SMF Post Prefix
Post by: chinaren on January 27, 2021, 06:29:55 AM
Quote from: Diego Andrés on October 28, 2020, 02:16:34 PM
3.2.1 - 28 October 2020
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Fixed buggy subject on topics after adding the prefix to the title.

3.2 - 27 October 2020
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Fixed issues with Manage class.
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Fixed typo that caused undefined errors and unexpected behavior.


Thank you for your efforts on this.  I tried again with 3.2.1 (after completely uninstalling the previous one), but whilst it still seems to work on installation, it then gets an error when I try to look at the boards.  Oddly I can look at topics. There is no error in the admin error log.  I think it must be just something to do with my forum.


The error is:





This page isn't working
xxxx.com is currently unable to handle this request.


HTTP ERROR 500




Do you think this is because my version of PHP isn't up to date on my server?  I've been meaning to update it, but you know how it is... ::)

Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 27, 2021, 07:55:49 PM
Quote from: chinaren on January 27, 2021, 06:29:55 AM

Do you think this is because my version of PHP isn't up to date on my server?  I've been meaning to update it, but you know how it is... ::)

I don't remember much about this issue but I tested different versions on php 7.x back then and it seemed to be working.
I don't have a test site at the moment, I'd be able to check it again soon.
Also if I recall correctly I told you that version only works with SMF 2.1 RC3 and you were running RC2.
Title: Re: SMF Post Prefix
Post by: chinaren on January 28, 2021, 03:59:16 AM
Quote from: Diego Andrés on January 27, 2021, 07:55:49 PM

Also if I recall correctly I told you that version only works with SMF 2.1 RC3 and you were running RC2.


OMG, so you did!  LoL. I'm an idiot.  Sorry!  Didn't mean to waste your time.
Title: Re: SMF Post Prefix
Post by: landyvlad on February 02, 2021, 06:17:12 PM
Diego continues to be a bloody legend! :D
Title: Re: SMF Post Prefix
Post by: chinaren on February 09, 2021, 10:14:16 AM
Finally got around to upgrading the board software, and installed this and it's great!  Thank you!!
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 30, 2021, 11:38:29 PM
3.2.3 - 30 August 2021
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Fixed check for permission to view unapproved posts
(https://smftricks.com/Themes/SMFTricks/images/changelog/tag--pencil.png) Minor improvements.

3.2.2 - 16 July 2021
(https://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Fixed typos on installation file.
Title: Re: SMF Post Prefix
Post by: shadav on August 30, 2021, 11:43:06 PM
removed a bunch of 0byte attachments from the download page....not sure what that was about, guessing something goofy in the site update
Title: Re: SMF Post Prefix
Post by: Bugo on August 31, 2021, 10:30:08 AM
Very nice mod, thank you :)

Is there a way to specify the icon as text or html (for example, for FontAwesome)?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 31, 2021, 10:37:24 AM
Not yet but that's a nice suggestion.
Thanks for the translation
Title: Re: SMF Post Prefix
Post by: Emre A. on August 31, 2021, 11:06:06 AM
Let it come from me in Turkish then  ;)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 31, 2021, 12:51:20 PM
Thank you.

3.2.4 - 31 August 2021
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmftricks.com%2FThemes%2FSMFTricks%2Fimages%2Fchangelog%2Flanguage.png&hash=67903c23e9043e394d79624c54ffd3cc89d06cf1) Russian translation provided by Bugo (https://www.simplemachines.org/community/index.php?action=profile;u=229017).
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fsmftricks.com%2FThemes%2FSMFTricks%2Fimages%2Fchangelog%2Flanguage.png&hash=67903c23e9043e394d79624c54ffd3cc89d06cf1) Turkish translation provided by Emre A (https://www.simplemachines.org/community/index.php?action=profile;u=92172).

Will see about features and other stuff soonish.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on September 01, 2021, 01:20:22 AM
3.3 - 01 September 2021
(https://smftricks.com/Themes/SMFTricks/images/changelog/tag--pencil.png) Improved logic of counting total of topics.
(https://smftricks.com/Themes/SMFTricks/images/changelog/tag--pencil.png) Added not_null to require_prefix column.
Title: Re: SMF Post Prefix
Post by: landyvlad on September 12, 2021, 07:53:20 AM
Trying to install SMFPostPrefix_forSMF2.0.x_2.1.1 after upgrade to SMF 2.0.18

I am getting the following error
Quote5.   Execute Modification   ./Sources/Subs-Post.php   Test failed
   1.   Replace   ./Sources/Subs-Post.php   Test successful
   2.   Replace   ./Sources/Subs-Post.php   Test successful
   3.   Replace   ./Sources/Subs-Post.php   Test successful
   4.   Replace   ./Sources/Subs-Post.php   Test successful
   5.   Replace   ./Sources/Subs-Post.php   Test successful
   6.   Replace   ./Sources/Subs-Post.php   Test successful
   7.   Replace   ./Sources/Subs-Post.php   Test successful
   8.   Replace   ./Sources/Subs-Post.php   Test failed

PLEASE help me fix it, this is my favourite mod!
Title: Re: SMF Post Prefix
Post by: shadav on September 12, 2021, 09:46:33 AM
would need to see the error for subs-post.php to know why it's failing
and find it in your subs-post.php to see what is different from your code to what it's looking for
Title: Re: SMF Post Prefix
Post by: landyvlad on September 12, 2021, 10:11:46 PM
Dunno it's a new file.

Mind you I have installed a few other mods it is possible that one of those has changed it so it can't see what its looking for but IIRC I didn't have this last time I installed the mod. Perhaps it's just a different order or something.
When I get a chance I'll have a look at that (cant access cpanel from work computer) 
Title: Re: SMF Post Prefix
Post by: landyvlad on September 13, 2021, 07:35:12 PM
Ok this is the error, and I have attached the file to this post hoping someone can diagnose please :)

QuoteCode: (Find) [Select]
$topicOptions['sticky_mode'] = isset($topicOptions['sticky_mode']) ? $topicOptions['sticky_mode'] : null;

    // This is longer than it has to be, but makes it so we only set/change what we have to.

Code: (Replace) [Select]
$topicOptions['sticky_mode'] = isset($topicOptions['sticky_mode']) ? $topicOptions['sticky_mode'] : null;
    $topicOptions['id_prefix'] = isset($topicOptions['id_prefix']) ? $topicOptions['id_prefix'] : null;

    // This is longer than it has to be, but makes it so we only set/change what we have to.
Title: Re: SMF Post Prefix
Post by: shadav on September 13, 2021, 07:42:38 PM
yeah you've added mods that changed that line

your file
    $topicOptions['sticky_mode'] = isset($topicOptions['sticky_mode']) ? $topicOptions['sticky_mode'] : null;


    mentions_process_post($msgOptions, $topicOptions, $posterOptions);
    if (!empty($msgOptions['mentions']))
        mentions_process_store($msgOptions['mentions'], $msgOptions['id'], $msgOptions['subject'], $msgOptions['approved']);
    // This is longer than it has to be, but makes it so we only set/change what we have to.

so you'll need to change the install to something like this

find
$topicOptions['sticky_mode'] = isset($topicOptions['sticky_mode']) ? $topicOptions['sticky_mode'] : null;

    // This is longer than it has to be, but makes it so we only set/change what we have to.
replace
    $topicOptions['sticky_mode'] = isset($topicOptions['sticky_mode']) ? $topicOptions['sticky_mode'] : null;


    mentions_process_post($msgOptions, $topicOptions, $posterOptions);
    if (!empty($msgOptions['mentions']))
        mentions_process_store($msgOptions['mentions'], $msgOptions['id'], $msgOptions['subject'], $msgOptions['approved']);
    // This is longer than it has to be, but makes it so we only set/change what we have to.

find
$topicOptions['sticky_mode'] = isset($topicOptions['sticky_mode']) ? $topicOptions['sticky_mode'] : null;
    $topicOptions['id_prefix'] = isset($topicOptions['id_prefix']) ? $topicOptions['id_prefix'] : null;

    // This is longer than it has to be, but makes it so we only set/change what we have to.

replace
    $topicOptions['sticky_mode'] = isset($topicOptions['sticky_mode']) ? $topicOptions['sticky_mode'] : null;
$topicOptions['id_prefix'] = isset($topicOptions['id_prefix']) ? $topicOptions['id_prefix'] : null;


    mentions_process_post($msgOptions, $topicOptions, $posterOptions);
    if (!empty($msgOptions['mentions']))
        mentions_process_store($msgOptions['mentions'], $msgOptions['id'], $msgOptions['subject'], $msgOptions['approved']);
    // This is longer than it has to be, but makes it so we only set/change what we have to.

keep in mind that this will make the mentions mod not be able to uninstall if you decide to uninstall it if it's searching for the same thing that this mod was searching for
Title: Re: SMF Post Prefix
Post by: landyvlad on September 15, 2021, 07:44:24 PM
So I can just install it, which will do most of the work with a few fails.
And then manually make the edits you've provided @shadav ? 
Title: Re: SMF Post Prefix
Post by: shadav on September 15, 2021, 08:16:40 PM
I mean, yeah...I just prefer to edit the mod install so if I ever decide to uninstall the mod

if you install the mod with errors, and this is the only error you're having
then in your subs-post.php

find
    $topicOptions['sticky_mode'] = isset($topicOptions['sticky_mode']) ? $topicOptions['sticky_mode'] : null;


    mentions_process_post($msgOptions, $topicOptions, $posterOptions);
    if (!empty($msgOptions['mentions']))
        mentions_process_store($msgOptions['mentions'], $msgOptions['id'], $msgOptions['subject'], $msgOptions['approved']);
    // This is longer than it has to be, but makes it so we only set/change what we have to.

replace with
    $topicOptions['sticky_mode'] = isset($topicOptions['sticky_mode']) ? $topicOptions['sticky_mode'] : null;
$topicOptions['id_prefix'] = isset($topicOptions['id_prefix']) ? $topicOptions['id_prefix'] : null;


    mentions_process_post($msgOptions, $topicOptions, $posterOptions);
    if (!empty($msgOptions['mentions']))
        mentions_process_store($msgOptions['mentions'], $msgOptions['id'], $msgOptions['subject'], $msgOptions['approved']);
    // This is longer than it has to be, but makes it so we only set/change what we have to.

and you should be good to go
Title: Re: SMF Post Prefix
Post by: landyvlad on September 18, 2021, 04:16:45 AM
Well I did that last and it works forum prefixes are back thanks !!
Title: Re: SMF Post Prefix
Post by: Diego Andrés on September 28, 2021, 10:31:59 PM
Quote from: Bugo on August 31, 2021, 10:30:08 AMIs there a way to specify the icon as text or html (for example, for FontAwesome)?

I'll finally see about this one in the next days/weeks, probably something basic and build upon that.
And the other stuff I'll have a look too
Title: Re: SMF Post Prefix
Post by: buypvaaccount on September 28, 2021, 11:25:18 PM
nice..
Title: Re: SMF Post Prefix
Post by: landyvlad on October 01, 2021, 12:08:52 AM
AAargghh I just installed the latest version ( 3.3 ) on SMF21.RC4  https://gsx1400owners.org/test21org

and got this error:

QuoteUnknown column 'pp.invert_color' in 'field list'
File: /home/gsxowner/public_html/test21org/Sources/PostPrefix/Helper.php
Line: 49

What the ???
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 01, 2021, 02:32:11 AM
When doing what specifically?
Do you have other related info in the error log?
Title: Re: SMF Post Prefix
Post by: landyvlad on October 02, 2021, 10:48:58 PM
Well I think there's a bigger issue I'll get sorted then if this recurs I'll check error log etc. Ta.
Title: Re: SMF Post Prefix
Post by: shadav on October 15, 2021, 11:14:18 PM
not sure what happened there but in landyvlad's database the 2 columns invert_color and groups wasn't added to the postprefixes table for some strange reason when installed
Title: Re: SMF Post Prefix
Post by: landyvlad on November 04, 2021, 01:23:18 AM
SUGGESTION.

Enhance the mod so that prefixes could be images / icons rather than text. That is - have both options available?

Example use case: Car forum. Rather than have prefixes "Ford" "VW" etc - use small images of the company logos.


Possible you reckon @Diego Andrés ?

Title: Re: SMF Post Prefix
Post by: Diego Andrés on November 04, 2021, 01:38:35 PM
You can currently use icons, do you mean both icons and text?
I'll add it to the list.

Decided to push this mod back for a bit till I find some more time to work on everything at once.
Title: Re: SMF Post Prefix
Post by: landyvlad on November 04, 2021, 09:50:47 PM
I mean that have the options so I could have (say)  5 prefixes, say 3 text and 2 icons, and could then choose from those. Wouldn't need to have both on the same thread.

Quote from: Diego Andrés on November 04, 2021, 01:38:35 PMDecided to push this mod back for a bit till I find some more time to work on everything at once.

In what sense push it back?
Hopefully it'll be available in its current form for 2.1 final when its released?

This is one of my Top 3 favourite mods.
Title: Re: SMF Post Prefix
Post by: Strannik64 on January 09, 2022, 05:02:40 AM
How to establish the rights to use not only global, but also on user groups by number of messages?
The prefix is not displayed in unread topics and messages, there are no them in the search results
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 09, 2022, 11:23:44 AM
From the settings you have the permissions for groups including post count.

The other part of your post, that's not a feature at the moment.
Title: Re: SMF Post Prefix
Post by: dodos26 on January 11, 2022, 11:05:17 AM
It would be great to see the categories, to display multiple prefixes. Example:
"Type" --> [A1, A2, A3]
"Type 2" --> [B1, B2, B3, B4]

And also the option to enable the selection of several prefixes from a category and the ability to enable the limitation of the number of prefixes for each category.

Example
"Type" --> [A1, A2, A3, A4] Can pick only 2 example A1 A2

After clicking on the checkbox, a menu with prefixes to be selected expands

Due to poor English, I made a settings tree here
Enable multi prefix -- true -->
  Maximum number of selected prefix

Enable categories -- true -->
  Require a choice in each of the categories -- false -->
    if Enable multi prefix -- true -->
      Min categories select
      Max categories select
    else "selecting one will deselect all the others"
  else -- true -->
    Category ID -->
      if Enable multi prefix -- true -->
        Min prefix select
        Max prefix select
      else min max always 1
  Maximum number of selected prefix
end
Title: Re: SMF Post Prefix
Post by: dodos26 on January 13, 2022, 07:38:22 AM
Enable multi prefix -- true -->
  Maximum number of selected prefix

Enable categories -- true -->
  Require a choice in each of the categories -- false -->
    if Enable multi prefix -- true -->
      Category ID -->
        Min categories select
        Max categories select
    else "selecting one will deselect all the others"
  else -- true -->
    if Enable multi prefix -- true -->
      Category ID -->
        Min prefix select
        Max prefix select
    else min max always 1
  Maximum number of selected prefix
end

If u start changes sory small corection. Just like the colleague above, it's nice that the search engine takes into account the prefixes and you can even choose to look only for selected prefixes. The idea of the mod is great and very functional, but it lacks features. I am finding that this mod with these two patches applied should be extra functionality in the defaulf forum.
Title: Re: SMF Post Prefix
Post by: landyvlad on January 13, 2022, 11:13:48 PM
Ok well it's not up to the mod author to add features - it was designed as it is for (reasons).

While your suggestions are nice, it's probably a bit much to ask someone to do significant changes in a free mod.

I have always found this mod to be brilliant, as is. For me, having multiple prefixes would get way too cluttered. 

I'm really looking forward to the mod being available for 2.1 in its current form, rather than the author spending time on changing the features.

As I said it's one of my top 3 mods and really enhances the functionality and look of a forum.  I use it to great effect at gsx1400owners.org


@Diego Andrés THUMBS UP
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 14, 2022, 12:24:19 AM
Thanks @landyvlad
I do plan on adding a few changes, specially the ones suggested by Bugo, but that's about it.
Turning the prefix mod in a tags mod of sorts is definitely not happening but I appreciate the feedback.

Here are some possible ideas including previously suggested:
- FA support
- Modules and integration with certain mods
- Being able to filter topics selecting multiple prefixes and not just one.
- Adding the prefixes in a few more areas without making file edits (not enough hooks but still doable I believe)

And still in the oven (maybe already burned and not happening):
- Setting prefixes when editing groups/boards so we don't need to update prefixes every time we add new groups of boards
Title: Re: SMF Post Prefix
Post by: natias on January 22, 2022, 05:15:38 PM
Hello everyone, I come to ask you for help to be able to modify my post panel, I have it this way
(https://i.ibb.co/wWgp0yg/gsm.png)

I want to modify it and make it look this way someone help me please
(https://i.ibb.co/ZX0VSGr/tsm.png)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 22, 2022, 05:20:42 PM
Have you given prefixes to those topics?
You have to assign a prefix to the topic when posting/editing.
Title: Re: SMF Post Prefix
Post by: natias on January 22, 2022, 05:47:42 PM
Quote from: Diego Andrés on January 22, 2022, 05:20:42 PMHave you given prefixes to those topics?
You have to assign a prefix to the topic when posting/editing.

when I create topic I don't get to select prefixes
(https://i.ibb.co/F4TZYmQ/new-tema.png)
Title: Re: SMF Post Prefix
Post by: Arantor on January 22, 2022, 06:00:22 PM
Did you make some prefixes in the admin panel?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 22, 2022, 06:02:02 PM
And also mark the boards you plan on using the prefix you are adding, won't appear if no boards have it available.
Title: Re: SMF Post Prefix
Post by: natias on January 22, 2022, 06:11:07 PM
Quote from: Arantor on January 22, 2022, 06:00:22 PMDid you make some prefixes in the admin panel?

what part is that in?
Title: Re: SMF Post Prefix
Post by: natias on January 22, 2022, 06:13:17 PM
Quote from: Diego Andrés on January 22, 2022, 06:02:02 PMAnd also mark the boards you plan on using the prefix you are adding, won't appear if no boards have it available.

I have it like this.
(https://i.ibb.co/C83pmFN/prefixes.png)

----
(https://i.ibb.co/KFRRFhm/panel-prefixes.png)
Title: Re: SMF Post Prefix
Post by: Arantor on January 22, 2022, 06:32:54 PM
Well, you didn't add the prefix to General Discussion but I think you're adding the topic in General Discussion? (Hard to tell; the dropdown is normally where the icon picker would be, and if you added a mod for 'post in any board quickly', it won't load prefixes because the prefixes available are available once you're in a board and posting in that board because mods don't have to play nicely together)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 22, 2022, 06:54:15 PM
In addition to that, doesn't look like you are using the mod from this support topic.
Title: Re: SMF Post Prefix
Post by: natias on January 22, 2022, 07:04:52 PM
Quote from: Diego Andrés on January 22, 2022, 06:54:15 PMIn addition to that, doesn't look like you are using the mod from this support topic.

Friend You think you can give me a hand please. via remote with teamviewer
Title: Re: SMF Post Prefix
Post by: morty on January 22, 2022, 07:11:14 PM
Is this mod working on 2.0.19? I installed the mod smoothly and when I tried to click Prefixes in admin it shows this error " Call to undefined function create_function() "
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 22, 2022, 07:12:29 PM
Try using this mod with it:
https://custom.simplemachines.org/index.php?mod=4300
Title: Re: SMF Post Prefix
Post by: natias on January 22, 2022, 07:38:15 PM
@Diego Andrés I already installed the mod from this forum, explain to me how I configure it please.

(https://i.ibb.co/StdV8RR/profixwa1.png)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 22, 2022, 07:41:31 PM
What exactly? You just repeat the steps in a similar fashion: Add prefix > Select Boards > Save, Permissions > Select groups > Save.
Title: Re: SMF Post Prefix
Post by: natias on January 22, 2022, 10:06:26 PM
I already configured it but it comes out this way and it doesn't come out where I want in the
Recent Topics


(https://i.ibb.co/RYpHchm/DENTRO-DEL-TABLERO.png)
(https://i.ibb.co/zGcs47Q/RESIEN-TOPICS.png)

Someone Help Me Please or it is not valid for the version SMF Simple 2.0.19
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 22, 2022, 10:08:20 PM
Well that's probably a custom mod (Recent Topics), so wouldn't know about it and it's not supported by default.
Title: Re: SMF Post Prefix
Post by: natias on January 22, 2022, 10:13:13 PM
then Recent Topics recommend me to be able to use.
Title: Re: SMF Post Prefix
Post by: natias on January 22, 2022, 11:10:00 PM
this is the Recent Topics i'm using

(https://i.ibb.co/BcMPF9B/1.png)

(https://i.ibb.co/qjzWwPJ/2.png)
Title: Re: SMF Post Prefix
Post by: natias on January 22, 2022, 11:55:01 PM
Quote from: morty on January 22, 2022, 07:11:14 PMIs this mod working on 2.0.19? I installed the mod smoothly and when I tried to click Prefixes in admin it shows this error " Call to undefined function create_function() "

Friend, how are you doing well with the Mod?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 23, 2022, 12:58:26 AM
Well it's not like the mod doesn't work... You just want to use it along an unsupported custom mod.
Title: Re: SMF Post Prefix
Post by: natias on January 23, 2022, 01:42:55 AM
Quote from: Diego Andrés on January 23, 2022, 12:58:26 AMWell it's not like the mod doesn't work... You just want to use it along an unsupported custom mod.

Please could you pass me the compatible Mod.
Title: Re: SMF Post Prefix
Post by: gevv on January 24, 2022, 01:52:57 PM
Hi,

Can the URL Prefix be compatible with Pretty urls ?

http://site/board/?prefix=1

http://site/board/prefix-name

+ Is it possible to add a link to the recent posts list?



Title: Re: SMF Post Prefix
Post by: landyvlad on January 24, 2022, 07:49:51 PM
gevv you can sort in a forum by prefix, if that's what you mean om the 2nd point. (should accomplish the same result I think)

As far as pretty IURLs what do you mean by compatible with pretty URLs? Do you mean you want the prefix to be included in the URL?  As I understand it that's not possible as the prefix is not part of the title string (which is what pretty URLs uses).  Plus I don't even think it's advisable as prefixes can be readily changed/modified which could leave the pretty URL as misleading.

Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 24, 2022, 07:56:00 PM
He's looking to have board/prefix/prefix-name and show the filtered prefixes I think.
Not sure if that's feasible, and I haven't used prettyurls to test that tbh.

Quote from: gevv on January 24, 2022, 01:52:57 PM+ Is it possible to add a link to the recent posts list?

It is but requires some extra work. Will attempt this in the future after final release.
Title: Re: SMF Post Prefix
Post by: Arantor on January 25, 2022, 04:05:17 AM
Fairly sure it requires edits in Pretty URLs itself to support that.
Title: Re: SMF Post Prefix
Post by: gevv on February 06, 2022, 01:28:40 PM
Hi,

How can I do the linked prefix name and remove prefix topic title header ?



prefix2355.png
Title: Re: SMF Post Prefix
Post by: Diego Andrés on February 06, 2022, 01:48:27 PM
Quote from: gevv on February 06, 2022, 01:28:40 PMHi,

How can I do the linked prefix name and remove prefix topic title header ?

Remove this in Sources/PostPrefix/PostPrefix.php
addInlineJavaScript('
                var pp_subject = document.getElementById("top_subject");
                pp_subject.innerHTML = \'' . self::format($context['topicinfo']['prefix']) . '\' + " " + pp_subject.textContent;
            ', true);

The linktree:
Code (Search) Select
$context['linktree'][count($context['linktree'])-1]['extra_before'] = self::format($context['topicinfo']['prefix'], ';text-shadow:none;padding-top:0;padding-bottom:0;');
Code (Replace) Select
$context['linktree'][count($context['linktree'])-1]['name'] = self::format($context['topicinfo']['prefix'], ';text-shadow:none;padding-top:0;padding-bottom:0;margin:0;') . ' ' . $context['linktree'][count($context['linktree'])-1]['name'];
Not sure if you meant linking the prefix to the filter or include it in the topic link, the code does the latter.
Title: Re: SMF Post Prefix
Post by: gevv on February 06, 2022, 02:32:27 PM
Thanks @Diego Andrés  remove prefix topic title header  ok.  I want to add prefix link

prefix2355b.png
Title: Re: SMF Post Prefix
Post by: Diego Andrés on February 06, 2022, 03:00:12 PM
Code (Search) Select
global $context;
Code (Replace) Select
global $context, $scripturl, $board_info;
Code (Search) Select
$context['linktree'][count($context['linktree'])-1]['extra_before'] = self::format($context['topicinfo']['prefix'], ';text-shadow:none;padding-top:0;padding-bottom:0;');
Code (Replace) Select
$context['linktree'][count($context['linktree'])-1]['extra_before'] = '<a href="'. $scripturl. '?board=' . $board_info['id'] . '.0;prefix='. $context['topicinfo']['id_prefix'] . '">' . self::format($context['topicinfo']['prefix'], ';text-shadow:none;padding-top:0;padding-bottom:0;') . '</a>';
Title: Re: SMF Post Prefix
Post by: gevv on February 06, 2022, 03:16:03 PM
Thanks @Diego Andrés  problem solved
 
Title: Re: SMF Post Prefix
Post by: gevv on February 06, 2022, 03:51:17 PM
Not a big problem but, perfix name appears in the headers on the paerfix page

Can i remove the prefix of title header on the prefix page
Title: Re: SMF Post Prefix
Post by: Diego Andrés on February 06, 2022, 03:54:36 PM
That's how it works, not sure what you mean
Title: Re: SMF Post Prefix
Post by: landyvlad on February 09, 2022, 07:29:19 PM
Hi Diego!

With the release of 2.1.0 having occurred, is it likely we'll see a compatible version of this prefix mod available in the short term?

Cheers mate.

Title: Re: SMF Post Prefix
Post by: Diego Andrés on February 09, 2022, 07:30:29 PM
It uses hooks so no issues atm and will install fine
Might work on new features but that's it
Title: Re: SMF Post Prefix
Post by: gevv on February 14, 2022, 02:36:53 PM
Quote from: Diego Andrés on February 06, 2022, 03:00:12 PM
Code (Search) Select
global $context;
Code (Replace) Select
global $context, $scripturl, $board_info;
Code (Search) Select
$context['linktree'][count($context['linktree'])-1]['extra_before'] = self::format($context['topicinfo']['prefix'], ';text-shadow:none;padding-top:0;padding-bottom:0;');
Code (Replace) Select
$context['linktree'][count($context['linktree'])-1]['extra_before'] = '<a href="'. $scripturl. '?board=' . $board_info['id'] . '.0;prefix='. $context['topicinfo']['id_prefix'] . '">' . self::format($context['topicinfo']['prefix'], ';text-shadow:none;padding-top:0;padding-bottom:0;') . '</a>';

Hi,

Can we add "title" to the link?

I tried the following code only "i" appeared

" title="'. $prefix['name']. '"
Untitled 1.png
Title: Re: SMF Post Prefix
Post by: Diego Andrés on February 14, 2022, 03:11:53 PM
It looks like you have a typo there, an extra "
Title: Re: SMF Post Prefix
Post by: gevv on February 15, 2022, 05:07:22 AM
Thanks @Diego Andrés   I edited and the output was title="a href=" 

Error log:  Illegal string offset 'name'
Title: Re: SMF Post Prefix
Post by: Diego Andrés on February 15, 2022, 02:51:44 PM
Where did you get $prefix['name'] though? That's not used anywhere.
You want to use $context['topicinfo']['prefix']
Title: Re: SMF Post Prefix
Post by: gevv on February 15, 2022, 03:16:52 PM
Quote from: Diego Andrés on February 15, 2022, 02:51:44 PMWhere did you get $prefix['name'] though?

line 99 I extracted from icon codes


 Untitled 2.png
Title: Re: SMF Post Prefix
Post by: Steve on February 22, 2022, 06:17:17 PM
Hey Diego, is there a limit to the number of prefixes?

And does it count against the number of characters a topic title can have?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on February 22, 2022, 06:19:55 PM
Only theoretical due to type/size limitation when using int, and I forgot to make the column unsigned back in the day.
I'll do that in the next update.
Title: Re: SMF Post Prefix
Post by: Steve on February 22, 2022, 06:26:56 PM
Not sure which question you're answering ... I'm guessing the first one, how about the second?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on February 22, 2022, 06:41:39 PM
I only saw one question when reading.
So for the second question: no it doesn't care about the topic subject
Title: Re: SMF Post Prefix
Post by: Steve on February 23, 2022, 07:41:26 AM
No worries and thanks Diego.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 01, 2022, 08:55:44 PM
Currently and finally working on a big update for this mod.

Lemme know any suggestions or even new features that you might want.

And before it gets suggested for the bizillion time, adding multiple prefixes WILL NOT be a feature  :D
Title: Re: SMF Post Prefix
Post by: landyvlad on March 02, 2022, 07:58:30 PM
It's awesome as it is so I can't think of much that needs doing!

The key is to make it really easy for admins to control what boards a prefix is shown in - by easy checkbox or something perhaps.
 
Maybe when creating a post in the 'select prefix' drop down - have it formatted in the colour/s the prefix is set up for?  (if possible)
Title: Re: SMF Post Prefix
Post by: gevv on March 03, 2022, 05:24:06 AM
Hi,


Prefix appear on search results page

Prefix font-weight selection (underline bold, italic)

Prefix usage count (filter by prefix)

count.png

Ignore Prefixes

ignore.png

may be illogical or unnecessary, just an idea :)
Title: Re: SMF Post Prefix
Post by: landyvlad on March 03, 2022, 06:41:17 PM
If you use a prefix count please make it optional because I don't see a use case for it - seems confusing to me as site users will always ask what the number means.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 13, 2022, 03:20:17 AM
Almost done with the update.


Quote from: gevv on March 03, 2022, 05:24:06 AMPrefix appear on search results page
No hooks for this, so I guess no

Quote from: gevv on March 03, 2022, 05:24:06 AMPrefix font-weight selection (underline bold, italic)
No because you can target the prefixes using css.

Quote from: gevv on March 03, 2022, 05:24:06 AMPrefix usage count (filter by prefix)
Probably no because would need to query each prefix for that. However, when filtering a prefix I could display the total if you think that's useful.

Quote from: gevv on March 03, 2022, 05:24:06 AMIgnore Prefixes
No  :P
Title: Re: SMF Post Prefix
Post by: gevv on March 13, 2022, 05:01:17 AM
Thanks.  ;D
Title: Re: SMF Post Prefix
Post by: landyvlad on March 13, 2022, 10:49:00 PM
Quote from: gevv on March 03, 2022, 05:24:06 AMIgnore Prefixes

Already has that - just go to package manager - SMF Post Prefix - uninstall.   :laugh:  :laugh:  :laugh:
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 16, 2022, 11:03:28 PM
4.0 - 16 March 2022

Notes:
- For updating, uninstall the old version and install the new one. DO NOT check the option to remove information. I tested the "upgrade" and it worked well, but you might want to also first test it locally (or somewhere else) so you don't lose your boards/groups. So make sure to backup your smf_postprefixes table, you will not lose the prefixes. This mod probably didn't work on pg before so I only tested MySQL, although it installs and works fine on PG now.

- The current release doesn't include any translation because they are outdated. Make sure to head over to Crowdin (https://crowdin.com/project/smf-post-prefix-mod) on this project page and help out!
PS: Russian, Turkish and Spanish are already up on crowdin, just need updating.
Title: Re: SMF Post Prefix
Post by: gevv on March 17, 2022, 04:32:18 AM
Hi,

@Diego Andrés  thanks for the update great job

There is a problem when opening a new topic after the update, an prefix is selected.

pr.gif

There is no problem with the fresh install.

prfr.png 

Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 17, 2022, 09:59:31 AM
I'm just waking up so you might want to describe the issue because I don't see it  :laugh:

For once, what are the other options? "No prefix" is no longer an option if the prefix is required in the board.
Title: Re: SMF Post Prefix
Post by: gevv on March 17, 2022, 10:20:40 AM
Quote"No prefix" is no longer an option if the prefix is required in the board.

 :(

Members do not pay attention without forcing them to choose. They send direct post without prefix selection

Prefixs that are irrelevant to the topic multiply

Is there a solution to make it the same as before?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 17, 2022, 10:36:58 AM
Should be trivial I'll leave you the change in a bit.
By the way, you could use the new "radio" option which is more visual in case you think it would help.
Title: Re: SMF Post Prefix
Post by: gevv on March 17, 2022, 10:43:37 AM
Thanks. I tried radio but when the prefix was too much, the view was bad on mobile

Untitled 1.png
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 17, 2022, 10:59:49 AM
In Sources/PostPrefix/Integration/Posting.php
You want to remove/comment this:
// Remove "No Prefix" if prefixes are required on this board
if (!empty($board) && !empty($modSettings['PostPrefix_prefix_boards_require']) && in_array($board, explode(',', $modSettings['PostPrefix_prefix_boards_require'])))
{
unset($context['posting_fields']['topic_prefix']['input']['options']['PostPrefix_select_prefix']['options']['none']);
unset($context['posting_fields']['topic_prefix']['input']['options']['none']);
}
Title: Re: SMF Post Prefix
Post by: gevv on March 17, 2022, 11:30:36 AM
Thanks. I tried Require prefix but opens topic without prefix selected

Untitled 1.png
Untitled.gif 
Title: Re: SMF Post Prefix
Post by: Shades. on March 17, 2022, 11:33:35 AM
@gevv sorry to change the subject real quick but what app do you use to make those animated gif's if you don't mind me asking?
Title: Re: SMF Post Prefix
Post by: gevv on March 17, 2022, 12:08:21 PM
Quote from: Shades. on March 17, 2022, 11:33:35 AM@gevv sorry to change the subject real quick but what app do you use to make those animated gif's if you don't mind me asking?

Recording screen with Camtasia studio 8 and exporting in .gif format
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 17, 2022, 12:36:44 PM
I will have a look in a bit
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 17, 2022, 12:59:23 PM
Quote from: Diego Andrés on March 16, 2022, 11:03:28 PM4.0 - 16 March 2022
  • (https://camo.githubusercontent.com/dabbb7cab40c66b82cb563365d644a1f098f665bf28cef0616f69a1a0f25084e/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d706c75732e706e67) Added option to enable prefixes in the recent action.
  • (https://camo.githubusercontent.com/dabbb7cab40c66b82cb563365d644a1f098f665bf28cef0616f69a1a0f25084e/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d706c75732e706e67) When prefixes are enabled in the boardindex, you can decide to display the prefix for replies, or only first post.
  • (https://camo.githubusercontent.com/dabbb7cab40c66b82cb563365d644a1f098f665bf28cef0616f69a1a0f25084e/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d706c75732e706e67) Added the ability to display prefixes in the boardindex including last posts in the info center.
  • (https://camo.githubusercontent.com/dabbb7cab40c66b82cb563365d644a1f098f665bf28cef0616f69a1a0f25084e/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d706c75732e706e67) New option to disabled/enable the prefix in the linktree.
  • (https://camo.githubusercontent.com/dabbb7cab40c66b82cb563365d644a1f098f665bf28cef0616f69a1a0f25084e/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d706c75732e706e67) New option to choose between "select" and "radio select" for the prefix list when posting.
  • (https://camo.githubusercontent.com/dabbb7cab40c66b82cb563365d644a1f098f665bf28cef0616f69a1a0f25084e/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d706c75732e706e67) Added support for "Post Action".
  • (https://camo.githubusercontent.com/5ba14cc5b307fd7683ab0b95737b5548d492d0029f2ce6f42c7cda8cc1c90fb9/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f6275672d2d6d696e75732e706e67) Prefix managers can now access the admin area if that's their only admin permission.
  • (https://camo.githubusercontent.com/5ba14cc5b307fd7683ab0b95737b5548d492d0029f2ce6f42c7cda8cc1c90fb9/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f6275672d2d6d696e75732e706e67) Fixed HTML issue with duplicated id's in the prefixes, they are now using classes instead.
  • (https://camo.githubusercontent.com/2b4ab97b0305c84fe3d563f95de3f5eaa7019a88172cd590e0d0ffbb681f2cf1/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d70656e63696c2e706e67) "No Prefix" option is no longer visible if the board requires a prefix.
  • (https://camo.githubusercontent.com/dabbb7cab40c66b82cb563365d644a1f098f665bf28cef0616f69a1a0f25084e/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d706c75732e706e67) Replaced colpick with coloris for picking a color.
  • (https://camo.githubusercontent.com/2b4ab97b0305c84fe3d563f95de3f5eaa7019a88172cd590e0d0ffbb681f2cf1/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d70656e63696c2e706e67) Icon image/url now replaced with Icon Class.
  • (https://camo.githubusercontent.com/2b4ab97b0305c84fe3d563f95de3f5eaa7019a88172cd590e0d0ffbb681f2cf1/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d70656e63696c2e706e67) Boards and Groups now each live in their own tables.
  • (https://camo.githubusercontent.com/2b4ab97b0305c84fe3d563f95de3f5eaa7019a88172cd590e0d0ffbb681f2cf1/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d70656e63696c2e706e67) Improved performance.
  • (https://camo.githubusercontent.com/2b4ab97b0305c84fe3d563f95de3f5eaa7019a88172cd590e0d0ffbb681f2cf1/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d70656e63696c2e706e67) Support for SMF 2.1

Notes:
- For updating, uninstall the old version and install the new one. DO NOT check the option to remove information. I tested the "upgrade" and it worked well, but you might want to also first test it locally (or somewhere else) so you don't lose your boards/groups. So make sure to backup your smf_postprefixes table, you will not lose the prefixes. This mod probably didn't work on pg before so I only tested MySQL, although it installs and works fine on PG now.

- The current release doesn't include any translation because they are outdated. Make sure to head over to Crowdin (https://crowdin.com/project/smf-post-prefix-mod) on this project page and help out!
PS: Russian, Turkish and Spanish are already up on crowdin, just need updating.

4.0.1 - 17 March 2022
Title: Re: SMF Post Prefix
Post by: gevv on March 17, 2022, 01:24:59 PM
Thanks @Diego Andrés 👍
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 17, 2022, 01:29:21 PM
Quote from: gevv on March 17, 2022, 10:43:37 AMThanks. I tried radio but when the prefix was too much, the view was bad on mobile

Untitled 1.png

I also fixed this mess on mobile, forgot to include it. It should look like a proper list on mobile now (when using radio).
Obviously with a lot of prefixes, it's still large  :P
Title: Re: SMF Post Prefix
Post by: gevv on March 17, 2022, 01:46:19 PM
Yes i noticed it while editing CSS. Looks better  Thanks.

It might be neater if the style is disabled while using the radio

Untitled 2.png

Untitled 3.png

Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 17, 2022, 01:55:55 PM
Yes, not sure.
Let's hope for more feedback on this option and we will see  :P

PS: Added spanish, russian and turkish translations to the package in the modsite
Title: Re: SMF Post Prefix
Post by: bsmither on March 17, 2022, 02:03:34 PM
Is it possible to display:none the radiobutton form element, use the prefix tag button as the label to the radiobutton (which, when tapped, should set the radiobutton - I think), float the tags, and when checked, have an inner border pulsate to indicate selection?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 17, 2022, 02:09:33 PM
it's not very visual for new users but you can do it with this:
#select_prefixes label input { display: none;}
Title: Re: SMF Post Prefix
Post by: alex_cipher on March 18, 2022, 04:46:02 AM
Hi Diego!

Everytime I try to install the mod I get this error.
postprefix.png

What is this and how can I fix it?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 18, 2022, 10:29:41 AM
What error did you get in your log?
Title: Re: SMF Post Prefix
Post by: alex_cipher on March 18, 2022, 10:32:32 AM
I had to remove the mod because I had over 1000 errors within 20 minutes.

I install it again and show you the errors. It was always the same error but in many files.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 18, 2022, 10:39:38 AM
Alright.
Make sure to leave more information such as your smf version, php version, etc
Additionally make sure the mod indeed added the database changes during installation.
Title: Re: SMF Post Prefix
Post by: alex_cipher on March 18, 2022, 11:33:27 AM
So, now I've installed it again and the errors appears after a few seconds.

SMF: 2.1.1
PHP: 7.4

There are the erros:
Sources/Display.php (Line 156)
Sources/MessageIndex.php (Line 348)
Sources/PostPrefix/Helper/Database.php (Line 70)
and:
Datenbankfehler: Unknown column 'pp.invert_color' in 'field list'


        SELECT
            t.num_replies, t.num_views, t.locked, ms.subject, t.is_sticky, t.id_poll,
            t.id_member_started, t.id_first_msg, t.id_last_msg, t.approved, t.unapproved_posts, t.id_redirect_topic,
            COALESCE(mem.real_name, ms.poster_name) AS topic_started_name, ms.poster_time AS topic_started_time,
            t.id_last_msg + 1 AS new_from
           
            , mem.id_member, mem.avatar, mem.email_address, COALESCE(lo.log_time, 0) AS is_online, a.filename, t.id_prefix, pp.id AS prefix_id, pp.name AS prefix_name, pp.status AS prefix_status, pp.color AS prefix_color, pp.bgcolor AS prefix_bgcolor, pp.invert_color AS prefix_invert_color, pp.icon_class AS prefix_icon_class, t.id_best_msg, t.id_board
           
        FROM smf_topics AS t
            INNER JOIN smf_messages AS ms ON (ms.id_msg = t.id_first_msg)
            LEFT JOIN smf_members AS mem on (mem.id_member = t.id_member_started)
            LEFT JOIN smf_log_online AS lo ON (lo.id_member = mem.id_member)
    LEFT JOIN smf_attachments AS a ON (a.id_member = mem.id_member)
    LEFT JOIN smf_postprefixes AS pp ON (pp.id = t.id_prefix)
        WHERE t.id_topic = 271
        LIMIT 1


Is this correct or did the "install.php" nothing and that's the reason why the database fields are missing?
postprefix_install.png

Here's a screenshot from the backtrace:
postprefix_backtrace.png  
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 18, 2022, 11:40:34 AM
You'd have to manually check in your database and see if the tables and columns were actually created.
Title: Re: SMF Post Prefix
Post by: alex_cipher on March 18, 2022, 11:41:51 AM
Yeah, if I would know which one have to be created and where to find them in the db.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 18, 2022, 11:45:27 AM
The tables:
postprefixes
postprefixes_boards
postprefixes_groups


And the column giving you issues would be in the first table
Title: Re: SMF Post Prefix
Post by: alex_cipher on March 18, 2022, 11:58:56 AM
The tables are created.
postprefix_db.png 
postprefix_db_struct.png 

There are some entries in smf_postprefix from an old installation with SMF2.0.x

Is it possible that that's the reason why it doesn't work?
Should I delete those entries and try to install it again?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 18, 2022, 12:04:19 PM
Yes that might be your issue.
The mod never had an upgrade path from 2.0.x and I'm not sure that's from the same mod as this one.
You could:
- uninstall the mod
- drop/delete the postprefixes table
- re-install the mod
Title: Re: SMF Post Prefix
Post by: alex_cipher on March 18, 2022, 12:15:04 PM
I used this mod since it was released for SMF 2.0.x

I delete it and give feedback.

EDIT:
Deleted and installed it again without any errors.

Just two more questions:
1. Isn't it possible to use an image as prefix like in the old version?
2. What is the "Icon Class"?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 18, 2022, 12:33:10 PM
Icons is no longer an option because you could do that with css.
Icon class is exactly that, a css class like font awesome or similar.
Title: Re: SMF Post Prefix
Post by: alex_cipher on March 18, 2022, 12:34:47 PM
Ah ok.
Is there anywhere an example of how to use it?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 18, 2022, 12:37:11 PM
What specifically, an icon class? Or displaying an icon?
Title: Re: SMF Post Prefix
Post by: alex_cipher on March 18, 2022, 12:40:40 PM
If you don't mind, both. :)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 18, 2022, 01:35:48 PM
Will write something up later  ;)
Title: Re: SMF Post Prefix
Post by: gevv on March 18, 2022, 01:56:28 PM
Hi,

Just idea As an example the SMF default icon class list can be given in the description popup

Title: Re: SMF Post Prefix
Post by: alex_cipher on March 18, 2022, 03:39:53 PM
Quote from: Diego Andrés on March 18, 2022, 01:35:48 PMWill write something up later  ;)
Thank you!

Quote from: gevv on March 18, 2022, 01:56:28 PMHi,

Just idea As an example the SMF default icon class list can be given in the description popup


I don't have this description popup. Or is this a mockup from you?

Title: Re: SMF Post Prefix
Post by: gevv on March 18, 2022, 03:54:19 PM
yes a suggestion for new version

try:
main_icons calendar
main_icons like
main_icons search
main_icons mlist
main_icons home
main_icons remove_button
main_icons error
main_icons modify_button



Question: where can i find smf 2.1 all icon class list ?
Title: Re: SMF Post Prefix
Post by: alex_cipher on March 18, 2022, 03:55:42 PM
Ok, I understand. :)
Title: Re: SMF Post Prefix
Post by: Kindred on March 18, 2022, 05:31:17 PM
QuoteQuestion: where can i find smf 2.1 all icon class list ?

Look in index.css
Title: Re: SMF Post Prefix
Post by: gevv on March 21, 2022, 02:30:42 AM
Hi,

prefix selection error appears when posting comments admin and normal users

Untitled.gif
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 21, 2022, 03:38:41 AM
My bad, I forgot smf doesn't natively support hidden type for the posting fields.
New update should fix it.

4.0.2 - 21 March 2022
Title: Re: SMF Post Prefix
Post by: gevv on March 21, 2022, 03:52:33 AM
Thanks for the quick update  @Diego Andrés

other language files are not included v4.0.2
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 21, 2022, 01:17:42 PM
Thanks, that is sorted now
Title: Re: SMF Post Prefix
Post by: Shades. on March 21, 2022, 04:02:15 PM
In Topic Prefixes - Settings I have "Remove 'No prefix' from the list when the board requires a prefix" ticked but it still shows in the list on the forum.

Topic Prefixes - Settings.png

Prefix.png
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 21, 2022, 04:06:46 PM
Can't replicate the issue
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 21, 2022, 04:07:59 PM
Do you mean the filter?
That wasn't reported before, not sure if it should be removed there, board could've had no prefixes before.
Title: Re: SMF Post Prefix
Post by: Shades. on March 21, 2022, 04:18:14 PM
Quote from: Diego Andrés on March 21, 2022, 04:07:59 PMDo you mean the filter?
That wasn't reported before, not sure if it should be removed there, board could've had no prefixes before.
Yes. So where does it remove the filter from? And I'm pretty sure I added that board after installing the first version of the mod. I'm using 4.0.2 now though.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 21, 2022, 04:21:23 PM
It's not a bug, it's just not a feature at the moment because of the reason mentioned above.
A very old board could still have topics with no prefixes because the mod was installed after.
Title: Re: SMF Post Prefix
Post by: Steve on March 28, 2022, 06:15:50 PM
I know I asked this before and I read through all the changes up to the current version since I posted the question but I still don't know if there is a limit to the number of prefixes. Is there?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 28, 2022, 06:20:48 PM
Yes, around 65,000 would be the limit
Title: Re: SMF Post Prefix
Post by: Steve on March 28, 2022, 10:31:37 PM
Thanks Diego.  :)
Title: Re: SMF Post Prefix
Post by: aaronhall on March 29, 2022, 05:39:58 AM
I added prefixes easily, but when I try to remove a prefix from a post and save the post the prefix does not go away.

How do I fix this?
Title: Re: SMF Post Prefix
Post by: Kindred on March 29, 2022, 06:39:50 AM
well, first of all, confirm that the problem is not your browser cache again... :P
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 29, 2022, 11:10:56 AM
Confirmed issue, it's now solved.

4.0.3 - 29 March 2022
Title: Re: SMF Post Prefix
Post by: landyvlad on March 31, 2022, 01:24:10 AM
I'm so glad this is 2.1 compatible as I'm now a step closer to being able to upgrade from 2.0 to 2.1 :)

Thanks for all your great work on this mod @Diego Andrés
Title: Re: SMF Post Prefix
Post by: Diego Andrés on April 19, 2022, 06:02:15 PM
French translation on Crowdin was left incomplete for some reason, if someone else that knows the language wants to finish it would be nice.
And do let me know if you want to add more languages :)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on April 26, 2022, 12:48:40 AM
4.0.4 - 25 April 2022
Title: Re: SMF Post Prefix
Post by: gevv on April 26, 2022, 02:57:12 PM
Thanks @Diego Andrés
Title: Re: SMF Post Prefix
Post by: Steve on June 19, 2022, 08:13:55 AM
Stupid question time ... how does one actually add a prefix to a post (prefixes have been added in the settings, permissions and boards have been selected)?

When I want to create a new topic I don't see any option for adding a prefix.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 19, 2022, 10:48:17 AM
The group should also have permissions from the 'main' permissions
Title: Re: SMF Post Prefix
Post by: Steve on June 19, 2022, 11:03:35 AM
But as admin and forum owner, don't I already have permission since there isn't a way to modify my permissions?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 19, 2022, 11:05:31 AM
Yes.
Could you post a screenshot of how you configured a prefix?
Title: Re: SMF Post Prefix
Post by: Steve on June 19, 2022, 11:12:46 AM
Omg! (https://i.imgur.com/lefk6z8.gif)

I didn't realize I had to allow myself in those settings. Thanks Diego!

Okay then, what setting am I missing to make the dropdown box show all the prefixes?
Title: Re: SMF Post Prefix
Post by: Steve on June 19, 2022, 11:20:32 AM
I had edited my post Diego in case you didn't see my question.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 19, 2022, 11:24:46 AM
I'm not sure what you mean by that.
Make sure they all are in the same board, and the prefixes are slightly cached in case you are using cache.
Title: Re: SMF Post Prefix
Post by: Steve on June 19, 2022, 11:25:14 AM
Never mind Diego. Must have just needed to refresh. Works great!
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 20, 2022, 10:13:12 AM
4.0.6 - 20 June 2022

4.0.5 - 20 June 2022
Title: Re: SMF Post Prefix
Post by: Steve on June 23, 2022, 06:45:30 AM
Hey Diego, I know nothing about coding so I need to check with you ... is there any reason I can't change part of postprefix.css to this?

span.postprefix-all,
.postprefix-all {
padding-inline: 0px !important;
min-height: 24px;
display: inline-flex;
border-radius: 4px;
line-height: normal;
justify-content: center;
align-items: center;
text-shadow: none;
gap: 5px;
font-size: 1.01em;
font-weight: 600;
margin-inline-end: 5px;
}

I didn't want the padding at the left and I wanted a little more space at the end of the prefix and the topic title so is there anything wrong with the coding above?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 23, 2022, 09:44:00 AM
Do you have the options to minimize files enabled?
Or perhaps share a link to an example of this to see what could be the issue.
Title: Re: SMF Post Prefix
Post by: Steve on June 23, 2022, 10:02:41 AM
I do not have the options to minimize files enabled.

I didn't think there was a problem ... I just wanted to make some cosmetic adjustments. The first image is how it normally looks and the second is how it looks with the changes in the code I posted above. Is there a better way to do it?

Screenshot 2022-06-23 at 08-55-43 U.S.png Screenshot 2022-06-23 at 08-57-43 U.S.png
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 23, 2022, 10:17:00 AM
Oh in that case it's fine, it looks good to me  :)
Title: Re: SMF Post Prefix
Post by: Steve on June 23, 2022, 10:24:02 AM
Cool beans. Thanks Diego.

One more question, if I wanted to put a colon ( : ) at the end of the prefix, how would I do that?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 23, 2022, 11:04:54 AM
Either in the name of the prefix or using css

span.postprefix-id::after { content: ":" }Or if it's for all:
span.postprefix-all::after { content: ":" }
Title: Re: SMF Post Prefix
Post by: Steve on June 23, 2022, 11:28:55 AM
Awesome. Thanks again Diego.  :)
Title: Re: SMF Post Prefix
Post by: gevv on June 24, 2022, 05:50:49 AM
Quote from: Diego Andrés on June 20, 2022, 10:13:12 AM4.0.6 - 20 June 2022
  • (https://camo.githubusercontent.com/5ba14cc5b307fd7683ab0b95737b5548d492d0029f2ce6f42c7cda8cc1c90fb9/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f6275672d2d6d696e75732e706e67) Fixed wrong total of messages when displaying prefix for all messages.

4.0.5 - 20 June 2022
  • (https://camo.githubusercontent.com/2b4ab97b0305c84fe3d563f95de3f5eaa7019a88172cd590e0d0ffbb681f2cf1/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d70656e63696c2e706e67) Remove 'redirect' boards from the list when editing/adding.
  • (https://camo.githubusercontent.com/2b4ab97b0305c84fe3d563f95de3f5eaa7019a88172cd590e0d0ffbb681f2cf1/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d70656e63696c2e706e67) Clear cache when saving/editing prefixes.


Thanks @Diego Andrés
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 29, 2022, 01:48:30 PM
4.0.7 - 29 June 2022
Title: Re: SMF Post Prefix
Post by: Steve on June 29, 2022, 02:15:19 PM
Thanks Diego. There's another issue though.

I combined two of my boards this morning and now I have to go through and re-save every prefix so they all show up where they're supposed to in the dropdown list.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 29, 2022, 02:20:57 PM
Quote from: Steve on June 29, 2022, 02:15:19 PMso they all show up where they're supposed to in the dropdown list
Not sure I follow this bit, what do you mean?
Title: Re: SMF Post Prefix
Post by: Steve on June 29, 2022, 02:35:59 PM
For example, the prefixes that were ticked to show up in the dropdown list when making a post in each original board have to be re-saved in order for them to show up in the now combined board's dropdown list.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 29, 2022, 02:54:21 PM
I don't think that's a bug. It has always worked like that, you have to setup the prefixes for new boards.
There's no quick-add prefix for boards, yet.
Title: Re: SMF Post Prefix
Post by: Steve on June 29, 2022, 03:31:17 PM
But when I modify a prefix and look at the boards ticked, the combined board is already ticked.

You're saying I need to re-save the prefix anyway?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 29, 2022, 03:41:07 PM
I wouldn't know. What are the steps to reproduce this situation?
If you clear cache, does it change?
Title: Re: SMF Post Prefix
Post by: Steve on June 29, 2022, 03:53:24 PM
Let's say I have 4 boards:

A
B
C
D

I move all the posts from board D to board C, then delete board D. All the prefixes that were initially available in board C need to be re-saved to be available again in board C.

As for the forum cache, I just cleared it and it appears to have cleared up the problem. I will do some more testing and get back to you.  :)
Title: Re: SMF Post Prefix
Post by: Steve on July 08, 2022, 06:49:49 AM
I haven't been able to replicate the problem yet so I'll consider it solved.

There is one issue I'm wondering if it could be changed. When clicking the 'Name' heading to sort the prefixes, they always sort in descending order by default (last name alphabetically to first name). Can that be changed to ascending order?

Btw, this has become one of my favorite mods.  :)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 08, 2022, 10:29:20 AM
When using the filter box?
Title: Re: SMF Post Prefix
Post by: Steve on July 08, 2022, 10:34:58 AM
Um, what filter box?

I go to Admin -> Topic Prefixes which gives me a list of all my prefixes. If I click on 'Name' just above the prefixes, they're sorted in descending order.

prefixes.png
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 08, 2022, 10:42:27 AM
4.0.8 - 08 July 2022
Title: Re: SMF Post Prefix
Post by: Steve on July 08, 2022, 11:54:48 AM
Thanks Diego. Works perfectly.  ;D
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 08, 2022, 02:54:08 PM
I actually found another issue.
Should be fixed now.

4.0.9 - 08 July 2022
Title: Re: SMF Post Prefix
Post by: Steve on July 08, 2022, 04:12:42 PM
Thanks again Diego.  :)
Title: Re: SMF Post Prefix
Post by: Steve on July 14, 2022, 03:44:07 PM
This is just a wish for some future version if there is one.

When I go into a board that has a lot of prefixes assigned to it, the prefix dropdown box defaults to whichever prefix comes first alphabetically as shown here:

wish.png

My wish is to have it default to [No Prefix] ... which btw, is the way it happens in boards with only a few prefixes assigned which now confuses me.

Am I missing something somewhere?

Edit: figured it out. It's the require prefixes setting.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 14, 2022, 03:47:50 PM
If the prefix is required then there's no option to select "No prefix".
I think a tweak was provided for this, a few pages before.
And there's a setting to remove it/keep it. Do you have it enabled?
Title: Re: SMF Post Prefix
Post by: Steve on July 14, 2022, 03:59:50 PM
I think I edited when you posted. I did figure it out finally.  ;D
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 17, 2022, 01:57:00 PM
4.0.10 - 17 July 2022
Title: Re: SMF Post Prefix
Post by: Steve on July 17, 2022, 06:54:21 PM
As always, thanks Diego.  :)
Title: Re: SMF Post Prefix
Post by: IP_Board_Rules on August 05, 2022, 09:48:31 AM
Hello Sir, can you please let me know what is the latest version of this mod that still works with SMF 2.0 and where I can find it. Thank you
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 05, 2022, 09:51:45 AM
It's not available anymore, I'm not sure if I have it at all.
Title: Re: SMF Post Prefix
Post by: IP_Board_Rules on August 06, 2022, 03:03:22 PM
Does anbody have a more recent version than 2.3 which is still working on SMD 2.0? Thank you
Title: Re: SMF Post Prefix
Post by: Viper013 on August 06, 2022, 05:18:53 PM
You have a PM   :)
Title: Re: SMF Post Prefix
Post by: Steve on August 07, 2022, 06:12:24 AM
Do you have a problem with this @Diego Andrés?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 07, 2022, 11:31:56 AM
No, the license allows it.
Plus, it doesn't have support so it's under their own risk.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 10, 2022, 12:38:39 AM
4.0.11 - 09 August 2022
Title: Re: SMF Post Prefix
Post by: Steve on August 10, 2022, 07:05:47 AM
Thanks Diego.
Title: Re: SMF Post Prefix
Post by: Steve on August 10, 2022, 10:04:04 AM
I installed this and suddenly I have almost 1000 errors and my 'Rename Topic' function has become 'Link to Calendar'...

My Arcade link has disappeared amongst other things.

Even uninstalling this and re-installing the previous version has no effect so I don't know if any of this is related to this mod or not.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 10, 2022, 10:34:36 AM
I don't think so.
What are the errors?

Perhaps a hook from this or other mod gone rogue or missing.
Title: Re: SMF Post Prefix
Post by: Steve on August 10, 2022, 10:41:34 AM
There are too many and too varied to list.

The two critical ones are this:

... /Sources/Load.php (Line 381)
Backtrace information

Type of error: Critical
Error message Select
JSON decode error: Syntax error, malformed JSON
Title: Re: SMF Post Prefix
Post by: mickjav on August 15, 2022, 04:37:11 PM
Been playing with this mod Have setup so one of my artists can use it

https://www.databasedreams.co.uk/testing/index.php?board=1.0;prefix=1

Have a request  ;D  :o  :o

On Above page The would it be possible to include the prefix ID With the Topics Links I.E. The topic link for "Test Prefix Topic"

Also I'm sure there was a setting for this in 2.0.18-9, Disable/Remove the Board Title Section
I seem to be having memory problems and can't find it lol

General Discussion
Feel free to talk about anything and everything in this board.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on August 15, 2022, 08:29:13 PM
Quote from: mickjav on August 15, 2022, 04:37:11 PMAlso I'm sure there was a setting for this in 2.0.18-9, Disable/Remove the Board Title Section
I seem to be having memory problems and can't find it lol
I'm not sure about this.

Quote from: mickjav on August 15, 2022, 04:37:11 PMOn Above page The would it be possible to include the prefix ID With the Topics Links I.E. The topic link for "Test Prefix Topic"
I didn't quite get your intention with this idea or how it should work?
Title: Re: SMF Post Prefix
Post by: mickjav on August 16, 2022, 06:01:10 PM
Well Thanks @Diego Andrés Managed to Get my artists system Working with this mod, Had a few issues which as usual was me being me but works smooth.

Having Pretty URLs Made getting my banner block work a bit tricky but now I can add the last bit to the block then move on.

Now I have the system I've wanted for more years.

Again thanks to @Diego Andrés for all his patience.


Title: Re: SMF Post Prefix
Post by: Steve on August 24, 2022, 01:47:02 PM
Found a small quirk (bug?) ...

When in the topic list with the prefixes showing and you double click on the topic title of any topic and change anything in the title, the prefix disappears.

You have to go to the topic, modify the first post and without doing anything (except making sure the prefix you want is chosen) save it. Then all is well again.
Title: Re: SMF Post Prefix
Post by: Julius_2000 on October 04, 2022, 02:50:39 PM
I get a blank page when I try to load any "parse" for the Manual Installation info in the package tab of the mod's download site.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 04, 2022, 03:47:18 PM
I'll pass it on, thanks.

In any case, this mod doesn't have instructions really as it uses hooks.
Title: Re: SMF Post Prefix
Post by: Steve on October 04, 2022, 04:49:44 PM
Hey Diego, is it possible to use two prefixes in the same topic title? I tried creating a prefix with the two prefixes I want but I got a 'string too long' error.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 04, 2022, 05:09:44 PM
No it's not possible.
Not sure how you manage to do that  :o

If it allowed multiple prefixes, it wouldn't be a prefix mod, it would be a labels mod.
Title: Re: SMF Post Prefix
Post by: Steve on October 04, 2022, 06:06:46 PM
Makes sense. I tried making a prefix of 'New York & New Jersey' and that's when I got the error.

But you're right, of course, doing that would be outside the intent of your mod (which I think is brilliant btw).
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 04, 2022, 08:44:20 PM
It's alright.
The issue with the string might be because it's limited to 25 characters... Might be an inconvenience but I thought it reasonable at the time since some like to write extremely long titles.
Title: Re: SMF Post Prefix
Post by: Shades. on October 11, 2022, 10:09:58 AM
SMF 2.1.2

Any way to make this mod work with the thumbnail topic mod (https://custom.simplemachines.org/index.php?mod=1151)? I tried to install both but get errors...I even tried disabling "prefixes" in the boards that have the thumbnail mod active but didn't work.

Error
Type of error
Database
Error message
Database Error: '******_******.t.id_prefix' isn't in GROUP BY


SELECT
t.id_topic, t.num_replies, t.locked, t.num_views, t.is_sticky, t.id_poll, t.id_previous_board,
COALESCE(lt.id_msg, COALESCE(lmr.id_msg, -1)) + 1 AS new_from,
COALESCE(( SELECT 1 FROM ******_messages AS parti WHERE t.id_topic = parti.id_topic and parti.id_member = 1 LIMIT 1) , 0) as is_posted_in,

t.id_last_msg, t.approved, t.unapproved_posts, ml.poster_time AS last_poster_time, t.id_redirect_topic,
ml.id_msg_modified, ml.subject AS last_subject, ml.icon AS last_icon,
ml.poster_name AS last_member_name, ml.id_member AS last_id_member,
COALESCE(meml.real_name, ml.poster_name) AS last_display_name, t.id_first_msg,
mf.poster_time AS first_poster_time, mf.subject AS first_subject, mf.icon AS first_icon,
mf.poster_name AS first_member_name, mf.id_member AS first_id_member,
COALESCE(memf.real_name, mf.poster_name) AS first_display_name, ml.smileys_enabled AS last_smileys, mf.smileys_enabled AS first_smileys, IFNULL(big.id_attach, 0) AS big_id, big.filename AS big_filename, big.width AS big_width, big.height AS big_height,
IFNULL(thn.id_attach, 0) AS thn_id, thn.filename AS thn_filename, thn.width AS thn_width, thn.height AS thn_height, IFNULL(thn.id_attach, mf.body) AS mainpost, t.id_board
, t.id_prefix, pp.id AS prefix_id, pp.name AS prefix_name, pp.status AS prefix_status, pp.color AS prefix_color, pp.bgcolor AS prefix_bgcolor, pp.invert_color AS prefix_invert_color, pp.icon_class AS prefix_icon_class
FROM (
SELECT t.id_topic, t.id_first_msg, t.id_last_msg, t.id_prefix, pp.id AS prefix_id, pp.name AS prefix_name, pp.status AS prefix_status, pp.color AS prefix_color, pp.bgcolor AS prefix_bgcolor, pp.invert_color AS prefix_invert_color, pp.icon_class AS prefix_icon_class
FROM ******_topics t

LEFT JOIN ******_postprefixes AS pp ON (t.id_prefix = pp.id)
WHERE t.id_board = 8
ORDER BY is_sticky DESC, id_last_msg DESC
LIMIT 20
OFFSET 0 ) as st
JOIN ******_topics AS t ON (st.id_topic = t.id_topic)
JOIN ******_messages AS ml ON (ml.id_msg = st.id_last_msg)
JOIN ******_messages AS mf ON (mf.id_msg = st.id_first_msg)

LEFT JOIN ******_attachments AS big ON (big.id_msg = mf.id_msg AND big.attachment_type = 0)
LEFT JOIN ******_attachments AS thn ON (thn.id_attach = big.id_thumb)
LEFT JOIN ******_members AS meml ON (meml.id_member = ml.id_member)
LEFT JOIN ******_members AS memf ON (memf.id_member = mf.id_member)
LEFT JOIN ******_log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = 1)
LEFT JOIN ******_log_mark_read AS lmr ON (lmr.id_board = 8 AND lmr.id_member = 1)
LEFT JOIN ******_postprefixes AS pp ON (t.id_prefix = pp.id)

GROUP BY t.id_topic, big.id_attach, thn.id_attach, t.num_replies, t.locked, t.num_views, t.is_sticky, t.id_poll, t.id_previous_board, lt.id_msg,lmr.id_msg, t.id_last_msg, t.approved, t.unapproved_posts, ml.poster_time,
t.id_redirect_topic, ml.id_msg_modified, ml.subject, ml.icon, ml.body, ml.poster_name, ml.id_member, meml.real_name, t.id_first_msg, mf.poster_time, mf.subject, mf.icon, mf.poster_name, mf.id_member, memf.real_name, ml.smileys_enabled,
mf.smileys_enabled, big.filename, big.width, big.height, thn.filename, thn.width, thn.height, mf.body, t.id_board

ORDER BY is_sticky DESC, id_last_msg DESC
File
/home/******/public_html/Sources/MessageIndex.php
Line
361
URL of page causing the error
https://*******.com/?board=8.0

Backtrace information
#0: smf_db_error()
Called from /home/******/public_html/Sources/Subs-Db-mysql.php on line 494
#1: smf_db_query()
Called from /home/******/public_html/Sources/MessageIndex.php on line 361
#2: MessageIndex()
Called from /home/******/public_html/index.php on line 192
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 11, 2022, 10:48:19 AM
This mod uses hooks, so you'd have to manually add the column into the group by for the other mod.

It occurs to me, that @vbgamer45 could include $message_index_selects in the group by, to account for the selects added by hooks?
Title: Re: SMF Post Prefix
Post by: vbgamer45 on October 11, 2022, 12:55:22 PM
Quote from: Diego Andrés on October 11, 2022, 10:48:19 AMThis mod uses hooks, so you'd have to manually add the column into the group by for the other mod.

It occurs to me, that @vbgamer45 could include $message_index_selects in the group by, to account for the selects added by hooks?
Possibly. hmm
Title: Re: SMF Post Prefix
Post by: Shades. on October 11, 2022, 01:24:48 PM
Quote from: vbgamer45 on October 11, 2022, 12:55:22 PMPossibly. hmm
Pretty please? ? ? ? ;D  O:)
Title: Re: SMF Post Prefix
Post by: mickjav on October 22, 2022, 09:39:38 AM
Don't know if this will be of use to anybody else, When I started using the prefixes I needed a way to automate the adding of prefixes.

I have over 300 so far, now I've added that many with the code below I have decided it's had enough testing lol

Updates you will want to make:

//Auto Add Prefixes To Artists
function addArtistPrefix($art_name)
{

        global $smcFunc;

        isAllowedTo('music_can_edit_artists');
   
        //Do Main Record
        $art_name = $art_name . ':';
   
        $smcFunc['db_query']('', "INSERT INTO {db_prefix}postprefixes
                    (name)
                    VALUES('$art_name')");
                   
        $prefix = $smcFunc['db_insert_id']('{db_prefix}postprefixes', 'id');
   
    //Do Boards
    $boardquery = $smcFunc['db_query']('', '
    SELECT id_board
    FROM {db_prefix}postprefixes_boards
    WHERE id_prefix = 1');


        while ($brow = $smcFunc['db_fetch_assoc']($boardquery))
        {
            $board = $brow['id_board'];
            $smcFunc['db_query']('', "INSERT INTO {db_prefix}postprefixes_boards
                    (id_prefix, id_board)
                    VALUES('$prefix', '$board')");
        }
        $smcFunc['db_free_result']($boardquery);

    //Do Permissions
    $groupquery = $smcFunc['db_query']('', '
    SELECT id_group
    FROM {db_prefix}postprefixes_groups
    WHERE id_prefix = 1');


        while ($grow = $smcFunc['db_fetch_assoc']($groupquery))
        {
            $group = $grow['id_group'];
            $smcFunc['db_query']('', "INSERT INTO {db_prefix}postprefixes_groups
                    (id_prefix, id_group)
                    VALUES('$prefix', '$group')");
        }
        $smcFunc['db_free_result']($groupquery);       
       
        return $prefix;
}

All the best mick
Title: Re: SMF Post Prefix
Post by: Shades. on October 28, 2022, 12:58:14 PM
Quote from: Diego Andrés on October 11, 2022, 10:48:19 AMThis mod uses hooks, so you'd have to manually add the column into the group by for the other mod.

It occurs to me, that @vbgamer45 could include $message_index_selects in the group by, to account for the selects added by hooks?
Can someone tell me where to add this? I tried adding it myself but got more errors cause I don't have a clue what I'm doing! :laugh:  O:)  :P
Title: Re: SMF Post Prefix
Post by: Diego Andrés on October 28, 2022, 08:23:27 PM
I think @vbgamer45 already did something similar in the latest update of his mod  8)
Title: Re: SMF Post Prefix
Post by: vbgamer45 on November 01, 2022, 08:50:07 AM
Haven't just yet.
Title: Re: SMF Post Prefix
Post by: Dream of Omnimaga on November 02, 2022, 07:35:38 AM
Hello, I'm getting the following error when installing:

QuoteParse error: syntax error, unexpected ')' in /var/www/codewalr.us/Packages/temp/install.php on line 291
Title: Re: SMF Post Prefix
Post by: Kindred on November 02, 2022, 01:35:33 PM
that's not a problem with this mod....   you have broken something on your site.
Title: Re: SMF Post Prefix
Post by: live627 on November 02, 2022, 05:01:57 PM
I see that the code uses syntax introduced in PHP 7.3. You need to update PHP.
Title: Re: SMF Post Prefix
Post by: darkmoon2010 on November 24, 2022, 05:56:12 AM
Hi @Diego Andrés,
very nice mod  :D

How can I implement a german language file ?

Only copying .english.php to .german.php in the language folder seems not to work.



Best regards
Thomas
Title: Re: SMF Post Prefix
Post by: Steve on November 28, 2022, 08:02:01 AM
Sorry you've not received a response @darkmoon2010 but Diego is off for awhile and won't providing a ton of support until he gets back.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on November 28, 2022, 08:12:30 AM
That should work.
Make sure it's the correct language name and it's translated properly.
Title: Re: SMF Post Prefix
Post by: mickjav on December 18, 2022, 02:32:26 PM
Created The final Part of may artists homepage.

I use the Prefixes so I have built a Recent posts for each artist that uses the prefixes.

you can see it here (https://www.databasedreams.co.uk/charts/index.php?action=music;area=artists;sa=home;art=-477275235)

In your table set the field that holds the prefix to a default of 0 or edit the line of code below

$context['prefix'] holds my Prefix ID for selected artist change for your Prefix id

Code ("In your template add the following line where you want the list") Select
//Recent Topics
        if ($context['prefix'] !=0) GetHomeRecentPosts($context['prefix']);

Code ("Add to your language file") Select
$txt['Music_artists_recent_posts'] = 'Recent Posts';
If you see any errors of can help improve the below code please post it here.

Code ("Function to be added to your file") Select
function GetHomeRecentPosts($prefix)
{
global $smcFunc, $scripturl, $txt;

$link = '';
$title = '';

$dbquery = $smcFunc['db_query']('', '
    SELECT t.id_topic ,t.id_last_msg ,t.id_board, t.id_first_msg, t.id_member_started, t.num_views, t.id_prefix,
t.num_replies, t.locked, t.approved, m.id_msg, m.id_member, m.poster_time, m.subject, m.poster_name, m.approved,
mg.online_color, mem.real_name
    FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (t.id_last_msg = m.id_msg)
LEFT JOIN {db_prefix}members AS mem ON (m.id_member = mem.id_member)
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
WHERE t.id_prefix = {int:id_prefix}
ORDER BY m.poster_time DESC
LIMIT 5',
array(
'id_prefix' => (int) $prefix,
)
);

if ($smcFunc['db_affected_rows']() != 0)
    {
echo'<br /><div class="cat_bar">
    <h3 class="catbg">'. $txt['Music_artists_recent_posts'] .'</h3>
</div>';

echo '<div class="roundframe"><table border="0" Width="100%"><tbody>';

echo '<tr class="title_bar">
<th style="colspan=col">Message</th>
<th scope="col">Author</th>
<th scope="col">Date</th>
</tr>';

while($row = $smcFunc['db_fetch_assoc']($dbquery))
{
if (!empty($row['online_color']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" style="color: ' . $row['online_color'] . ';">' . $row['real_name'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>';

$title = '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg'. $row['id_last_msg'] .';topicseen#msg'. $row['id_last_msg'] . '">' . $row['subject'] . '</a>';

echo  '<tr>
<td style="text-align: left; width: 60%">' . $title . '</td>
<td style="text-align: left; width: 20%">' . $link . '</td>
<td style="text-align: left; width: 20%">' . date("Y-m-d H:i:s",$row['poster_time']) . '</td></tr>';

}

echo '</tbody></table></div>';
}

}
Title: Re: SMF Post Prefix
Post by: mickjav on December 18, 2022, 03:36:58 PM
Have Updated the code so only the selected board(s) posts will be displayed but can't update the above as timed out for edits.

Edit this AND t.id_board IN(126,128) For the boards you wish to display

function GetHomeRecentPosts($prefix)
{
global $smcFunc, $scripturl, $txt;

$link = '';
$title = '';

$dbquery = $smcFunc['db_query']('', '
    SELECT t.id_topic ,t.id_last_msg ,t.id_board, t.id_first_msg, t.id_member_started, t.num_views, t.id_prefix,
t.num_replies, t.locked, t.approved, m.id_msg, m.id_member, m.poster_time, m.subject, m.poster_name, m.approved,
mg.online_color, mem.real_name
    FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (t.id_last_msg = m.id_msg)
LEFT JOIN {db_prefix}members AS mem ON (m.id_member = mem.id_member)
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
WHERE t.id_prefix = {int:id_prefix} AND t.id_board IN(126,128)
ORDER BY m.poster_time DESC
LIMIT 5',
array(
'id_prefix' => (int) $prefix,
)
);

if ($smcFunc['db_affected_rows']() != 0)
    {
echo'<br /><div class="cat_bar">
    <h3 class="catbg">'. $txt['Music_artists_recent_posts'] .'</h3>
</div>';

echo '<div class="roundframe"><table border="0" Width="100%"><tbody>';

echo '<tr class="title_bar">
<th style="colspan=col">Message</th>
<th scope="col">Author</th>
<th scope="col">Date</th>
</tr>';

while($row = $smcFunc['db_fetch_assoc']($dbquery))
{
if (!empty($row['online_color']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" style="color: ' . $row['online_color'] . ';">' . $row['real_name'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>';

$title = '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg'. $row['id_last_msg'] .';topicseen#msg'. $row['id_last_msg'] . '">' . $row['subject'] . '</a>';

echo  '<tr>
<td style="text-align: left; width: 60%">' . $title . '</td>
<td style="text-align: left; width: 20%">' . $link . '</td>
<td style="text-align: left; width: 20%">' . date("Y-m-d H:i:s",$row['poster_time']) . '</td></tr>';

}

echo '</tbody></table></div>';
}

}


Title: Re: SMF Post Prefix
Post by: mickjav on December 20, 2022, 02:23:35 PM
Request:

Not Shure if I've formatted the link incorrectly, I am trying to create a create a new post with the Prefix pre selected.

This is the link that is created for a artist.

https://www.databasedreams.co.uk/charts/artists-charts-analysis/?action=post;prefix=267
Title: Re: SMF Post Prefix
Post by: Steve on January 07, 2023, 01:59:13 PM
@Diego Andrés - there's a serious issue (at least, serious to me) with this mod.

If I create a prefix and have it show in boards:

A
B
C
D

And then delete boards C and D (or only just D), I have to now go to the prefix settings and just save it again without changing anything in order for it to be available for boards A and B.

I have almost 200 prefixes and it's going to take me a long time to re-save each and every one.

Is there a fix for this?
Title: Re: SMF Post Prefix
Post by: mickjav on January 07, 2023, 02:39:37 PM
does that give you orphaned Records in postprefixes_boards if so I would delete those records for boards C and D depending on which you deleted.

mick
Title: Re: SMF Post Prefix Adding Boards to prefixes
Post by: mickjav on January 07, 2023, 02:46:18 PM
I use this to add current prefixes to a new board.

function addPrefixBoard()
{
//DONT USE UNLESS ADDING NEW BOARDS
        global $smcFunc;

$board = 75; //Change as needed.
        //Loop Through Prefixes Adding The Board
    $boardquery = $smcFunc['db_query']('', '
    SELECT id
    FROM {db_prefix}postprefixes');

        while ($brow = $smcFunc['db_fetch_assoc']($boardquery))
        {
            $prefix = $brow['id'];
            $smcFunc['db_query']('', "INSERT INTO {db_prefix}postprefixes_boards
                    (id_prefix, id_board)
                    VALUES('$prefix', '$board')");
        }
        $smcFunc['db_free_result']($boardquery);


}
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 07, 2023, 02:50:55 PM
It's indeed a bug, because the query is using a left join so those boards don't exist anymore.
I'll fix it in a bit.

Title: Re: SMF Post Prefix
Post by: Steve on January 07, 2023, 03:24:39 PM
Thanks Diego.
Title: Re: SMF Post Prefix
Post by: peter_mein on January 07, 2023, 03:34:04 PM
Hello
How can i delete a Prefix ?
If an user used a prefix, how can i delete this prefix from the user ?

 
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 07, 2023, 03:43:08 PM
You can edit the post and remove the prefix from it... I'm not sure what you mean.
You can also limit their permissions or put this user in a group where they can't use that specific prefix.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 07, 2023, 03:44:14 PM
4.1.0 - 07 January 2023

@mickjav If you modified files from the mod, you can check the individual commits on GitHub to update your files.
Title: Re: SMF Post Prefix
Post by: peter_mein on January 07, 2023, 03:53:11 PM
Ok
Found it.
I ticked too many in the settings. Now it works as I wanted
Title: Re: SMF Post Prefix
Post by: mickjav on January 07, 2023, 03:56:58 PM
No I haven't edited the files as to be honest they are still a bit beyond me Think It will be at least a year before I feel confident enough to edit them not that I need to as your doing a very nice job.

Thank you for adding the "Allow passing prefixes in the URL when posting to have them pre-selected" That sorts my OCD lol.

I'll uninstall and update hopefully tomorrow.

All the best mick
Title: Re: SMF Post Prefix
Post by: peter_mein on January 07, 2023, 04:34:51 PM
Not solved my problem.
If I put a prefix in a contribution and want it
subsequently delete the prefix so this is not possible.
I edit the contribution and select no prefix. If I now go to save now the text appears that I should choose a prefix.
See attachement
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 07, 2023, 04:49:42 PM
Then don't require prefixes in that board if you are planning to have topics without prefix.
Title: Re: SMF Post Prefix
Post by: peter_mein on January 07, 2023, 04:55:58 PM
And why can I then select no prefix?
Then it makes no sense
Title: Re: SMF Post Prefix
Post by: Steve on January 07, 2023, 04:58:14 PM
Awesome Diego! Works like a charm!
Title: Re: SMF Post Prefix
Post by: peter_mein on January 07, 2023, 05:02:34 PM
No prefix is needed when moving a post.
If prefixes are allowed in a board and I move a post to a board
where no prefixes are allowed, the prefix is moved with it
and you can no longer delete it.

Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 07, 2023, 05:32:30 PM
My only guess is that you are having this issue if you enable the option to remove "No Prefix"?
Otherwise I don't understand how you are unable to choose "No prefix", unless you still have this board requiring prefixes.
Title: Re: SMF Post Prefix
Post by: peter_mein on January 08, 2023, 03:58:36 AM
Everything OK. The cache was not yet rewritten and
still showed me the old state.
Title: Re: SMF Post Prefix
Post by: mickjav on January 09, 2023, 03:57:16 AM
Hi I'm sure this request will only be related to what I'm doing.

What I have done:

I have built A Synce To My Chart Weeks So when new weeks are added it creates the corresponding prefix and links it to the Chart Week.

My prefix name is created so:
2020 Jul 09: UK Singles Chart:
2020 Jun 13: Billboard Hot 100 Singles:
2020 Feb 06: UK Albums Chart:

This all works fine but my question/request is would of be possible For specific boards to to be able to change the sort order from ASC to DESC The board I wish the order to be changed for is board_ID 136

if there is a code change I could make please let me know.

Just in case it's of use to others i've posted the code.
this is what I built to synce the prefixes and chart weeks

The call is set so only admin runs it "Q: Is there a is admin context?"
//Add Any New Chart Weeks To The Prexixes
        if ($context['user']['is_guest'])
        $mem_id = 0;
        else
        $mem_id = $context['user']['id'];
        //Only Run For Admin
        if ($mem_id == 1) CheckForNewChartWeeks();

The two functions below do the work, You will need to update the "id_prefix = 805" to what you need plus I have added a tag to the prefixes table to make managing them simpler "p_type"

function CheckForNewChartWeeks()
{
    global $smcFunc;
   
    $prefix_name = '';
   
    $dbquery = $smcFunc['db_query']('', '
    SELECT w.week_id, w.wkend, c.chart_name, c.chart_name_short, c.use_prefix
    FROM {db_prefix}chart_weeks AS w
    INNER JOIN {db_prefix}chart_names AS c ON (w.chart_id = c.chart_id)
    WHERE w.prefix_id = 0 AND YEAR(w.wkend) >= 2020 AND c.use_prefix = 1
    ORDER BY YEAR(w.wkend) DESC');
       
    if ($smcFunc['db_affected_rows']() != 0)
    {
        while($row = $smcFunc['db_fetch_assoc']($dbquery)){
        $prefix_name = date("Y M d",strtotime($row['wkend'])) . ': ' .(strlen($row['chart_name_short'])>0 ? $row['chart_name_short'] : $row['chart_name']) . ':';
        addChartWeeksPrefix($row['week_id'], $prefix_name, 3);
        }
    }       
   
        $smcFunc['db_free_result']($dbquery);
}

//Auto Add Prefixes To Artists
function addChartWeeksPrefix($id, $prefix_name, $typ)
{

        global $smcFunc;

        isAllowedTo('music_can_edit_artists');
   
       
        $smcFunc['db_query']('', "INSERT INTO {db_prefix}postprefixes
                    (name, p_type)
                    VALUES('$prefix_name', '$typ')");
                   
        $prefix = $smcFunc['db_insert_id']('{db_prefix}postprefixes', 'id');
       
    //Update The Chart Week
    $smcFunc['db_query']('', "UPDATE {db_prefix}chart_weeks
                    SET prefix_id = '$prefix'
                    WHERE week_id = $id LIMIT 1");
   
    //Do Boards
    $boardquery = $smcFunc['db_query']('', '
    SELECT id_board
    FROM {db_prefix}postprefixes_boards
    WHERE id_prefix = 805');


        while ($brow = $smcFunc['db_fetch_assoc']($boardquery))
        {
            $board = $brow['id_board'];
            $smcFunc['db_query']('', "INSERT INTO {db_prefix}postprefixes_boards
                    (id_prefix, id_board)
                    VALUES('$prefix', '$board')");
        }
        $smcFunc['db_free_result']($boardquery);

    //Do Permissions
    $groupquery = $smcFunc['db_query']('', '
    SELECT id_group
    FROM {db_prefix}postprefixes_groups
    WHERE id_prefix = 805');


        while ($grow = $smcFunc['db_fetch_assoc']($groupquery))
        {
            $group = $grow['id_group'];
            $smcFunc['db_query']('', "INSERT INTO {db_prefix}postprefixes_groups
                    (id_prefix, id_group)
                    VALUES('$prefix', '$group')");
        }
        $smcFunc['db_free_result']($groupquery);       
       
}
Title: Re: SMF Post Prefix
Post by: Steve on January 12, 2023, 06:26:54 PM
I may have come across a bug. When I have a board that requires prefixes and have 'Remove 'No prefix' from the list when the board requires a prefix.' selected, the 'No Prefix' still shows in the boards requiring a prefix. Can you confirm Diego?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 12, 2023, 07:56:37 PM
Quote from: mickjav on January 09, 2023, 03:57:16 AMThis all works fine but my question/request is would of be possible For specific boards to to be able to change the sort order from ASC to DESC The board I wish the order to be changed for is board_ID 136
Prefixes are added globally so they can be available easier.

In PostPrefix/PostPrefix.php
Add $board to the globals.
Code (Search) Select
$context['user_prefixes']['post'] = Database::pNested(
'pp.' . (!empty($modSettings['PostPrefix_select_order']) ? 'id' : 'name')
Code (Replace) Select
$custom_boards = [1];
$custom_sorting = (!empty($board) && in_array($board, $custom_boards) ? ' DESC' : '');
$context['user_prefixes']['post'] = Database::pNested(
'pp.' . (!empty($modSettings['PostPrefix_select_order']) ? 'id' : 'name') . $custom_sorting

Just put your boards in the $custom_boards array: [2,5,453,67,223]





Quote from: Steve on January 12, 2023, 06:26:54 PMI may have come across a bug. When I have a board that requires prefixes and have 'Remove 'No prefix' from the list when the board requires a prefix.' selected, the 'No Prefix' still shows in the boards requiring a prefix. Can you confirm Diego?

I reckon a few pages ago on this topic it was suggested it worked this way to prevent users from submitting topics with whatever prefix appears first on the list.
Title: Re: SMF Post Prefix
Post by: mickjav on January 13, 2023, 08:37:38 AM
Many Thanks @Diego Andrés Worked A Treat. ;D
Title: Re: SMF Post Prefix
Post by: Steve on January 13, 2023, 10:35:10 AM
Quote from: Steve on January 12, 2023, 06:26:54 PMI may have come across a bug. When I have a board that requires prefixes and have 'Remove 'No prefix' from the list when the board requires a prefix.' selected, the 'No Prefix' still shows in the boards requiring a prefix. Can you confirm Diego?
Quote from: Diego Andrés on January 12, 2023, 07:56:37 PMI reckon a few pages ago on this topic it was suggested it worked this way to prevent users from submitting topics with whatever prefix appears first on the list.
I don't think I understand. Why would the option be in the settings then?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 13, 2023, 10:40:11 AM
I might remove it, or add a note that it doesn't apply for boards that require prefixes to prevent users from submitting topics without checking what prefix is selected.
Title: Re: SMF Post Prefix
Post by: Steve on January 13, 2023, 10:47:49 AM
Ah, okay. Thanks Diego.
Title: Re: SMF Post Prefix
Post by: mickjav on January 22, 2023, 01:02:23 PM
Hi think this may relate to @vbgamer45 pretty urls

When I use the link I created
/charts/chart-analysis/?action=post;prefix=809 all works as intended,

But when I use the new topic button link I see the prefix id I.E. charts/chart-analysis/?prefix=1 but no prefix is preselected on the post screen.


All the best mick




Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 22, 2023, 01:07:21 PM
For filtering the board? I wouldn't know how to support pretty urls.
But also you provided different examples, action=post would be different than just browsing the board without action=post
Title: Re: SMF Post Prefix
Post by: mickjav on January 22, 2023, 01:47:46 PM
This is the link

https://www.databasedreams.co.uk/charts/artists-forums-126/?prefix=152 but I can't see the prefix in the new topic button url anymore??, that link filters the board for that prefix which is from my artists homepage
https://www.databasedreams.co.uk/charts/index.php?action=music;area=artists;sa=home;art=-1455642346

When I get on my pc ill look into this more as was sure the new topic button included the prefix? maybe I'm seeing things  :o


Title: Re: SMF Post Prefix
Post by: Diego Andrés on January 22, 2023, 01:51:27 PM
The new topic button does not add a prefix to the url when filtering, that's not a feature... yet.  :P
I'm not sure if you added the prefix to a custom url from the music action and that's why you thought it was the same behavior?
Title: Re: SMF Post Prefix
Post by: mickjav on January 22, 2023, 04:10:32 PM
Thought I was going nuts lol

All the best mick
Title: Re: SMF Post Prefix
Post by: pulgatomika on February 23, 2023, 10:30:16 AM
Hello Diego Andres.
The first thing very good this mod, I discovered it yesterday and delighted with it, but I did not want to comment a couple of doubts I have and if it is possible to do so.
The first one. You could add more prefixes in the topics 2,3,4 the ones that are needed.
And the second one is possible to change the position of the prefixes, instead of going out before the title of the topic in the left part, to go out just under the title.
I hope to see me explained.
Greetings and very good mod.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on February 23, 2023, 10:43:53 AM
Quote from: pulgatomika on February 23, 2023, 10:30:16 AMThe first one. You could add more prefixes in the topics 2,3,4 the ones that are needed.

No this won't be a feature because it's not a label or tags mod.


Quote from: pulgatomika on February 23, 2023, 10:30:16 AMAnd the second one is possible to change the position of the prefixes, instead of going out before the title of the topic in the left part, to go out just under the title.
Could be done changing the order in the code in the multiple files that add the prefix before the subject. In practice I don't think it's useful at all, defeats the purpose of being a prefix (it comes before).
Title: Re: SMF Post Prefix
Post by: pulgatomika on February 23, 2023, 11:09:01 AM
Hello Diego Andres, thank you very much for the quick response, everything is very well explained.
Greetings.
Title: Re: SMF Post Prefix
Post by: DeadMan... on March 18, 2023, 11:29:48 AM
Quote from: Diego Andrés on May 11, 2015, 10:37:35 PMDisplay prefixes in the boardindex and latest posts
Display prefixes in the unread posts/replies action

I'm using NameX theme, and am not seeing the prefixes on board index, or recent posts.
Even when go to look at recent posts page, they are not showing.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 18, 2023, 06:58:39 PM
I'll have a look later.
Did you enable it for posts too? Otherwise it only displays prefixes for the first post (topic).
Title: Re: SMF Post Prefix
Post by: DeadMan... on March 18, 2023, 07:17:16 PM
Quote from: Diego Andrés on March 18, 2023, 06:58:39 PMI'll have a look later.
Did you enable it for posts too? Otherwise it only displays prefixes for the first post (topic).

Tried that, and still not showing.
Only seems to show in message index and topic view.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 18, 2023, 08:13:47 PM
I'm not having any issues on my test forum. I also have a similar theme/setup on ST and it works fine there as well.
Perhaps some other mod is giving you this issue?
Title: Re: SMF Post Prefix
Post by: DeadMan... on March 18, 2023, 08:28:05 PM
Quote from: Diego Andrés on March 18, 2023, 08:13:47 PMI'm not having any issues on my test forum. I also have a similar theme/setup on ST and it works fine there as well.
Perhaps some other mod is giving you this issue?

List of mods:

1   BBC You   2.2.1
2   Remove "Last Edit" 1.2
3   Ghostly Smileys   1.0
4   More Spiders 1.3.1
5   Quick New Topic Button   1.3
6   Unapproved Attachments, Posts and Topics in Mod   1.0.1
7   TinyPortal 2.3.0
8   Quick Spoiler 1.5.1
9   SMF Post Prefix   4.1.0
10   HtmlButton 1.0

EDIT: On blank test forum, shows in info center, but not recent posts page.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 18, 2023, 08:36:21 PM
Quote from: DeadMan... on March 18, 2023, 08:28:05 PMbut not recent posts page.
This... might be a typo in the settings. The mod displays prefixes in the unread posts, not recent posts.
Title: Re: SMF Post Prefix
Post by: DeadMan... on March 18, 2023, 08:44:31 PM
Quote from: Diego Andrés on March 18, 2023, 08:36:21 PMThis... might be a typo in the settings. The mod displays prefixes in the unread posts, not recent posts.

Yep, think you nailed that one:
QuoteDisplay prefixes in recent posts

Think it may be TinyPortal messing up the rest?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 18, 2023, 09:08:09 PM
Quote from: DeadMan... on March 18, 2023, 08:44:31 PMThink it may be TinyPortal messing up the rest?
Don't think so, but also depends, what exactly are you looking at?

I definitely need to fix the texts on the settings, and the descriptions as well...
Additionally, there's a chance I could add recent posts action in the future, we'll see.
Title: Re: SMF Post Prefix
Post by: DeadMan... on March 18, 2023, 09:23:15 PM
@Diego Andrés
Installed TP on test forum, and now prefix doesn't show up on board index and info center.

Without TinyPortal:

Prefix_WithOut_TP.jpg

With TinyPortal:

Prefix_With_TP.jpg
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 18, 2023, 10:24:30 PM
They are cached (2 minutes) on those areas, you should check if that's the case by clearing the forum cache.
Other than that, I wouldn't know what issue you might be having, can't replicate so far.
Title: Re: SMF Post Prefix
Post by: DeadMan... on March 18, 2023, 10:36:58 PM
Quote from: Diego Andrés on March 18, 2023, 10:24:30 PMOther than that, I wouldn't know what issue you might be having, can't replicate so far.

Have you tried a test site and installing TP with this mod?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 18, 2023, 10:43:03 PM
Not a default installation, I might have different TP settings on the current setup...
Title: Re: SMF Post Prefix
Post by: DeadMan... on March 18, 2023, 10:52:57 PM
@Diego Andrés  Found it!
TP all right.
In order to see the prefix, got to disable the TP frontpage, and have it go directly to board index.
Wonder if there's some issue with the ?action=forum that the prefix mod does not like?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 18, 2023, 10:56:58 PM
It does seem to have an issue with TP.

I wouldn't know about TP at all and don't want to guess about it.
@@rjen might be able to help us.

This mod uses integrate_mark_read_button for those areas.
Title: Re: SMF Post Prefix
Post by: DeadMan... on March 19, 2023, 10:31:09 AM
@Diego Andrés
I asked over in the TinyPortal support topic and got this reply:

Quote from: tinoest on March 19, 2023, 10:28:11 AMOk, it's a issue with the other mod not TinyPortal.

Just found the line causing the problem. Please ask the other Mod Author to check the boardHooks function.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 19, 2023, 05:22:24 PM
I'll make some changes soon.
It's not really a problem with either of the mods, just unexpected things.
Title: Re: SMF Post Prefix
Post by: DeadMan... on March 19, 2023, 05:28:06 PM
Funny, that's what I was saying all along,
Quote from: Diego Andrés on March 19, 2023, 05:22:24 PMjust unexpected things
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 20, 2023, 12:42:05 AM
4.2.0 - 19 March 2023

Title: Re: SMF Post Prefix
Post by: DeadMan... on March 20, 2023, 05:10:27 AM
(https://www.deadmanknows.site/images/dk_like2.png)
Title: Re: SMF Post Prefix
Post by: Darknico on March 24, 2023, 06:01:31 AM
Hi!
Thanks for the mod!

In attachment, the Italian translation  8)
Title: Re: SMF Post Prefix
Post by: DeadMan... on April 02, 2023, 08:43:23 PM
@Diego Andrés

I have a modified recent topics block, using TinyPortal.
I'd like to see if you could help me get it so the prefix shows on it.
Would like it to be to the left of the title.
Here's the code I have:

global $scripturl, $context, $modSettings, $settings, $txt;
$context['TPortal']['recentboxnum'] = '25';

if(isset($modSettings['recycle_board']))
$bb = $modSettings['recycle_board'];

$what = ssi_recentTopics($context['TPortal']['recentboxnum'], NULL, NULL, 'array');
$counter=1;
$cmax = count($what);

echo '
<div style="width: 100%; overflow: auto; height: 30ex;">';
$member_ids = array();
foreach($what as $wi => $w)
{
$member_ids[] = $w['poster']['id'];
}

if(!empty($member_ids))
$avatars = progetAvatars($member_ids);
else
$avatars = array();


foreach($what as $w)
{
echo '<span class="tpavatar"><a href="' . $scripturl. '?action=profile;u=' . $w['poster']['id'] . '">' , empty($avatars[$w['poster']['id']]) ? '<img src="' . $settings['tp_images_url'] . '/TPguest.png" alt="" />' : $avatars[$w['poster']['id']] , '</a></span>
<div class="smalltext"><a href="'.$w['href'].'">' . $w['subject'] . '</a></div>
<div class="smalltext">', $txt['by'], ' <b>', $w['poster']['link'], '</b></div>
<div class="smalltext">';
if(!$w['new'])
{
if (!TP_SMF21)
echo '<a href="'.$w['href'].'"><img src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="new" /></a> ';
else
echo '<a href="'.$w['href'].'" id="newicon" class="new_posts" >' . $txt['new'] . '</a> ';
}
echo '['.$w['time'].']
</div>';

if($counter != $cmax)
echo '<hr />';
$counter++;
}
echo '
</div>';
Title: Re: SMF Post Prefix
Post by: Diego Andrés on April 03, 2023, 02:22:42 AM
Would need to edit the query in SSI to add the column
Title: Re: SMF Post Prefix
Post by: Steve on April 13, 2023, 08:35:53 AM
In Admin → Topic Prefixes, how difficult would it be to have the sort order changed to the name column by default instead of the modify column?
Title: Re: SMF Post Prefix
Post by: DeadMan... on April 13, 2023, 08:56:36 AM
Quote from: Diego Andrés on April 03, 2023, 02:22:42 AMWould need to edit the query in SSI to add the column

Not quite sure how to do that.
I'm still not familiar with the SSI.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on April 13, 2023, 02:59:53 PM
Quote from: Steve on April 13, 2023, 08:35:53 AMIn Admin → Topic Prefixes, how difficult would it be to have the sort order changed to the name column by default instead of the modify column?

Sources/PostPrefix/Admin/Manage.php
'default_sort_col' => 'modify', Change to 'default_sort_col' => 'item_name',
Not sure if it will be the right order, might need to invert these
'sort' =>  [
'default' => 'prefix_name',
'reverse' => 'prefix_name DESC',
],



Quote from: DeadMan... on April 13, 2023, 08:56:36 AMNot quite sure how to do that.
I'm still not familiar with the SSI.

SSI.php
Code (Search) Select
COALESCE(lt.id_msg, lmr.id_msg, 0) >= ml.id_msg_modified AS is_read,
COALESCE(lt.id_msg, lmr.id_msg, -1) + 1 AS new_from') . ', SUBSTRING(ml.body, 1, 384) AS body, ml.smileys_enabled, ml.icon
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)
INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)
Code (Replace) Select
COALESCE(mem.real_name, ml.poster_name) AS poster_name, ' . ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' : '
COALESCE(lt.id_msg, lmr.id_msg, 0) >= ml.id_msg_modified AS is_read,
COALESCE(lt.id_msg, lmr.id_msg, -1) + 1 AS new_from') . ', SUBSTRING(ml.body, 1, 384) AS body, ml.smileys_enabled, ml.icon,
t.id_prefix, pp.id AS prefix_id, pp.name AS prefix_name, pp.status AS prefix_status, pp.color AS prefix_color, pp.bgcolor AS prefix_bgcolor, pp.invert_color AS prefix_invert_color, pp.icon_class AS prefix_icon_class
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)
INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)
LEFT JOIN {db_prefix}postprefixes AS pp ON (t.id_prefix = pp.id)

Code (Search) Select
'subject' => $row['subject'],
'replies' => $row['num_replies'],
Code (Replace) Select
'subject' => PostPrefix::format($row) . $row['subject'],
'replies' => $row['num_replies'],

Not sure if it will work, didn't test it.
Also you'll probably or likely need to include Sources/PostPrefix/PostPrefix.php?

function ssi_recentTopics($num_recent = 8, $exclude_boards = null, $include_boards = null, $output_method = 'echo')
{
global $settings, $scripturl, $txt, $user_info;
global $modSettings, $smcFunc, $context;

require_once($sourcedir . '/PostPrefix/PostPrefix.php');
Title: Re: SMF Post Prefix
Post by: DeadMan... on April 13, 2023, 04:04:39 PM
Didn't work. Just gave me a 500 page.
Also, had error on the $sourcedir as not valid, so changed that and same result, just no error
, @Diego Andrés.

However, this part gives issue with the blocks, causing some things to not load, like rest of recent topics block and everything after.
'subject' => PostPrefix::format($row) . $row['subject'],
Fixed the issue, but they still don't show in that special recent topics block I am using.

global $scripturl, $context, $modSettings, $settings, $txt;
$context['TPortal']['recentboxnum'] = '25';

if(isset($modSettings['recycle_board']))
$bb = $modSettings['recycle_board'];

$what = ssi_recentTopics($context['TPortal']['recentboxnum'], NULL, NULL, 'array');
$counter=1;
$cmax = count($what);

echo '
<div style="width: 100%; overflow: auto; height: 30ex;">';
$member_ids = array();
foreach($what as $wi => $w)
{
$member_ids[] = $w['poster']['id'];
}

if(!empty($member_ids))
$avatars = progetAvatars($member_ids);
else
$avatars = array();


foreach($what as $w)
{
echo '<span class="tpavatar"><a href="' . $scripturl. '?action=profile;u=' . $w['poster']['id'] . '">' , empty($avatars[$w['poster']['id']]) ? '<img src="' . $settings['tp_images_url'] . '/TPguest.png" alt="" />' : $avatars[$w['poster']['id']] , '</a></span>
<div class="smalltext"><a href="'.$w['href'].'">' . $w['subject'] . '</a></div>
<div class="smalltext">', $txt['by'], ' <b>', $w['poster']['link'], '</b></div>
<div class="smalltext">';
if(!$w['new'])
{
if (!TP_SMF21)
echo '<a href="'.$w['href'].'"><img src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="new" /></a> ';
else
echo '<a href="'.$w['href'].'" id="newicon" class="new_posts" >' . $txt['new'] . '</a> ';
}
echo '['.$w['time'].']
</div>';

if($counter != $cmax)
echo '<hr />';
$counter++;
}
echo '
</div>';
Title: Re: SMF Post Prefix
Post by: Arantor on April 13, 2023, 04:31:55 PM
You'd need to add $sourcedir to the list of globals.
Title: Re: SMF Post Prefix
Post by: DeadMan... on April 13, 2023, 05:29:42 PM
I did, @Arantor.
However, it doesn't appear to let me do the one edit I posted. It causes the blocks to not load. Starting with the recent topics block I posted.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on April 13, 2023, 06:03:10 PM
Do you get any errors or info?
If everything is breaking after the block, then the error might be hiding around that area. I can't test it at the moment.
Title: Re: SMF Post Prefix
Post by: DeadMan... on April 13, 2023, 06:07:31 PM
Quote from: Diego Andrés on April 13, 2023, 06:03:10 PMDo you get any errors or info?
If everything is breaking after the block, then the error might be hiding around that area. I can't test it at the moment.

That's the odd thing. Even after removing and getting the blocks back, there's no errors in the log.
Title: Re: SMF Post Prefix
Post by: Steve on April 13, 2023, 06:30:42 PM
Side note: Thanks Diego!

Back to @DeadMan...'s problem.
Title: Re: SMF Post Prefix
Post by: eliney on May 21, 2023, 03:11:37 AM
By chance, does anyone here have a version prior to v3.0 of this mod that they can share with me? I am looking for it since it is the only version that my forum supports smf 2.0.19 help please :'(  :'(
Title: Re: SMF Post Prefix
Post by: mickjav on May 23, 2023, 06:15:18 PM
In next version would it be possible to add feature(s)


Mick
Title: Re: SMF Post Prefix
Post by: Diego Andrés on May 23, 2023, 08:29:42 PM
It's been 'logged' for a while.
It requires a good amount of work, or I don't know if it's even possible with hooks only.

I would need to work on it, but it's not a priority right now for me, hopefully in the future.
Title: Re: SMF Post Prefix
Post by: mickjav on May 27, 2023, 02:37:28 AM
Quote from: Diego Andrés on May 23, 2023, 08:29:42 PMIt's been 'logged' for a while.
It requires a good amount of work, or I don't know if it's even possible with hooks only.

I would need to work on it, but it's not a priority right now for me, hopefully in the future.

As it's an admin only thing, it makes it easer.

I think I have a ways to make this work, all you would need to do is add a page to your admin or additional options to current admin page plus add the functions, lol.

I won't have a chance today, but if my misses still love me tomorrow, if not it'll be next week lol, I'll look at altering a function I have for doing something like this.

Feel free to use it or alter as needed.

All the best mick
Title: Re: SMF Post Prefix
Post by: Diego Andrés on May 27, 2023, 09:38:44 PM
4.3.0 - 27 May 2023
Title: Re: SMF Post Prefix
Post by: Shades. on May 28, 2023, 03:55:50 PM
Quote from: Shades. on October 28, 2022, 12:58:14 PM
Quote from: Diego Andrés on October 11, 2022, 10:48:19 AMThis mod uses hooks, so you'd have to manually add the column into the group by for the other mod.

It occurs to me, that @vbgamer45 could include
$message_index_selects
 in the group by, to account for the selects added by hooks?
Can someone tell me where to add this? I tried adding it myself but got more errors cause I don't have a clue what I'm doing! :laugh:  O:)  :P
Quote from: Diego Andrés on October 28, 2022, 08:23:27 PMI think @vbgamer45 already did something similar in the latest update of his mod  8)
Yeah he did but I was still getting errors so Since you updated your mod I decided to tinker with it again and I finally figured out how to add the columns myself and it was more than just the one.

On line 393 of MessageIndex.php I changed:
        GROUP BY t.id_topic, big.id_attach, thn.id_attach, t.num_replies, t.locked, t.num_views, t.is_sticky, t.id_poll, t.id_previous_board, ' . ($user_info['is_guest'] ? '' : ' lt.id_msg,lmr.id_msg, ' ) . '  t.id_last_msg, t.approved, t.unapproved_posts, ml.poster_time,
        t.id_redirect_topic, ml.id_msg_modified, ml.subject, ml.icon, ml.body, ml.poster_name, ml.id_member, meml.real_name, t.id_first_msg, mf.poster_time, mf.subject, mf.icon, mf.poster_name, mf.id_member, memf.real_name, ml.smileys_enabled,
        mf.smileys_enabled, big.filename, big.width, big.height, thn.filename, thn.width, thn.height, mf.body, t.id_board
' . (!empty($settings['avatars_on_indexes']) ? ',meml.avatar, meml.email_address, memf.avatar, af.id_attach, al.id_attach, af.attachment_type, al.attachment_type, al.filename, af.filename' : '') . '
            ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC'),
        $message_index_parameters
    );

To:
        GROUP BY t.id_prefix, pp.id, pp.name, pp.status, pp.color, pp.bgcolor, pp.invert_color, pp.icon_class, t.id_topic, big.id_attach, thn.id_attach, t.num_replies, t.locked, t.num_views, t.is_sticky, t.id_poll, t.id_previous_board, ' . ($user_info['is_guest'] ? '' : ' lt.id_msg,lmr.id_msg, ' ) . '  t.id_last_msg, t.approved, t.unapproved_posts, ml.poster_time,
        t.id_redirect_topic, ml.id_msg_modified, ml.subject, ml.icon, ml.body, ml.poster_name, ml.id_member, meml.real_name, t.id_first_msg, mf.poster_time, mf.subject, mf.icon, mf.poster_name, mf.id_member, memf.real_name, ml.smileys_enabled,
        mf.smileys_enabled, big.filename, big.width, big.height, thn.filename, thn.width, thn.height, mf.body, t.id_board
' . (!empty($settings['avatars_on_indexes']) ? ',meml.avatar, meml.email_address, memf.avatar, af.id_attach, al.id_attach, af.attachment_type, al.attachment_type, al.filename, af.filename' : '') . '
            ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC'),
        $message_index_parameters
    );

I had to add this to the beginning of the group by and seems to work perfect now with the other mod:
t.id_prefix, pp.id, pp.name, pp.status, pp.color, pp.bgcolor, pp.invert_color, pp.icon_class,
Title: Re: SMF Post Prefix
Post by: Darknico on May 29, 2023, 09:10:22 AM
Quote from: Diego Andrés on May 27, 2023, 09:38:44 PM4.3.0 - 27 May 2023
  • (https://camo.githubusercontent.com/dabbb7cab40c66b82cb563365d644a1f098f665bf28cef0616f69a1a0f25084e/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d706c75732e706e67) (https://camo.githubusercontent.com/dabbb7cab40c66b82cb563365d644a1f098f665bf28cef0616f69a1a0f25084e/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d706c75732e706e67) Select prefixes for a group when editing a group.
  • (https://camo.githubusercontent.com/dabbb7cab40c66b82cb563365d644a1f098f665bf28cef0616f69a1a0f25084e/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d706c75732e706e67) (https://camo.githubusercontent.com/dabbb7cab40c66b82cb563365d644a1f098f665bf28cef0616f69a1a0f25084e/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d706c75732e706e67) Select prefixes for a board when editing a board.
  • (https://camo.githubusercontent.com/2b4ab97b0305c84fe3d563f95de3f5eaa7019a88172cd590e0d0ffbb681f2cf1/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d70656e63696c2e706e67) (https://camo.githubusercontent.com/2b4ab97b0305c84fe3d563f95de3f5eaa7019a88172cd590e0d0ffbb681f2cf1/68747470733a2f2f736d66747269636b732e636f6d2f6173736574732f6368616e67656c6f672f7461672d2d70656e63696c2e706e67) Improved settings HTML markup.

Added italian translation update

P.S. in crowdin (https://crowdin.com/project/smf-post-prefix-mod/it), you can uoload this file?
I have no permits... thanks :)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on May 29, 2023, 10:05:00 AM
Thanks, will update languages soon.  ;D
Title: Re: SMF Post Prefix
Post by: Diego Andrés on June 02, 2023, 02:17:30 AM
4.3.1 - 02 June 2023
Title: Re: SMF Post Prefix
Post by: sbartelski on June 29, 2023, 12:54:15 PM
Diego,
I like the look of your mod, but as an SMF noob I am not sure how to install it. I looked up 'hooks' in the SMF documentation and found it quite confusing. Do you, or someone else, have a step by step guide on installing a 'hooks' mod like yours?

TIA
Stefan
Title: Re: SMF Post Prefix
Post by: TwitchisMental on June 29, 2023, 01:08:23 PM
Quote from: sbartelski on June 29, 2023, 12:54:15 PMDiego,
I like the look of your mod, but as an SMF noob I am not sure how to install it. I looked up 'hooks' in the SMF documentation and found it quite confusing. Do you, or someone else, have a step by step guide on installing a 'hooks' mod like yours?

TIA
Stefan
You do not need to worry about the "Hooks".

You are looking for how to install a mod package.

See more here - https://wiki.simplemachines.org/smf/SMF2.1:Package_manager
Title: Re: SMF Post Prefix
Post by: jafl on July 03, 2023, 01:32:20 AM
Hello:
I am getting an error on this line, could you help me?

<a class="button button_strip_' . $key . (!empty($value['active']) ? ' active' : '') . (isset($value['class']) ? ' ' . $value['class'] : '') . '" ' . (!empty($value['url']) ? 'href="' . $value['url'] . '"' : '') . ' ' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '>'.(!empty($value['icon']) ? '<span class="main_icons '.$value['icon'].'"></span>' : '').'' . $txt[$value['text']] . '</a>';
Thank you very much and sorry for my english
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 03, 2023, 01:42:36 AM
Quote from: jafl on July 03, 2023, 01:32:20 AMI am getting an error on this line, could you help me?

Hola, esa línea no tiene que nada ver con este MOD o no tiene suficiente contexto.
Lo mejor es que abras un tema de soporte y expliques qué problema tienes, ya sea en inglés o español.

Saludos!
Title: Re: SMF Post Prefix
Post by: Diego Andrés on July 05, 2023, 09:43:53 PM
What @jafl reported is indeed an issue I confirmed while browsing his site.

4.3.2 - 05 July 2023
Title: Re: SMF Post Prefix
Post by: sbartelski on July 06, 2023, 10:23:06 AM
Quote from: TwitchisMental on June 29, 2023, 01:08:23 PM
Quote from: sbartelski on June 29, 2023, 12:54:15 PMDiego,
I like the look of your mod, but as an SMF noob I am not sure how to install it. I looked up 'hooks' in the SMF documentation and found it quite confusing. Do you, or someone else, have a step by step guide on installing a 'hooks' mod like yours?

TIA
Stefan
You do not need to worry about the "Hooks".

You are looking for how to install a mod package.

See more here - https://wiki.simplemachines.org/smf/SMF2.1:Package_manager

Thanks for the reply, I will try this out
Stefan
Title: Re: SMF Post Prefix
Post by: Diego Andrés on November 12, 2023, 03:48:44 PM
4.3.3 - 12 November 2023
List of changes (https://github.com/SMFTricks/SMF-Post-Prefix/compare/v4.3.2...v4.3.3)
Title: Re: SMF Post Prefix
Post by: CraftyLion on December 04, 2023, 11:35:32 PM
How do we add a padding to each prefix against their background? What css file would we need to use? Right now, it is touching the edges of the prefix ...
Title: Re: SMF Post Prefix
Post by: Diego Andrés on December 05, 2023, 12:34:14 AM
By default it has padding.
You can tweak the CSS in the Themes/default/css/postprefix.css file.

span.postprefix-all,
.postprefix-all {
    padding-inline: 5px !important;
Title: Re: SMF Post Prefix
Post by: CraftyLion on December 05, 2023, 01:21:58 AM
Unfortunately, tweaking the inline padding makes no difference to the pre-fix ...

However, I ended up adding more to the css code which seems work.

span.postprefix-all,
.postprefix-all {
padding-inline-start: 5px !important;
padding-inline-end: 5px !important;
Title: Re: SMF Post Prefix
Post by: Diego Andrés on December 05, 2023, 11:22:26 AM
That is fine
Title: Re: SMF Post Prefix
Post by: StarredSkies on December 13, 2023, 11:36:34 PM
Hello! Updating from 2.0.17 to 2.1.4 here.

When upgrading this mod after emulating/uninstalling, I am getting this error:
Unknown column 'pp.invert_color' in 'field list'
File: /home/DOMAIN/SUBDOMAIN/Sources/PostPrefix/Helper/Database.php
Line: 70

The databases postprefix_groups and _boards do not have any information in them. Is this to be expected upon installation?

After uninstalling dropping postprefix_groups and _boards (as mentioned here (https://www.simplemachines.org/community/index.php?topic=536401.msg4116742#msg4116742)), there has been no change. I am afraid to drop postprefix from the database as I assume it has info that cannot be re-added.

Would there be another fix to this?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on December 14, 2023, 12:36:38 AM
You'll need to make sure the new tables were created correctly.
Try uploading the install.php file from the package and run it directly from the browser {domain}/install.php

You can also open the file and just use it as a 'blueprint' to check if your columns are correct.
Title: Re: SMF Post Prefix
Post by: StarredSkies on December 22, 2023, 10:39:19 PM
Sorry for the late reply.

Quote from: Diego Andrés on December 14, 2023, 12:36:38 AMTry uploading the install.php file from the package and run it directly from the browser {domain}/install.php
Tried this. Blank screen (which I presume is normal) and no changes.

Quote from: Diego Andrés on December 14, 2023, 12:36:38 AMYou can also open the file and just use it as a 'blueprint' to check if your columns are correct.
Just checked. Here's what I am seeing for postprefixes (information from 2.0 prefixes). Differences are 'status,' 'invert_color,' and 'icon_class.'
(https://i.imgur.com/GJ0PioH.png)
postprefixes_board
(https://i.imgur.com/EnQwRwb.png)
postprefixes_group
(https://i.imgur.com/m3jB2Lb.png)

My assumption is that the first table isn't updating correctly, but what do I know about databases?
Still getting the error as listed above.
Title: Re: SMF Post Prefix
Post by: Diego Andrés on December 23, 2023, 04:00:14 AM
Okay, one idea that might work.

Edit the install.php file and change this:
'if_exists' => 'ignore',To:
'if_exists' => 'update',
You might get an error (irrelevant), but you will probably get the missing columns added.

Also, did your data change, is it now updated in the same table?
Title: Re: SMF Post Prefix
Post by: Jotade29 on March 28, 2024, 04:59:55 PM
In version 2.0.2 for version smf 2.0.19 there are a big problem security

@Diego Andrés

Any user, whether or not they have permission to use a prefix for their group, or for the forum, can use any prefix.

To do this, simply copy and paste the following fragment into the web inspector

<select name="id_prefix" id="id_prefix">
<optgroup label="Select Prefix">
<option value="0" selected="">[No Prefix]</option>
<option value="5">[icon]</option>
</optgroup>
</select>

They change the value to whatever they want in the prefix they select from the list, and they can use that prefix. Is this bug fixed for the 2.1 branch? If yes, how could i fix it for 2.0.19?
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 28, 2024, 05:45:56 PM
Quote from: Jotade29 on March 28, 2024, 04:59:55 PMThey change the value to whatever they want in the prefix they select from the list, and they can use that prefix. Is this bug fixed for the 2.1 branch? If yes, how could i fix it for 2.0.19?

Yes.
It's solved using a master list of user's available prefixes.
https://github.com/SMFTricks/SMF-Post-Prefix/blob/8700fa4f34c5b97566973c39e91a8b0f74d1cf79/Sources/PostPrefix/PostPrefix.php#L174-L201
Title: Re: SMF Post Prefix
Post by: Jotade29 on March 28, 2024, 06:27:39 PM
Quote from: Diego Andrés on March 28, 2024, 05:45:56 PM
Quote from: Jotade29 on March 28, 2024, 04:59:55 PMThey change the value to whatever they want in the prefix they select from the list, and they can use that prefix. Is this bug fixed for the 2.1 branch? If yes, how could i fix it for 2.0.19?

Yes.
It's solved using a master list of user's available prefixes.
https://github.com/SMFTricks/SMF-Post-Prefix/blob/8700fa4f34c5b97566973c39e91a8b0f74d1cf79/Sources/PostPrefix/PostPrefix.php#L174-L201

@Diego Andrés
To fix this bug in 2.0.19 should i change that function to this one?

public static function load_theme() : void
    {
        global $user_info, $context, $modSettings;

        // It's only for post pages really...
        if (!isset($_REQUEST['action']) && empty($_REQUEST['action']) || ($_REQUEST['action'] !== 'post' && $_REQUEST['action'] !== 'post2'))
            return;

        // Load the prefixes
        if (($context['user_prefixes']['post'] = cache_get_data('user_postprefixes_u' . $user_info['id'], 600)) === null)
        {
            $context['user_prefixes']['post'] = Database::pNested(
                'pp.' . (!empty($modSettings['PostPrefix_select_order']) ? 'id' : 'name'), 'postprefixes AS pp',
                array_merge(array_merge(Database::$_prefix_normal, Database::$_boards_columns), Database::$_groups_columns), ['b.id_board'], 'boards',
                'WHERE pp.status = 1' . (allowedTo('postprefix_manage') ? '' : '
                    AND ppg.id_group ' . ($user_info['is_guest'] ? '= {int:guest}' : 'IN ({array_int:groups})')
                ),
                'LEFT JOIN {db_prefix}postprefixes_groups AS ppg ON (ppg.id_prefix = pp.id)
                LEFT JOIN {db_prefix}postprefixes_boards AS ppb ON (ppb.id_prefix = pp.id)
                RIGHT JOIN {db_prefix}boards AS b ON (b.id_board = ppb.id_board)',
                [
                    'groups' => array_unique(array_merge($user_info['groups'], [0])),
                    'guest' => -1,
                ]
            );
            cache_put_data('user_postprefixes_u' . $user_info['id'], $context['user_prefixes']['post'], 600);
        }
    }


The function that i have is very different

public static function load_theme()
{
global $context, $settings;

// Color picker
if ((isset($_REQUEST['action']) && ($_REQUEST['action'] == 'admin')) && (isset($_REQUEST['area']) && ($_REQUEST['area'] == 'postprefix')) && (isset($_REQUEST['sa']) && (($_REQUEST['sa'] == 'add') || ($_REQUEST['sa'] == 'edit'))))
{
$context['html_headers'] .= '
<script type="text/javascript">!window.jQuery && document.write(unescape(\'%3Cscript src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"%3E%3C/script%3E\'))</script>
<link rel="stylesheet" type="text/css" href="'. $settings['default_theme_url']. '/css/colpick.css" />
<script type="text/javascript" src="'. $settings['default_theme_url']. '/scripts/colpick.js"></script>';
}
}
Title: Re: SMF Post Prefix
Post by: Jotade29 on March 28, 2024, 10:22:00 PM
Quote from: Jotade29 on March 28, 2024, 06:27:39 PM
Quote from: Diego Andrés on March 28, 2024, 05:45:56 PM
Quote from: Jotade29 on March 28, 2024, 04:59:55 PMThey change the value to whatever they want in the prefix they select from the list, and they can use that prefix. Is this bug fixed for the 2.1 branch? If yes, how could i fix it for 2.0.19?

Yes.
It's solved using a master list of user's available prefixes.
https://github.com/SMFTricks/SMF-Post-Prefix/blob/8700fa4f34c5b97566973c39e91a8b0f74d1cf79/Sources/PostPrefix/PostPrefix.php#L174-L201

@Diego Andrés
To fix this bug in 2.0.19 should i change that function to this one?

public static function load_theme() : void
    {
        global $user_info, $context, $modSettings;

        // It's only for post pages really...
        if (!isset($_REQUEST['action']) && empty($_REQUEST['action']) || ($_REQUEST['action'] !== 'post' && $_REQUEST['action'] !== 'post2'))
            return;

        // Load the prefixes
        if (($context['user_prefixes']['post'] = cache_get_data('user_postprefixes_u' . $user_info['id'], 600)) === null)
        {
            $context['user_prefixes']['post'] = Database::pNested(
                'pp.' . (!empty($modSettings['PostPrefix_select_order']) ? 'id' : 'name'), 'postprefixes AS pp',
                array_merge(array_merge(Database::$_prefix_normal, Database::$_boards_columns), Database::$_groups_columns), ['b.id_board'], 'boards',
                'WHERE pp.status = 1' . (allowedTo('postprefix_manage') ? '' : '
                    AND ppg.id_group ' . ($user_info['is_guest'] ? '= {int:guest}' : 'IN ({array_int:groups})')
                ),
                'LEFT JOIN {db_prefix}postprefixes_groups AS ppg ON (ppg.id_prefix = pp.id)
                LEFT JOIN {db_prefix}postprefixes_boards AS ppb ON (ppb.id_prefix = pp.id)
                RIGHT JOIN {db_prefix}boards AS b ON (b.id_board = ppb.id_board)',
                [
                    'groups' => array_unique(array_merge($user_info['groups'], [0])),
                    'guest' => -1,
                ]
            );
            cache_put_data('user_postprefixes_u' . $user_info['id'], $context['user_prefixes']['post'], 600);
        }
    }


The function that i have is very different

public static function load_theme()
{
global $context, $settings;

// Color picker
if ((isset($_REQUEST['action']) && ($_REQUEST['action'] == 'admin')) && (isset($_REQUEST['area']) && ($_REQUEST['area'] == 'postprefix')) && (isset($_REQUEST['sa']) && (($_REQUEST['sa'] == 'add') || ($_REQUEST['sa'] == 'edit'))))
{
$context['html_headers'] .= '
<script type="text/javascript">!window.jQuery && document.write(unescape(\'%3Cscript src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"%3E%3C/script%3E\'))</script>
<link rel="stylesheet" type="text/css" href="'. $settings['default_theme_url']. '/css/colpick.css" />
<script type="text/javascript" src="'. $settings['default_theme_url']. '/scripts/colpick.js"></script>';
}
}

I have done the crazy thing of trying it, and obviously it does not work for version 2.0.19. Could you tell me how to adapt that code to 2.0.19? I know that for that version the support is obsolete, but taking into account that it is still used, and it is a serious security problem, i ask you to please help me adapt. Thank you @Diego Andrés   :)
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 28, 2024, 10:32:28 PM
I don't have time at the moment to look into it, and I don't support that MOD anymore.

All you'd need to do is query the prefixes from the table that contains the membergroups and the boards (inside that function is fine) and build a usable array to check using in_array() PHP function, and then load it into a global variable using $context.
An alternative solution you could use is querying the boards/groups each time the posts are edited/posted against the table using the prefix id to check if the user group and the current board are a match.
Title: Re: SMF Post Prefix
Post by: Jotade29 on March 29, 2024, 09:11:44 PM
Quote from: Diego Andrés on March 28, 2024, 10:32:28 PMI don't have time at the moment to look into it, and I don't support that MOD anymore.

All you'd need to do is query the prefixes from the table that contains the membergroups and the boards (inside that function is fine) and build a usable array to check using in_array() PHP function, and then load it into a global variable using $context.
An alternative solution you could use is querying the boards/groups each time the posts are edited/posted against the table using the prefix id to check if the user group and the current board are a match.

Thank you very much for the schematic @Diego Andrés 

It's a pity that support for 2.0 branches has ended in your mods; they are really good, but they have their bugs, and many people still use that branch.

I have already patched it. To avoid leaving things... please confirm if, apart from the board restriction, i only have to keep in mind the powers:

- member_groups
- deny_member_groups

Thank you!!
Title: Re: SMF Post Prefix
Post by: Diego Andrés on March 29, 2024, 09:44:26 PM
I'd assume so, but I haven't seen that version of the MOD in many years so I'm not sure  O:)
Title: Re: SMF Post Prefix
Post by: mickjav on April 24, 2024, 12:56:18 PM
Hi Diego, As you know I'm doing a lot of work on my site, The current section I'm working on will require me to create new topics and replies via a custom UI, as you know I use the prefixes mod, my question is can I send the prefix_id to createPost using the topic array I.E.

createPost($msgOptions, $topicOptions, $posterOptions);
All the best mick
Title: Re: SMF Post Prefix
Post by: Diego Andrés on April 24, 2024, 01:09:59 PM
You need to define it in the array before sending it:
$topicOptions['id_prefix'] = id;

You should already have it defined before calling createPost() so just add the new key with the value.
Title: Re: SMF Post Prefix
Post by: mickjav on April 24, 2024, 01:16:57 PM
Quote from: Diego Andrés on Today at 01:09:59 PMYou need to define it in the array before sending it:
$topicOptions['id_prefix'] = id;

You should already have it defined before calling createPost() so just add the new key with the value.

Thanks was just checking before I made a start

mick