ElkArte Community

Extending Elk => Addons => Addons ideas and questions => Topic started by: ahrasis on October 21, 2014, 10:12:44 pm

Title: First topic on top in every page addon?
Post by: ahrasis on October 21, 2014, 10:12:44 pm
I love this mod back in SMF. Is there a chance this is made available by default (I don't think so) or any taker for this as an addon?
Title: Re: First topic on top in every page addon?
Post by: emanuele on October 22, 2014, 07:09:51 pm
That's just a kind of proof of concept.

It requires 2 hooks:
Code: [Select]
	$hooks = array(
array(
'integrate_display_topic',
'Pin_First_Message_Integrate::display_topic',
'SOURCEDIR/PinFirstMessage.integrate.php',
),
array(
'integrate_action_display_after',
'Pin_First_Message_Integrate::action_display_after',
'SOURCEDIR/PinFirstMessage.integrate.php',
),
);
foreach ($hooks as $hook)
add_integration_function($hook[0], $hook[1], $hook[2]);
Title: Re: First topic on top in every page addon?
Post by: nhwood on February 27, 2015, 05:45:09 am
A few noob questions: Would this work with the current version? Where would I place the hooks?
Title: Re: First topic on top in every page addon?
Post by: emanuele on March 02, 2015, 05:12:14 pm
O_O
Did I wrote that?
I completely forgot.

Well, still a proof of concept, but now it works a bit better (it doesn't replicate the first message in the first page and it doesn't generate errors here and there).

I don't guarantee it works, but you can try the attached package.
It doesn't follow Good Coding Practice, and it may have bugs.
Title: Re: First topic on top in every page addon?
Post by: ahrasis on July 27, 2016, 07:47:13 am
I will note to look into this one too.
Title: Re: First topic on top in every page addon?
Post by: ahrasis on February 14, 2017, 01:22:06 am
I was wondering about this addon because last time and even current test, I didn't get it working. Anybody got it working as it is or by making further modifications to it?
Title: Re: First topic on top in every page addon?
Post by: emanuele on February 14, 2017, 04:45:36 am
Not having tested it, it's very likely it doesn't work.
Maybe I mistyped something or some hook are not fired when I hope they would.