Page 1 of 2
Gbook module help
Posted: Mon Jul 08, 2013 6:21 pm
by mma
Hi all,
Please help to find answer in next question:
When im use a Gbook module fo cmsms and open page with details of any entry - its called by code:
{Gbook action="detail" entryid="2"}
I dont understand, how can i make this page a dynamic. I mean that i need somthenig like that: {Gbook action="detail" entryid="<? echo $_GET['entry_id']; ?>"} - but it doesnt work((
or i try for test:
{Gbook action="detail" entryid="2"}
<? echo $_GET['entry_id']; ?>
and it doenst work too.
Maybe because im use $config['url_rewriting'] = 'mod_rewrite'; ??
Please help and sorry for my english
Re: Gbook module help
Posted: Mon Jul 08, 2013 8:00 pm
by Jos
I don't know why you would want to make pages like that, but I guess you have your own specific reasons for it.
It should work like this:
{Gbook action='detail' entryid=$smarty.get.entry_id}
where entry_id is the get parameter
Re: Gbook module help
Posted: Mon Jul 08, 2013 10:06 pm
by mma
Jos wrote:I don't know why you would want to make pages like that, but I guess you have your own specific reasons for it.
It should work like this:
{Gbook action='detail' entryid=$smarty.get.entry_id}
where entry_id is the get parameter
Yes, its work! Thank u soo much!
If can tell me a better way to make that page i'll be very grateful to u!
Re: Gbook module help
Posted: Mon Jul 08, 2013 10:14 pm
by mma
And could you also tell whats wrong?
Code: Select all
{literal}<? If (is_set($_GET['nomer'])) { ?>{/literal}
{Gbook action='detail' entryid=$smarty.get.nomer}
{literal}<? } else { ?>{/literal}
{Gbook action='default'}
{literal}<? } ?>{/literal}
Im sorry, but i cant understand how smarty works. I know php and ever work with it. Is it possible to work with php code and easy integrate it to any page? Or i must use only smarty lang?
Re: Gbook module help
Posted: Tue Jul 09, 2013 6:27 am
by Jos
mma wrote:And could you also tell whats wrong?
Im sorry, but i cant understand how smarty works. I know php and ever work with it. Is it possible to work with php code and easy integrate it to any page? Or i must use only smarty lang?
If you know php, smarty is very easy to understand, check documentation on
http://www.smarty.net/docs/en/
or check the example templates that comes with every module
in your case:
Code: Select all
{if isset($smarty.get.nomer)}
{Gbook action='detail' entryid=$smarty.get.nomer}
{else}
{Gbook action='default'}
{/if}
Simple isn't it?

Re: Gbook module help
Posted: Wed Jul 10, 2013 5:17 pm
by mma
Thank u very much. Yeah, looks like more then easy) Ill try to understand Smarty again.
If u well know this module, could u also get help in next code (off course if u can):
Code: Select all
<div class="gbook_form">
{if !empty($gbook_errormessage)}<p class="gbook_error">{$gbook_errormessage}</p>{/if}
{$gbook_startform}
<div class="gbook_field{if $gbook_name_error} gbook_field_error{/if}">
<label for="{$gbook_name_field}">{$gbook_name_label}</label>{$gbook_name_input}
</div>
<div class="gbook_field{if $gbook_email_error} gbook_field_error{/if}">
<label for="{$gbook_email_field}">{$gbook_email_label}</label>{$gbook_email_input}
</div>
<div class="gbook_field{if $gbook_title_error} gbook_field_error{/if}">
<label for="{$gbook_title_field}">{$gbook_title_label}</label>{$gbook_title_input}
</div>
<div class="gbook_field{if $gbook_message_error} gbook_field_error{/if}">
<label for="{$gbook_message_field}">{$gbook_message_label}</label>{$gbook_message_input}
</div>
This a code of new msg form submit template. I cant understand, how can i add a new field to submit form? it is at all possible?
thanks in advance..
Re: Gbook module help
Posted: Wed Jul 10, 2013 6:07 pm
by mma
Got it! Iv got it by myself. But now new question and answer for it i cant find in smarty manual.
Code: Select all
$smarty->assign('gbook_message_label', $this->Lang('message'));
$smarty->assign('gbook_message_field', $id . 'message');
$smarty->assign('gbook_message_input', $this->CreateTextArea(false, $id, html_entity_decode($params['message'],ENT_QUOTES), 'message', '', $id . 'message'));
$smarty->assign('gbook_message_error', in_array('message', $fielderrors) ? 1 : '');
How i can mae changeable some style params like width, height.
Thanks.
Re: Gbook module help
Posted: Wed Jul 10, 2013 6:28 pm
by mma
Additional:
Add a new field to form submit i did. added new fied to bd also. But now, CMSMS when form is submit doesnt save a new value to new bd field, it saved to field "title" and real title value doesnt saved)

Re: Gbook module help
Posted: Wed Jul 10, 2013 7:34 pm
by Dr.CSS
To style these you need to look in the rendered page source to see what you can target, I have never used this module but some require that you hit a button to get the new filed to show up in a template for results, like form builder...
Re: Gbook module help
Posted: Wed Jul 10, 2013 7:59 pm
by Jos
mma wrote:I cant understand, how can i add a new field to submit form? it is at all possible?
No, with Gbook it is currently not possible to add extra fields.
Please do not mess with the php files. You will have a problem as soon as an update comes along
Re: Gbook module help
Posted: Wed Jul 10, 2013 11:37 pm
by mma
Dr.CSS wrote:To style these you need to look in the rendered page source to see what you can target, I have never used this module but some require that you hit a button to get the new filed to show up in a template for results, like form builder...
omg what is it
Jos wrote:No, with Gbook it is currently not possible to add extra fields
i cant believe it(( i so much need in city field(
ok, big thanks for ur help
Re: Gbook module help
Posted: Thu Jul 11, 2013 9:53 am
by Jos
mma wrote:Jos wrote:No, with Gbook it is currently not possible to add extra fields
i cant believe it(( i so much need in city field(
ok, big thanks for ur help
Currently on one of my own sites I use the title field for city.
I think I will add a dedicated city field with a next release.
Re: Gbook module help
Posted: Fri Jul 12, 2013 9:19 pm
by mma
got a new question((
I have two guestbooks.
One of them (which is default) called by {Gbook action="default"}. Page for msg add with form called by {Gbook action="form"}. Everything works good.
But if i want to add msg to another gbook alias, which called by {Gbook action="default" alias="name_of_gb_2"} ?
If i use {Gbook action="form" alias="name_of_gb_2"} its doesnt work. Pls help Jos!
Re: Gbook module help
Posted: Sun Jul 14, 2013 10:33 pm
by mma
Also I could give you more correctly language translation (Russian) for you're module, if ure a creator.
And please anybody help with upside question
Coz it cannot be started an important part of my medical portal.
Re: Gbook module help
Posted: Mon Jul 15, 2013 8:31 pm
by Jos
mma wrote:if i want to add msg to another gbook alias, which called by {Gbook action="default" alias="name_of_gb_2"} ?
If i use {Gbook action="form" alias="name_of_gb_2"} its doesnt work.
Works for me... maybe browser cache (ctrl-F5), or your message was marked as spam?
mma wrote:Also I could give you more correctly language translation (Russian) for you're module, if ure a creator.
Translations are very welcome.
Please signup here:
http://dev.cmsmadesimple.org/signup
Then login and hit "Request to join" here:
http://dev.cmsmadesimple.org/projects/russian
Then after your request got approved, do your translations here:
http://translations.cmsmadesimple.org/
After you completed the translation, you can grab the latest translationfiles here:
http://svn.cmsmadesimple.org/svn/transl ... /lang/ext/
Each new release I will include the latest files automatically.