Page 1 of 1

.php Website

Posted: Sun 09 Jan 2011 9:47 pm
by captzero
Hi Guys,
I have moved my site to a new server and would like to utilise the php functions. Just a question about converting Cumulus pages to .php format. I dont need to send all the standard Cumulus web pages, so in the Internet Settings > Files in Cumulus, I should...

untick "Include Standard Files'
and have Cumulus convert the pages I want to send to my server from .htm to .php.

Is this correct?

Thanks

Re: .php Website

Posted: Sun 09 Jan 2011 9:53 pm
by Synewave
Yes that is correct. List your current .htm files in the files page and have the remote names as .php. You need to have process ticked and Ftp ticked.

Re: .php Website

Posted: Sun 09 Jan 2011 11:23 pm
by captzero
Great. Thanks Paul.

Re: .php Website

Posted: Mon 10 Jan 2011 10:08 am
by daj
Typically you would have Cumulus process and upload just one file -- the PHP webtags file.

You then have all you PHP files on the server, and the simply reference (include) the webtags file and you can then use those variables in your PHP

I can include an example here if you wish

Re: .php Website

Posted: Mon 10 Jan 2011 11:47 am
by captzero
Thanks David,

PHP is still a bit of a mystery to me but then again so was HTML 12 months ago. An example would be great. Happy to see what ever you've got.

Cheers

Re: .php Website

Posted: Mon 10 Jan 2011 12:27 pm
by daj
Ok, here's a quick tour of PHP! Fasten your seatbelt....

The first thing to do it get Cumulus to process and upload the Cumulu webtags in a PHP format. All the details are here ...http://wiki.sandaysoft.com/a/Php_webtags

Basically this is a list of variables you can then use in PHP pages, containing the data from Cumulus.

Now, copy indexT.htm from Cumulus folder and call it index.php

You now need to edit index.php in something like notepad++ (good, free text editor)

Right at the top of the file add the following lines

Code: Select all

<?php 
 require_once("cumuluswebtags.php");
?>
This tells the web server to also read the contents of the webtags file when it is opening the index.php file

Now you need to look through the whole file changing any cumulus webtags to php variables

example..

Code: Select all

<title><#location> weather</title>
becomes

Code: Select all

<title><?php echo $location; ?> weather</title>
Notice how the Cumulus webtag for the location has changed. What I am now saying to the web server is ....

<?php - what follows next is PHP code
echo $location; - echo means print/display and $location is the variable from the webtags file containing the stations location
?> -- we are finished with PHP, what comes next is normal HTML

Another example, a few lines down

Code: Select all

    <td class="site_data" style="text-align: left;"><#dawn></td>
becomes

Code: Select all

    <td class="site_data" style="text-align: left;"><?php echo $dawn; ?></td>
You need to do this for each of the htm files. Upload the PHP files to your webserver; Cumulus never needs to process these PHP files so do not include them in Cumulus files. You should only be processing and upload the webtags file as that is the once that needs updated each time by Cumulus.

I would suggest you create a folder on your webserver and upload them there to test it.

Note, PHP only works on a web server, so you can not see PHP files working locally on your PC (unless you install a webserver locally!)

Later I can give you a filly working index.php file if you wish

Re: .php Website

Posted: Mon 10 Jan 2011 3:07 pm
by gemini06720
daj wrote:The first thing to do it get Cumulus to process and upload the Cumulu webtags in a PHP format. All the details are here Php webtags
David, you do realise that the 'webtags' file is quite outdated - it has not been updated in almost a year... ;)

For some time now, I have been using two 'webtags' files which contain all the tags produced by Cumulus (last updated on December 30) - unfortunately, because of a change to the format for the variables contain in the tag files, they are completely incompatible with the previous version of the old 'webtags' file.

I would be willing to share the files, but the new format of the variables would involve modifying all the variables in the Cumulus PHP templates... :(

Re: .php Website

Posted: Mon 10 Jan 2011 3:33 pm
by daj
gemini06720 wrote: David, you do realise that the 'webtags' file is quite outdated - it has not been updated in almost a year... ;)
as far as I am aware the PHP webtags file is up to date with Cumlulus 1.9.0, however the dates do not tie up as 1.9.0 was in Sept 2010. I will need to look at this.

All the new tags for 1.9.1 will be added once it is out of beta. Equally all the webtags are not added to the webtags page yet for the beta version until it is live.
I would be willing to share the files, but the new format of the variables would involve modifying all the variables in the Cumulus PHP templates... :(
Is there a set of PHP web templates? Nothing on the Wiki. Do yo mean users own templates? I'm not sure what YOUR PHP webtags structure is like, but, as you know, we have in the past tried to keep the webtag name the same as the PHP variable name. Are you saying your variable names differ?

Re: .php Website

Posted: Tue 11 Jan 2011 1:17 am
by captzero
Thanks David,

All seems pretty straight forward. It will give me something to do this weekend.

Thanks again