About auto publish and sending expiration notifications

More
11 years 2 months ago #41602 by brandonking
Hello,

When we create an menu item for item submission form, there is Auto publish override option.

I know how to set those publish up/down intervals...

But what is gonna happen when item unpublished?

Does author get notification?
Can author re-publish item via editing item form?
Will publish up interval apply on item when re-publish item?

Thanks for your time.

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #41603 by ggppdk
Hello

this autopublish - override is for submitting only, and all other SUBMIT menu item parameters, effect the submit page only

-- to have an effect after that we would need a new feature, e.g. have a plugin/feature that periodically checks for unpublished items,

and send notifications if (via a single faster query)
now > ITEM unpublish date
and logs the unpublish date on a different table (thus notifications are sent once),

in future if again is detected
now > unpublish date
and LOGGED unpublish date <> ITEM unpublish date then notification is sent again and LOGGED unpublish date is changed to the new value

you could do the above via a simple PHP script that would run via CRON


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #41608 by brandonking
Thanks for your suggestion.
I will try..

Please Log in or Create an account to join the conversation.

More
11 years 2 months ago #41611 by ggppdk
Hello,

-0- start implementing this, and it is not that difficult, below is good, compact code for doing what you need and ... more ;)

-- and i give you this because we will be implementing this in a near future release,

(... we would need a good full day or more to implement this, debug, test various configuration scenarios, add languages strings, add email templating etc, etc, plus don't want to add this new feature now ...)

-1- just note that FLEXIcontent implementation will be what we will see best at the time, but this is a good start for you

-2- please !!CORRECT!! the below code it is only a draft

-3- please don't discuss this further by posting long codes that you have written, i will not look at them, but i will answer you other questions, if you have ;)

e.g. below i describe issuing notifications as the expiration time appoaches, PLUS after it has expired

You need:

1. Create a table (3 columns):
#__content_expired_notifications

!! KEY (item_id, days_notify) // so that replacing old record will work !!

(int) item_id,
(date) publish_down
(int) days_notify
30: WARNING for 1 month prior to expire
14: WARNING for 2 weeks prior to expire,
7 : WARNING for 1 week prior to expire,
0 : WARNING for that it has expired,
Code:
$days_intervals = array(30, 14, 7, 0); foreach($days_intervals as $days) { $query = 'SELECT i.id, i.publish_down, i.title ' // more cols ... .' FROM #__content AS i' // find previous notification record (if any ... using LEFT join) .' LEFT JOIN #__content_expired_notifications AS n .' ON n.item_id=i.id' .' WHERE' // Send notifications only for published content '. i.state IN (1,-5)' // that have expired ($days=0), or are $days before expiration .' AND i.publish_down > DATE_SUB(NOW(), INTERVAL '.$days.' DAY)' // but the notification date differs, // so no NEW notification was sent yet !! .' AND n.publish_down!=i.publish_down' ; $db->setQuery($query); $notify_items_list = $db->loadObjectList(); // NOTE 1: last AND clause detects different published_down date for a re-published_item !! so next time it re-expires e.g. after a year we will re-send a new notification // NOTE 2: if you use CRON, LOAD joomla framework (google to find how to this) or DO NOT load it and use PHP mysqli commands foreach ($notify_items_list as $item) { // 1. code to send notification email // ... // 2. Update notifications DB table, so that next run will not $query = 'REPLACE INTO #__content_expired_notifications' .' (item_id, publish_down, notify_days)' .' VALUES('. $item->id.', '. $db->Quote($item->publish_down).', '. $days .')'; $db->setQuery($query); $db->query(); // 3. create a log file or append to a log file // ... } } // end of foreach days, note THAT the VERY FIRST run will send for unexpired item 4 notifications at once BECAUSE the notifications table is empty, final code will be handling this ...


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 1 month ago #42533 by ggppdk
Hello

what have you done with this?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 1 month ago #42535 by brandonking
Hi,

I know that you provide me detailed explanation but I couldn't do it.
It's a bit difficult for me. :oops:

Sorry about that.

I will have to wait for the next version.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.423 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline