16 | | == Displaying a SINGLE piece of content at several (but not all) hotspots. |
17 | | This is a very common scenario: displaying a certain piece of content at all the hotspot in a certain neighbourhood, or all the hotspots of a ccertain type (cafe, bar, library, etc.). |
| 16 | == Displaying a SINGLE piece of content at several (but not all) hotspots. == |
| 17 | This is a very common scenario: displaying a certain piece of content at all the hotspot in a certain neighborhood, or all the hotspots of a certain type (cafe, bar, library, etc.). |
24 | | This is usefull for notices |
25 | | 1. Link a ContentGroup where you want your notice to go. |
26 | | 1. In "ContentGroup access control", make the ContentGroup non-reusable. |
27 | | 1. Add your notice as an element of the ContentGroup. |
28 | | 1. In "ContentGroup configuration"/"Can content be shown more than once to the same user?:" select "Content can only be shown once". |
| 24 | This is useful for notices |
| 25 | 1. Link a !ContentGroup where you want your notice to go. |
| 26 | 1. In "!ContentGroup access control", make the !ContentGroup non-reusable. |
| 27 | 1. Add your notice as an element of the !ContentGroup. |
| 28 | 1. In "!ContentGroup configuration"/"Can content be shown more than once to the same user?:" select "Content can only be shown once". |
45 | | === Adding prises or special events in certain time-windows === |
46 | | There are several ways to do this, but the simplest is to create a second, independent ContentGroup (also linked network-wide), in which the different special prizes (password for free beer, etc.) are listed (for each nodes they apply at). For each content group element, list the start and end time of the special event. |
| 45 | === Giving prizes or advertizing special events in certain time-windows === |
| 46 | There are several ways to do this, but the simplest is to create a second, independent !ContentGroup (also linked network-wide), in which the different special prizes (password for free beer, etc.) are listed (for each nodes they apply at). For each content group element, list the start and end time of the special event. |
77 | | == Integrating with an existing locative CMS == |
| 78 | == Integrating with another website or CMS == |
| 79 | The SmartyTemplate content type allows passing auth server variables to a remote server if it accepts input as http GET parameters. The following example show two approaches. |
| 80 | === IRC chat example using a simple HTML link to pass get variables === |
| 81 | This example code allows using a [http://www.linux-quebec.org/cgi-bin/cgiirc/irc.cgi IRC web interface] to connect to the #wifidog channel directly. You'd normally have to pick your username and the channel manually. The following will create a link ('Chat with wifidog developers') that will get you directly into the #wifidog channel, telling other users where you are connecting from if you are physically at a hotspot. |
| 82 | {{{ |
| 83 | {if $userName} |
| 84 | <a target='_new' href='http://www.linux-quebec.org/cgi-bin/cgiirc/irc.cgi?interface=nonjs&Nickname={$userName|remove_accents|urlencode}{if $realNodeName}{'|'|urlencode}{$realNodeName|remove_accents|urlencode}{/if}&Realname={$userName|remove_accents|urlencode}{if $realNodeName}{'@'|urlencode}{$realNodeName|remove_accents|urlencode}{/if}&Server={'irc.freenode.net'|urlencode}&Channel={'#wifidog'|urlencode}'> |
| 85 | Chat with wifidog developers</a> |
| 86 | {/if} |
| 87 | }}} |
| 88 | |
| 89 | === ShoutBox example using JavaScript to pass get variables === |
| 90 | This code will send a copy of the users's shouts to another website, and open it in a new window. It was developped to integrate ISF's network with [http://cwide.org/ CityWide]. To try it: |
| 91 | * Create a ShoutBox |
| 92 | * Add a SmartyTemplate in "Shout button 'onclick=' value" |
| 93 | * Paste the following in the SmartyTemplate, without newlines |
| 94 | |
| 95 | {{{ |
| 96 | window.open('http://www.cwide.org/scripts/cwide_addMsgAndRedirect.php?hotspotID={$realNodeId}&hotspotName={$realNodeName|urlencode}&message='+escape(document.getElementById('shout_text').value)+'&ipAddress={$realNodeLastHeartbeatIP}&username={$userNam|urlencode}'); |
| 97 | |
| 98 | }}} |