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 Mod (https://custom.simplemachines.org/mods/index.php?mod=4038)

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

(https://img.shields.io/badge/License-MPL 2.0-a05a3f?style=flat-square) (https://img.shields.io/badge/SMF-2.1-3f73a0?style=flat-square) (https://img.shields.io/badge/SMF-2.0-996ee1?style=flat-square)

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 or replace them with icons..



Features

Languages
(https://www.simplemachines.org/site_images/lang/english.gif) (https://www.simplemachines.org/site_images/lang/spanish.gif)

*NOTE
Version 3.0 and above are only compatible with SMF 2.1


Changelog (https://smftricks.com/index.php?topic=795.0)
GitHub (https://github.com/SMFTricks/SMF-Post-Prefix)

License
Code: [Select]
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0
If a copy of the MPL was not distributed with this file,
You can obtain one at http://mozilla.org/MPL/

The contents of this package are subject to the Mozilla Public License Version
2.0 (the "License"); you may not use this package except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
 *
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
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-




Code: [Select]
),
'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
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

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

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
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
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
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

Quote
1.0.1 - 31 May 2015
(http://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Now showing inherit groups while adding/editing a prefix.
(http://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) 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
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
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
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
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
Code: [Select]
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!
Quote
2.0 - 15 July 2015
(http://smftricks.com/Themes/SMFTricks/images/changelog/tag--pencil.png) Now you can decide to use text or show an icon.
(http://smftricks.com/Themes/SMFTricks/images/changelog/tag--plus.png) Search topics by prefix.
(http://smftricks.com/Themes/SMFTricks/images/changelog/tag--plus.png) Filter topics by prefix inside a board.
(http://smftricks.com/Themes/SMFTricks/images/changelog/tag--plus.png) Added Spanish translation.
(http://smftricks.com/Themes/SMFTricks/images/changelog/tag--plus.png) 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-

Code: [Select]
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
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
Code: [Select]
'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
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.

Error while searching
Code: [Select]
'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:
Code: [Select]
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
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
Error while searching
Code: [Select]
'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!

Quote
2.0.2 - 27 July 2015
(http://smftricks.com/Themes/SMFTricks/images/changelog/tag--plus.png) Added two new settings for selecting how to order the list of prefixes.
(http://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Fixed the way permissions were added.
(http://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) 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-

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

Code: [Select]
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.

Code: [Select]
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:

Code: [Select]
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:

Code: [Select]
// 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:


Quote
Fatal 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
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?

Quote
XXXXX?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
Code: [Select]
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . ';topicseen#msg' . $row['id_msg'] . '" rel="nofollow">' . $row['subject'] . '</a>'Replace
Code: [Select]
'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
Code: [Select]
'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['first_subject'] . '</a>'Replace
Code: [Select]
'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
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:
Code: [Select]
?>
Add before:
Code: [Select]
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

Code: [Select]
<?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
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
Hi,

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


Quote
Fatal 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
(http://nsa37.casimages.com/img/2015/11/06/151106051326730592.png)
(http://nsa37.casimages.com/img/2015/11/06/151106051626864905.png)
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
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



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

Code: [Select]
<?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
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

(http://i.imgur.com/r3fQkBo.png)
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:
Quote
Fatal 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
(http://imageshack.com/a/img921/519/JnVJNM.png)
Title: Re: SMF Post Prefix
Post by: Dreadaxe on January 31, 2017, 04:12:49 PM
Part of problem solve.

(http://imageshack.com/a/img924/8508/azR3eT.png)

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
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
Quote
8: 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:
Code: [Select]
t.id_topic, t.is_sticky, t.locked, t.id_poll, t.num_replies, t.num_views,
Replace with
Code: [Select]
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
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
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
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:
Code: [Select]
$subject_query['where'][] = 't.id_prefix ' . $search_params['prefix'];Replace with:
Code: [Select]
$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
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:
Code: [Select]
$subject_query['where'][] = 't.id_prefix ' . $search_params['prefix'];Replace with:
Code: [Select]
$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
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
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
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 ...
   
Code: [Select]
$topicOptions['sticky_mode'] !== null || $topicOptions['lock_mode'] !== null || $topicOptions['poll'] !== nullchange it for
Code: [Select]
$topicOptions['sticky_mode'] !== null || $topicOptions['lock_mode'] !== null || $topicOptions['poll'] !== null || $topicOptions['id_prefix'] != null
Code: [Select]
id_poll = {raw:id_poll}change it for
Code: [Select]
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
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

Code: [Select]
m.poster_time, m.subject, m.id_topic, m.id_member, m.id_msg,
In my subs-recent file it looks like this.

Code: [Select]
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
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)

Code: [Select]
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??
Code: [Select]
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
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
(http://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) Finally adressed the issues in Search.php.
(http://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) 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
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
(http://smftricks.com/Themes/SMFTricks/images/changelog/bug--minus.png) 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
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
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
Side 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.

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
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
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
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
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:
Code: [Select]
<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:
Code: [Select]
<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

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

(http://1.bp.blogspot.com/-Jq6owX0G_uo/UIHMUS8e8-I/AAAAAAAAAeg/Ww3CooB4Erw/s1600/Hold-Your-Breath.jpg)

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

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

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 "=":
Code: [Select]
AND t.id_prefix =It is really supposed to be something like the following when you don't select a prefix to search by?:
Code: [Select]
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
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
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 -
Quote
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.
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
Code: [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.
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 :)