Disqus Integration 2020-02-19
The intention is to retain backward compatibility with Disqus forums from my old pages and allow Disqus and Dissenter to be enabled independently on any page.
Rationalizing thumbnail links.
Without thinking I made my various clickable icons all the same arbitrary dimensions (and then let my software thumb-size them automatically). It would however be more convenient to adopt a standard width-to-height ratio.
Film cameras for instance are doing 1080p which has a 16/9 ratio, but I prefer something more vertical to click on, consistently against the left margin... easy to find again as I scan thru a page.
A standard 35mm stills camera produces 24/36 = 2/3 ratio in portrait orientation.
There is also the micro 4 thirds digital camera format, which is a little less elongated. I think it looks nicer for portraits such as avatars and since I actually have an Olympus camera, I make my thumbnails 120px wide by 160px tall (=3/4). What does it look like, straight out of the box? See adjacent, but can obviously be rescaled and typically floated left or right by the browser to suit a particular theme.
Many sites like Gravatar here, have standardized rectangular images.
I will use the extra height to put text in and I've rescaled it to be half it's original size.
Thus rather than embedding a legend as graphocs in the image it can be subject to different translations.
First I try it over the top of a background image.
Alas this has currently unresolved issues with locating my original picture as the additional path_info seems to get lost when doing background images.
An alternative idea is to use a z-index and place the text over the image.
The image dimensions themselves could determine the aspect ratio of the icon, but it makes it necessary for the browser to reform the page after the images have been loaded and I really prefer them all to just line up with the same sizes for potentially different image sources.
That just leaves esthetic choice to put text above or below and with or without border for my consistent ap-thumb macro (there is nothing to stop me hand coding the unusual cases, like the first one there).
I've adapted my 404_thumb.php script to set max dimension to 160. Which is double what I think I need for this particular theme, should be good for other themes and still not too big to impact performance. The macro does the one without borders there.
Note: I wasn't able to get transparency to work with formats like WebP so I will export my icons mostly in png format for now. I need to remember to specify the /thumb/ folder rather than default /image/ and also to include the result file type to make the appropriate auto-sizing 404 take effect.
Dissenter seems to identify each # location as separate url, so alas that means the comments you get depends on the specific id that got you to the page and you don't get all the comments of the page.
I've also seen a defect when ther are unusual characters such as apostrophes or spaces in the url, but there is no point trying to program round those as I want it to reflect what the actual dissenter plugin will do.
Dissenter records the page title tag (so I need to set that and will just use the current topic).
It looks like Dissenter uses the first image it can find, so I still need a plan for setting what it finds in line with the page displayed. That may also serve in generating rss feed (which I haven't even looked at yet).
Expiring Temporary Links
The idea was to only give access to sensitive documents thru this script, and expire the links after they are used. I found that symbolic links do store the time and date that the link was created (rather than that of the original file as with an actual link). I then discovered that hostinger servers won't do symbolic links. So if the symbolic link function fails I return the original document.
If the server doesn't allow symbolic links it's best to disable the php engine in the folders that must be accessed so that partial (include) scripts can't be executed outside this framework.
In the topic directories use the appropriate .htaccess file:
# hostinger doesn't allow symbolic links: need to access originals
php_flag engine off
# files only accessible to the main script in the http root folder
Deny from all