Stand alone pages

Allgemeines
Post Reply
neons
Posts: 1
Joined: Tue 19. Dec 2023, 18:43

Stand alone pages

Post by neons »

Not sure if I overlooked it or something, but is there a way to add stand alone pages?

Looking for a way to add extra pages outside the built in URL but still contain the look of the site.
~
The reason for this is I have a 2000 row list with 9 columns of information that is in a database. It can be added into the normal workings of the site, but i would like to display the information of each row separately. I can use a simple php page to display all but the now way to use it due to the pagemanager not liking the php.

So I looked for a alternative method.
My coding is not the greatest, Im still learning.

urls:
the original link site.nr/index.php, then have a custom page that shares the the site info, meta, header, side bar, menu, footer but with a url of site.nr/newpage.php

I checked the index file.

Code: Select all

$pth['folder']['base'] = './';
include('./cmsimple/cms.php');
It takes me to the cms file.
I clearly see a index page reference,

Code: Select all

// NEW 2016 (4.6.5)
// prevents call with "/index.php" from address line 
if (preg_match('/index.php/i', $_SERVER['REQUEST_URI']) && $cf['site']['allow_call_indexphp'] != "true")
{
	die('<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>CMSimple - Open Source CMS ohne Datenbank</title>
<meta name="robots" content="noindex, nofollow">
<style type="text/css">
a {text-decoration: none;}
a:hover {color: #c60;}
</style>
</head>
<body style="background: #d0d6d9;">
<p style="margin-top: 60px; text-align: center; font-size: 20px; font-weight: 700;">
<a href="' . $sn . '">Come In &raquo;</a><br>
<a href="' . $sn . '"><span style="font-size: 96px; line-height: 96px;"><img src="' . $pth['folder']['base'] . 'css/icons/entrance.png" title="Entrance" alt="&raquo;"></span></a>
</p>
</body>
</html>');
}
// END NEW

If you copy it and alter it to point to the "newpage" file it just leads to a grey page with the words "Come in" with a arrow below it.

Code: Select all

// NEW 2016 (4.6.5)
// prevents call with "/index.php" from address line 
if (preg_match('/newpage.php/i', $_SERVER['REQUEST_URI']) && $cf['site']['allow_call_indexphp'] != "true")
{
	die('<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>CMSimple - Open Source CMS ohne Datenbank</title>
<meta name="robots" content="noindex, nofollow">
<style type="text/css">
a {text-decoration: none;}
a:hover {color: #c60;}
</style>
</head>
<body style="background: #d0d6d9;">
<p style="margin-top: 60px; text-align: center; font-size: 20px; font-weight: 700;">
<a href="' . $sn . '">Come In &raquo;</a><br>
<div><p>Some text here to show if this is working.</p></div>
<a href="' . $sn . '"><span style="font-size: 96px; line-height: 96px;"><img src="' . $pth['folder']['base'] . 'css/icons/entrance.png" title="Entrance" alt="&raquo;"></span></a>
</p>
</body>
</html>');
}
// END NEW
Image

after this alteration the admin page fails to work.
Gert
Posts: 2140
Joined: Sun 18. Nov 2012, 14:18

Re: Stand alone pages

Post by Gert »

Hello,

calling CMSimple with .../index.php is prevented intentionally to avoid duplicated content. It is not a good idea to manipulate core files.

There is a function geturl(), you can use it to include external ressources into a CMSimple page (sourcecode view):

Code: Select all

<div>{{{function:geturl('https://your_domain.tld/userfiles/php/demo.php');}}}</div>
The referenz must be absolute, beginning with "http(s)://".

The demo.php (just for testing):

Code: Select all

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>demo php file</title>
</head>
<body>
<h3>php file demo.php - included by geturl()</h3>
<?php echo '<p>This is an php file,  included by geturl().</p><div style="clear: both;"></div>'; ?>
</body>
</html>
have fun - Gert

PS: You can see it here: https://www.ge-webdesign.de/demotpl/?Pl ... _einbinden
Gert Ebersbach | CMSimple | Templates - Plugins - Services
Post Reply