Findmore plugin inactive for sticky posts?

Creating and modifying plugins.
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Findmore plugin inactive for sticky posts?

Post by Fabien »

I use the findmore pligin, but I would like it to be inactive for sticky posts. Is there an easy way to do that?

Thanks, Fabien
Fabien Chabreuil (blog)
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Findmore plugin inactive for sticky posts?

Post by Timbalu »

Salut Fabien

Yes, go the Smarty way...
The findmore event plugin has a template file, named plugin_findmore.tpl.
You could edit it and add something like this surrounding that files content:

Code: Select all

{if not $dategroup.is_sticky}
    ...
{/if}
That would need the findmore plugin to appear after the entryproperties plugin, I assume.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by Fabien »

Hi Ian,

Thanks for your message. I tried your solution, but alas no effect !

Cheers, Fabien
Fabien Chabreuil (blog)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by garvinhicking »

Hi!

Did you maybe check instead for:

Code: Select all

Sticky value: {$entrydata.properties.ep_is_sticky} {$entrydata.properties.is_sticky}
{if NOT $entrydata.properties.ep_is_sticky AND NOT $entrydata.properties.is_sticky}
(I'm not sure if the key is is_sticky or ep_is_sticky, so I added both...)

It could be that $dategroup is not available within this tpl file; currently I don't have my test installation accessible to test it on my own...

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by Fabien »

Hi Garvin,

Thanks for being here!

No effect also.

Warmly, Fabien
Fabien Chabreuil (blog)
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Findmore plugin inactive for sticky posts?

Post by Timbalu »

{if NOT $entrydata.properties.ep_is_sticky AND NOT $entrydata.properties.is_sticky} should be much better than mine.
Did you also made sure to have the entryproperties before the findmore plugin in the plugin management?

You could also try to add that sticky check {if ... } {/not} into the entries.tpl of your template, right there where plugins hook in...
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by Fabien »

Yes the findmore plugin is the last event plugin.
Fabien Chabreuil (blog)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by garvinhicking »

Hi!

When you use my code, you should see in the plugin an output like this:

Code: Select all

Sticky value: 
Does this appear for you as well? You might want to enhance it to:

Code: Select all

<pre>
Entry data: {$entrydata|@print_r}
Global Entry data: {$entry|@print_r}
Global Entrygroup data: {$dategroup|@print_r}
</pre>
This would give a clue on what variables are there, and how/if/why the seem to be misbehaving. Sorry for this, but currently my devel-webserver is down for maintenance and I can't check it on my own :-/

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by Fabien »

Here is what i see above the icons

Code: Select all

Entry data: Array
(
    [url] => http://www.integralpersonality.com/IPBlog/archives/1-Aller-au-cur-de-la-connaissance.html
    [title] => Aller au cœur de la connaissance
    [path] => /IPBlog/plugins/serendipity_event_findmore/img/
)
1
Global Entry data: 1
Global Entrygroup data: 1
 Sticky value: 
Cheers, Fabien
Fabien Chabreuil (blog)
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Findmore plugin inactive for sticky posts?

Post by Timbalu »

Where did you try this, in plugin_findmore.tpl or in entries.tpl?
Are there many sticky entries in your blog? If not, you you could try to workaround with

Code: Select all

{if NOT $entrydata.title == 'Aller au cœur de la connaissance' AND  NOT $entrydata.title == 'some other sticky title'} and so on
...
{/if}
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by Fabien »

I have only one sticky entry. I have tried your solution and also with entrydata.url: no result!

Thanks, Fabien
Fabien Chabreuil (blog)
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Findmore plugin inactive for sticky posts?

Post by Timbalu »

Try again in your templates entries.tpl and find this part...

Code: Select all

$entry.plugin_display_dat}
and change it like this

Code: Select all

{if NOT $entry.title == 'Aller au cœur de la connaissance' AND NOT $entry.is_sticky}
{$entry.plugin_display_dat}
{/if}
I am not sure if $entry.is_sticky is available, but you could make the |print_r tests as before
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by Don Chambers »

Ian - I think you were on the right track before, just not quite the right syntax. if it is only a single sticky entry, try this:

Code: Select all

{if $entrydata.title!='Aller au cœur de la connaissance'}....{/if}
=Don=
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Findmore plugin inactive for sticky posts?

Post by Timbalu »

Sure, that could be as well :wink: I remember I had a fuzzy twilighted feeling with that other syntax... it felt so mysqlish..., but should Smarty not support this too?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Findmore plugin inactive for sticky posts?

Post by Don Chambers »

I think {if NOT $entrydata.title} is a logical true/false test.... whereas {if $entrydata.title!='whatever'} is a string evaluation... or something like that. What do I know?! I just do the occasional template, and I have not had much time for any of this stuff lately! :mrgreen:
=Don=
Post Reply