Timeline Express Pro Modifications: Difference between revisions

mNo edit summary
mNo edit summary
Line 11: Line 11:
<br />
<br />


=== The Fix(es) ===
===The Fix(es)===
The first thing that needed to be done was to swap everything in the "announcement" section with the content in the Excerpt Add-On section.  I wasn't about to do a copy past on that for several hundred entries.  The solution to that was to swap column data in two database tables with each other.  But as I read, mySQL (MariaDB) doesn't have that capability like other database servers do.  for mySQL, it has to be done in stages.  I read a bunch of stuff from people who were experts in SQL server.  For my purposes it was way to complex.  To stay within my abilities, I decided to create a couple of temporary tables and copy the data to them, and then copy from the temporary tables to the places I wanted to put the data.  To make things even easier, I used phpMyAdmin.
The first thing that needed to be done was to swap everything in the "announcement" section with the content in the Excerpt Add-On section.  I wasn't about to do a copy past on that for several hundred entries.  The solution to that was to swap column data in two database tables with each other.  But as I read, mySQL (MariaDB) doesn't have that capability like other database servers do.  for mySQL, it has to be done in stages.  I read a bunch of stuff from people who were experts in SQL server.  For my purposes it was way to complex.  To stay within my abilities, I decided to create a couple of temporary tables and copy the data to them, and then copy from the temporary tables to the places I wanted to put the data.  To make things even easier, I used phpMyAdmin.


* First, backup the database: Select Database in phpMyAdmin, Export Tab, use defaults, Go and save to a location
*First, backup the database: Select Database in phpMyAdmin, Export Tab, use defaults, Go and save to a location
* During the above step I noticed that the database had the incorrect collation defined, so I changed it to the WordPress recommended utf8mb4_unicode_ci setting: Select Database in phpMyAdmin, Operations Tab, Collation Section
*During the above step I noticed that the database had the incorrect collation defined, so I changed it to the WordPress recommended utf8mb4_unicode_ci setting: Select Database in phpMyAdmin, Operations Tab, Collation Section
* Create two temporary tables, TT1 and TT2 (as in Temporary Table 1 and 2): Select Database in phpMyAdmin, immediately under it select New, and create three columns with the following settings
*Create two temporary tables, TT1 and TT2 (as in Temporary Table 1 and 2): Select Database in phpMyAdmin, immediately under it select New, and create three columns with the following settings
** TT1 (duplicating the necessary columns from the WordPress postmeta table);
**TT1 (duplicating the necessary columns from the WordPress postmeta table);
*** Name: post_id, Type: bigint(20)
***Name: post_id, Type: bigint, Length/Values: 20
*** Name: meta_key, Type: varchar(255)
***Name: meta_key, Type: varchar, Length/Values: 255
*** Name: meta_value, Type: longtext
***Name: meta_value, Type: longtext, , Length/Values: Leave it Blank
** TT2 (duplicating the necessary columns from the WordPress posts table);
***Save it
*** Name: ID, Type: bigint(20)
***Create an Index on Column 1: Go, Index Choice: PRIMARY
*** Name: post_type, Type: varchar(20)
**TT2 (duplicating the necessary columns from the WordPress posts table);
*** Name: post_content, Type: longtext
***Name: ID, Type: bigint, Length/Values: 20
***Name: post_type, Type: varchar, Length/Values: 20
***Name: post_content, Type: longtext, Length/Values: Leave it Blank
***Save it
***Create an Index on Column 1: Go, Index Choice: PRIMARY
*Use a SQL statement to copy the data from the postmeta Table to TT1 Table: Select Database in phpMyAdmin, SQL Tab, Go, with the following SQL statement;
*<syntaxhighlight lang="text">
INSERT INTO TT1 (post_id, meta_key, meta_value)
SELECT post_id, meta_key, meta_value
FROM wp_postmeta
WHERE meta_key = 'announcement_custom_excerpt';
</syntaxhighlight>
 
* Use a SQL statement to copy the data from the posts Table to TT2 Table: Select Database in phpMyAdmin, SQL Tab, Go, with the following SQL statement;
* <syntaxhighlight lang="text">
INSERT INTO TT2(ID, post_content, post_type)
SELECT ID, post_content, post_type
FROM wp_posts
WHERE post_type = 'te_announcements';
</syntaxhighlight>The number of rows copied into TT1 and TT2 should be the same
* Use a SQL statement to copy the data from the TT1 Table to the posts Table: Select Database in phpMyAdmin, SQL Tab, Go, with the following SQL statement;
* <syntaxhighlight lang="text">
UPDATE wp_posts INNER JOIN TT1
SET wp_posts.post_content = TT1.meta_value
WHERE TEMPO.post_id = wp_posts.ID;
</syntaxhighlight>
* Use a SQL statement to copy the data from the TT2 Table to the postmeta Table: Select Database in phpMyAdmin, SQL Tab, Go, with the following SQL statement;
* <syntaxhighlight lang="text">
UPDATE wp_postmeta INNER JOIN TT2
SET wp_postmeta.meta_value = TT2.post_content
WHERE TEMPO2.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = 'announcement_custom_excerpt';
</syntaxhighlight>




OK, that solves the SEO issue because the sitemap now recognizes all the individual items and images because they also have their own individual URLs and "slugs".  But what was displayed to users was now the citations instead of the content I wanted to display.  That involved burrowing into the PHP code for the Add-On and making a small change.
OK, that solves the SEO issue because the sitemap now recognizes all the individual items and images because they also have their own individual URLs and "slugs".  But what was displayed to users was now the citations instead of the content I wanted to display.  That involved burrowing into the PHP code for the Add-On and making a small change.