Hi all!
Currently some plugins try to autodetect if the plugin's "genpage" hook is called on the frontpage of the blog.
I now added this code-snippet to the default genpage.inc.php file of Serendipity 1.0 (nightlies) so that you can use $addData['startpage'] to see whether your plugin is called on the startpage, or not.
HTH,
Garvin
Plugin detection for "Is shown on startpage?" now
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Plugin detection for "Is shown on startpage?" now
Last edited by garvinhicking on Wed May 24, 2006 2:35 pm, edited 1 time in total.
# 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/
# 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/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
I think a sidebar plugin should be able to access $GLOBALS['uri_addData']['startpage'], yes.
Regards,
Garvin
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/
# 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/
Hey, Garvin.
The frontpage detection isn't working for me. I just downloaded yesterday's nightly; when my plugin tries to detect the frontpage, it fails.
I'm accessing the page directly via the complete pretty URL. Apache redirect is on. The URL is http://judebert.com/wasted_youth/index.php -- I'm running s9y side-by-side with my existing static pages, so if I use index.html it'll load the old static page. I added debugging to print 'Front Page detected.' or 'Not Front Page!' at the bottom of the page; as you can see, genpage is being hooked twice, and it always thinks there's no front page.
Before switching, I was detecting frontpage with:
...which seemed to work from every hook, but didn't detect archive or single entries. I can correct those after a bit of research, but I'd rather use the provided hook, since I don't know what else my frontpage detection might be missing.
The frontpage detection isn't working for me. I just downloaded yesterday's nightly; when my plugin tries to detect the frontpage, it fails.
I'm accessing the page directly via the complete pretty URL. Apache redirect is on. The URL is http://judebert.com/wasted_youth/index.php -- I'm running s9y side-by-side with my existing static pages, so if I use index.html it'll load the old static page. I added debugging to print 'Front Page detected.' or 'Not Front Page!' at the bottom of the page; as you can see, genpage is being hooked twice, and it always thinks there's no front page.
Before switching, I was detecting frontpage with:
Code: Select all
if ((!empty($args) && trim($args) == $serendipity['indexFile'])
|| isset($serendipity['GET']['adminModule'])
|| isset($serendipity['GET']['category'])
)
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
How does your plugin try to do the frontpage detection exactly?
Ah, nah. Forget it. There was a typo in genpage.inc.php (uriaddData instead of uri_addData). Just fixed, thank you!
Regards,
Garvin
Ah, nah. Forget it. There was a typo in genpage.inc.php (uriaddData instead of uri_addData). Just fixed, thank you!
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/
# 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/