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

Complete Uninstall to Work in J4??
We have recently updated a site from Joomlav3 to v4 (4.4.2). Now when we go to m...
4 Replies
Posted on Tuesday, 30 April 2024
  • New
  • verschiedene URL's für Kursübersicht einer Kategor
    Hallo, ich habe eine Frage in Bezug auf SEO: ein externer Spezialist macht die...
    1 Replies
    Posted on Monday, 29 April 2024
  • New
  • Google no index für bestimmte Seiten/Details
    Hallo ich habe eine kleine Frage: wo kann ich einstellen, dass Google die Seite...
    1 Replies
    Posted on Wednesday, 24 April 2024
    Changes to Submission Form?
    Are you able to make changes to the Hotspot submission form? There are several f...
    0 Replies
    Posted on Friday, 26 April 2024
  • New
  • Question regarding custom fields
    How do I access custom fields after I have created them?...
    0 Replies
    Posted on Wednesday, 24 April 2024
    • #custom fields