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

Questions on new installation...
Working on getting this set up... https://eastend2024.joepolecheck.com/rumma...
3 Replies
Posted on Wednesday, 17 April 2024
  • Resolved
  • New
  • Changes to the Submission form
    Can you make changes to the Submission form? There are a few fields I'd like to ...
    0 Replies
    Posted on Thursday, 18 April 2024
  • New
  • Error received? Class "XMLReader" not fo
    Just installed the Pro version of Hotspots, but am getting an error when I try t...
    1 Replies
    Posted on Wednesday, 17 April 2024
  • Resolved
  • New
  • Links aus Veranstaltungsübersicht funktionieren ni
    Nach der Migration von Joomla 3.10 auf Joomla 5.0.3 treten folgende Probleme auf...
    2 Replies
    Posted on Monday, 08 April 2024
    Custom Hotspot Marker fails to load
    I just updated from Joomla 3 to Joomla 4.3.4 and Hotspots 6.0.12. I decided to e...
    0 Replies
    Posted on Tuesday, 09 April 2024