 |

dhorne
User
Jun 9, 2003, 1:45 PM
Post #1 of 15
(11275 views)
Shortcut
|
|
AM: Add user trigger to "Publish" button
|
Can't Post
|
|
We would like to have a custom entry screen that is constucted by querying the AM database. We don't want to use the search for every time the users enter the main page, because cgi execution provided by our host provider is *slow*. Unfortunately, they don't provide a cron facility, so we can generate it at regular intervals. An alternative that would work for us is to be able to specify a script that should get executed whenever "publish all" is clicked or a new article is published - effctively a trigger on the "publish" event. Dan Dan Horne Redbone Systems Ltd http://www.redbone.co.nz
|
|
|  |
 |

Donna
Staff
/ Moderator

Jun 9, 2003, 2:02 PM
Post #2 of 15
(11267 views)
Shortcut
|
|
Re: [dhorne] AM: Add user trigger to "Publish" button
[In reply to]
|
Can't Post
|
|
Hi Dan, Thanks for your post. :) Are you referring to Auto Manager or Article Manager? If you mean Article Manager, can you let me know what sort of a query you're trying to have setup? Maybe we can come up with a workaround that doesn't hit the CGI. However, that's a good idea, so I've added it to the feature request list as well. :) Donna
Hire me! 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 Priority Consulting.
|
|
|  |
 |

dhorne
User
Jun 9, 2003, 2:22 PM
Post #3 of 15
(11265 views)
Shortcut
|
|
Re: [Donna] AM: Add user trigger to "Publish" button
[In reply to]
|
Can't Post
|
|
Hi Donna, this is for Article Manager. For example, say you wanted a two column page using search.cgi as in http://www.interactivetools.com/forum/gforum.cgi?post=276;search_string=columns;#276, or more specifically, we would like to have a strongly customised front page where we would query the Article Manager database using the APIs - for example, have the first 250 words of the latest (or editor nominated) article as the feature that takes up most of the page, and then say the first 50 words of the next 3 latest (or editor nominated) stories. To run and parse the queries every time someone hit the main page would be too slow. A solution that would work for us would be to have a configuration setting where we could enter the name of our custom cgi script, and this would be run on the "publish" event generating our front page. Thanks Dan Dan Horne Redbone Systems Ltd http://www.redbone.co.nz
|
|
|  |
 |

Donna
Staff
/ Moderator

Jun 9, 2003, 4:09 PM
Post #4 of 15
(11259 views)
Shortcut
|
|
Re: [dhorne] AM: Add user trigger to "Publish" button
[In reply to]
|
Can't Post
|
|
Dan -- thanks for the info! Yep, you're right, that's definitely a bit of a hit on the search engine on a slower server. I'll make a note on the feature request for you. :) Let me know if you have any other questions or requirements. :) Donna
Hire me! 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 Priority Consulting.
|
|
|  |
 |

Theo
Project Manager
/ Moderator

Jun 13, 2003, 4:45 PM
Post #5 of 15
(11232 views)
Shortcut
|
|
Re: [dhorne] AM: Add user trigger to "Publish" button
[In reply to]
|
Can't Post
|
|
Dan, have you taken a look at the publishcron.cgi tool? Although it's designed to be scheduled into a cronjob, we're right now discussing ways to get it to "piggyback" the publish events, so that every time you add/erase an article or category, you would also generate your search queries as static HTML (that could then be used as includes). It's nearing the end of our work day, but we'll have some ideas for you on Monday. If you want to see what you can come up with over the weekend, take a look at this thread: http://www.interactivetools.com/iforum/Products_C2/Article_Manager_Add-ons_F15/Publishcron_1.0_for_Article_Manager_P11967/ Theo Wiersma Project Manager
|
|
|  |
 |

dhorne
User
Jun 16, 2003, 5:29 AM
Post #6 of 15
(11223 views)
Shortcut
|
|
Re: [Theo] AM: Add user trigger to "Publish" button
[In reply to]
|
Can't Post
|
|
Hi Theo it looks like this could be a solution for us. Am I right in saying that your proposed solution would call publishcron.cgi whenever a publish event is triggered? Dan Dan Horne Redbone Systems Ltd http://www.redbone.co.nz
|
|
|  |
 |

Theo
Project Manager
/ Moderator

Jun 24, 2003, 5:02 PM
Post #7 of 15
(11191 views)
Shortcut
|
|
Re: [dhorne] AM: Add user trigger to "Publish" button
[In reply to]
|
Can't Post
|
|
Dan: Sorry for the delay. There is a cute little trick for this that I learned from Dave's Open Sign for our website header. This worked successfully for me, so I'm hoping it will open up options for other users for initializing publishcron as a publish event rather than as a cronjob. Let me know how it works out. - Install publishcron following the directions in its text file.
- Edit templates/interface/_art_menus.html
- Find the <!-- templatecell : erased -->
add <img src="publishcron.cgi" width="0" height="0"> as the line after <b>Article has been erased</b> - Find the <!-- templatecell : saved -->
add <img src="publishcron.cgi" width="0" height="0"> as the line after <b>Article has been saved</b> - Open templates/interface/_cat_menus.html
- Find the <!-- templatecell : erased -->
add <img src="publishcron.cgi" width="0" height="0"> as the line after <b>Category has been erased</b> - Find the <!-- templatecell : saved -->
add <img src="publishcron.cgi" width="0" height="0"> as the line after <b>Category has been saved</b> - Edit templates/interface/_setup_menus.html
- Find the <!-- templatecell : published_all -->
add <img src="publishcron.cgi" width="0" height="0"> as the line after <b>All files have been published</b> - In Setup Options, make sure you have the following set to “Yes”:
- Display "record erased" page
- Display "record saved" page
Remember that you can get publishcron.cgi from: http://www.interactivetools.com/forum/forum.cgi?post=11967 If you have questions related to publishcron implementation, post to the above thread. Otherwise let me know if you have any other questions. Theo Wiersma Project Manager
(This post was edited by Theo on Dec 29, 2004, 1:57 PM)
|
|
|  |
 | |  |
 |

Neotrope
User
Oct 20, 2004, 4:36 PM
Post #9 of 15
(10013 views)
Shortcut
|
|
Re: [Theo] AM: Add user trigger to "Publish" button
[In reply to]
|
Can't Post
|
|
For those setting this up.. it's worth noting that in the 2004 versions of AM, you will want to flip the items here from theo's post Edit templates/interface/_art_menus.html 1. Find the <!-- templatecell : erased --> add <img src="publishcron.cgi" width="0" height="0"> as the line after <b>Article has been saved</b> 2. Find the <!-- templatecell : saved --> add <img src="publishcron.cgi" width="0" height="0"> as the line after <b>Article has been erased</b> Actually - "article has been erased" is under the erased section, and the "...saved" is under the "saved" section in the _art_menus.html template, not as shown above. I'm actually setting this up now, after surviving a complex RSS and RDF template setup for publishcron (two complete sets of xml data being pumped out each time). This fix will be the icing on the cake! Neotrope® is a brand identity and marketing communications solution provider founded 1983. Neotrope is a reg. trademark and service mark.
|
|
|  |
 |

Cliff
Staff

Oct 21, 2004, 10:03 AM
Post #10 of 15
(10003 views)
Shortcut
|
|
Re: [Neotrope] AM: Add user trigger to "Publish" button
[In reply to]
|
Can't Post
|
|
Hey Neotrope, Thanks for the update, I'll be sure to keep that in mind when implementing this Regards, Cliff Stefanuk - Customer Service Manager support@interactivetools.com
|
|
|  |
 |

Neotrope
User
Oct 21, 2004, 10:39 AM
Post #11 of 15
(10001 views)
Shortcut
|
|
Re: [Neotrope] AM: Add user trigger to "Publish" button
[In reply to]
|
Can't Post
|
|
in case anybody is curious, or for those following my adventures in the RSS template and publishcron setup in another topic, this final step works ... this "hack" to AM works perfectly!! I'm happy to say my AM now spits out the RSS and RDF feeds flawlessly ... whenever I add/delete or publish all articles. only noticeable difference is there's a slight "something going on" in the browser when you click "publish all" and then see the confirmation dialog. So, just to be safe, I let it "spin" for a couple of moments before hitting 'okay' WOOHOOOO!!! Thanks to Theo, Mike, and the whole gang hereabouts for helping on my RSS/publishcron adventure. Chris Neotrope® is a brand identity and marketing communications solution provider founded 1983. Neotrope is a reg. trademark and service mark.
|
|
|  |
 |

dwethell
Novice
Apr 27, 2005, 6:54 AM
Post #12 of 15
(8998 views)
Shortcut
|
|
Re: [Theo] AM: Add user trigger to "Publish" button
[In reply to]
|
Can't Post
|
|
Hope it's not too late to answer in this thread instead of posting a new one. My question is, I want to implement the img link to call publishcron when saving articles and such, but I don't want publishcron called just for saving an article. I want it called when the status = visible. I see the $status$ variable, but I didn't know if the AM templating system supported conditionals in any fashion. Also, I want to pass the page number to publishcron so that it only publishes the page desired instead of republishing all the pages at each save. I have my pages set up so there are two page variables and two query variables for each AM category. I only want to update the category that the article was saved to. Of course, if it moved categories I'd need to know the old category which doesn't seem to be in the template. Any ideas on this? In theory my img src would just change to publishcron.cgi?page=$cat$, but I didn't know if $cat$ was available from the template. Thanks, David
|
|
|  |
 |

Theo
Project Manager
/ Moderator

Apr 27, 2005, 9:50 AM
Post #13 of 15
(8997 views)
Shortcut
|
|
Re: [dwethell] AM: Add user trigger to "Publish" button
[In reply to]
|
Can't Post
|
|
I don't think there are any article or category placeholders available in the "article saved" page, but you could try them out. However, I believe that even when you pass publishcron a page value (publishcron.cgi?page=1), it will publish all of the pages defined in its .ini file. Passing the page value will simply display the published page to you for debugging purposes. So passing the $cat_num$ as the page value won't get the effect you want. Also, you'll actually be better off with publishcron running when the status is hidden or pending, otherwise when you remove or hide an article it will keep showing up in the headlines lists published by publishcron.cgi. Are you finding publishcron.cgi is generating an inordinate server load? It's pretty lightweight, each page published by publishcron.cgi is no more overhead than a single search query done through Article Manager's search.cgi. Theo Wiersma Project Manager
|
|
|  |
 |

dwethell
Novice
Apr 28, 2005, 3:10 AM
Post #14 of 15
(8974 views)
Shortcut
|
|
Re: [Theo] AM: Add user trigger to "Publish" button
[In reply to]
|
Can't Post
|
|
Actually, I haven't even implemented it via cron yet. I was just looking into doing it via the article saved page instead so that rather than running once or twice a day it would only run when articles were saved. Right now the performance problem is searches in the live pages so either implementation of publishcron will save us lots of CPU time. I have 52 pages in our publishcron. Am I doing this correctly? The reason I have 52 is because there are 26 categories on the site and I have to generate two pages for each category. At least I think I do. This is because the customcat.html used as a template has these two includes in it: <!--#include virtual="/cgi-bin/artman/exec/search.cgi?cat=$cat_num$&fields=art_field2&keyword=yes&template=search/custom.html"--> <!--#include virtual="/cgi-bin/artman/exec/search.cgi?cat=$cat_num$&fields=art_field2&keyword=no&template=search/custom2.html"--> That provides two different searches per category. So I have reproduced those calls for each category in the system: page1 = /var/www/html/artman/inc/static_1_1.html query1 = cat=1&fields=art_field2&keyword=yes&template=search/custom.html page2 = /var/www/html/artman/inc/static_1_2.html query2 = cat=1&fields=art_field2&keyword=no&template=search/custom2.html And so on for all the categories we have. Then I will be changing customcat.html to use these includes instead: <!--#include virtual="/artman/inc/static_$cat_num$_1.html"--> <!--#include virtual="/artman/inc/static_$cat_num$_2.html"--> It almost seems like overkill to have that many pages in the publishcron. Actually there are no 26 active categories, but the current max number is 26 with many gaps in between 1 and 26. I just put them all in there to cover any future categories (assuming artman fills in the gaps when a new category is created). Am I on the right track? Thanks, David
|
|
|  |
 |

jcamp
User
Dec 22, 2005, 3:17 AM
Post #15 of 15
(6598 views)
Shortcut
|
|
Re: [Theo] AM: Add user trigger to "Publish" button
[In reply to]
|
Can't Post
|
|
For anyone thats interested I had many problems with the default index/rss.rss template for publishcron to use. So I copied a working rss feed from another source and added it to our configuration for our web site. The attached template (needs to be in your templates/index dir) works great for us.
|
|
Attachments:
|
rss.rss
(2.92 KB)
|
|
|  |
|