Timeline Express Pro Modifications: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 14: | Line 14: | ||
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. | ||
=== "Swap" Table Data in the WordPress Database === | ==="Swap" Table Data in the WordPress Database=== | ||
*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 | ||
Line 51: | Line 51: | ||
UPDATE wp_posts INNER JOIN TT1 | UPDATE wp_posts INNER JOIN TT1 | ||
SET wp_posts.post_content = TT1.meta_value | SET wp_posts.post_content = TT1.meta_value | ||
WHERE | WHERE TT1.post_id = wp_posts.ID; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 58: | Line 58: | ||
UPDATE wp_postmeta INNER JOIN TT2 | UPDATE wp_postmeta INNER JOIN TT2 | ||
SET wp_postmeta.meta_value = TT2.post_content | SET wp_postmeta.meta_value = TT2.post_content | ||
WHERE | WHERE TT2.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = 'announcement_custom_excerpt'; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Editing of Excerpt Add-On PHP Code === | ===Editing of Excerpt Add-On PHP Code=== | ||
After hunting around in the PHP code for a couple of minutes I found the areas where I needed to make the change. The change was to have the Excerpt Add-On retrieve data from the post Table instead of the postmeta Table. Below is the original code from the ../wp-content/plugins/timeline-express-html-excerpt-add-on/timeline-express-html-exerpts-add-on.php File (with tabs and spacing removed);<syntaxhighlight lang="text"> | After hunting around in the PHP code for a couple of minutes I found the areas where I needed to make the change. The change was to have the Excerpt Add-On retrieve data from the post Table instead of the postmeta Table. Below is the original code from the ../wp-content/plugins/timeline-express-html-excerpt-add-on/timeline-express-html-exerpts-add-on.php File (with tabs and spacing removed);<syntaxhighlight lang="text"> | ||
public function replace_default_timeline_express_excerpt( $excerpt, $post_id ) { | public function replace_default_timeline_express_excerpt( $excerpt, $post_id ) { |