The articles in this category are examples of how to display your walks from the Walks Finder.
A guide the the system used is at https://github.com/ramblerswebs/ramblers-library/wiki
While the code added to each article or module is in PHP you don't need to know much about PHP unless you want a new format for displaying your walks.
Please note:
- All the examples use walks for the group DE02 (Derby & South Derbyshire) Please change this code to your group
- These code examples can be added to either an aricle or module, see wiki for details
- You may add text before or after the PHP script
- Once you have decided which formats you wish to use you should delete or disable the other formats. You may also wish to add menu items that point directly to the formats you wish to use.
Sample code
The code below will display the full details of future walks
Sample code
<?php
//error_reporting(E_ALL);
//ini_set('display_errors', 1);
$rafeedurl ="http://www.ramblers.org.uk/api/lbs/walks?groups=bk01";
$feed=new RJsonwalksFeed($rafeedurl); // standard software to read json feed and decode file
$display= new RJsonwalksStdFulldetails(); // code to display the walks in a particular format
$feed->Display($display); // display walks information
?>
Comments about the code
-
The code is surrounded by the tags <?php ?> This tells the system that the code between these tags is in the PHP language
- Text after the // symbols are comments
- Each PHP line must end with a ;
- Text string must be contained in quote marks. "text"
- error_reporting(E_ALL); and ini_set('display_errors', 1); These lines are comments. If you remove the // then they provide some error reporting, this is useful if you are having problems
- $rafeedurl ="http://www.ramblers.org.uk/api/lbs/walks?groups=de02"; This line defines the URL of the feed from the Ramblers Led Walks and Events System - please see out wiki above for further details. de02 is the group code whose walks are to be displayed.
- $feed=new RJsonwalksFeed($rafeedurl); This line tells the system the feed URL and the code retrieves the walks
- $display= new RJsonwalksStdFulldetails(); This line defines how you wish to display the walks
- $feed->Display($display); This line tells the system to display the walks with the chosen display method
- The code MUST be entered into an article are normal paragraph text, if it is any other style it may just display the code itself rather than your walks
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$rafeedurl ="http://www.ramblers.org.uk/api/lbs/walks?groups=bk01";
$feed=new RJsonwalksFeed($rafeedurl); // standard software to read json feed and decode file
$display= new RJsonwalksStdFulldetails(); // code to display the walks in a particular format
$feed->Display($display); // display walks information
?>
