serendipitypath vs. serendipityHTTPPath

Discussion corner for Developers of Serendipity.
Post Reply
User avatar
Don Chambers
Regular
Posts: 3614
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

serendipitypath vs. serendipityHTTPPath

Post by Don Chambers » Thu Feb 19, 2015 6:43 pm

I am going to make a small change to the freetag plugin which makes it respond more gracefully if a smarty template has been specified, but does not exist. Prior to making that change, I had a question..

Currently, I see this:

Code: Select all

$template = serendipity_getTemplateFile($template, 'serendipityPath');
Should that be

Code: Select all

$template = serendipity_getTemplateFile($template, 'serendipityHTTPPath', true);

:?:

User avatar
garvinhicking
Core Developer
Posts: 30015
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: serendipitypath vs. serendipityHTTPPath

Post by garvinhicking » Thu Feb 19, 2015 10:07 pm

That depends whether that line occurs when being viewed in the frontend or backend.

If it's a line of code that gets executed in the backend, it needs the "true" flag to reference a frontend file.

If it's a line that only gets executed in the frontend, this parameter should not be necessary. I actually don't know by heart if it breaks something, possibly not, so adding it would never hurt, but that would need checking. Until then, I'd rather not add it, unless the code gets executed in the backend, in which case it would be required. ;)
# 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/

User avatar
Don Chambers
Regular
Posts: 3614
Joined: Mon Feb 13, 2006 3:40 am
Location: Chicago, IL, USA
Contact:

Re: serendipitypath vs. serendipityHTTPPath

Post by Don Chambers » Thu Feb 19, 2015 10:22 pm

Thanks Garvin. What is the difference between "serendipitypath" and "serendipityHTTPPath"?

User avatar
garvinhicking
Core Developer
Posts: 30015
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: serendipitypath vs. serendipityHTTPPath

Post by garvinhicking » Fri Feb 20, 2015 3:59 pm

serendipityPath is the absolute directory path, serendipityHTTPPath the path for the browser URL.
# 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/

Post Reply