Page 1 of 1
[Not a Bug/Solved] - form at top, not at bottom
Posted: 07 Nov 2009, 22:27
by quodo
With the PhocaGuestbook 1.3.2 one can choose the "form position" according to the Back-end parameters. I'd like the form at the bottom but it won't work using the backend parameters. I'm on Joomla 1.5.15 and PHP5.
I checked the database:
Code: Select all
(41, 'Phoca Guestbook', 'option=com_phocaguestbook', [...]display_form=1\n[b]form_position=1[/b]\n[...]send_mail=0\n\n', 1),
and the parameter "form_position" changes from 0 to 1 to 0 when I change the parameter in the Back-end.
Then I found "..\components\com_phocaguestbook\views\phocaguestbook\tmpl\default.php" where there are the code parts
Code: Select all
if ($this->config['position'] ==1) {
echo $msgpg;
}
and
Code: Select all
if ($this->config['position'] ==0) {
echo $msgpg;
}
If I set both on ==1, then no messages are shown. I I set both on ==0 then the messages are shown at the top and bottom. That makes sense. What doesn't make sense is that this happens independent of what the saved position was, either top or bottom. (Okay, I now know how to edit the files to make it work

)
Concluding, I think that somehow the part
Code: Select all
//Select the position, add V A L U E S
if ($params->get( 'form_position' ) != '') {$config['position'] = $params->get( 'form_position' );}
else {$config['position'] = 0;}
if ($params->get( 'max_url' ) != '') {$config['maxurl'] = $params->get( 'max_url' );}
else {$config['maxurl'] = 5;}
if ($params->get( 'enable_captcha' ) != '') {$require['captcha'] = $params->get( 'enable_captcha' );}
else {$require['captcha'] = 1;}
(from ..\components\com_phocaguestbook\views\phocaguestbook\view.html.php) fails, but I don't understand what and why (it seems that max_url and enable_captcha don't work either).
Re: Bug? - form at top, not at bottom
Posted: 14 Nov 2009, 00:45
by codejunkie
Check the XML file (saved on your server) to see if the parameter names in the file match those parameter names shown in the code you listed.
Re: Bug? - form at top, not at bottom
Posted: 23 Nov 2009, 13:27
by quodo
Yes, parameter names match the parameter names in the \administrator\components\com_phocaguestbook\config.xml file saved on the server (they are not in the file \administrator\components\com_phocaguestbook\phocaguestbook.xml).
Part from \administrator\components\com_phocaguestbook\config.xml:
Code: Select all
<param name="form_position" type="list" default="0" label="Form Position" description="Form Position DESC">
<option value="0">Top</option>
<option value="1">Bottom</option>
</param>
<param name="@spacer" type="spacer" default="" label="" description="" />
<param name="forbidden_word_filter" type="phocatextarea" rows="5" cols="40" default="" label="Forbidden Word Filter" description="Forbidden Word Filter DESC" />
<param name="forbidden_whole_word_filter" type="phocatextarea" rows="5" cols="40" default="" label="Forbidden Whole Word Filter" description="Forbidden Whole Word Filter DESC" />
<param name="ip_ban" type="phocatextarea" rows="5" cols="40" default="" label="IP Ban" description="IP Ban DESC" />
<param name="max_char" default="2000" size="6" type="phocatext" label="Maximum Characters" description="Maximum Characters DESC" />
<param name="max_url" default="5" size="6" type="phocatext" label="Maximum URL" description="Maximum URL DESC" />
<param name="@spacer" type="spacer" default="" label="" description="" />
<param name="enable_captcha" type="list" default="1" label="Enable Captcha" description="Enable Captcha DESC">
<option value="1">Standard Captcha</option>
<option value="2">Math Captcha</option>
<option value="3">TTF Captcha</option>
<option value="10">Random (Standard, Math, TTF)</option>
<option value="11">Random (Standard, Math)</option>
<option value="12">Random (Standard, TTF)</option>
<option value="13">Random (Math, TTF)</option>
<option value="0">No</option>
</param>
Re: Bug? - form at top, not at bottom
Posted: 11 Dec 2009, 17:34
by quodo
I think I have the same problem as "dl7awl" in
viewtopic.php?f=2&t=5309#p23379:
if backend settings are such that entering an email address is optional (not mandatory), it ist still not possible to post a guestbook entry without having an email address entered
.
For version 1.3.2 the variable "$require['email']" is always true, independent of what is saved in Backend > Phoca Guestbook > Control Panel > Parameters > Require Username (Name). Similarly I cannot change form_position and the other parameters.
I have tried to find a solution myself, using JDump (
http://extensions.joomla.org/extensions ... pment/1509, it allows a popup window to showup with output of the variables you want). For example, I wanted the contents of $params at about line 57 in \administrator\components\com_phocaguestbook\front\controllers\phocageustbook.php. (I tried to attach an image with the results, but 'could not upload').
It seems that the parameters are stored at two places in this JParameter object. (And then I don't know what I'm talking about:) Directly in properties and in _registrey - _default - data - Properties.
I still think something is wrong with where changed parameters are stored, but I cannot pinpoint it.
Any help is appreciated.
Re: Bug? - form at top, not at bottom
Posted: 12 Dec 2009, 17:19
by quodo
I tried modifying the xml file and then installing PhocaGuestbook: does not help, e.g. enable_captcha=3 even if I put 0 (disable) in the xml. Can it be that parameters are saved or fetched from the wrong table? This is why I think that:
If I change the colour in the backend through the parameters it end up in table jos_components, the changed parameter goes into the 'params' field.
But if I want to see the changes to work in the frontend I have to change the parameters in the 'params' field of jos_menu.
And to make things difficult: when you use JoomFish, the parameters can be translated and can be found in _jf_content. With JoomFish I can translate the menuitem with its parameters, this one shows the pamerenters from jos_menu to translate.
Re: Bug? - form at top, not at bottom
Posted: 13 Dec 2009, 13:17
by Jan
Yes, Joomla! works this way, it enables to you a lot of possible options, as you can add parameters to global configuration but you can change it in parameters component in menu link (which will override the global configuration) and the menu link can have customized parameters. The same with languages (joomfish), you can change (but you need not to) it for different languages.
Jan
Re: Bug? - form at top, not at bottom
Posted: 14 Dec 2009, 11:44
by quodo
Oops, it just hit me! (Or in Dutch: "Het kwartje is gevallen.") Jan, thank you for your response!
It is not a bug, it is a very nice feature, that I did not understand! I'm sorry for that.

I'll try to explain for others... (although in hindside it is indeed explained here:
https://www.phoca.cz/documents/16-joomla ... -in-joomla)
There are
two places to set Parameters for PhocaGallery! And one overrules the other.
The first one is at Backend > Menus > [MyMenu with PhocaGuestbook] > [PhocaGuestbook-item] > Parameters (Component), this one can overrule the other set of parameters. That's where I changed values, not realising that "Use Global" means using the second parameter list at Backend > Component > PhocaGuestbook > Control Panel > Parameters (it says 'Global Configuration' there).
By the way, in "Parameters (Component)" (at the menu-item) there is one value "Send Email" without "Use Global" option. Is that how it's supposed to be?
Re: [Not a Bug/Solved] - form at top, not at bottom
Posted: 16 Dec 2009, 21:58
by Jan
By the way, in "Parameters (Component)" (at the menu-item) there is one value "Send Email" without "Use Global" option. Is that how it's supposed to be?
Hi, as described in the article, in Joomla! parameters there are some limitation, e.g. text form field cannot include "use global"
Jan
Re: [Not a Bug/Solved] - form at top, not at bottom
Posted: 17 Dec 2009, 13:24
by quodo
Thank you Jan, for your explanation. I have learned a lot in this little thread.
I assumed that the "Send Email" field was also a "Select box" because you get a nice dropdown list. Wrong assumption apparently (again, I might add).
Re: [Not a Bug/Solved] - form at top, not at bottom
Posted: 19 Dec 2009, 20:31
by Jan
Hi, this is a specific select box which is not a standard Joomla! select box and it includes not the use default
