From WORDPRESS to DBF-mod harbour

mod_harbour es un módulo para Apache que permite correr tus PRGs directamente en la web!!!

From WORDPRESS to DBF-mod harbour

Postby Otto » Tue Sep 07, 2021 7:02 am

From WORDPRESS to DBF-mod harbour

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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: From WORDPRESS to DBF-mod harbour

Postby Otto » Mon Sep 20, 2021 6:56 am

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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm


Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 3 guests