Damoor, thank you for this.
As you suggested, I created a subfolder and successfully protected it using .htaccess/.htpsswd
Now I have a folder structure similar to this:
/ROOT/
|- index.php
|- news.php (newspage - not protected)
|--/news/
|--/news/<cutenews> (CN admin panel)
|--/private/
|--/private/news.php (copy of newspage - protected)
The next step is to update the $PHP_SELF variable. Can you confirm I should make the update as per below?
No changes to this block
<?php
require_once("news/core/init.php");
// Play with settings --------------------------------------------------
$pw = REQ('pw');
if (isset($pw['PHP_SELF'])&&$pw['PHP_SELF']) $PHP_SELF = $pw['PHP_SELF'];
if (isset($pw['template'])&&$pw['template']) $template = $pw['template'];
if (isset($pw['start_from'])&&$pw['start_from']) $start_from = $pw['start_from'];
if (isset($pw['number'])&&$pw['number']) $number = $pw['number'];
if (isset($pw['archive'])&&$pw['archive']) $archive = $pw['archive'];
if (isset($pw['category'])&&$pw['category']) $category = $pw['category'];
if (isset($pw['ucat'])&&$pw['ucat']) $ucat = $pw['ucat'];
if (isset($pw['sortby'])&&$pw['sortby']) $sortby = $pw['sortby'];
if (isset($pw['dir'])&&$pw['dir']) $dir = $pw['dir'];
if (isset($pw['page_alias'])&&$pw['page_alias']) $page_alias = $pw['page_alias'];
if (isset($pw['tag'])&&$pw['tag']) $page_alias = $pw['tag'];
if (isset($pw['user_by'])&&$pw['user_by']) $user_by = $pw['user_by'];
if (isset($pw['static'])&&$pw['static']) $static = $pw['static'];
if (isset($pw['reverse'])&&$pw['reverse']) $reverse = $pw['reverse'];
if (isset($pw['only_active'])&&$pw['only_active']) $only_active = $pw['only_active'];
if (isset($pw['no_prev'])&&$pw['no_prev']) $no_prev = $pw['no_prev'];
if (isset($pw['no_next'])&&$pw['no_next']) $no_next = $pw['no_next'];
// ---------------------------------------------------------------------
if (isset($_GET['do'])&& $_GET['do'] == "rss") include("rss.php");
?>
Changes below
<div class="pagedata">
<?php
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here we decide what page to include
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
if (isset($_GET['search'])&&$_GET['search'])
{
$PHP_SELF = "private/news.php";
include ("news/search.php");
}
elseif (isset($_GET['do'])&&$_GET['do'] == 'archives')
{
$PHP_SELF = "private/news.php";
include ("news/show_archives.php");
}
elseif (isset($_GET['do'])&&$_GET['do'] == "stats")
{
echo "You can download the stats addon and include it here to show how many news, comments ... you have"; // include("$path/stats.php");
}
else
{
$PHP_SELF = "private/news.php";
include ("news/show_news.php");
}
?>
</div>