FAQ database driven

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

FAQ database driven

Postby Otto » Tue Jul 21, 2020 2:56 pm

Hello,

The FAQ page is the 2nd most visited page that your potential customers go to after seeing your Home or Services pages.
For many people, FAQ pages are often the first page they go to after Home. The right questions and answers can be instrumental in advancing potential sales. The value FAQ pages bring to a website is well worth the effort in writing them.

Best regards,
Otto

https://winhotel.space/harbourino/htmlpublic/faq---database-driven.html
********************************************************************
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: FAQ database driven

Postby Otto » Fri Jul 24, 2020 8:49 am

Filter for FAQs

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: FAQ database driven

Postby Otto » Fri Jul 24, 2020 10:40 am

Hello,
The screenshot shows code with placeholders that are patched.
To use HARBOURINO makes sense if you prepare TEMPLATES.
Then you can develop standard tasks very fast.

In the code section is the pure mod harbour code.
Best regards,
Otto

Image





Code: Select all  Expand view  RUN


     cStatus="ready"  
   use ( hb_GetEnv( "PRGPATH" ) + "\data\faq.dbf" ) new
   do while .not. eof()
      if field->status = cStatus
         AADD( aRelationship_DBF, ( "REC" + "_" + ALLTRIM( STR( recno() ) ) + "_ID"  )  )
         if LEN( ALLTRIM( field->ID ) ) = 0
            hHash_DBF[ "REC" + "_" + ALLTRIM( STR( recno() ) ) +"_ID" ] = ALLTRIM( field->ID )
         else
            hHash_DBF[ "REC" + "_" + ALLTRIM( STR( recno() ) ) +"_ID" ] = ALLTRIM( CONVERTUMLAUTE (  field->ID  ) )
         endif
         
      AADD( aRelationship_DBF, ( "REC" + "_" + ALLTRIM( STR( recno() ) ) + "_QUESTION"  )  )
      if LEN( ALLTRIM( field->QUESTION ) ) = 0
         hHash_DBF[ "REC" + "_" + ALLTRIM( STR( recno() ) ) +"_QUESTION" ] = ALLTRIM( field->QUESTION )
      else
         hHash_DBF[ "REC" + "_" + ALLTRIM( STR( recno() ) ) +"_QUESTION" ] = ALLTRIM( CONVERTUMLAUTE (  field->QUESTION  ) )
      endif
     
      AADD( aRelationship_DBF, ( "REC" + "_" + ALLTRIM( STR( recno() ) ) + "_ANSWER"  )  )
      if LEN( ALLTRIM( field->ANSWER ) ) = 0
         hHash_DBF[ "REC" + "_" + ALLTRIM( STR( recno() ) ) +"_ANSWER" ] = ALLTRIM( field->ANSWER )
      else
         hHash_DBF[ "REC" + "_" + ALLTRIM( STR( recno() ) ) +"_ANSWER" ] = ALLTRIM( CONVERTUMLAUTE (  field->ANSWER  ) )
      endif
     
      AADD( aRelationship_DBF, ( "REC" + "_" + ALLTRIM( STR( recno() ) ) + "_STATUS"  )  )
      if LEN( ALLTRIM( field->STATUS ) ) = 0
         hHash_DBF[ "REC" + "_" + ALLTRIM( STR( recno() ) ) +"_STATUS" ] = ALLTRIM( field->STATUS )
      else
         hHash_DBF[ "REC" + "_" + ALLTRIM( STR( recno() ) ) +"_STATUS" ] = ALLTRIM( CONVERTUMLAUTE (  field->STATUS  ) )
      endif
     
      AADD( aRelationship_DBF, ( "REC" + "_" + ALLTRIM( STR( recno() ) ) + "_DATE"  )  )
      hHash_DBF[ "REC" + "_" + ALLTRIM( STR( recno() ) ) +"_DATE" ] = dtoc( field->DATE )  
     
      AADD( aRelationship_DBF, ( "REC" + "_" + ALLTRIM( STR( recno() ) ) + "_TEXT"  )  )
      if LEN( ALLTRIM( field->TEXT ) ) = 0
         hHash_DBF[ "REC" + "_" + ALLTRIM( STR( recno() ) ) +"_TEXT" ] = ALLTRIM( field->TEXT )
      else
         hHash_DBF[ "REC" + "_" + ALLTRIM( STR( recno() ) ) +"_TEXT" ] = ALLTRIM( CONVERTUMLAUTE (  field->TEXT  ) )
      endif
     
   endif  
   select faq
   skip
enddo
select faq
use

TEMPLATE PARAMS   hHash_DBF

 
********************************************************************
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 8 guests