JavaScript Export
By Paul
3.43/5 based on 7 votes. The median rating is 4.
By Paul
Suppose you want to allow a plain HTML page to display top articles from your site. You may either want to do this on one of your own pages, or to distribute the ability to your site's visitors so that they can place your list of top links on their own site. With the help of some JavaScript, this is possible. Users can configure the type of toplist they wish to display. Thanks to din for developing this feature.
Customize the basics of the look by editing your 'JavaScript Export' template (in the misc templates section of your template editor). Note that if you're doing a toplist of something other than articles you must edit the default template to something that includes the temlpate variables of the type you're trying to display.
The 'javascript export' page of your admin panel allows you to set timed generation of the data, which is strongly advised to speed page loading. If you want instant data, though, you can use this basic JavaScript:
<script language="javascript" src="http://yoursite.com/wsnkb/exporter.php"></script>
Change yoursite.com/wsnkb to what's appropriate for your installation. You can add paramaters onto the end by adding ?name=value. Set the default by editing the template.
The available paramaters are the same as for any toplist:
type[1]
number[1]
field[1]
order[1]
ascdesc[1]
thecondition[1]
Example: For a JavaScript to show a toplist of the 10 newest comments, use <script language="javascript" src="http://yoursite.com/wsnkb/exporter.php?number[1]=10&field[1]=time&ascdesc[1]=descending&type[1]=comments"></script>
To do only regular type comments, you'd use <script language="javascript" src="http://yoursite.com/wsnkb/exporter.php?number[1]=10&field[1]=time&ascdesc[1]=descending&type[1]=comments&thecondition=type='regular'"></script>
You can use a different template by adding &template=javascript_export2 to the URL, where javascript_export2.tpl is the template file in the /custom/ subdirectory of your templates directory. If &template= is not specified, the javascript_export.tpl template is used.
If you are using this to let other people put your content on their site, you can either instruct them in how to customize it or write up specialized versions for them.
Note that this method is dynamic, and thus slow. The page has to be rendered befoe being sent as javascript. To avoid slowing down the pages of people using your javascript, go to the 'JavaScript export' section of your admin panel. The instructions there will tell you how to get static versions of your feed automatically generated daily... this will make the page load time for the page containing the javascript as fast as possible.
Customize the basics of the look by editing your 'JavaScript Export' template (in the misc templates section of your template editor). Note that if you're doing a toplist of something other than articles you must edit the default template to something that includes the temlpate variables of the type you're trying to display.
The 'javascript export' page of your admin panel allows you to set timed generation of the data, which is strongly advised to speed page loading. If you want instant data, though, you can use this basic JavaScript:
<script language="javascript" src="http://yoursite.com/wsnkb/exporter.php"></script>
Change yoursite.com/wsnkb to what's appropriate for your installation. You can add paramaters onto the end by adding ?name=value. Set the default by editing the template.
The available paramaters are the same as for any toplist:
type[1]
number[1]
field[1]
order[1]
ascdesc[1]
thecondition[1]
Example: For a JavaScript to show a toplist of the 10 newest comments, use <script language="javascript" src="http://yoursite.com/wsnkb/exporter.php?number[1]=10&field[1]=time&ascdesc[1]=descending&type[1]=comments"></script>
To do only regular type comments, you'd use <script language="javascript" src="http://yoursite.com/wsnkb/exporter.php?number[1]=10&field[1]=time&ascdesc[1]=descending&type[1]=comments&thecondition=type='regular'"></script>
You can use a different template by adding &template=javascript_export2 to the URL, where javascript_export2.tpl is the template file in the /custom/ subdirectory of your templates directory. If &template= is not specified, the javascript_export.tpl template is used.
If you are using this to let other people put your content on their site, you can either instruct them in how to customize it or write up specialized versions for them.
Note that this method is dynamic, and thus slow. The page has to be rendered befoe being sent as javascript. To avoid slowing down the pages of people using your javascript, go to the 'JavaScript export' section of your admin panel. The instructions there will tell you how to get static versions of your feed automatically generated daily... this will make the page load time for the page containing the javascript as fast as possible.
Rating:
3.43/5 based on 7 votes. The median rating is 4.
Submitted: 10/18/03 (Edited 12/03/06)
Description: Using WSN Knowledge Base information on static pages and other websites.
Views:
2320 views. Averaging 1 per day.
In the most recent 30 day period, there've been 7 views.

Print
E-Mail