0

I have a notification setup that is pulling the top 5 most viewed entries within the specific channel, and I want to send this email with the top 5 most viewed entries, and I want to send this notification out every 2 weeks. Below is the line of PHP code that I embedded to the notification as well as the channel entry calling it. Its showing just the top 5 most viewed overall still and is not resetting.

<?php
        $start_time = ee()->localize->format_date('%Y-%m-%d %H:%i', ee()->localize->now - (60*60*24*14));
?>

    {embed="_embeds/two-weeks-php"}
{exp:channel:entries start_on="<?php echo $start_time; ?>" site="example" channel="blog" dynamic="no" limit="10" status="open|Preview" {global:disable_basic} orderby="view_count_one"}

Any help would be greatly appreciated!

  • Is PHP parsing set on input or output?? Also, It's wack (j/k) to use PHP in a template when things like gotolow.com/addons/low-nice-date exists (I don't work for them but I use that free addon all over). – jrothafer Jun 26 '15 at 14:13
0

if the dynamic timespan is your problem, try using

start_on="-2 Weeks" 

and (optional)

stop_before="{current_time}"

and first try to test it with a regular template. You will not need an addon

I would try to avoid using php

Gabriel

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.