Build Info for News Page and Download Counters
Reminders to self on how to contruct these items
Building the publishable Review files
Because we have printing on the inside cover in 2017, and Lulu only
does a single-sided cover, the hi-res file for Lulu comprises all the
pages. There is a separate wrap-around cover.
- Low-resolution file for viewing on screen or for home-printing -
review/br16-eBook-noBleed-allPages.pdf
- High-resolution file for professional printing -
review/br16-hiRes-noBleed-allPages-LuluJobOptions.pdf
- Single-piece wsap-around cover (not on web site) -
br15-hiRes-fullBleed-Cover-w5033-h3583-c5.jpg, made from
br16-hiRes-noBleed-OutsideCover.pdf
File construction as follows...
- For ebook and hi-res files, simply combine pages as for C&KS. See
BCRA Review folder in Cloud
- For Lulu file, REPRINT the PDF to PDF using Lulu joboptions.
- Cover has to be a specific size of JPG. Begin by starting a new
publication at Lulu. Lulu will report the size of JPG required. For details on
how to assemble it, see readme notes in BCRA Review folder in Cloud
Download Counter for News and Bookshop pages
The download counter has been modified to combat the AJAX problem,
whereby some browsers abort an ajax request if the page is defocussed. The
salient points are...
- In the HEAD of any page with counters, the correct sequence of PHP
and JS files must be included; and the style sheet.
- The new code requires the "debug" element in which to store variables
(easier to debug than using cookies). This uses visibility:hidden; position:
absolute, rather than display:none, as some older browsers might not
update tags otherwise.
- The click-counter has now been separated from the URL-follower. The
<A> tag needs the MOUSEDOWN action, as well as the ONCLICK action.
- If the argument to countClicks() does not exist it will
automatically be added to the database
- Spans for displaying downloads must have an ID that matches the
countClicks() argument in the <A> tag
- the ID in the countClicks() argument must be in format
[B_]<span id>:<description>. The optional [B_] is used on the
Bibliograph pages, to help to filter the lines in setCounts().
- For the Bookshop pages, the <description> field is
generated automatically from the URL. To make the comment clearer the URL can
begin with a comment string, e.g. http://some_comment@bcra.org.uk...
etc, because browsers will treat that as a Remote User field and ignore
it.
Fixes to do
The JS error handler for absence of theclick() method should,
ideally, be in a pop-up box so that it can be pasted by the user.
possible future fix
No guard against multpile clicking on biblio pages (see below) as there
now is with countClicks() - possible future
fix
Additional notes for Biblio pages
The above scheme cannot be used with the Biblio pages because they
require a login and so, if the countClick() function was placed in the
<A> tag for the download, it would execute twice if the user was not
logged in (because the first click is diverted to the login routines). so,
instead of executing countClicks() in JS with AJAX, it is simpler to
execute it from the "downloads" routines, in PHP. This means it can access the
database directly, instead of via AJAX , so it is actually simpler.
However: there is then no guard against multpile clicking as there now
is with countClicks() - possible future
fix
Some spin-offs from this are: a) the biblio index.html pages do not need
to include the JS ajax_referrals file and b) the <span> items that
hold the ajax variables do not need to be present on the page.
Further Reading
See the ajax listener file
David Gibson 2-nov-2017