Search found 23 matches

by jonathanholvey
Tue Jan 02, 2018 6:37 am
Forum: General
Topic: [Solved] How to determine if a plugin is enabled?
Replies: 6
Views: 2665

Re: How to determine if a plugin is enabled?

Thanks. $plugins['all']['pluginRSS']->installed() is what I'm after.
by jonathanholvey
Mon Jan 01, 2018 3:59 am
Forum: General
Topic: [Solved] How to determine if a plugin is enabled?
Replies: 6
Views: 2665

Re: How to determine if a plugin is enabled?

Edi wrote: Sun Dec 31, 2017 7:41 pm Why not use the plugin RSS Feed that comes with Bludit?
That's the one I'm talking about. How can I tell if it's enabled or not in PHP?
by jonathanholvey
Sun Dec 31, 2017 3:54 am
Forum: General
Topic: [Solved] How to determine if a plugin is enabled?
Replies: 6
Views: 2665

[Solved] How to determine if a plugin is enabled?

Hi, I'd like to add an RSS link in the footer of the theme I'm working on. However, this link will only make sense if the RSS plugin is enabled. How can I check to see if a given plugin is enabled? The contents of $plugins["all"]["pluginRSS"] doesn't seem to provide the enabled s...
by jonathanholvey
Thu Nov 30, 2017 10:02 am
Forum: General
Topic: Prevent a theme page returning 404
Replies: 6
Views: 3098

Re: Prevent a theme page returning 404

After a little more thought... Allowing Url->setNotFound() to override Bludit's found/not found logic is confusing, especially since Bludit uses it internally. Also, the implementation I wrote to handle the status code reset won't work to force a page into a not found state if Bludit thinks it exist...
by jonathanholvey
Wed Nov 29, 2017 10:01 pm
Forum: General
Topic: Prevent a theme page returning 404
Replies: 6
Views: 3098

Re: Prevent a theme page returning 404

I can't be sure, but it seems like PHP is only sending the most recent status code. I can't find a client which will show me multiple status codes when using this technique. So, assuming this is ok, and to to get $Url->setNotFound(false, 200, "Ok") to work as expected, I've created a new f...
by jonathanholvey
Tue Nov 28, 2017 9:47 pm
Forum: General
Topic: Prevent a theme page returning 404
Replies: 6
Views: 3098

Re: Prevent a theme page returning 404

Unfortunately, this doesn't really work as expected. It allows me to set the parameters in the $Url object, however, since the response code header has already been sent by bl-kernel/boot/site.php, the browser still sees the 404 response code. I managed to re-send the response code header, however t...
by jonathanholvey
Mon Nov 27, 2017 10:07 pm
Forum: General
Topic: Prevent a theme page returning 404
Replies: 6
Views: 3098

Re: Prevent a theme page returning 404

Thanks for that! I'll give it a try
by jonathanholvey
Wed Nov 22, 2017 10:28 am
Forum: General
Topic: Prevent a theme page returning 404
Replies: 6
Views: 3098

Prevent a theme page returning 404

Hi, I have a page in my theme which displays categories. The URL is /category, and my index.php file looks something like this: if ($Url->whereAmI() == "home") include_once(THEME_DIR_PHP . "home.php"); elseif ($Url->uri() == "/category") { $Url->setHttpCode(200); includ...
by jonathanholvey
Sat Nov 04, 2017 12:25 pm
Forum: General
Topic: How to get URL of latest post
Replies: 3
Views: 2884

Re: How to get URL of latest post

Thanks for that!
by jonathanholvey
Fri Nov 03, 2017 10:53 pm
Forum: General
Topic: How to get URL of latest post
Replies: 3
Views: 2884

How to get URL of latest post

In Bludit 2 you can access the $pages array on the home page, which gives access to properties such as title, URL etc. Is there a way to do the same from any page? Specifically, I'm trying to get the URL of the latest published post (page), so I can use it as a direct link in my theme's navigation m...