Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued Products: Article Manager 1 Add-ons:
Writing AM Add-ons - Basics

 

 


Dogcatfish
User

Nov 5, 2004, 2:35 AM

Post #1 of 7 (5841 views)
Shortcut
Writing AM Add-ons - Basics Can't Post

Good day all. So far I have done very little adventurous stuff to my website, simply using all of the tools AM has to offer in it's default condition. As a result, I have not written scripts or add-ons for it so far, not for lack of trying. When I first started using it, I was having trouble linking to the images I wanted to appear for the page layout. I then realised that this could only be done by using the placeholders - $img_url$/... This was alright, however I am still unsure why it did not like either virtual or relative paths without a $img_url$ tag.

However, I am drifting from my point. I have tried writing small php scripts to include at the bottom of the page, mabye displaying something as simple as a date in year format. The usual result I get is simply "[there was a problem executing this script]" in place of my date. When you are writing scripts, etc to be included on a page, which directory do you upload them to, and how do you link to them without AM complaining?

Nick Lines
www.diagnosticsonar.com


(This post was edited by Dogcatfish on Nov 5, 2004, 2:38 AM)


Luke
Staff / Moderator


Nov 5, 2004, 10:45 AM

Post #2 of 7 (5829 views)
Shortcut
Re: [Dogcatfish] Writing AM Add-ons - Basics [In reply to] Can't Post

Hi Nick,

I'm not a PHP expert but here's a couple of things to check.

1. Are you publishing Article Manager's pages with a .php extension. You may need to change his publish file extension to .php in order to include PHP scripts into your published pages, or modify your server settings (or .htaccess) to parse PHP out of .shtml pages. If you change your extension, you'll likely need to change your virtual includes (in your template files) to PHP includes.

2. The error message you're receiving ("[there was a problem executing this script]") isn't output by Article Manager, this looks like a server message. You might want to see if you can execute the script by going to it through your browser directly, rather than calling it through an include. This way you can make sure that it's executing properly.

As long as you upload the PHP script into a directory that allows you to run PHP scripts from, you should be able to use a PHP include to call the script into one of Article Manager's pages.

As for your first question regarding images, I'm not sure why virtual paths to your images doesn't work. There should be no problem using:

<img src="/images/myimage.jpg">, assuming the directory "/images" is right off your web root.

If you're adding relative paths to the templates, you'll want to make them relative from the /publish directory instead.

I hope this helps! :)

Luke Holzken
Product Development


Dogcatfish
User

Nov 6, 2004, 10:16 AM

Post #3 of 7 (5814 views)
Shortcut
Re: [Luke] Writing AM Add-ons - Basics [In reply to] Can't Post

Has anyone found that publishing files with an extension other than shtml works any better? I like php, but shtml is much simpler! By the way, I sorted the original problem and solved my confusion over images. I had not correctly set up the CHMOD values for the directory despite having set them up correctly for the included php file. The problem I had linking to images I worked out now that I know how AM works: I had placed all of the images in a subdirectory of the templates folder, as I thought this was where AM made the published articles. I now realise that I should have put these in a subfolder below the publish directory, as this is where the actual articles would go.

I take it publishing files with a php extension would simply mean more complicated templates could be used, rather than AM treating them any different? This is hatching an idea for the future... Wink


MikeB
Staff / Moderator


Nov 6, 2004, 5:22 PM

Post #4 of 7 (5808 views)
Shortcut
Re: [Dogcatfish] Writing AM Add-ons - Basics [In reply to] Can't Post

Hi Nick,

Thanks for the update! Smile

Generally the main change you'd have to make in your template files if you published as php would be to use php includes rather than the server side includes that are in the templates by default. You would also be able to add other php code to the template files that would be looked at once the actual file was published as php. If you're familiar with php the changes shouldn't be too complicated and if you're really familiar with php you may prefer to publish them this way.

If you have any other questions feel free to let me know! Smile

Cheers,
Mike Briggs - 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.


dhorne
User

Dec 27, 2004, 2:18 PM

Post #5 of 7 (5549 views)
Shortcut
Re: [Dogcatfish] Writing AM Add-ons - Basics [In reply to] Can't Post


In Reply To
Has anyone found that publishing files with an extension other than shtml works any better?

Yep! The great thing about using PHP is that you can place real code in your templates rather than the limited set of SSI tags. I just started using .php instead of .shtml, and I won't be going back...
Dan Horne
Redbone Systems Ltd
http://www.redbone.co.nz


Dogcatfish
User

Mar 10, 2005, 3:01 AM

Post #6 of 7 (5282 views)
Shortcut
Re: [dhorne] Writing AM Add-ons - Basics [In reply to] Can't Post

I understand replacing all of the includes with php, but can someone tell me the permissions setup required to run php? It got very confusing with different permissions on template pages, publish pages and all the appropriate folders within it...


ross
Staff / Moderator


Mar 10, 2005, 4:37 PM

Post #7 of 7 (5264 views)
Shortcut
Re: [Dogcatfish] Writing AM Add-ons - Basics [In reply to] Can't Post

Hi Nick.

Good to hear from you again Smile.

I don’t actually think you’ll need any special permissions set on the php files for them to work. Here is a general permissions break down for your reference:

Templates folder = “777”
Templates themselves = “644”
Publish directory = “755”
Article themselves =”644”

I have seen some servers though were the articles in your publish directory will need to have “777” permissions in order to update them, so if you don’t have any luck, try changing them to that.

I hope this helps. Just let me know if you have anymore questions Smile.
-----------------------------------------------------------
Cheers,
Ross Fairbairn - 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.



 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4