Hi,
On my website fishing lakes can be registered / entered (via a registration (Chrono)form).
I display the list of fishing lakes using ChronoConnectivity, when the link of one lake is clicked I take the user to the details page, which is again a form realised using ChronoForms and the Profile Plugin to display a single record of my database table.
I want to do some Php programming to display a google map if the GPS coordinates were supplied during the registration and to set dynamically the meta data of the page (description and key words).
My problem is that I don't know how to use in Php the variables that describe my record.
For instance, suppose I have: {name_of_lake}, {GPS_latitude}, {GPS_longitude} (the last 2 are not displayed on my page, so they are not used in the Form HTML.
In the Form HTML I tried to use different code to get the values of these fields, but most often without success. For example:
In the above example the line
works without problems in order to find out the user id of the lake in order to display the images uploaded by the lake's admin.
But the same approach does not work in the first section:
So that part of the code is commented out as of now.
I also tried other formats, like:
$_POST['name_of_lake'] or
$var = JRequest::getVar('name_of_lake');
I admit I am new to Joomla and Php, but maybe some of you can help, I could not find an exact solution on this forum despite searching for hours.
Thanks in advance.
On my website fishing lakes can be registered / entered (via a registration (Chrono)form).
I display the list of fishing lakes using ChronoConnectivity, when the link of one lake is clicked I take the user to the details page, which is again a form realised using ChronoForms and the Profile Plugin to display a single record of my database table.
I want to do some Php programming to display a google map if the GPS coordinates were supplied during the registration and to set dynamically the meta data of the page (description and key words).
My problem is that I don't know how to use in Php the variables that describe my record.
For instance, suppose I have: {name_of_lake}, {GPS_latitude}, {GPS_longitude} (the last 2 are not displayed on my page, so they are not used in the Form HTML.
In the Form HTML I tried to use different code to get the values of these fields, but most often without success. For example:
<?php
JHTML::_('behavior.modal');
/* Set the page title, description and key words*/
$doc =& JFactory::getDocument();
$lake = {name_of_lake}; /* does not work!!*/
$page_description = 'Horgásztavak - '.$lake;
$page_title = 'Horgásztavak - '.$lake;
$doc->setDescription ($page_description, $page_title);
$page_keywords = 'some text here..'.$lake;
$doc->setMetaData('keywords', $page_keywords);
/*Get user category from gallery to display images*/
$db =& JFactory::getDBO();
$cf_user_id = {cf_user_id}; /* This works!!*/
$query = "
SELECT `cid`
FROM `#__joomgallery_catg` WHERE `owner` = $cf_user_id;
";
$db->setQuery($query);
$joomgallery_cat = $db->loadResult();
/*Get path to user category... */
/*Get pictures from joomgallery category... */
/* and display pictures */
}
?>
In the above example the line
$cf_user_id = {cf_user_id};
works without problems in order to find out the user id of the lake in order to display the images uploaded by the lake's admin.
But the same approach does not work in the first section:
$lake = {name_of_lake}; /* does not work!!*/
So that part of the code is commented out as of now.
I also tried other formats, like:
$_POST['name_of_lake'] or
$var = JRequest::getVar('name_of_lake');
I admit I am new to Joomla and Php, but maybe some of you can help, I could not find an exact solution on this forum despite searching for hours.
Thanks in advance.