Server Frontend - AttiliaTheHun/Songbook-Manager GitHub Wiki

Server frontend

The server in default configuration features two pages that are browsable through the HTTP (web browser). It also has several custom error pages.

homepage.php

The root directory index and the server landing page. Under the default layout, this page contains a logo with the title, a "Browse songbook" button, links to downloadable PDF files, license notices and SongbookManager footer with low-profile advertisement.

You can edit this file as you would any other HTML file, but be careful not to interfere with any PHP functions within the file. You may want to translate the Export files links. It is possible to disable the homepage in server settings. Source code

pageview.php

This is a PHP script file that generates page of the songbook (the feature we call An online preview). We do not recommend touching this one. However, you may edit the template that is located under /resources/templates/pageview.html. Be sure to make a visual checkout of different songs though! If you need, you can also modify the stylesheet under /resources/css/style.css, but be aware that this stylesheet is used on other pages, too. For safe styling, you can modify this stylesheet: /resources/css/style_pageview.css, which is used on this page only.

usage

The pageview can be accessed (given it is not disabled) via HTTP at http://your-domain-name.your-domain/pageview/. By default it opens the first page of the standard collection of the songbook with a navigation bar (the buttons) at the top and a background. You may, however, need different behavior, which is why you can put additional arguments to the URL.

argument effect
"nobuttons" removes the navigation bar with the buttons for previous and next songs
"nodecoration" removes the background graphic
"print" both "nobuttons" and "nodecoration"
<songId> when the script encounters and integer value, it will attempt to assign it as an index of song1 or song2 in the collection
<collectionName> if a string does not match any of the other arguments, the script will try to match it to one of the collections and if successfull, it will display songs for the collection

The arguments can be chained to the URL using a forward slash (/) as a delimeter. Examples:

arguments effect
.../pageview/easter/2/8/nodecoration/ will show songs 2 and 8 of the easter collection and it will also not display the background
../pageview/12/nobuttons/ will set song1 to 12 (and song2 to the next one) of the standard collection, additionally it will hide the navbar

Keep in mind that the number will be used as an index in the collection and not as a song id. It is possible to disable the homepage in server settings. Source code | pageview.html | style.css | style_pageview.css.

Error pages

Error pages are stored under /resources/pages/. You may modify them freely as long as you do not change their file names.

401.php

The Error n. 401 means that you do not have the permission to access the location you are trying to. Usually you need to log in. Source code | Learn more

403.php

The Error n. 403 means the target location is not meant to be accessed in this way (over HTTP/browser). Source code | Learn more

404.php

The Error n. 404 means there is nothing on the URL you are trying to access. It can be a typo or and old link. Source code | Learn more

405.php

The Error n. 405 means the HTTP request method is not allowed. In our case it means the target page has been disabled in the server settings. Source code | Learn more

⚠️ **GitHub.com Fallback** ⚠️