publicdrum logo

Import Publicdrum data into your publishing process using a 'pseudo' web form

If you currently allow users to submit event data via a web form, you can easily import data from Publicdrum or anyone using our automatic calendars.

How to do it:

  1. Start by watching this 7 minute video - learn how it works and how to write the code.
  2. Make a copy of your current web form handler, comment out the section that reads from your current form and replace it with our cut and paste code (below).
  3. Map our variables to your current form variables.
  4. Use the sample data and test enviroment to debug your work (below).

Special cases:
We supply data to many outlets, our structure may not exactly match yours and missing information will have to be provided by the event editor. For instance:

Contact Warren Armstrong at info@publicdrum.org or 517 775-0777 with any questions or suggestions!

 


Appendix:

Sample data and test environment.

This technique works by putting hidden fields on our calendars and event pages. You can receive this data in the same way you process any form - reading and processing the data in the fields.

We have provided a sample form you can use to test your form processing code. It has the fields visible, live data and a submit button.

Sample form

This link will open a form with our standard structure and containing actual data. You can use it to
get the field names and to understand the structure. You can also test your application by providing a url and alter the event id to get different data.

To test your application, put your form processor path in the command line. When you Submit the form - you should ge able to read the posted fields.


Sample Code

PHP to read the form and assign to variables:

<?php
// php code to read the standard event data form

$EventName = $_POST['EventName'];
$startHour = $_POST['startHour'];
$startMinutes = $_POST['startMinutes'];
$startAP = $_POST['startAP'];
$startDate = $_POST['ESD'];
$EventStart = $_POST['EventStart'];
$endHour = $_POST['endHour'];
$endMinutes = $_POST['endMinutes'];
$endAP = $_POST['endAP'];
$EndDate = $_POST['EED'];
$EventEnd = $_POST['EventEnd'];
$EventTimeDesc = $_POST['EventTimeDesc'];
$EventReType = $_POST[EventReType];
$EventVenueName = $_POST['EventVenueName'];
$EventStreet = $_POST['EventStreet'];
$EventCity = $_POST['EventCity'];
$EventState = $_POST['EventState'];
$EventZip = $_POST['EventZip'];
$EventDesc = $_POST['EventDesc'];
$EventFree = $_POST['EventFree'];
$ac0 = $_POST['ac0'];
$ac1 = $_POST['ac1'];
$ac2 = $_POST['ac2'];
$ac3 = $_POST['ac3'];
$ac4 = $_POST['ac4'];
$ac5 = $_POST['ac5'];
$EventTickets = $_POST['EventTickets'];
$EventTags = $_POST['EventTags'];
$EventPhone = $_POST['EventPhone'];
$EventEmail = $_POST['EventEmail'];
$EventImageURL = $_POST['EventImageURL'];
$EventMp3URL = $_POST['EventMp3URL'];
$EventURL = $_POST['EventURL'];
$EventPrURL = $_POST['EventPrURL'];
$EventLat = $_POST['EventLat'];
$EventLng = $_POST['EventLng'];
$EventLastEdit = $_POST['EventLastEdit'];
$OrgID = $_POST['OrgID'];
$EventID = $_POST['EventID'];

/*
After reading the data you can map it into your data structure.
- For example, if your current form has a field "MyEventDescription", you can combine several of these variables
*/
$MyEventDescription = $EventDesc . " " . $EventTickets;
echo $MyEventDescription;
/*
Once you have mapped the variables - the rest of your code remains unchanged:
- Validate, clean and save as usual.
*/

?>

 

Do you work in other languages - submit your code and we'll add it here!

 

Call Warren at 517.775.0777 with questions or suggestions!

 

 

Copyright 2008 © SyndicateUs. Privacy | Terms of Service | Contact Us | FAQs | API |