Hello,
I have an online petition created using formbuilder and formbrowser which works a treat. I just wondered if it`s possible to have a little counter at the top of the page which will tell me how many petitions have been posted on the website?
Any thoughts would be greatly apreciated
Kind Regards
Sam
A hit counter for formbrowser?
Re: A hit counter for formbrowser?
Hello sam_m
Create an UDT called read_entries
You can call this udt in a page like:
You can use the parameter max if you want to limit the entries. You probably don't need this.
In a template or page you can use these strings:
{$entries} = Total entries in the database
{$entries_left} = Allowed entries left
{$entries_max} = Maximum entries allowed.
Hope this helps,
Rolf
Create an UDT called read_entries
Code: Select all
// Maximum excepted entries
$entries_max = ($params[max]);
// Read entries in FormBrowser
global $gCms;
$list = $gCms->smarty->get_template_vars('list');
$entries = count($list);
// Complex Mathematical Calculation :o)
$entries_left = $entries_max - $entries;
// Passing the parameters to the template
$smarty = &$gCms->GetSmarty();
$smarty->assign('entries_max', $entries_max);
$smarty->assign('entries', $entries);
$smarty->assign('entries_left', $entries_left);
Code: Select all
{cms_module module='FormBrowser' browser='your-name'}
{read_entries max='10'}
In a template or page you can use these strings:
{$entries} = Total entries in the database
{$entries_left} = Allowed entries left
{$entries_max} = Maximum entries allowed.
Hope this helps,
Rolf

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: A hit counter for formbrowser?
Thank you Rolf,
Greatly appreciated
will give it ago now
Greatly appreciated
