Freetag and Hide from article overview / frontpage

Creating and modifying plugins.
Post Reply
WebReiter
Regular
Posts: 23
Joined: Sun Sep 03, 2006 2:35 pm
Location: Jülich, Germany

Freetag and Hide from article overview / frontpage

Post by WebReiter »

Hi,

I am using the freetag plugin. If i marked a article as "Hide from article overview / frontpage" it also will not listed in the article overview to a tag.

How can i modify this. Is there a trick?

Webreiter
Serendipity 1.1 and PHP 4.3.10-16
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Freetag and Hide from article overview / frontpage

Post by garvinhicking »

Hi!

I'm afraid but those options don't play nicely together. It would require patching at code level of the freetag plugin and the entryproperties plugin to make them interact.

Best 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/
WebReiter
Regular
Posts: 23
Joined: Sun Sep 03, 2006 2:35 pm
Location: Jülich, Germany

Post by WebReiter »

Hi Garvin,

i don't know/find how these two plugins interact together. Can you give me more help.

I believe this code should be modifed in entryproperties?:
if (!isset($serendipity['GET']['category']) && !isset($serendipity['GET']['adminModule']) && $event == 'frontend_fetchentries' && $addData['source'] != 'search') {
$conds[] = " (ep_no_frontpage.property IS NULL OR ep_no_frontpage.value != 'true') ";
$joins[] = " LEFT OUTER JOIN {$serendipity['dbPrefix']}entryproperties ep_no_frontpage
ON (e.id = ep_no_frontpage.entryid AND ep_no_frontpage.property = 'ep_no_frontpage')";
}
But no plan how to mod freetag plugin.

Regards
Webreiter
Serendipity 1.1 and PHP 4.3.10-16
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I believe the freetag plugin sets $serendipity['GET']['tag'] when it is being used to display something. So modifying the entryproperties code to something like:

[quote]if (!isset($serendipity['GET']['tag'] && !isset($serendipity['GET']['category']) && !isset($serendipity['GET']['adminModule']) && $event == 'frontend_fetchentries' && $addData['source'] != 'search') {
$conds[] = " (ep_no_frontpage.property IS NULL OR ep_no_frontpage.value != 'true') ";
$joins[] = " LEFT OUTER JOIN {$serendipity['dbPrefix']}entryproperties ep_no_frontpage
ON (e.id = ep_no_frontpage.entryid AND ep_no_frontpage.property = 'ep_no_frontpage')";
}[/code]

Might do the trick?

Best 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/
WebReiter
Regular
Posts: 23
Joined: Sun Sep 03, 2006 2:35 pm
Location: Jülich, Germany

Post by WebReiter »

Hi,
Might do the trick?
not really. The variable $serendipity['GET']['tag'] is empty.

Best Regards
Webreiter
Serendipity 1.1 and PHP 4.3.10-16
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Hm. Then I just updated the freetag plugin to version 2.77, which will now set a global $serendipity['plugin_vars']['tag'] and $serendipity['plugin_vars']['displayTag'] variables on which you should be able to check.

Best 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/
WebReiter
Regular
Posts: 23
Joined: Sun Sep 03, 2006 2:35 pm
Location: Jülich, Germany

Post by WebReiter »

Hi,

i tried the latest updated version 2.77, but it doesn't run on my site. Following variables are empty in serendipity_event_entryproperties.php at
case 'frontend_fetchentries':
case 'frontend_fetchentry':
$serendipity['plugin_vars']['tag']
$serendipity['plugin_vars']['displayTag']
$serendipity['GET']['tag']
$showtag

I don't know how to fix.

Best Regards
Webreiter
Serendipity 1.1 and PHP 4.3.10-16
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Hm, the variables should be set if the entryproperites plugin comes AFTER the freetag plugin in the list of event plugins?

Did you check if $serendipity is declared 'global $serendipity' in the plugin's event_hook method?

Best 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/
WebReiter
Regular
Posts: 23
Joined: Sun Sep 03, 2006 2:35 pm
Location: Jülich, Germany

Post by WebReiter »

Hi,
Hm, the variables should be set if the entryproperites plugin comes AFTER the freetag plugin in the list of event plugins?
yes, it is.
Did you check if $serendipity is declared 'global $serendipity' in the plugin's event_hook method?
yes, it is.

And nothing. I hardcoded the variables in freetag plugin with a value, but in entryproperties the variables are nevertheless empty.

safe_mod = off
register_globals = on

Best Regards
Webreiter
Serendipity 1.1 and PHP 4.3.10-16
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Hm, works for me with the mentioned freetag plugin update and this simple patch to serendipity 1.2:

http://svn.berlios.de/viewcvs/serendipi ... erties.php

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/
WebReiter
Regular
Posts: 23
Joined: Sun Sep 03, 2006 2:35 pm
Location: Jülich, Germany

Post by WebReiter »

Hi,

now I have updated serendipity 1.1 complete again on a existing website, with your patched entryproperties v 1.14 and the freetag v 2.77
But it doesn't run yet. :shock:

Then i checked it with a fresh installation of serendipity 1.1 on another server and it runs. :o

So i think that there is something wrong with the updated installation. Perhaps the MySQL Database or template.


Best Regards
WebReiter
Serendipity 1.1 and PHP 4.3.10-16
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Hm, the database didn't need updating - the only thing required to get it to work were the updated versions of the freetag and entryproperties plugin. Did you absolutely make sure the two files are updated on your existing website page?

Maybe you are using a different version than the files you updated?

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/
WebReiter
Regular
Posts: 23
Joined: Sun Sep 03, 2006 2:35 pm
Location: Jülich, Germany

Post by WebReiter »

Hi,

the problem is solved. There was a problem between the event_freetag and plugin_freetag.
After deinstalling both and reinstall with the latest versions it runs now.

Thank you for your help.

Best Regards
WebReiter
Serendipity 1.1 and PHP 4.3.10-16
Post Reply