
MikeB
Staff
/ Moderator

May 17, 2006, 4:32 PM
Post #1 of 32
(34325 views)
Shortcut
|
|
Add-on: autopublish.cgi 1.0
|
Can't Post
|
|
Hi Everyone The ability to hide articles and have them published at a later date is something we get requests for quite often so I've created an autopublish.cgi script that will do just that. In this forum post I'll outline a few details about how this works and you can download the attached autopublish_1_0.zip file. Contained in the zip file is an autopublish.cgi file and an autopublish.txt readme. In this forum post I've kept a couple of the more technical details a bit brief as there is more detail in the autopublish.txt file. What is autopublish.cgi? This script is designed to allow you to set articles to be published at a later date. This means that each day, when you run this script it will check if any articles should be published on this day. It will set these hidden articles to "Visible" and will re-publish your Article Manager content. How do I set up my articles to use autopublish.cgi? The first step to start using autopublish.cgi is to create a new field within Article Manager's Setup Options. The script is defaulted to use art_field19 but if you'd like to use something else you can easily change this. You can call this field "Auto Publish at a later date?" and make the field a dropdown menu with options "No" and "Yes". This means that in the "field name" box, you'll have this: Auto Publish at Later Date? (No, Yes) Be sure to set this as a "pulldown" and click the enabled checkbox. Also, make a note of the field number that you're using (art_fieldX). To have an article be auto-published at a later date it needs to meet three distinct criteria, the article must be set to "Hidden", the new "Auto Publish?" field must be set to "Yes" and the article's Month, Day and Year dropdown menus need to be set for the day you'd like the article to be published on. How do I install autopublish.cgi? Now that the ground work has been set up for your articles you'll want to put the autopublish.cgi file on the server. Full details about uploading and running autopublish.cgi can be found in the autopublish.txt readme file. To install the autopublish.cgi script there are three basic steps: 1) Open autopublish.cgi on your local computer (in a basic text editor) to modify a few user-defined values. 2) Upload autopublish.cgi into your /artman/exec/ directory 3) Make the file world executable (chmod 755) How do I run autopublish.cgi? There are a couple of ways to run autopublish.cgi and this is a quick overview of the different methods: 1) You can run autopublish.cgi manually through your browser. Because this is something that you'll only be doing once a day (at most) it shouldn't be too time-consuming to run it manually through the browser. You would want to use a URL that looks like this: http://yoursite.com/cgi-bin/artman/exec/autopublish.cgi?id=USERNAME&pw=PASSWORD You'll want to ensure that "USERNAME" and "PASSWORD" are the details for the administrator as this will be required to access the admin program's Setup Options to re-publish your articles. 2) You can set up a link within Article Manager to run autopublish.cgi from the Setup Options. You would basically add the URL from option 1 above as a link. In the autopublish.txt file there is more detail about how and where to add this code. 3) Depending on the way your server is set up you may be able set up this script to run as a Cronjob at a predetermined time that works well for you (once a day, once a week, etc.) Note: autopublish.cgi does run Article Manager's "Publish All" once the status of the articles has been changed. This means that the amount of time this script takes to complete should be comparable to the amount of time a "Publish All" takes on your site (with just a few added seconds depending on the amount of articles). Also, this script has currently only been tested on version 1.41 of Article Manager. I hope you find this helpful and if you have any questions or comments about this script just let me know! Cheers, Mike Briggs - Product Specialist support@interactivetools.com [hr][i][url "http://www.interactivetools.com/consulting/"][b]Hire me![/b][/url] Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with [url "http://www.interactivetools.com/consulting/"][b]Priority Consulting[/b][/url].[/i]
(This post was edited by MikeB on May 18, 2006, 4:38 PM)
|