hallo Community,
hier geht es um die Frage, wie man Daten auf mehreren Seiten syncen kann?
Also konkret, wie man bei einem Einsatz von mehreren Seiten (also 2 bis 3) die eine Datensatz aus entweder WP-Job-Manager oder Paticipants-DB [vgl. unten auch die Links]) zur Anzeige bringen sollen, wie man diese Seiten am besten so miteinander verbindet, dass ein Dropdown-Menu es dann erlaubt, die Daten aus versch. sites einer WordPress-multisite auszuwählen und zur Anzeige zu biringen.
die hierbei eingesetzten Module:
(bin noch nicht 100% sicher welches der beiden ich nehmen werde)
a. wp-job-Manager:
vgl.: https://wordpress.org/support/plugin/wp-job-manager/
b. Participants-Database:
vgl. https://wordpress.org/plugins/participants-database/
auch - https://xnau.com/populate-a-form-dropdown-from-the-database/
Szenario: wenn auf einer site ich aus einem Dropdown-menu auswähle und damit die Abfrage einer anderen subsites job-listings erhalte. Zentral bei diesem Ansatz ist es, eine zentrale db zu haben in der alle jobs gespeichert sind
ich hätte dann insges. - sagen wir drei sites:
jobs_1.mysite.com
jobs_2.mysite.com
jobs_3.mysite.com
ist dies denn vorstellbar und umsetzbar - unter Zuhilfenahme der Multisite-Funktion mit dem Bau von den o.g. Subsites – Zentral hierbei die Frage: komme ich klar mit einer Datenbank bzw. einer Zentralen Datenbank für die WP-Job-Manager-Anwendung.
nebenbei bemerkt: Hier die Bauanleitung einer WordPress Multisite?
ZitatStep 1: Install WordPress. If i am building a Multisite network from-scratch, then i need to install WordPress.
Step 2: Back up the site. …
Step 3: Deactivate all active plugins. …
Step 4: Update wp-config.php. …
Step 5: Install Multisite in WordPress. …
Step 6: Enable the Network.
zurück zu dem Ansatz mehrere Seiten db-mässig "miteinander korrespondieren zu lassen"
Es ist zunächst wichtig, diese Korrespondenz bzw. den Zugriff auf die Zentrale DB seitenübergreifend herzustellen. Das ist etwas tricky aber ansonsten sicher machbar. Hier gibt es mehrere Dinge die wichtig sind - zu beachten sind.. Wenn die mehrere Seiten auf mehreren Severn gehostet sind - wird es schwierig - man müsste das z.B. dann mit Spezialloesungen wie REST API angehen. Das gute aber in meinem Fall: die Seiten sind auf einem Server gehostet. Mit einem Skript und unter Zuhilfenahme von wpdb sollte es möglich sein, auf eine separate bzw. spezielle Datenbank zu loggen und die Daten von ihr zu beziehen.
Syncen der DBs
Eine weitere Möglichkeit ist es eine Sync-Funktion zwischen den (sagen wir zwei ) Datenbanken herzustellen, damit die Datenbanken von den mehreren Installationen dieselben Daten haben - für die Ausgaben. Dieser Sync-Ansatz ist eine Möglichkeit, vor allen Dingen wenn die Seiten auf einem Account u. auf einem Server gehostet werden.
Drop-Down:
eine weitere technische Herausforderung ist die Frage, wie man die Daten dann in das dropdown-Menü bekommt. Doch dies sollte nicht extrem aufwändig sein. Roland, der Entwickler der PD-DB der Participants-DB dazu (vgl. unten mehr)
Worum es geht: die zentrale Frage:; also lautet: für wie komplziert bzw. wie einfach haltet ihr die Überlegung zu dem Thema Daten auf mehreren Seiten syncen?
Freue mich. von Euch zu hoeren.
Lin, :)
Anhang:
Roland, der Entwickler der PD-DB der Participants-DB zum Thema Drop-Down und die Darstellung bei Sync-Inha:
ZitatThis is much easier. If this is a Participants Database dropdown, I have published a tutorial that will help you get that done: Populate a Form Dropdown from the Database. If the dropdown is not in Participants Database, you’d need to use whatever methods are available in that context.
vgl. auch: https://xnau.com/populate-a-form-dropdown-from-the-database/
ZitatAlles anzeigenWhen the volunteer coordinator signs up, you will want to provide them with a dropdown selector that lists all of the volunteers. The only way to do that is to get the list of volunteers from the database and then use that to populate the dropdown.
The Query
To get our list of volunteers from the database, we need a query that gathers the information we need (in this case, their name) from the records that we know are from volunteers. Referring to the method in the Multiple Registration Forms article, we have a field in the form that is filled with the name of the page the form was on. This is how we will know whether the record was created by a volunteer or not. Let’s say the volunteer’s form is on a page named “volunteer-signup” and the coordinator’s form is on a page called “volunteer-coordinators.” To get one and not the other we need two statements.Here is our query:
SQLSELECT first_name,last_name FROM wp_participants_database WHERE form_type LIKE "%volunteer%" AND form_type NOT LIKE "%coordinator%"That will get us our list of names of all the volunteers. With WordPress, it’s best to use the $wpdb object for interacting with the database. To get an array of values, we use the $wpdb->get_col method like this:
PHP<?php global $wpdb; $values = $wpdb->get_col( ' SELECT first_name,last_name FROM `' . $wpdb->prefix . 'participants_database` WHERE form_type LIKE "%volunteer%" AND form_type NOT LIKE "%coordinator%" ' ); ?>
There is no user input here so we don’t need to sanitize the query. This will give us an array of objects, one for each record returned.Altering the Dropdown....(. und so weiter und so fort...)...vgl. auch: https://xnau.com/populate-a-form-dropdown-from-the-database/
Worum es geht: die zentrale Frage:; also lautet: für wie komplziert bzw. wie einfach haltet ihr die Überlegung zu dem Thema Daten auf mehreren Seiten syncen?
Freue mich, von Euch zu hoeren.
Lin :)