I have forgotten to add templates/rebus.cpp to the repository
git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@525 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
dc5f002de3
commit
13b0204427
|
@ -0,0 +1,52 @@
|
||||||
|
/*
|
||||||
|
* This file is a part of CMSLU -- Content Management System like Unix
|
||||||
|
* and is not publicly distributed
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "../core/request.h"
|
||||||
|
#include "../core/data.h"
|
||||||
|
#include "templates.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace TemplatesFunctions
|
||||||
|
{
|
||||||
|
|
||||||
|
static size_t rebus_reqid = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void rebus_init()
|
||||||
|
{
|
||||||
|
if( rebus_reqid != request.id )
|
||||||
|
{
|
||||||
|
request.session->rebus_item = data.rebus.Rand();
|
||||||
|
rebus_reqid = request.id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void rebus_question(Info & i)
|
||||||
|
{
|
||||||
|
rebus_init();
|
||||||
|
|
||||||
|
if( request.session->rebus_item )
|
||||||
|
i.out << request.session->rebus_item->question;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue