News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

SMF Post Prefix

Started by Diego Andrés, May 11, 2015, 10:37:35 PM

Previous topic - Next topic

Diego Andrés

Link to the mod




SMF Post Prefix
Developed by Diego Andrés



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

Features
  • Add/Edit prefixes
    • Enable/Disable prefix
      • Enable/Disable prefix
    • Select a color for the prefix
      • Text color
      • Background color
    • Add a class for an icon
    • Select allowed groups to use specific prefix
    • Select boards where the prefix can be used
  • Select boards where the prefix will be required (forced)
  • Permissions
    • Manage prefixes
    • Use prefixes (Global permission)
  • Filter Topics by prefix
    • Enable the filter box on selected boards
  • Display prefixes in the boardindex and latest posts
  • Display prefixes in the unread posts/replies action

Localization
English
Spanish
Russian
Turkish
French


Crowdin
Changelog
GitHub

SMF Tricks - Free & Premium Responsive Themes for SMF.

br360

Thanks for submitting this- it's nice to finally see a topic prefix mod on the smf site.

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

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

Here is my recent.php-




),
'topic' => $row['id_topic'],
'href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#msg' . $row['id_msg'],
'link' => ($row['id_msg'] == $row['id_first_msg'] ? PostPrefix::formatPrefix($row['id_prefix']) : ''). ' <a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['id_msg'] . '#msg' . $row['id_msg'] . '" rel="nofollow">' . $row['subject'] . '</a>'
(line 342----->>>)   'start' => $row['num_replies'],
'subject' => $row['subject'],
'time' => timeformat($row['poster_time']),
'timestamp' => forum_time(true, $row['poster_time']),

margarett

Try to add a comma "," at the end of the previous line ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Diego Andrés

LOL I have fixed that like three times, I need to pay more attention :P
Updated and fixed

SMF Tricks - Free & Premium Responsive Themes for SMF.

br360

Works great now. Thank you both. :)


Suriya-DsR

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 [nofollow]_sticky, t.id [nofollow]_poll,

Code: (Replace) [Select]

t.num_replies, t.num_views, t.locked, ms.subject, t.is [nofollow]_sticky, t.id [nofollow]_poll, t.id [nofollow]_prefix,


I am running the correct version of the forum for the mod, I was wondering if there was a way to fix this?

Diego Andrés

Try manual parsing, on a clean install shouldn't be any problems.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Bigguy

Nice mod, very good work. Thanks. :)

Alanar

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

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

Alanar

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.

Diego Andrés

Quote from: Alanar on May 25, 2015, 11:07:37 AM
Hey there and thanks for a mod I've been waiting a long time for!

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

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

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

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

Could you leave an example of this problem, e.g
User 1 is on primary group 1, and additional group 1
And prefixes and be used by additional group but the user cannot because primary can't, is hat what you meant?

SMF Tricks - Free & Premium Responsive Themes for SMF.

Alanar

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

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

Only member groups with a unique set of permissions are shown in the options so only they work with the prefixes.

Alanar

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

Diego Andrés

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?

SMF Tricks - Free & Premium Responsive Themes for SMF.

Alanar

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.

Alanar

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.

Diego Andrés

Sorry I forgot about this, will try to check it tomorrow.
The thing is about showing all the groups right?

SMF Tricks - Free & Premium Responsive Themes for SMF.

Alanar

Well, if they work, yes. If you can't do that, no worries. It's still an amazing free mod. :)

FireDitto

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!
Second Pass Weyr<br />An AU Pernse RPG<br /><br />SMF 2.0.6 with SP 2.3.5

Diego Andrés

Quote from: Alanar on May 27, 2015, 01:17:25 AM
Well, if they work, yes. If you can't do that, no worries. It's still an amazing free mod. :)

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

Thanks.

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

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

Thank you for your time!

1- Sure
2- For sure

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

Thank you for the suggestions.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Advertisement: