Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Is HTML a Disallowed Document Type?  (Read 3470 times)

0 Members and 1 Guest are viewing this topic.

Jim20

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Is HTML a Disallowed Document Type?
« on: December 20, 2005, 04:54:36 am »

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?
« Last Edit: December 20, 2005, 08:50:08 am by GauGau »
Logged

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: Is HTML a Disallowed Document Type?
« Reply #1 on: December 20, 2005, 05:02:38 am »

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
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Is HTML a Disallowed Document Type?
« Reply #2 on: December 20, 2005, 05:21:35 am »

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.
Logged

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: Is HTML a Disallowed Document Type?
« Reply #3 on: December 20, 2005, 05:34:06 am »

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
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Is HTML a Disallowed Document Type?
« Reply #4 on: December 20, 2005, 05:58:58 am »

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...
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Is HTML a Disallowed Document Type?
« Reply #5 on: December 20, 2005, 07:53:18 am »

try
Code: [Select]
<?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
Logged

Jim20

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Is HTML a Disallowed Document Type?
« Reply #6 on: December 20, 2005, 08:29:29 am »

Donnoman - AWESOME!  These two tips not only solve my problem, they give me much more robust abilities than I had hoped for.  Thank you!
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 21 queries.