From WORDPRESS to DBF-mod harbour

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!

From WORDPRESS to DBF-mod harbour

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

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 » Tue Sep 07, 2021 5:01 pm

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.
********************************************************************
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 Antonio Linares » Wed Sep 08, 2021 5:10 am

Dear Otto,

Excellent work, well done!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: From WORDPRESS to DBF-mod harbour

Postby Otto » Mon Sep 20, 2021 6:32 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 2 guests