FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index mod_harbour From WORDPRESS to DBF-mod harbour
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
From WORDPRESS to DBF-mod harbour
Posted: Tue Sep 07, 2021 07:02 AM
From WORDPRESS to DBF-mod harbour

We export from phpMyAdmin to json file. This looks something like this:




Then with a little HABOUR/FIVEWIN program we import the json file into a DBF. With 2 lines of source we get a hash in HARBOUR.





Code (fw): Select all Collapse
properties oft the object:
$post_id = -99; // negative ID, to avoid clash with a valid post
$post = new stdClass();
$post->ID = $post_id;
$post->post_author = 1;
$post->post_date = current_time( 'mysql' );
$post->post_date_gmt = current_time( 'mysql', 1 );
$post->post_title = 'Some title or other';
$post->post_content = 'Whatever you want here. Maybe some cat pictures....';
$post->post_status = 'publish';
$post->comment_status = 'closed';
$post->ping_status = 'closed';
$post->post_name = 'fake-page-' . rand( 1, 99999 ); // append random number to avoid clash
$post->post_type = 'page';
$post->filter = 'raw'; // important!







The WordPress blog I am importing started around the year 2000. Here is a screenshot from a post of 2005. Look how small the pictures have been.

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: From WORDPRESS to DBF-mod harbour
Posted: Mon Sep 20, 2021 06:56 AM
Good morning, now data comes from the dbf-file.







This is the source how the "Featured articles" are addressed.





Preprocessor substitutes |ckey| before inserting the whole source "FEATURED_ARTICLES_ITEM" into your prg file.
The advantage of patching is that you release a single source code. This is so important for debugging (F12) from the browser.



And to maintain, you have a well-organized code.
And you have pure HTML, javascript and mod harbour. No new syntax to learn!



Continue the discussion