Categories > OpenTBS general >

Website broken: OpenTBS demo page: link to PHP source

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Vincent
Date: 2014-10-18
Time: 16:55

Website broken: OpenTBS demo page: link to PHP source

Heads up...
By: Skrol29
Date: 2014-10-18
Time: 23:21

Re: Website broken: OpenTBS demo page: link to PHP source

Hi,

It works for me. Can you precise your navigator, your OS, and which template source you're trying to view.
By: Vincent
Date: 2014-10-20
Time: 09:48

Re: Website broken: OpenTBS demo page: link to PHP source

Firefox 33, Archlinux, .odt template

When I click the 'PHP source' link, I get the following page (no TBS-code, so I presume this is not what it should be):

<?php

// Display this code source if asked.
if (isset($_GET['source'])) exit('<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>OpenTBS plug-in for TinyButStrong - demo source</title></head><body>'.highlight_file(__FILE__,true).'</body></html>');

// Read user choices
if (!isset($_POST['btn_go'])) exit("You must use <a href='demo.html'>demo.html</a>");

// Retrieve the template to open
$template = (isset($_POST['tpl'])) ? $_POST['tpl'] : '';
$template = basename($template); // for security
$info= pathinfo($template);

// Checks
if (substr($template,0,5)!=='demo_') exit("Wrong file.");
if (!file_exists($template)) exit("The asked template does not exist.");

// Start the demo
$script = $info['filename'].'.php';
include($script);
By: Skrol29
Date: 2014-10-20
Time: 10:06

Re: Website broken: OpenTBS demo page: link to PHP source

OK, thanks, I will fix this soon.
By: Skrol29
Date: 2014-10-21
Time: 01:09

Re: Website broken: OpenTBS demo page: link to PHP source

fixed