Wordpress - CRUD operation from the front end - wordpress

I'm in a bit of crux here. I have this application designed that basically allows users to enter info, create an entry, etc. etc. all the usual CRUD operations from the front end only. No user should ever have to mess around with the admin page.
When this was designed, I was thinking of using the standard way of just using JavaScript to grab all the necessary info, put it into a JSON object, and send that back to the SQL database.
However, there are a few issues with this. I'm not sure how to hook up javascript code to a button in wordpress that will fetch the entered info and upload this to wordpress SQL database, and then later retrieve this information.
I've seen lots of plugins, for instance, wpdataaccess, which is create in terms of creating an SQL database and such, but it doesn't really have much functionality for a customizable CRUD front-end. There are shortcodes, which are about the closest that you can come to this.
But ideally I'd like to somehow just have a button with JavaScript code that says like ok grab the info from each of the fields and upload it to the SQL database.
Is this only possible with a custom-coded plugin? Or do plugins for this already exist? Or do I even need a plugin?
Really any help would be appreciated here.
Also, you're probably wondering why I'm using wordpress... I don't really have an option here - I've got a raspberry pi OS that was built on top of WordPress so I sort of have to stick with it.
Thank you so much

I was able to find a solution to this. Use the plugin gravity forms to have users enter their data. Then, you can display the data back with another plugin, gravity view.

Related

Altering forms from Silverstripe CMS

I'm a beginner to silverstripe and am happy for someone to just point to a relevant section of the docs if they know where I should read. I just haven't been able to find very good instruction on this.
So I have created an Enquiry form for a site I'm building, and have:
/template/Layout/EnquiryPage.ss
/mysite/code/EnquiryPage.php
/mysite/code/EnquirySubmission.php
All are working well, users can upload enquirers and they are stored in the database.
What I want however is, as an admin, to be able to see/edit/delete these forms from within a tab in the CMS. What do I need to know about to be able to do this?
Thanks
Sounds like you want a ModelAdmin.
Pro tip: Don't forget to set your canEdit(), canDelete(), etc. permission methods on your DataObject.

Silverstripe URL Mapping

I'm trying to understand how URL Mapping works. I've gone through numerous pages, but I can't seem to wrap my head around what I'm trying to do.
Its really simple, I use DataObjects as pages approach and I have a member extension written to the member class. And I have the typical actions, show, edit, add.
So if I go to www.mywebsite.com/members/show/1 I can see the first user. If I change show to edit, I can edit the first user. Now if I go to www.mywebsite.com/members/add I can create a new user. This is working all as expected due to the functionality I created in the add method.
My problem is in the fact that when you go any website, you don't register to the website by going to members/add, you register by going to website.com/Register or something similar. From code management perspective, it is a lot easier for me to leave the code the way it is now. I don't want to have to create a Register page and move the code there, instead I am trying to figure out if it is possible to go to www.mywebsite.com/Register and have it load www.mywebsite.com/members/add. I am not talking about a redirect link that would update the url, I want users to still see Register in the url and not see /members/add.
Vice versa, if users were to go to www.mywebsite.com/members/add I want the link to update to Register or say page not found.
Is this possible with Silverstripe Framework?
I am not 100% sure, but I believe this is called URL Masking.
This is very possible, firstly I'd advise that you look over...
silverstripe-memberprofiles
...because even if you dont' want to use an existing module I'm sure there would be useful information. There is a great example of "pure" routing (i.e. silverstripe no cms) that leads on to "nested" routes - which is what I think you are asking for, so I highly recommend reading the slides below and then the created todo app
silverstripe-framework-building-without-the-cms
todo app source

Post rating system on Wordpress Heroku blog

I am trying to install on my blog a system that allow post rating and add in the sidebar the top ten of most rated post...
For this i am trying to use much cummon plugins, such as:
contestant-rating, post-ratings, buddypress-rate-forum-posts, rate-my-whatever
also this:
http://wordpress.org/extend/plugins/wp-postratings/
that looks to be better of all...
But nothing they won't work correctly...it seems to have problem with PostgresSQL DB...
Do you know this issue? if yes, have a solution?
Wordpress is done for the MySQL initially. There's an extension for using PostgreSQL with it, and it even works (we're using it for small blog).
Unfortunately, many plugins are designed to query database directly, not via the Wordpress layer. If this is the case, then you have either to modify such plugin, or look for something else.
There're some movements towards support of more databases, but it is work in progress.

Goal: Is it possible to integrate an Asp.Net website with Joomla CMS

I have an asp.net application which is purely build using C#, CSS, Javascript. Now i need to integrate my application with joomla cms.
**Is it possible to integrate an Asp.Net website with Joomla CMS**
Any help would be deeply appreciated.
Yes it is possible, and depending on what you are trying to "integrate" it might be fairly easy to do. First, you will need to get ChronoForms and ChronoConnectivity. Without having any more details here is what you would need to do -
Put the Joomla DB in the same database. By default Joomla uses the prefix jos_ for its database tables so this should not pose any issues. This will make it easy to access the tables of your application within Joomla.
Next you will need to create a form that has a field for each corresponding field in the table you want to edit. You will need one form for each table.
Using ChronoConnectivity you then associate the form with the table in the database.
This is pretty basic but it will give you the ability to edit any table in the same database that Joomla is installed in. You may have to get a little trickier to make it work well, but you can insert additional code in both ChoronForms and ChronoConnectivity as needed.
That would probably be the fastest and easiest way to do a simple integration.

Where is the best place to put a DB query in drupal?

I have a few forms who's data needs to be written to the main database in their own tables. Just simple name-email collection forms, that are part of regular pages in drupal. I suspect the right way to do this would be to write a module that would have the query in a function, but this is just a guess. I've never written a module before, and don't know how the form would be processed that way.
It's also a guess that to perform the db query within a node would be insecure?
The only other idea I have would be to use a php file on the server to do the form processing, with the db query written there, but that seems very non-drupal, as far as I can tell.
How to??
http://drupal.org/node/508 is Drupal's info on module development
You'll be wanting to use the function "db_query()"
You can use Drupal's built in methods to build forms though that will save the data for you. Have a look at the module developers guide though and you should be able to figure it out. Module development sounds intimidating but it's not as hectic as it seems once you actually know what's going on with Drupal (hence, read the guide).
Have you checked what's already out there? Webform may be able to solve your needs without any custom code.
Also, I highly recommend the book Pro Drupal Development if you want to learn more about Drupal and basic module development.
I'd second the Webform module. Create a really simple webform with name and email (results can be emailed or stored automatically in the DB, and can be exported easily in several formats). Then check out the Webform Block module to put that webform in a block and place wherever you need it on your site. No custom coding required!
Here is an excerpt from the Webform Block project page:
Allows embedding a webform node into a block which can be positioned in any block region (theme space permitting).
Handles redirecting back to the current page on validation errors.
A good use for this is to add a site wide contact form inline on your pages, such as in the footer or sidebar.
Multiple webforms can appear on the same page. The contents of the block is simply a node, so theme work can be done in the node-webform.tpl.php file as usual.

Resources