Is HTML a Disallowed Document Type? Is HTML a Disallowed Document Type?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Is HTML a Disallowed Document Type?

Started by Jim20, December 20, 2005, 04:54:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jim20

I would like to upload an HTML file as a document in a library so that it is shown like any other file, then opens up when a user clicks on it.  In part, this idea is meant to allow me to use Coppermine's excellent security features as a front end to all content to my site, including web pages.

When I try this, however, it appears that htm is a disallowed file type.  Why would this be and is there any way around it?

artistsinhawaii

Jim,

If you want the page to have the same theming format as your coppermine gallery, you could try the following:

Quote
<?php
define('IN_COPPERMINE', true);
require('include/init.inc.php');
pageheader('Your page title goes here');
// your actual page content starts here
    starttable("100%", 'Content block title', 1);
    ?>

    Hello World .. you can place your html content in here as well.


<?php
    endtable();
// your actual page content ends here
pagefooter();
ob_end_flush();
?>

Dennis
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

Jim20

Thanks, Dennis.  I am working on testing this right now.  How do you recommend then linking the resulting page within my gallery?  Would I place the php file in a gallery?  Sorry if this is a dumb question.

artistsinhawaii

yes, you place the file right into the folder where your gallery resides. Then edit your theme's template.html file or theme.php file to put a link to the page where you want it.

If you want to add the link somewhere among the standard coppermine links, AND your current theme is not using buttons, you will have to copy the menu sections from the sample/theme.php file into your theme.php file.  IF YOUR current theme is using buttons, then look at it's theme.php file and see if you can't duplicate a the pattern, usually between <td> and  </td>,  and insert your own links.

Dennis
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.

Jim20

Dennis - thanks, I got it working.  However, it appears accessing the page does not require a user to login.  If I logout, then enter http://www.mydomain.com/newpage.php, it takes me right to the page without requiring login.  How do you force people to login in order to see the page?

I know this works with the albums, that's why I originally though to upload the page as an item in an album...

donnoman

try

<?php
define
('IN_COPPERMINE'true);
require(
'include/init.inc.php');

$REFERER =urlencode($_SERVER['PHP_SELF'] . (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] ? '?' $_SERVER['QUERY_STRING'] : ''));
if (!
USER_ID && $CONFIG['allow_unlogged_access'] == 0) {
    $redirect $CONFIG['ecards_more_pic_target']. "login.php?referer=".$REFERER;
    header("Location: $redirect");
    exit();
}

pageheader('Your page title goes here');
// your actual page content starts here
    starttable("100%"'Content block title'1);
    ?>


    Hello World .. you can place your html content in here as well.


<?php
    endtable
();
// your actual page content ends here
pagefooter();
ob_end_flush();
?>



You may also want to check into the minicms plugin over at cpg-contrib.org

http://cpg-contrib.org/thumbnails.php?album=1

Jim20

Donnoman - AWESOME!  These two tips not only solve my problem, they give me much more robust abilities than I had hoped for.  Thank you!