Hello friends,
In this video, I show how to change port the W3Schools webpage template "COMPANY" to mod harbour.
Best regards,
Otto
https://www.w3schools.com/boo.../bootstrap_theme_company.asp
https://mybergland.com/fwforum/startwithharbourino.mp4
W3Schools webpage template "COMPANY" to mod harbour
- Otto
- Posts: 6403
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 21 times
- Been thanked: 2 times
- Contact:
W3Schools webpage template "COMPANY" to mod harbour
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
Re: W3Schools webpage template "COMPANY" to mod harbour
dear friends,
I set out today to understand in detail what happens in this small piece of code ... but I quickly realized I would very much appreciate and need your help. please...
here is the link to the small website:
https://winhotel.space/submarine_newsletter_ruth/portfolio.prg
And I put the code at the end of this post.
_____________________________________________
questions I tried to google:
* why do you use "static" for hSLIDER and "local" for hCards
* what does dbf2hash do? (maybe this question is ridiculous to some...sorry...)
* what does hb_jsonEncode do?
* hSLIDER provides me with content of the data.dbf but I don´t get where in the code the connection between hSLIDER and data.dbf ist made...
* and my last question...good wikis for mod-harbour and harbour
Which link should I use?
Thank you very much and kind regards
Ruth
I set out today to understand in detail what happens in this small piece of code ... but I quickly realized I would very much appreciate and need your help. please...
here is the link to the small website:
https://winhotel.space/submarine_newsletter_ruth/portfolio.prg
And I put the code at the end of this post.
_____________________________________________
questions I tried to google:
* why do you use "static" for hSLIDER and "local" for hCards
* what does dbf2hash do? (maybe this question is ridiculous to some...sorry...)
* what does hb_jsonEncode do?
* hSLIDER provides me with content of the data.dbf but I don´t get where in the code the connection between hSLIDER and data.dbf ist made...
* and my last question...good wikis for mod-harbour and harbour
Which link should I use?
Thank you very much and kind regards
Ruth
Code: Select all | Expand
REQUEST DBFCDX
REQUEST DBFFPT
static hSLIDER := {=>}
function main
local hCards := {=>}
local cdbf_file := hb_GetEnv( "PRGPATH" ) + "/data/cards.DBF"
hCards := dbf2hash( cdbf_file )
TEMPLATE PARAMS hCards, hSLIDER
<!DOCTYPE html>
<html lang="en">
-> HEAD
<body>
<script>
var oSLIDER=<?prg return hb_jsonEncode( hSLIDER, .T. )?>;
var cKeySLIDER = 1;
var iSLIDER =1;
var nRecSLIDER = oSLIDER[ "RECREAD" ] ;
</script>
- Otto
- Posts: 6403
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 21 times
- Been thanked: 2 times
- Contact:
Re: W3Schools webpage template "COMPANY" to mod harbour
Dear Ruth,
please search your source code for
function dbf2hash.
This is your own function.
***
static and local is very similar to JS. If you declare a variable inside a function, then it is like local.
You only can access it inside the function in which you declared the variable.
static is similar to JS variables declared globally (outside any function) have Global Scope.
Static declaration in HARBOUR must be done before the main function.
With TEMPLATE PARAMS you pass the variables to HTML/JS part
***
hb_jsonenconde/hb_jsondecode
Turns a Harbour HASH into a JS jsonobject and vice versa
***
Please, if you post code here, use only code from the prg file after you have pressed "Publish" in Harbourino.
-> HEAD without the code does not help here.
The source code of HEAD is patched thanks to Harbourino into the release prg.
Here you have a list of help-files:
https://winhotel.space/modharbour/modharbouronline.prg
Best regards,
Otto
please search your source code for
function dbf2hash.
This is your own function.
***
static and local is very similar to JS. If you declare a variable inside a function, then it is like local.
You only can access it inside the function in which you declared the variable.
static is similar to JS variables declared globally (outside any function) have Global Scope.
Static declaration in HARBOUR must be done before the main function.
With TEMPLATE PARAMS you pass the variables to HTML/JS part
***
hb_jsonenconde/hb_jsondecode
Turns a Harbour HASH into a JS jsonobject and vice versa
***
Please, if you post code here, use only code from the prg file after you have pressed "Publish" in Harbourino.
-> HEAD without the code does not help here.
The source code of HEAD is patched thanks to Harbourino into the release prg.
Here you have a list of help-files:
https://winhotel.space/modharbour/modharbouronline.prg
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
Re: W3Schools webpage template "COMPANY" to mod harbour
Thank you very much!!!! Now everything is much clearer!!!
I read the whole code like a book from top to bottom...
does the prefix "hb_" indicate all the functions that come from "outside"...not my own?
thank you again, kind regards and a nice day to all of you...
I read the whole code like a book from top to bottom...
![Embarassed :oops:](./images/smilies/icon_redface.gif)
does the prefix "hb_" indicate all the functions that come from "outside"...not my own?
thank you again, kind regards and a nice day to all of you...
- Otto
- Posts: 6403
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 21 times
- Been thanked: 2 times
- Contact:
Re: W3Schools webpage template "COMPANY" to mod harbour
I think it is the abbreviation for harbour (hb).
But I have never looked it up.
But I have never looked it up.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
Re: W3Schools webpage template "COMPANY" to mod harbour
thanks again...![Smile :-)](./images/smilies/icon_smile.gif)
I can´t stop thinking about the dbf2hash ... I can remember working with SELECT * FROM ... is it something like that?
is there a way to extract what I need from a database and start working?
kind regards again...
![Smile :-)](./images/smilies/icon_smile.gif)
I can´t stop thinking about the dbf2hash ... I can remember working with SELECT * FROM ... is it something like that?
is there a way to extract what I need from a database and start working?
kind regards again...
- Otto
- Posts: 6403
- Joined: Fri Oct 07, 2005 7:07 pm
- Has thanked: 21 times
- Been thanked: 2 times
- Contact:
Re: W3Schools webpage template "COMPANY" to mod harbour
Ruth,
![Image](https://mybergland.com/fwforum/dbf2hash2.jpg)
You have included a function here that fills 2 HASHs.
The database is opened with USE().
Then you browse the database with
do while .not. eof()
skip
enddo
You then fill the local HASH
local hDBF_Recs := {=>}
and the hSLIDER (static) HASH.
The local HASH is returned as a return param.
return( hDBF_Recs )
hCards := dbf2hash( cdbf_file )
Here you call the function.
The locale HASH of the function dbf2hash() is assigned to your locale HASH hCards.
The HASH hSLIDER is only filled if the condition is met.
if TMPDBF_FILE->slider = "J"
The number of records read is stored here.
hDBF_Recs[ "RECREAD" ] := str( nDBF_RecRead + 1 )
hSLIDER[ "RECREAD" ] := str( nKeySLIDER + 1 )
You then need this in JS to display the data.
![Image](https://mybergland.com/fwforum/hcards.jpg)
Best regards,
Otto
![Image](https://mybergland.com/fwforum/dbf2hash2.jpg)
You have included a function here that fills 2 HASHs.
The database is opened with USE().
Then you browse the database with
do while .not. eof()
skip
enddo
You then fill the local HASH
local hDBF_Recs := {=>}
and the hSLIDER (static) HASH.
The local HASH is returned as a return param.
return( hDBF_Recs )
hCards := dbf2hash( cdbf_file )
Here you call the function.
The locale HASH of the function dbf2hash() is assigned to your locale HASH hCards.
The HASH hSLIDER is only filled if the condition is met.
if TMPDBF_FILE->slider = "J"
The number of records read is stored here.
hDBF_Recs[ "RECREAD" ] := str( nDBF_RecRead + 1 )
hSLIDER[ "RECREAD" ] := str( nKeySLIDER + 1 )
You then need this in JS to display the data.
![Image](https://mybergland.com/fwforum/hcards.jpg)
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
Re: W3Schools webpage template "COMPANY" to mod harbour
Again...thank you
I was able to put some <img> files directly from the database in here
https://winhotel.space/mh_bergland_bs5/pages/kulinarik.prg
![Image](https://winhotel.space/ruth/clip15.jpg)
now when you click on a photo it opens in full-format. this took me quite some time again ... but now I am happy and proud![Smile :)](./images/smilies/icon_smile.gif)
for
I had to escape the "double quote" character and wasn´t successful with
\' but found out that " worked instead.
kind regards to all of you again...
![Smile :)](./images/smilies/icon_smile.gif)
I was able to put some <img> files directly from the database in here
https://winhotel.space/mh_bergland_bs5/pages/kulinarik.prg
![Image](https://winhotel.space/ruth/clip15.jpg)
now when you click on a photo it opens in full-format. this took me quite some time again ... but now I am happy and proud
![Smile :)](./images/smilies/icon_smile.gif)
for
Code: Select all | Expand
document.write("data-bigpicture='{"gallery":"#home-gallery"}'") ;
I had to escape the "double quote" character and wasn´t successful with
\' but found out that " worked instead.
kind regards to all of you again...