• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: list all forms published as menu item

list all forms published as menu item 10 years 6 days ago #31091

  • lrazov
  • lrazov's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
Hello,

Is there a way to show a dynamic list of all the forms published in the front end as a menu item? The component menu item for RSForms! Pro allows to display one form at a time, I want to list all the forms currently created.

Please advice. Thank you
The administrator has disabled public write access.

list all forms published as menu item 2 years 9 months ago #42108

  • huwhuw
  • huwhuw's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
Here is a solution to list all RS Forms in a joomla article using the excellent Regular Labs sorcerer

<?php

$servername = "changeme";
$username = "changeme";
$password = "changeme";
$dbname = "changeme";



try {
// Start connection
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
// Set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

// Query
$sql = "SELECT * FROM jos_rsform_forms WHERE Published = 1 ORDER BY FormId DESC";

// Prepare query
$stmt = $conn->prepare($sql);

// Bind


// Execute
$stmt->execute();
if ($stmt->rowCount() > 0) {
$msg = "Successfully fetched the webinar list.";
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);


echo '<ul>';
foreach($rows as $row) {

echo '<li><h4><a target="_blank" href = "index.php?option=com_rsform&view=rsform&formId='.$row[FormId].'">' .
$row[FormTitle] .'</a></h4></li>';


}
echo '</ul>';
}

}
catch(PDOException $e) {
$msg = "Error while fetching the webinar list.";

$response = [
"success" => false,
"message" => $msg,
"webinars" => null,
];
}

// Close connection
$conn = null;
?>
Last Edit: 2 years 9 months ago by huwhuw.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!