 |

Tony_Holm
Novice
Aug 8, 2008, 8:35 AM
Post #1 of 3
(1077 views)
Shortcut
|
|
Using an include when publishing
|
Can't Post
|
|
Hi, Hoping someone can point me down the right path. I searched the forum and didn't find anything, excuse me if there is a thread on this already and I'd appreciate a link! I want to do some article pre-processing when the article is published. For instance, I have PHP code that will go through the article looking for names and inserts hyper links into the article so that the names become links. The code works great but I'd like to get this into ArtMan 2 when the article is published to perform some pre-processing on the article. Can this be accomplished? Thanks!
(This post was edited by Tony_Holm on Aug 8, 2008, 9:10 AM)
|
|
|  |
 |

Jake
Staff
/ Moderator

Aug 10, 2008, 2:16 PM
Post #2 of 3
(1018 views)
Shortcut
|
|
Re: [Tony_Holm] Using an include when publishing
[In reply to]
|
Can't Post
|
|
Hi Tony_Holm, There isn't any way to modify your article's content using another script before it's written to the software's database, however depending on how this script is written you may be able to embed it on your template files so that this processing occurs when visitors access pages on your site. Let us know if you have any other questions. ----------------------------------------------------------- Cheers, Jake Swanson - Product Specialist support@interactivetools.com
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.
|
|
|  |
 |

Tony_Holm
Novice
Aug 11, 2008, 1:50 PM
Post #3 of 3
(1008 views)
Shortcut
|
|
Re: [Jake] Using an include when publishing
[In reply to]
|
Can't Post
|
|
Thanks. In case it helps anyone, I ended up putting my php code on a crontab that will modify the content in the artman database and set the needsPublishing flag in the article table to 1. Then I use the admin.cgi trick (in these boards somewhere) to re-publish but I ran into some cookie issues with curl for PHP (which I've also read about in this forum) that required some extra curl settings to make happen. PHP Example: // Start an article republish to move the changes live. // create a new cURL resource $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "http://www.yoursite.com/cgi-bin/artman2/admin.cgi?loginUsername=user&loginPassword=password&action=loginSubmit&nextAction=publishUpdated"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_REFERER, http://www.yoursite.com"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($ch, CURLOPT_COOKIEJAR, './cookie.txt'); // Make sure location is writable curl_setopt($ch, CURLOPT_COOKIEFILE, './cookie.txt'); // Make sure location is writable // grab URL and pass it to the browser curl_exec($ch); // close cURL resource, and free up system resources curl_close($ch);
(This post was edited by Tony_Holm on Aug 11, 2008, 1:51 PM)
|
|
|  |
 | |  |
|