Admin Required Link
Admin Required Link
Is it possible to set up a static page or any other linked page that only the admin can access? I looked for a plugin that might do this, but if it exists I wasn't able to find it. Thanks in advance.
Re: Admin Required Link
just create a new static page but do not add it to the menu
Proudly using flatpress https://www.mypoppy.uk/blog
Re: Admin Required Link
Thanks George, I tried that but can't get php code to work in a static page. Is it possible?
Re: Admin Required Link
The {php} tag is disabled by default. Enable with $smarty->allow_php_tag=true
Proudly using flatpress https://www.mypoppy.uk/blog
Re: Admin Required Link
Where do I enable that? I'm still trying to figure out this blog application. And thanks for the response.
Re: Admin Required Link
Hey George; Wineman and I are partners in crime with the blog. I searched through almost all of the Smarty files and can't seem to find where to set php tags to true. I think we're gonna need some pointers here. 

- fraenkiman
- Posts: 14
- Joined: Thu Feb 03, 2022 7:25 pm
- Contact:
Re: Admin Required Link
Hello, everyone,
apparently you have to put this in the new static admin page.
I found this about it.
Arvid may have a code snippet; PHP+Smarty is not my forte.
Best regards
apparently you have to put this in the new static admin page.
I found this about it.
Arvid may have a code snippet; PHP+Smarty is not my forte.
Best regards
My Flatpress-Blog [German]: https://frank-web.dedyn.io
Re: Admin Required Link
It may not be "visible" on your site, but always remains publicly accessible through the direct link. Not a good idea if you want to protect information from the public - which is what I think WineMan tries to achieve. That said, ...
...what's the purpose of doing so? What do you try to achieve?
Just tested the Inline PHP plugin, works like a charm. Install and enable it, and then add your PHP code encapsulated in [exec] tags to your static page:
Code: Select all
Current time is [exec]echo date('Y-m-d H:i:s T');[/exec]
All the best,
Arvid
Helpful FlatPress links: Project blog
- FlatPress wiki
- FlatPress@Twitter
- FlatPress@Mastodon 
Stay up to date with our feeds: Forum RSS feed
- Project blog RSS feed 
Stay up to date with our feeds: Forum RSS feed
Re: Admin Required Link
Arvid,
I have been playing around with the inlinePHP plugin and can't seem to make it work. I am specifically trying it on this code:
I left out some of the html code that goes before the php code. Am I misunderstanding how it is supposed to work?
I have been playing around with the inlinePHP plugin and can't seem to make it work. I am specifically trying it on this code:
Code: Select all
if(!file_exists("data.txt"))
{
echo "The file cannot be found!";
exit;
}
$fp = fopen("data.txt", "r");
if(!$fp)
{
echo "File cannot be opened";
exit;
}
echo "<table border = 2>";
while(!feof($fp))
{
$info = fgets($fp);
echo "<tr>";
echo "<td>$info</td>\n";
echo "<br />";
}
echo "</tr>\n";
echo "</table>";
fclose($fp)
Re: Admin Required Link
as Arvid said in his previous post your PHP code needs to be encapsulated in [exec]php code [/exec]
Proudly using flatpress https://www.mypoppy.uk/blog
Who is online
Users browsing this forum: No registered users and 0 guests