Hi everyone,
is there any way to make the Newsfeeds dependent on the HTTP-User-Agent?
Background: there are a few certain user-agents to whom I don't want to deliver the complete entries, but only headlines and/or teaser-texts.
Feed-Templates depending on the User-Agent?
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Feed-Templates depending on the User-Agent?
Yes, you can do that.
Write up a config.inc.php for your template, set
then in your feed*.tpl template you can use
Best regards,
Garvin
Write up a config.inc.php for your template, set
Code: Select all
<?php
$serendipity['smarty']->assign('user_agent', $_SERVER['HTTP_USER_AGENT']);
Code: Select all
{if $user_agent == 'XXX'}
...
{else}
{/if}
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/
-
Boris
Re: Feed-Templates depending on the User-Agent?
Great. That sounds really easy. Thank you.