Page 1 of 1

From WORDPRESS to DBF-mod harbour

PostPosted: Tue Sep 07, 2021 7:03 am
by Otto
We export from phpMyAdmin to json file. This looks something like this:

Image


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.



Image

Code: Select all  Expand view

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!



Image


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.

Image

Re: From WORDPRESS to DBF-mod harbour

PostPosted: Tue Sep 07, 2021 5:01 pm
by Otto
https://www.modharbour.club/mh_blog/page-blog.prg

I exported a WordPress blog and an old ASP blog.
Now the raw data is online in a DBF-file.
Next I have to design the web page and program the functionality.

Re: From WORDPRESS to DBF-mod harbour

PostPosted: Wed Sep 08, 2021 5:10 am
by Antonio Linares
Dear Otto,

Excellent work, well done!

Re: From WORDPRESS to DBF-mod harbour

PostPosted: Mon Sep 20, 2021 6:32 am
by Otto
Good morning, now data comes from the dbf-file.

Image

Image

Image

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

Image

Image

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.

Image

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



Image