Single category on front page

Creating and modifying plugins.
Post Reply
vastneonwolf
Regular
Posts: 43
Joined: Sun May 22, 2005 6:57 am
Contact:

Single category on front page

Post by vastneonwolf »

Just finished my first solo plugin!
This one gives the admin the ability to show just one category on the front page.

Don't know how to add it to CVS so get it here
vastneonwolf
Regular
Posts: 43
Joined: Sun May 22, 2005 6:57 am
Contact:

Found a bug...

Post by vastneonwolf »

It seems that the plugin shows only the selected category on the Edit Entries page...
Will look into it tomorrow.
vastneonwolf
Regular
Posts: 43
Joined: Sun May 22, 2005 6:57 am
Contact:

Post by vastneonwolf »

Can some one take a look at this for me please?
I can't seem to work out why it is effecting the "Edit Entries" page as well.

Code: Select all

    function event_hook($event, &$bag, &$eventData) {
        global $serendipity;

        $hooks = &$bag->get('event_hooks');
        if (isset($hooks[$event])) {
            switch($event) {

                case 'frontend_configure':
                    $serendipity['GET']['category'] = $this->get_config('base_category');
                    break;

            }
        }

    }
Thanks in advance :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

You could try to surround it by using:

Code: Select all

                case 'frontend_configure':
if (!empty($serendipity['GET']['adminModule'])) return true;
                    $serendipity['GET']['category'] = $this->get_config('base_category');
This will not apply your plugin when the admin panel is used

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/
vastneonwolf
Regular
Posts: 43
Joined: Sun May 22, 2005 6:57 am
Contact:

Post by vastneonwolf »

Thank you once again :)
Untamed
Regular
Posts: 11
Joined: Thu Sep 08, 2005 9:37 pm

Post by Untamed »

If the answer to this (the plug in) is here: http://www.s9y.org/forums/viewtopic.php ... t+category

I have another question...

I would very much like to employ this plug in - I read in another place (though as usual I can't find it now...) that this is for a newer version of serendipity. I'm running 0.8.1 I think - just downloaded and installed today. Can I use this plug in?

Also, now that I've downloaded the plug in, how do I employ it so it does what it's supposed to do?

OH yeah, I'm a real honest to goodness, still wet behind the ears newbie to all things regarding the internet...

Thanks heaps for your help!
Blessings,
Lissa
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Untamed,

the announced plugin should work with serendipity 0.8! Just try it out by downloading the file, copy it to your /plugins directory (with directory structure) and then go to your s9y admin panel, click on "configure plugins", then click the link "click here to install a new event plugin" and then select the plugin you just uploaded.

HOWEVER, if you installed Serendipity 0.8.1 you should UPGRADE immediately. 0.8.1 and 0.8.2 have serious security issues with the bundled XML-RPC library, which many other systems also had. Or delete the serendipity_xmlrpc.php file if you do not want to upgrade...

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/
Col. Kurtz
Regular
Posts: 450
Joined: Thu May 26, 2005 10:43 am
Location: Bonn, Germany
Contact:

Post by Col. Kurtz »

I use this plugin with 0.8.4, before with 0.8.2. and its doin fine!
Marc
Untamed
Regular
Posts: 11
Joined: Thu Sep 08, 2005 9:37 pm

Post by Untamed »

Fabulous! Works like a charm!

Yes, it's taken me this long to do it and fix things like I want it but hey - Rome wasn't built in a day either right?

Many thanks for your help and assistance!! I really appreciate it!
Blessings,
Lissa
wesley
Regular
Posts: 197
Joined: Sun Jul 10, 2005 11:15 am
Contact:

Post by wesley »

Interestingly, this plugin sort of does the exact opposite of one of my
plugins... show all categories except one. :) (and no, I didn't know this
plugin before making my own)
I make s9y plugins, too.
My s9y blog depends on them. :)
Post Reply