Make use of $quicklinksnum for better display behaviour

Implementing mcolliver’s code from Issue #43