So far, it has been explained how to

-keep the value of a variable for a given user over the current session
 (done by passing it in urls across pages)

-keep the value of a variable for a given user over different sessions
 (done by cookies or auth+prefs)

However, there is also a need for global variables of the widest scope
possible. This is useful for hit counters, banner rotation and so on. To
achieve this on midgard level, do the following:

Create a virtual person, like "robot" and a group like "robots".
Make robot a member of robots.
Create a topic tree owned by robots. Now, global vriables can be stored
in various article fields under this topic tree. To write such an
article, the processing page has to switch to the id of robot by
executing

mgd_auth_midgard(robot, password, 0);    (requires v.1.4)

Now you can write to the topic tree, owned by robots. Then, switch back
to anonymous user by

mgd_auth_midgard('','',0);

Note, that the latter command assumes that we were in non-auth mode. If
not, save $midgard->user beforehand and restore later.


Frank
-- 
Dr Frank Boehme                      | Email: [EMAIL PROTECTED]
National University of Ireland, Cork | phone: +353-21-903163
Dept of Computer Science             |   fax: +353-21-903113
Cork, Ireland                        |

--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]

Reply via email to