The
All About ER6 Syndication System
Implemented by Rafe
and Dazler.
Contents:
Introduction and Customisation
Listing of available js output files
Recommended Code (for beginners)
Live example
Introduction
and customisation
The full
syndication of both news headline/ articles and forum topics / posts is now
available. This is achieved through Javascript and a high degree of customisation
is possible. In addition an XML-based backend is also available. For those interested
in using this please contact the webmaster for more details.
Please, if you decide to use this please acknowledge the source. A link to the site would be nice, the layout must include a link for each item to the appropriate place on this site (e.g. news headlines link to news article), and somewhere near please place the text provided by All About ER6.
The Javascript works by calling a javascript hosted on this site. You must then either call one of the predefined layout functions or make your own.
You call the Javascript with the following code:
| <script src="/allabouter6-late/external/js/filename.php"></script> |
Where you want
the syndicated content to appear you put the following:
| <script> MakeAll(); </script> |
The MakeAll(); is a predefined layout function. There are three predefined layout functions:
It is possible to write your own layout function. Here is the code for the MakeHeadlines() as an example:
function MakeHeadlines()
{
for (var x=0;x<newsitems.length;x++)
{
document.write("<li><a href='"+newsitems[x].commentsurl+"'target='_blank'>"+newsitems[x].headline+"</a>");
}
}
|
The important part of this is the document.write line. This control the layout since it is the part of the Javascript which outputs html. It also is where you put the array variables discussed below, which are created in the called script. An example of an array variable is the newsitems[x].commentsurl part of the script above, this example is saying for newsitem x print the commentsurl variable. This can be combined with HTML as shown above. Notice how the html and other text are surrouned by " while the variables are not. To join them together '+' is used.
The variables available for use are as follows:
|
newsid - id if news
item |
To use say date, you would put in the script:
| newsitems[x].date |
This obviously allows ofr very powerful customisation of layouts.
An example shown below would show a list of the last posters:
| <script> for (var x=0;x<newsitems.length;x++) { document.write("<li><a href='"+newsitems[x].profileurl+"' target='_blank'>"+newsitems[x].name+"</a>"); } </script> |
Listing
of available js output files.
These
files are all in the /allabouter6-late/external/js/ directory. Therefore
the code for linking needed is:
<script src="/allabouter6-late/external/js/filename.php"></script>
More are available on request to the webmaster, when contacting the webmaster please specify what you want. Remember it is possible to customise the output of the script as described above. With special negotiation the full text of an article or post is also available. Please contact the webmaster for more details.
Recommended code - use this if you don't understand above.
Place the following in your HTML file to get a list of the last 10 headlines.
|
<script src="/allabouter6-late/external/js/jsnat.php"> |
Place the following in your HTML file to get a list of the last 10 topic titles posted in the forum.
| <script src="/allabouter6-late/external/js/jsfallt.php"> </script> <ul> <script> MakeHeadlines(); </script> </ul> |
Live Example of jsfallrt.php (All Forums, recent posts, teaser, make all layout function) and placed in table.
Live example of headlines (recommended code placed in a table):
|
|