1. Pascal Wickert
  2. Sherlock Holmes The Voice
  3. General Talk
  4. Tuesday, 20 February 2018
  5.  Subscribe via email
Hello Yves,

long time no see. Our installation of Matukio 6.1.5 is working well. I did not yet upgrade to version 7 but I should do it this summer when the registration are lower than now.

I am trying, using RSForm pro, to populate a dropdown list field with a list of our current events. I am able to display all the events but not only the currents one. Here is the php code I used in the specific field within a RSForm Pro form :



//<code>
// Prepare the empty array
$items = array();
// Prepare the database connection
$db = JFactory::getDbo();
// Keep this if you'd like a "Please select" option, otherwise comment or remove it
$items[] = "|Please Select[c]";

// Run the SQL query and store it in $results
$db->setQuery("SELECT title FROM #__matukio");
$results = $db->loadObjectList();

// Now, we need to convert the results into a readable RSForm! Pro format.
// The Items field will accept values in this format:
// value-to-be-stored|value-to-be-shown
// Eg. m|M-sized T-shirt
foreach ($results as $result) {
$value = $result->title;
$label = $result->title;
$items[] = $value.'|'.$label;
}

// Multiple values are separated by new lines, so we need to do this now
$items = implode("\n", $items);

// Now we need to return the value to the field
return $items;
//</code>



Ref.: https://www.rsjoomla.com/support/documentation/rsform-pro/custom-scripting/how-to-store-the-submission-in-a-file-and-send-it-through-the-email.html

As you can see I am not a developper and I have taken their example code that I tweak a bit with Matukio database information. Could you help me to refine the query for the field to show only current event titles?

Thank you so much,

Pascal
Responses (1)


There are %s replies to this question. If you want to see them you need a valid subscription.
If you have a valid subscription, please login now.
Visit store now

Last questions

J5 compatibility for Hotspots
Hi guys, Just started to update my old J3x website. Is there J5 compatibility p...
2 Replies
Posted on Monday, 24 February 2025
  • #Hotspots
  • #hotspots Joomla 5
error message when adding/cofiguring email address
When configuring the email plugin that send a email message to admin when a new ...
0 Replies
Posted on Friday, 09 May 2025
CMigrator: Path from Drupal 6 to J5?
(Category s/b CMigrator, but didn't see it on the list) I'm interested in usi...
0 Replies
Posted on Monday, 28 April 2025
Dowload all Hotspots entries
Hi there, I'm looking for a way to dowload all the Hotspots entries. I've got t...
0 Replies
Posted on Sunday, 06 April 2025
  • #kml
  • #download
Set number of hotspots / user groups
Hi, I'm working with Hotspots for my new website and I love it! After trying ...
0 Replies
Posted on Monday, 31 March 2025