Update website automatically via database - database

So I have created a database for my church website that the admin can upload our current sermons easily and it update the website automatically based on what the date is.
Use Case:
Admin Uploads Sermon 3 months before it starts --> No Change on the website --> 3 Months pass and it’s the first Sunday that sermon is airing —> Website updates to show the sermon.
openarms.site down at the bottom is where I want it to be viewable, showing the previous 10ish sermons with the most current one being at the left.
I’ve successfully made the code to upload the sermons to the database but I am not sure where to start on the website updating it’s self. Does anyone have any ideas?

Depends on which language you're writing your website in. The basic idea is you need to have different views in your database and your website only serves the most current view and in the database the views are updated at regular intervals based on whatever update logic you have.

Related

Referencing Another App

What is the best way to reference another app in the visual query designer?
I am using the blog app and I created a second app to list the tags that are used in the main blog app. This way when the app goes to a detail page of a post, I can still have the tags listed on the website without the view changing automatically. I set up my blog tags app with a visual query that list all of the tags used in the main app. Everything was working fine in development.
The problem that I have run into is that when I move the app to a production site the AppId was different than the one I was currently using and development. Now, the tags app is showing an error and I am not able to get into the settings to change the app ID of the visual query to the proper one in order to get the information needed. Is there a better way that I should be handling this?
This sounds like the right way to do it - your main issues is getting into the admin-ui when the template you have shows an error.
I suggest that you quickly rename your current template (so it's not used till you fix the bug) and create an empty template with the original name. This way you can go to the normal settings.
Another option is to switch into dnn-edit-mode, and use the black-dnn buttons to get to app-admin.

Database search field database

I'm looking for a way to create a search box in wordpress, where visitors can search a number from the database. Is this possible? I have several package numbers in my database. I want to give my visitors the ability to search for their package number and request the information that comes with the number.
What you want to do can be done.
I suggest a different approach than using wp-exec. (I just looked at wp-exec website, and that plugin was created for WordPress 1.5, which means it hasn't been updated in about 5 years).
The content you want to display exists entirely outside of WordPress. I suggest you use a custom page template - see
http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates
In this case you would not use WordPress posts or pages or custom post types. On the custom page template you would write (or have written if you don't have the knowhow to do it yourself) PHP code to extract the info from the database and display it on a page.
For pages like that you would be using WordPress only as a container within which to display the results - they custom page would appear in the site Nav, The page of results would use the site's theme to display so it looks like the rest of the site.
But the code to display from the database would not use the WordPress loop. It would be PHP / MySQL data retrieval and display code.
I really doubt you will find a plugin that lets you display results from an external database, formatted the way you want them to appear. The reason is every external database is different, has different tables and table structures. And no two sites will want the external data visually displayed in the same way. So there is little generalization to encapsulate in a plugin as everyone wants it different.
I've created pages on some sites along the lines of what you want to do thus I know it can be done. But it requires writing custom code.

Keep content from database when updating database.

I have a website live on the web. I've been working on the re-design for the site. I duplicated the entire site and database and worked on a test site. Now the test site is ready to go live. However, the current live site has been up for the last few weeks and content has been added as usual. How do I upload my new look for the site, with the changes I've made in the test database but at the same time not overwrite any content changes made in the current live database that were made over the past few weeks?
I want to keep the site content in the database but overwrite any module or theme data with the data from the test database.
My site is built on drupal
Thanks!
1) Upload new theme - this will apply themes changes and keep content in the live DB
2) If you have added any new content types, blocks, fields etc to your dev site then install the features modules. This will allow you to export your new features to a module, and then you can add this module to the live site to import your new features.
See this post for further discussion on the topic.
I used https://drupal.org/project/data_export_import it seems to be working well.

Use of Views slowing down site

Not sure if I am correct or not but i found that my site nerdeky.com which is using a view to show latest nodes on front page is crashing because of the views process of loading all nodes at once.
I have a content type called "Nerdeky Info" which contains more than 500 posts. To show latest 12 posts on frontpage i created a view and applied pager for rest of the posts. It was working good untill i had 100 or 200 posts but now it is slow in loading and sometimes crashes. I have New Relic integrated with my server and i can see that whenever site crashes it reports that the view took most of the time to process php and database.
After some searching on forum i found that my view is currently loading all posts at once and showing nerdeky latest posts afterwards.
Please suggest how to make it light so that only latest posts load first.
Thanks
Bharat sharma

How to auto generate a webpage after user submits form

I am looking for some initial direction on this one because I cannot seem to find my way with it. Let me explain...
I am developing a website wherein a logged in site member (Joomla 1.6) can fill out a simple form and attach a pdf to be uploaded upon submission. The user then clicks the submit button and the page will refresh to a new and unique web page.
User Submits data on http://www.examplesite.com and then after submission a new web page is generated that is called http://www.examplesite.com/userSubmittedValue
This newly generated web page would come from a template that is specified by the administrator and, most important, it will display all of the information that the user submitted. Also, there would be a link to download the pdf they uploaded. The user could then view a list of all the pages they have created in this manner via their profile.
I have seen this all over, but I am at a loss for how to generate this. Any help is much appreciated.
This is not something you will be able to easily do or get a detailed answer for here. If you just wanted to do the submission form with a thank you page that shows the data submitted you could use any number of form wizard type extensions - http://extensions.joomla.org/extensions/contacts-and-feedback/forms
If you just needed a way for users to upload PDfs and have access to them you could use one of the file management extensions that offer front end upload features - http://extensions.joomla.org/extensions/directory-a-documentation/downloads
If the additional data that is being submitted is simply data related to the file - title, description, etc then one of the file download components should work fine for you. The choices are limited in 1.6 at this time though so you might have to go with 1.5 to get the extension that works best for your needs.
So this probably isn't the best way to do it if your using Joomla but it just might help.
I would use PHP and inside of you're directory have a file like "template.html". Then I would create some php to handle the task of....
Opening "template.html"
Finding and replacing the values that the user passed you
Save the "template.html" under a new name (userSubmittedValue.html)
Again, I never really use Joomla. If you were to try this I'd suggest checking out php's file system functions (http://us2.php.net/manual/en/ref.filesystem.php).
Hope this helps a bit.

Resources