Gbook module help

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
mma
New Member
New Member
Posts: 9
Joined: Mon Jul 08, 2013 12:17 am

Gbook module help

Post 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
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Gbook module help

Post 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
mma
New Member
New Member
Posts: 9
Joined: Mon Jul 08, 2013 12:17 am

Re: Gbook module help

Post 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!
mma
New Member
New Member
Posts: 9
Joined: Mon Jul 08, 2013 12:17 am

Re: Gbook module help

Post 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?
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Gbook module help

Post 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? ;)
mma
New Member
New Member
Posts: 9
Joined: Mon Jul 08, 2013 12:17 am

Re: Gbook module help

Post 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..
mma
New Member
New Member
Posts: 9
Joined: Mon Jul 08, 2013 12:17 am

Re: Gbook module help

Post 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.
mma
New Member
New Member
Posts: 9
Joined: Mon Jul 08, 2013 12:17 am

Re: Gbook module help

Post 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) ???
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Gbook module help

Post 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...
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Gbook module help

Post 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
mma
New Member
New Member
Posts: 9
Joined: Mon Jul 08, 2013 12:17 am

Re: Gbook module help

Post 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 :o

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
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Gbook module help

Post 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.
mma
New Member
New Member
Posts: 9
Joined: Mon Jul 08, 2013 12:17 am

Re: Gbook module help

Post 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!
Last edited by mma on Sun Jul 14, 2013 10:34 pm, edited 1 time in total.
mma
New Member
New Member
Posts: 9
Joined: Mon Jul 08, 2013 12:17 am

Re: Gbook module help

Post 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.
Jos
Support Guru
Support Guru
Posts: 4020
Joined: Wed Sep 05, 2007 8:03 pm

Re: Gbook module help

Post 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.
Post Reply

Return to “Modules/Add-Ons”