The board has been upgrade to the latest version. Please let me know of any problems.
Also, there is a high probability that the forum will move to a different host, but that will happen in 2018.
Thanks, Doug

[Solved] Insert alert to buy the book

Discuss using and your tips/tricks for BookCAT
Post Reply
User avatar
Alex Ivanovich
Posts: 292
Joined: Mon Sep 07, 2015 2:24 pm
Location: Russian - Italia

[Solved] Insert alert to buy the book

Post by Alex Ivanovich » Thu Mar 30, 2017 9:07 am

this code was created by Dave (LotsOCds ;), It is only a portion

Code: Select all

<xsl:if test="publishdate/@unformatted>concat(substring(/data/@unformatteddate,1,6),'00') and dateacquired=''">
I wanted him to explain the code on the date :roll:

especially this part

Code: Select all

1,6),'00'
thanky
Last edited by Alex Ivanovich on Thu Apr 13, 2017 5:51 pm, edited 1 time in total.

User avatar
LotsOCds
Posts: 177
Joined: Thu Aug 20, 2015 4:23 am
Location: California, USA

Re: Insert alert to buy the book

Post by LotsOCds » Sat Apr 01, 2017 7:43 pm

This code shows the alert whenever the dateacquired is blank AND the publishdate is either "in the present month" or "in the future". We do this by replacing the number for the present day of the month with "00" then see if the publishdate is greater.
Cheers,
Dave

User avatar
Alex Ivanovich
Posts: 292
Joined: Mon Sep 07, 2015 2:24 pm
Location: Russian - Italia

Re: Insert alert to buy the book

Post by Alex Ivanovich » Mon Apr 03, 2017 8:13 am

hello Dave
sorry for the late response
Yes,
the function of the code know,
I had done to you the request to create it

I wanted to know how to understand this piece of code :roll:

Code: Select all

1,6),'00'
1,6 what is it?
month? day? :roll:

00
empty? :roll:

because 'I ask this?
if one day I would change the warning, take it one week, two months, or a year
I need to know what to enter in the code

thanks

User avatar
LotsOCds
Posts: 177
Joined: Thu Aug 20, 2015 4:23 am
Location: California, USA

Re: Insert alert to buy the book

Post by LotsOCds » Tue Apr 04, 2017 4:38 am

Example:
/data/@unformatteddate = "20170331"
publishdate/@unformatted = "20170315"

Code: Select all

<xsl:if test="publishdate/@unformatted>concat(substring(/data/@unformatteddate,1,6),'00') and dateacquired=''">
"The substring function returns the substring of the first argument starting at the position specified in the second argument with length specified in the third argument."
substring(/data/@unformatteddate,1,6) = substring("20170331",1,6) = "201703"

"The concat function returns the concatenation of its arguments."
concat(substring(/data/@unformatteddate,1,6),'00') = concat("201703","00") = "20170300"

publishdate/@unformatted>concat(substring(/data/@unformatteddate,1,6),'00') = "20170315">"20170300" = True
Cheers,
Dave

User avatar
Alex Ivanovich
Posts: 292
Joined: Mon Sep 07, 2015 2:24 pm
Location: Russian - Italia

Re: Insert alert to buy the book

Post by Alex Ivanovich » Tue Apr 04, 2017 6:46 am

thanks for the explanation Dave ;)

Post Reply