justmehereinbrisbane
Forum Replies Created
-
Hi Aacesc
Thank you for your reply. Can you confirm that FPSM will work with the Divi theme? I have not yet created the form as the lite version does not allow to upload files. The error message was on the wpshuffle.com / contact-us page.
Error was “There was an error trying to send your message. Please try again later” I did try a day later – same error π
Best regards
- This reply was modified 7 months, 4 weeks ago by justmehereinbrisbane.
Hi Patrick
thank you for your response. I only have two categories, and only two forms that post using categories.
I will try to implement your suggestion above. Will let you know of progress.
Cheers
Hi Nithin
Thank you for your response. I have looked into the “Pre-Populate” feature and am unable to see how to get this to work with postdata fields specifically the categories field. Am i missing something obvious?
Thank you Kris for your reply.
Ok. Tackling it from a different angle. Form1 with Category A , Form2 with TagB.
I just then need to run a script to convert TagB into CategoryB.
Would something like below work?
<?php
// Database connection details
$db_host = 'localhost';
$db_user = 'your_username';
$db_pass = 'your_password';
$db_name = 'your_database_name';
// Connect to the database
$conn = new mysqli($db_host, $db_user, $db_pass, $db_name);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Example: Convert a specific tag to a category
$tag_name_to_convert = 'TagB';
// 1. Get tag information
$tag_query = "SELECT tag_id FROM tags WHERE tag_name = '$tag_name_to_convert'";
$tag_result = $conn->query($tag_query);
if ($tag_result->num_rows > 0) {
$tag_row = $tag_result->fetch_assoc();
$tag_id = $tag_row['tag_id'];
// 2. Create new category
$insert_category_query = "INSERT INTO categories (category_name) VALUES ('$tag_name_to_convert')";
$conn->query($insert_category_query);
$new_category_id = $conn->insert_id;
// 3. Update post relationships (assuming a post_tags and post_categories table)
$update_relationships_query = "INSERT INTO post_categories (post_id, category_id)
SELECT post_id, $new_category_id FROM post_tags WHERE tag_id = $tag_id";
$conn->query($update_relationships_query);
// 4. Delete old tag relationships
$delete_tag_relationships_query = "DELETE FROM post_tags WHERE tag_id = $tag_id";
$conn->query($delete_tag_relationships_query);
// 5. Delete the original tag
$delete_tag_query = "DELETE FROM tags WHERE tag_id = $tag_id";
$conn->query($delete_tag_query);
echo "Tag '$tag_name_to_convert' successfully converted to a category.";
} else {
echo "Tag '$tag_name_to_convert' not found.";
}
$conn->close();
?>thank you in anticipation
Hi Jose
Can confirm the issue has been resolved. Thank you for resolving so fast. Have a Superb Sunday.
Cheers
Hi – we can close this. I am using the DIVI theme and hadn’t created the default posts template in DIVI to include the custom fields.
It is all working now.
Hi Patrick
I have added the custom fields as can be seen in this link https://monosnap.com/file/kWY4buXvMxIoV76d5HGYGwK1sqCbeE
in the submissions area it looks like this https://monosnap.com/file/bi7lWLuf97lN0hZOUBLu7On1kdGVOl
In the notification email i am getting this https://monosnap.com/file/w3ehxbcfOx1VE5cvautDLQE1EtcGAy
but in the actual post i am only getting the content field https://monosnap.com/file/3sKJfDsbUyv1VXgZ68aEbhrDuZ6QuZ
Appreciate your fast response. I am hoping it is just something simple I am not doing π
cheers
Thank you – all appears to be working. Thank you for your fast response!