Software development, photography, jokes, ....

Sites by me

 
tas-logoTransportation Administration System
snoezelkussen-logo-kleinstSnoezelen Pillows for Dementia
ikzoekeenbegeleider-logoBegeleiders voor gehandicapten
Laat uw hond het jaarlijkse vuurwerk overwinnen
Betuweroute en Kunst
logo 50x50Hey Vos! Je eigen naam@vos.net emailadres?
Kunst in huis? Nicole Karrèr maakt echt bijzonder mooie dingen
nettylogo2Kunst in huis? Netty Franssen maakt ook bijzonder mooie dingen
Professionele opvang bij Gastouderbureau
Kind-Zijn
Salarisadministratie en belastingadvies bij
De Zaak Loont
Zutphense Bomenstichting

Hosting Favorites

 
ANU Internet Services
XelMedia .internet services
register.com
GoDaddy.com

Blogroll

 
Bomenstichting
MacFreak
Google Translate
PHP
MySQL
jQuery
jQuery UI
codecademy
YourHead Stacks API
Favicon Generator. For real.
Check HTTPS problems



Categories

Archives

Marc's Place


 

The Blogspot Stack 1.1.4 for Stacks with RapidWeaver

 Permalink


Version 1.1.4 is out with the following changes:
Version 1.1.4
Released on 27 feb 2018.
  • Known issues with deprecated, removed and changed PHP calls from PHP v5.4 through v7.1 : fixed
  • Some other bugs fixed.
  • Added a checkbox 'Display errors on', which shows possible PHP warnings. Use it on your local machine and on your live site and then please report any warnings and errors you see (Deprecated: , Warning:, Notice:, Fatal error:), to me, with screen-shots. Then switch it of again.
  • Added YEAR-only option to archives. When selected, archive-links are shown as 1 link per year, and when 'Show archive count' is checked, with the number of posts per year.
  • Removed 'Show author' checkbox - you can swicth it on or off in the 'Alternate ordering'-settings.
  • Added the option to leave out blogpost-sections inside 'Alternate ordering'. If you don't want a certain section in your blogposts, check 'Alternate ordering' and choose the 'blank' option for that section.
  • Added the RSS feed link as a stack. Instead of being always on top of the blog, you can now place it anywhere you prefer, or use this code snippet: <?php renderRSSlink(); ?>
  • Included FontAwesome via Stacks API.
  • Cosmetic changes.
  • If you purchased this stack, you can re-download the installer via your Paddle account.
    If not, you can read more about it here .
     Comments

    The Blogspot Stack 1.1.3 for Stacks with RapidWeaver

     Permalink


    Version 1.1.3 is out with the following changes:
    Version 1.1.2
    Released on 23 feb 2018.
    Bug fixed when viewing a permalink.
    Permalinks now have the Google SEO name added to their URLs.
    Version 1.1.3
    Released on 23 feb 2018.
    You may now also enter the complete domain, like myblog.blogspot.nl, if you feel more comfortable about it.
    Domain check: if the domain you entered, doesn't exist, an error is displayed at the top of the page. In Preview and real-time mode.
    Some PHP4 code removed.
    Fixed E_STRICT and E_DEPRECATED errors. Not by simply switching error-reporting off, but really fixing the code!
    If you purchased this stack, you can re-download the installer via your Paddle account.
    If not, you can read more about it here .
     Comments

    The Blogspot Stack 1.1.1 for Stacks with RapidWeaver

     Permalink


    Version 1.1.1 is out with the following changes:
    Version 1.1.0
    Released on 21 feb 2018.
    Added 'In blog-entry footer (default)' to the Interblog-settings.
    Version 1.1.1
    Released on 22 feb 2018.
    Bug fixed in XML parser.
    Code improvements.
    If you purchased this stack, you can re-download the installer via your Paddle account.
    If not, you can read more about it here .

    After installing the update, you have to mark the page as changed and re-publish it, so the updated code files get uploaded to your server:



     Comments

    The Blogspot Stack for Stacks with RapidWeaver

     Permalink


    As a replacement for the old RapidBlog from Loghound , I created a replacement, named Blogspot.

    Although RapidBlog was a page-plugin for Realmac's RapidWeaver , my replacement is a stack, for use with YourHead's Stacks-plugin .

    Read all about it here

    The advantage now, is that:
    • You don't have to add new posts inside RapidWeaver. Blogger is much better for that purpose.
    • It's mobile-friendly
    • By using Stacks, you can place a Blogger-blog anywhere in the content-area of the page.
    • It's fast
    • No usernames and passwords required to login to Blogger.
    • Blogspot.stack displays any public accessible Blogspot-domain.

     Comments

    Copy DOM content to the clipboard with pure Javascript

     Permalink
    Of all the tips on the internet on how to copy data from a DOM element to the clipboard, I compiled my own function(s).

    The examples below are to copy the 'href'-part of  a link to an RSS feed to the clipboard.

    1. By class name, use the first found element
    function copyToClipboardCN(element, attr) {
    x = document.getElementsByClassName(element);
    if(x !== undefined && x !== null && x[0] !== undefined) {
    var textarea = document.createElement("textarea");
    document.body.appendChild(textarea);
    textarea.value = x[0][attr];
    textarea.select();
    var status = document.execCommand('copy');
    textarea.remove();
    }
    }

    2. By id
    function copyToClipboardID(element, attr) {
    x = document.getElementById(element);
    if(x !== undefined && x !== null) {
    var textarea = document.createElement("textarea");
    document.body.appendChild(textarea);
    textarea.value = x[attr];
    textarea.select();
    var status = document.execCommand('copy');
    textarea.remove();
    }
    }

    RSS feed link example with a class and an ID, using FontAwesome icons :

    <a class="blog-rss-link" href="https://macvos.blogspot.com/feeds/posts/default" rel="alternate" target="_blank" title="RSS Feed" type="application/rss+xml"><i class="fa fa-rss"> RSS Feed <i class="fa fa-copy" onclick="copyToClipboardCN('blog-rss-link', 'href')" style="cursor: pointer;" title="Copy RSS link to clipboard">

    <a id="blog-rss-link" href="https://macvos.blogspot.com/feeds/posts/default" rel="alternate" target="_blank" title="RSS Feed" type="application/rss+xml"><i class="fa fa-rss"> RSS Feed <i class="fa fa-copy" onclick="copyToClipboardID('blog-rss-link', 'href')" style="cursor: pointer;" title="Copy RSS link to clipboard">

    I have thought about combining the two functions into one, but i find that dangerous. In case you don't, here it is:
    function copyToClipboard(element, attr) {
    var x = document.getElementById(element);
    if(x === undefined || x === null) {
    x = document.getElementsByClassName(element);
    if(x !== undefined && x !== null && x[0] !== undefined) {
    x = x[0];
    }
    else {
    x = undefined;
    }
    }
    if(x !== undefined) {
    var textarea = document.createElement("textarea");
    document.body.appendChild(textarea);
    textarea.value = x[attr];
    textarea.select();
    var status = document.execCommand('copy');
    textarea.remove();
    }
    }
     Comments

    [Repair] MySQL Upgrade on Mac OS X

     Permalink
    Some time ago I did a MySQL upgrade without thinking ... that was not funny. So I retraced what I did to get the new version up and running and wrote it down as a sequence of steps to follow, when I need to upgrade to the next higher version.

    I published these steps on the page [Repair] MySQL Upgrade (Mac OS X) , so they might be of help to you too.
     Comments

    Add or Subtract Business Days in Javascript, PHP and Lasso

     Permalink
    I was lately looking for a working version of a function to add and/or subtract business days. The scripts and code I found via Google somehow did not produce the correct results all the time - and I do not mean the loops that simply add a day and check for weekends. Read more . . .
     
     Comments

    Apache vhost sort order on CentOS

     Permalink
    I’ve written a page on how to control the order of Apache vhosts [on CentOS]. Just for reference.
     
     Comments

    Restrict Lasso AJAX-file calls to the intended web page

     Permalink
    Suppose you have a nice setup where a page interacts with the server via AJAX-calls and executes a Lasso file on the server to get some data. You don't want this file to be called directly via the URL-bar in a web browser, or via other self-made web pages by others who try to access it via a copy of your page. Anybody can see which AJAX-files your page is calling, so for some it is always a challenge to execute them outside the normal webpage to see what data will come up. Might be of interest! So you want to prevent that, somehow.

    There is a Lasso-tag called referrer_url, which returns a string containing the URL that requested your AJAX-page. If you look into this string for a domain name or a path that only you have, you can block execution if the requestor is not coming from your server. When a page is called directly in the browser, the referrer_url is always an empty string. Which is logical, since the page was not referred to by another page.

    Suppose I have a page mypage.html with a jQuery auto-complete implementation in it. This auto-complete can of course be used by more than one page and you do not want people to try it out in other ways.

    ...
    ...
    <input type="text" id="inp1" size="25"><span id="desc1"></span>
    ...
    ...
    <script>
    $(document).ready(function() {
       $("#inp1").autocomplete({minLength:2, source: "ajax.lasso?p1=a&p2=b", select: function(e,u) { $("#inp1").val(u.item.value); $("#desc1").html((u.item.label).replace("(" + u.item.value + ")", "")); return false; } });
    });
    </script>


    Simple protection:
    [
    if (referrer_url >> '/mypage.html' || referrer_url >> '/myotherpage.html');
    ...
    ...
    /if;
    ]


    Better protection:
    [
    if (string(referrer_url)->beginswith('http://my.domain.com/') &&
       (referrer_url >> '/mypage.html' || referrer_url >> '/myotherpage.html'));
    ...
    ...
    /if;
    ]


    So this gives you some protection from just try something-users. Add a login-system, which restricts the number of users that might want to hack your pages - you can trace their actions on your site. In that case, add a check if the user is logged in. You must execute your complete login-sequence in your AJAX-pages too, as with 'normal' pages, since the xhttprequest is a normal HTTP request and thus the browser sends the same HTTP-headers and cookies, etc.. to your AJAX-page.

    More protection:
    [
    if (referrer_url >> '/mypage.html' || referrer_url >> '/myotherpage.html');
       var('loggedIn = false');

       include('checkuser.lasso');

       if($loggedIn);
          ...
          ...
       /if;
    /if;
    ]


    Even better protection:
    [
    if (string(referrer_url)->beginswith('http://my.domain.com/') &&
       (referrer_url >> '/mypage.html' || referrer_url >> '/myotherpage.html'));
       var('loggedIn = false');

       include('checkuser.lasso');

       if($loggedIn);
          ...
          ...
       /if;
    /if;
    ]


    But, as with everything web-related, nothing can be trusted.
     
     Comments

    'Transfer services from server to server' mind map

     Permalink
    Using mind maps to follow your thoughts and track your findings is really a superb experience, every time again. And especially MindMeister, because it is 'in the cloud', i.e. web-based and can be accessed from anywhere and almost anything.

    Every one of my personal projects goes into MindMeister if it involves more than just a few scribbles. In this mind map, I have noted all steps I must take, with all peculiarities that arise in the process, to transfer web sites and services from one server to another, in this case from a virtual CentOS server to a co-located MacMini Server from 2011. Mind you, the MacMini Server is no toy anymore - it is blazing fast!

    I find this mind map quite interesting and since I am not the only one in the world doing stuff like this, I thought I'd share it so you, reader, might find the information in it somehow useful.

    to_MacMINIthumb
     Comments

    Virtual host order on Mac OS X Server

     Permalink
    I am in the process of converting my website forwarding setup to actual host names (A-records). I was quite reluctant to do this at first, because I could not oversee the consequences and googling didn't reassure me either. But on the LDC09, I talked to Chris who kindly explained to me how easy and unproblematic this actually is. Being a sceptic, I did not start by converting all entries at once, but I do convert one entry per day - when it succeeds.

    The first one went wrong already because of my logical thinking as a programmer. I pointed the subdomain name to our Mac OS 10.4 server and setup the site there, putting the default (*) at the bottom. Hey, where is a catch-all entry for!? It belongs at the end, just like with a if/else/end - the last 'else' is the catch-all. But from that moment on, every site landed on my newly created domain, so I quickly swapped the two site entries so that the catch-all was the first one again. Now it worked.

    So I made a whole plan : setup a subdomain on one afternoon and check if it works the next morning. This way I set some others up on this 10.4 server and they all work.

    Then comes the day I needed to setup the same construct on a Mac OS 10.5 Server. So I deleted the website forwarding entry, created the A-record, created the site on the OS X server, leaving the catch-all at the top and waited until the next morning. The domain name worked all right, but landed on /library/webserver/documents/ (the www-root) instead of the path I put into the site. I have been struggling for two days with this 10.5 server. I checked and double checked, changed the site's path, etc.. Nothing worked, it kept landing on the webroot. And today I thought, what if I swap the site entries and put the default (*) at the bottom (as I did at first on the 10.4 server) and ... it worked! I tested the other sites which have no domain name yet (website forwarding) and they all work ok.

    So the order for site entries on MacOS 10.4 Server differs from MacOS 10.5 Server. You can see that in the
    sites folder inside the Apache folder (/etc/httpd/ on 10.4 and /etc/apache2/ on 10.5). Sites are loaded by including sites/*.conf and the order is determined by the name of the conf-files (10.5 example):

    -rw-r--r-- 1 root wheel 1659 Nov 1 17:12 sites/0000_any_80_my.site.com.conf
    -rw-r--r-- 1 root wheel 1857 Nov 1 17:12 sites/0001_any_80_default.conf
    -rw-r--r-- 1 root wheel 566 Nov 1 17:12 sites/virtual_host_global.conf


    So it seems on 10.5 the catch-all sites are loaded last.
     Comments

    At the Lasso Developer Conference 2009

     Permalink
    LDC09-2009-10-5-22-17

    From october 1 thru 4, the Lasso Developer Conference 2009 was held in Amsterdam. For me, this was the first time because a) it was in Amsterdam and b) Lasso 9 would be introduced and c) at last I would meet quite a few fellow Lasso-ers in real life.
    There were some round-tables and workshops presented by Lasso-ers themselves, where some interesting topics were discussed and great solutions to returning questions were offered.
    LassoSoft picked a real cool location: Spaces at the Herengracht. You can see some photo's of it here.

    It was great. Thanks Lassosoft and everyone for this opportunity!

    DSCF0114-2009-10-5-22-17.JPG

    LDC09 Video's :
    YouTube - LassoSoft's channel

    Here are some links to LDC09 material :
    LassoTech
    At_begin URL-handling and REST
    Version Control Systems
    L-Migrator presentation
    itPage presentation
    Lfor presentation
    Encoding and Character-sets
    File permissions
    jquery Week calendar

    Check out the lively Lasso community at LassoTalk
    And Brian's blog-post
     Comments
    © 1997- Marc Vos (and others)   -   Privacy Statement   -    Contact Me