Advertisement:

Author Topic: SMF Post Prefix  (Read 50334 times)

Offline Diego Andrés

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,102
  • Gender: Male
  • We know, we'll be coming
    • MeTiroAtuTia on GitHub
    • @bihgetter on Twitter
    • SMF Tricks - Free & Premium Themes
Re: SMF Post Prefix
« Reply #40 on: July 14, 2015, 06:01:09 PM »
Send me a pm

SMF Tricks - Free & Premium Responsive Themes for SMF.

Offline Diego Andrés

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,102
  • Gender: Male
  • We know, we'll be coming
    • MeTiroAtuTia on GitHub
    • @bihgetter on Twitter
    • SMF Tricks - Free & Premium Themes
Re: SMF Post Prefix
« Reply #41 on: July 15, 2015, 02:18:35 PM »
New version 2.0!
Quote
2.0 - 15 July 2015
Now you can decide to use text or show an icon.
Search topics by prefix.
Filter topics by prefix inside a board.
Added Spanish translation.
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
« Last Edit: July 15, 2015, 02:36:50 PM by Diego Andrés »

SMF Tricks - Free & Premium Responsive Themes for SMF.

Offline br360

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,233
    • GenXcommunity
Re: SMF Post Prefix
« Reply #42 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

Offline Diego Andrés

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,102
  • Gender: Male
  • We know, we'll be coming
    • MeTiroAtuTia on GitHub
    • @bihgetter on Twitter
    • SMF Tricks - Free & Premium Themes
Re: SMF Post Prefix
« Reply #43 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

SMF Tricks - Free & Premium Responsive Themes for SMF.

Offline br360

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,233
    • GenXcommunity
Re: SMF Post Prefix
« Reply #44 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. ;)

Offline Diego Andrés

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,102
  • Gender: Male
  • We know, we'll be coming
    • MeTiroAtuTia on GitHub
    • @bihgetter on Twitter
    • SMF Tricks - Free & Premium Themes
Re: SMF Post Prefix
« Reply #45 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.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Offline br360

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,233
    • GenXcommunity
Re: SMF Post Prefix
« Reply #46 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. ;)

Offline Diego Andrés

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,102
  • Gender: Male
  • We know, we'll be coming
    • MeTiroAtuTia on GitHub
    • @bihgetter on Twitter
    • SMF Tricks - Free & Premium Themes
Re: SMF Post Prefix
« Reply #47 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.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Offline Diego Andrés

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,102
  • Gender: Male
  • We know, we'll be coming
    • MeTiroAtuTia on GitHub
    • @bihgetter on Twitter
    • SMF Tricks - Free & Premium Themes
Re: SMF Post Prefix
« Reply #48 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!

SMF Tricks - Free & Premium Responsive Themes for SMF.

Offline br360

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,233
    • GenXcommunity
Re: SMF Post Prefix
« Reply #49 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.

Offline Geor'G

  • Semi-Newbie
  • *
  • Posts: 62
Re: SMF Post Prefix
« Reply #50 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:
Ошибка при поиске

Offline Diego Andrés

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,102
  • Gender: Male
  • We know, we'll be coming
    • MeTiroAtuTia on GitHub
    • @bihgetter on Twitter
    • SMF Tricks - Free & Premium Themes
Re: SMF Post Prefix
« Reply #51 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.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Offline Amargedon

  • Newbie
  • *
  • Posts: 2
Re: SMF Post Prefix
« Reply #52 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?

Offline Diego Andrés

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,102
  • Gender: Male
  • We know, we'll be coming
    • MeTiroAtuTia on GitHub
    • @bihgetter on Twitter
    • SMF Tricks - Free & Premium Themes
Re: SMF Post Prefix
« Reply #53 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.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Offline Amargedon

  • Newbie
  • *
  • Posts: 2
Re: SMF Post Prefix
« Reply #54 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.

Offline Diego Andrés

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,102
  • Gender: Male
  • We know, we'll be coming
    • MeTiroAtuTia on GitHub
    • @bihgetter on Twitter
    • SMF Tricks - Free & Premium Themes
Re: SMF Post Prefix
« Reply #55 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?

SMF Tricks - Free & Premium Responsive Themes for SMF.

Offline Diego Andrés

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,102
  • Gender: Male
  • We know, we'll be coming
    • MeTiroAtuTia on GitHub
    • @bihgetter on Twitter
    • SMF Tricks - Free & Premium Themes
Re: SMF Post Prefix
« Reply #56 on: July 27, 2015, 11:45:03 PM »
New version 2.0.2!

Quote
2.0.2 - 27 July 2015
Added two new settings for selecting how to order the list of prefixes.
Fixed the way permissions were added.
Fixed the empty list of prefixes in search page.

Please report any issues  :)

SMF Tricks - Free & Premium Responsive Themes for SMF.

Offline br360

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,233
    • GenXcommunity
Re: SMF Post Prefix
« Reply #57 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))

Offline Diego Andrés

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,102
  • Gender: Male
  • We know, we'll be coming
    • MeTiroAtuTia on GitHub
    • @bihgetter on Twitter
    • SMF Tricks - Free & Premium Themes
Re: SMF Post Prefix
« Reply #58 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

SMF Tricks - Free & Premium Responsive Themes for SMF.

Offline br360

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,233
    • GenXcommunity
Re: SMF Post Prefix
« Reply #59 on: July 28, 2015, 01:37:02 AM »
Thanks Diego. Works great...and thanks again for this excellent mod.