Avatar billede rdc Nybegynder
18. august 2006 - 21:10 Der er 9 kommentarer og
1 løsning

Include i php/html

Hejsa... jeg har det her stykke kode:

<?php
/*
+--------------------------------------------------------------------------
|  Image period Mod by Des Hooper
|  ========================================
|  Web: http://www.pinguish.co.uk
|  Email: mod@pinguish.co.uk
+---------------------------------------------------------------------------
| Do not remove this link data - credit where due please
+--------------------------------------------------------------------------
*/
define('IN_COPPERMINE', true);
define('UPLOAD_PHP', true);

require('include/init.inc.php');

if (isset($HTTP_GET_VARS['page'])) {
    $PAGE = max((int)$HTTP_GET_VARS['page'], 1);
    $USER['lap'] = $PAGE;
} elseif (isset($USER['lap'])) {
    $PAGE = max((int)$USER['lap'], 1);
} else {
    $PAGE = 1;
}

if (isset($HTTP_GET_VARS['cat'])) {
    $cat = (int)$HTTP_GET_VARS['cat'];
}
// Gather data for categories
$breadcrumb = '';
$cat_data = array();
$statistics = '';
$STATS_IN_ALB_LIST = false;

pageheader($BREADCRUMB_TEXT ? $BREADCRUMB_TEXT : $lang_index_php['welcome']);

        //***Enter Path information here***
//***absolute path to main coppermine directory***

$copperminepath = '../';  //***YOU MUST CHANGE THIS***

//This connects to the mysql DB
//***change username and password below***

$MZrandompic = @mysql_connect('xxxxxxxx', 'xxxxxxxxxx', 'xxxxxxxxx'); //***YOU MUST CHANGE THIS***

if (!$MZrandompic) { 
echo( '<p>Unable to connect to the ' . 
'database server at this time.</p>' ); 
exit(); 


//select photo DB


if (! @mysql_select_db('xxxxxxxx') ) {//***YOU MUST CHANGE THIS*** 
die( '<p>Unable to locate the picture ' . 
'database at this time.</p>' ); 

function all_ims() {
//This gets a random picture record from the database and
//the picture's location and displays it
//***title of the page is here so can me made day/week/month etc**
//***YOU MUST CHANGE THIS***
echo "<CENTER><H2>Image Of The Week</H2><CENTER>";
echo "<BR>latest winners<BR>";
$MZresult = @mysql_query("SELECT  *
FROM cpg148_pictures , cpg148_imageperiod
WHERE cpg148_imageperiod.pid = cpg148_pictures .pid AND date < now( ) order by cpg148_imageperiod.powid DESC Limit 10"); 
if (!$MZresult) { 
die('<p>Error performing query: ' . mysql_error() . 
'</p>'); 


while ( $MZrow = mysql_fetch_array($MZresult) ) { 

// $albumid = $MZrow['aid'];  //This gets the picture's associated album name
$pos = $MZrow['pid'];      //This finds the picture's coppermine location
$ownername =$MZrow['owner_name'];
$dd=$MZrow['date'];
$uploaded =date("d F Y",strtotime("$dd")); 
echo('<P ALIGN=center>'); 
//***YOU MUST CHANGE THIS*** note path to the gallery must follow your path convention
echo('<table border = 2><TR><TD><a  href="../displayimage.php?album=' . $albumid . 
'&pos=-' . $pos . '">'); //make thumbnail clickable
//***YOU MUST CHANGE THIS*** note path to the gallery must follow your path convention
echo('<IMG SRC="../albums/');          //append base dir structure
echo($MZrow['filepath'].thumb_.$MZrow['filename'] .
    '" alt="click HERE to comment or get more info on the image"'. 'border=0 >' . '</a>'); //outputs path from /userspics
echo"</TD><TD>Image of the week from: $uploaded <BR>Photographer: $ownername <BR></TD></TR></TABLE>";


echo('<BR><BR><BR> <A HREF="imageweek.php">click here to go back</A><BR>');
}
function im() {
//This gets a random picture record from the database and
//the picture's location and displays it
echo "<CENTER><H1>Image Of The Week</H1><CENTER><BR><table border = 2><TR><TD>";
$MZresult = @mysql_query("SELECT *
FROM cpg148_pictures, cpg148_imageperiod
WHERE cpg148_imageperiod.pid = cpg148_pictures.pid AND date < now() order by cpg148_imageperiod.powid DESC LIMIT 1"); 
if (!$MZresult) { 
die('<p>Error performing query: ' . mysql_error() . 
'</p>'); 


while ( $MZrow = mysql_fetch_array($MZresult) ) { 

// $albumid = $MZrow['aid'];  //This gets the picture's associated album name
$pos = $MZrow['pid'];      //This finds the picture's coppermine location
$ownername =$MZrow['owner_name']; 
$dd=$MZrow['date'];
$uploaded =date("d F Y",strtotime("$dd"));   
echo('<P ALIGN=center>'); 
$ownerid =$MZrow['owner_id']; 
//***YOU MUST CHANGE THIS*** note path to the gallery must follow your path convention
echo('<a  href="../displayimage.php?album=' . $albumid . 
'&pos=-' . $pos . '">'); //make thumbnail clickable
//***YOU MUST CHANGE THIS*** note path to the gallery must follow your path convention
echo('<IMG SRC="../albums/');          //append base dir structure
echo($MZrow['filepath'].$MZrow['filename'] .
    '" alt="click HERE to comment or get more info on the image" '. 'border=0 >' . '</a>'); //outputs path from /userspics
echo "</TD></TR></TABLE><h3><BR>Image of the week since:$uploaded <BR><BR> Photographer : ";
echo('<a HREF="../index.php?showuser='.$ownerid.'">'.$ownername.'</A></H3>');
echo('<BR><BR><BR> <A HREF="imageweek.php?id=history">click here to see the last 10 winners</A><BR>');
if (!USER_IS_ADMIN) {
}else{
echo('<BR><BR><BR> <A HREF="imageweekadmin.php">click here to enter admin tools</A><BR>');}

}

if ($_GET['id']== "history") { all_ims();
}
else { im();
}

pagefooter();   


?>



Den stump kode bruges til at udskrive billedet af ugens billede, som jeg vælger som administrator på min hjememside... Koden fejler ikke noget det virker! :)

Problemet kommer så her:

Jeg vil gerne udskrive billedet af ugens billede, på forsiden, som er en html fil... Når jeg benytter: <!--#include FILE="../../imageweek.php" --> så virker det ikke... Den melder fejl...

Og et andet problem er at når jeg fx går ind og laver en seperat mappe med imageweek.php, fx inde i : themes/rdc/imageweek.php og kører den derinde så kommer følgende fejl:


Warning: main(include/debugger.inc.php): failed to open stream: No such file or directory in /home/www/rdc.lir.dk/include/init.inc.php on line 26

Fatal error: main(): Failed opening required 'include/debugger.inc.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/www/rdc.lir.dk/include/init.inc.php on line 26



Og det må jo være fordi at jeg åbenbart ikke skrive den rigtige stig til hvor selve imageweek.php filen ligger...
Den ligger her: http://www.hjememside.dk/themes/rdc/imageweek.php


Hvis i ikke forstår mit problem, så skriv endelig så skal jeg gerne uddybe :)

På forhånd tusind tak.
Avatar billede Slettet bruger
19. august 2006 - 10:36 #1
Det må være simpelst at lave et link til det link der normalt udskriver.

Altså find egenskaber på det link der normalt udskriver og lav så et link på forsiden der henviser til dette.
Avatar billede rdc Nybegynder
19. august 2006 - 12:54 #2
Jamen problemet er at jeg netop ikke kan finde det eller lave det link....

Jeg tror det er det her der udskriver billede:
echo($MZrow['filepath'].$MZrow['filename'] .
    '" alt="click HERE to comment or get more info on the image" '. 'border=0 >' . '</a>'); //outputs path from /userspics
Avatar billede zynzz Praktikant
19. august 2006 - 22:07 #3
echo "<a href=" . $MZrow[filepath] . $MZrow[filename] . "alt=click HERE to comment or get more info on the image border=0></a>";
Avatar billede rdc Nybegynder
19. august 2006 - 23:07 #4
jamen zynzz du skal tænke på at den fil, som et der skal sidde i er en html fil, hvad gør jeg så? og plus at det der er jo slet ikke nok at sætte ind i dokumentet, for så vil der jo komme fejl efter fejl.... Altså du skal huske på at det du skriver der ligger i en php fil, som hedder: imageweek.php
og design filen er en html fil, som hedder: template.html
Avatar billede zynzz Praktikant
20. august 2006 - 11:05 #5
Men det har ikke noget at sige om den hedder .php, .htm eller .html...
Avatar billede rdc Nybegynder
21. august 2006 - 03:20 #6
hva mener du med at det ikke har noget med det at gøre? hvis jeg indsætter ovenstående kode ind i en html filer, melder den da fejl....
Avatar billede Slettet bruger
21. august 2006 - 08:48 #7
Den fil du lister er en del af et samspil mellem flere filer - det er umuligt for os at udrede en fornuftig forklaring når enkelthederne ikke kendes
Avatar billede rdc Nybegynder
21. august 2006 - 13:52 #8
kan det her så hjælpe:


include/init.inc.php :

<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2006 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.8
  $Source$
  $Revision: 3116 $
  $Author: gaugau $
  $Date: 2006-06-08 00:11:54 +0200 (Do, 08 Jun 2006) $
**********************************************/

define('COPPERMINE_VERSION', '1.4.8');
define('COPPERMINE_VERSION_STATUS', 'stable');

if (!defined('IN_COPPERMINE')) { die('Not in Coppermine...');}

// Store all reported errors in the $cpgdebugger
require_once('include/debugger.inc.php');

set_magic_quotes_runtime(0);
// used for timing purpose
$query_stats = array();
$queries = array();

function cpgGetMicroTime()
{
    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);
}
$cpg_time_start = cpgGetMicroTime();
// Do some cleanup in GET, POST and cookie data and un-register global vars
$HTML_SUBST = array('&' => '&amp;', '"' => '&quot;', '<' => '&lt;', '>' => '&gt;', '%26' => '&amp;', '%22' => '&quot;', '%3C' => '&lt;', '%3E' => '&gt;','%27' => '&#39;', "'" => '&#39;');
if (get_magic_quotes_gpc()) {
    if (is_array($_POST)) {
        foreach ($_POST as $key => $value) {
            if (!is_array($value))
                $_POST[$key] = strtr(stripslashes($value), $HTML_SUBST);
            if (isset($$key)) unset($$key);
        }
    }

    if (is_array($_GET)) {
        foreach ($_GET as $key => $value) {
            unset($_GET[$key]);
            $_GET[strtr(stripslashes($key), $HTML_SUBST)] = strtr(stripslashes($value), $HTML_SUBST);
            if (isset($$key)) unset($$key);
        }
    }

    if (is_array($_COOKIE)) {
        foreach ($_COOKIE as $key => $value) {
            if (!is_array($value))
                $_COOKIE[$key] = stripslashes($value);
            if (isset($$key)) unset($$key);
        }
    }
    if (is_array($_REQUEST)) {
        foreach ($_REQUEST as $key => $value) {
            if (!is_array($value))
                $_REQUEST[$key] = strtr(stripslashes($value), $HTML_SUBST);
            if (isset($$key)) unset($$key);
        }
    }
} else {
    if (is_array($_POST)) {
        foreach ($_POST as $key => $value) {
            if (!is_array($value))
                $_POST[$key] = strtr($value, $HTML_SUBST);
            if (isset($$key)) unset($$key);
        }
    }

    if (is_array($_GET)) {
        foreach ($_GET as $key => $value) {
            unset($_GET[$key]);
            $_GET[strtr(stripslashes($key), $HTML_SUBST)] = strtr(stripslashes($value), $HTML_SUBST);
            if (isset($$key)) unset($$key);
        }
    }

    if (is_array($_COOKIE)) {
        foreach ($_COOKIE as $key => $value) {
            if (isset($$key)) unset($$key);
        }
    }
    if (is_array($_REQUEST)) {
        foreach ($_REQUEST as $key => $value) {
            if (!is_array($value))
                $_REQUEST[$key] = strtr($value, $HTML_SUBST);
            if (isset($$key)) unset($$key);
        }
    }
}
// Initialise the $CONFIG array and some other variables
$CONFIG = array();
//$PHP_SELF = isset($_SERVER['REDIRECT_URL']) ? $_SERVER['REDIRECT_URL'] : $_SERVER['SCRIPT_NAME'];

$PHP_SELF = '';
$ORIGINAL_PHP_SELF = $_SERVER['PHP_SELF'];
$possibilities = array('REDIRECT_URL', 'PHP_SELF', 'SCRIPT_URL', 'SCRIPT_NAME','SCRIPT_FILENAME');
foreach ($possibilities as $test){
  if (isset($_SERVER[$test]) && preg_match('/([^\/]+\.php)$/', $_SERVER[$test], $matches)){
    $PHP_SELF = $_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME'] = $matches[1];
    break;
  }
}

$REFERER = urlencode($_SERVER['PHP_SELF'] . (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] ? '?' . $_SERVER['QUERY_STRING'] : ''));
$ALBUM_SET = '';
$META_ALBUM_SET = '';
$FORBIDDEN_SET = '';
$FORBIDDEN_SET_DATA = array();
$CURRENT_CAT_NAME = '';
$CAT_LIST = '';
// Record User's IP address
$raw_ip = stripslashes($_SERVER['REMOTE_ADDR']);

if (isset($_SERVER['HTTP_CLIENT_IP'])) {
    $hdr_ip = stripslashes($_SERVER['HTTP_CLIENT_IP']);
} else {
    if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $hdr_ip = stripslashes($_SERVER['HTTP_X_FORWARDED_FOR']);
    } else {
        $hdr_ip = $raw_ip;
    }
}

if (!preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $raw_ip)) $raw_ip = '0.0.0.0';
if (!preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $hdr_ip)) $hdr_ip = '0.0.0.0';

// Define some constants
define('USER_GAL_CAT', 1);
define('FIRST_USER_CAT', 10000);
define('RANDPOS_MAX_PIC', 200);
define('TEMPLATE_FILE', 'template.html');
// Constants used by the cpg_die function
define('INFORMATION', 1);
define('ERROR', 2);
define('CRITICAL_ERROR', 3);

// Include config and functions files
if(file_exists('include/config.inc.php')){
        ob_start();
        require_once 'include/config.inc.php';
        ob_clean();
} else {
  // error handling: if the config file doesn't exist go to install
  die('<html>
    <head>
      <title>Coppermine not installed yet</title>
      <meta http-equiv="refresh" content="10;url=install.php">
      <style type="text/css">
      <!--
      body { font-size: 12px; background: #FFFFFF; margin: 20%; color: black; font-family: verdana, arial, helvetica, sans-serif;}
      -->
      </style>
    </head>
    <body>
      <img src="images/coppermine_logo.png" alt="Coppermine Photo Gallery - Your Online Photo Gallery" /><br />
      Coppermine Photo Gallery seems not to be installed correctly, or you are running coppermine for the first time. You\'ll be redirected to the installer. If your browser doesn\'t support redirect, click <a href="install.php">here</a>.
    </body>
</html>');
}
$mb_utf8_regex = '[\xE1-\xEF][\x80-\xBF][\x80-\xBF]|\xE0[\xA0-\xBF][\x80-\xBF]|[\xC2-\xDF][\x80-\xBF]';
require 'include/functions.inc.php';
# see http://php.net/mbstring for details
if (function_exists('mb_internal_encoding')) { mb_internal_encoding('UTF-8'); }

$CONFIG['TABLE_PICTURES']  = $CONFIG['TABLE_PREFIX'].'pictures';
$CONFIG['TABLE_ALBUMS']    = $CONFIG['TABLE_PREFIX'].'albums';
$CONFIG['TABLE_COMMENTS']  = $CONFIG['TABLE_PREFIX'].'comments';
$CONFIG['TABLE_CATEGORIES'] = $CONFIG['TABLE_PREFIX'].'categories';
$CONFIG['TABLE_CONFIG']    = $CONFIG['TABLE_PREFIX'].'config';
$CONFIG['TABLE_USERGROUPS'] = $CONFIG['TABLE_PREFIX'].'usergroups';
$CONFIG['TABLE_VOTES']      = $CONFIG['TABLE_PREFIX'].'votes';
$CONFIG['TABLE_USERS']      = $CONFIG['TABLE_PREFIX'].'users';
$CONFIG['TABLE_BANNED']    = $CONFIG['TABLE_PREFIX'].'banned';
$CONFIG['TABLE_EXIF']      = $CONFIG['TABLE_PREFIX'].'exif';
$CONFIG['TABLE_FILETYPES']  = $CONFIG['TABLE_PREFIX'].'filetypes';
$CONFIG['TABLE_ECARDS']    = $CONFIG['TABLE_PREFIX'].'ecards';
$CONFIG['TABLE_TEMPDATA']  = $CONFIG['TABLE_PREFIX'].'temp_data';
$CONFIG['TABLE_FAVPICS']    = $CONFIG['TABLE_PREFIX'].'favpics';
$CONFIG['TABLE_BRIDGE']    = $CONFIG['TABLE_PREFIX'].'bridge';
$CONFIG['TABLE_VOTE_STATS'] = $CONFIG['TABLE_PREFIX'].'vote_stats';
$CONFIG['TABLE_HIT_STATS']  = $CONFIG['TABLE_PREFIX'].'hit_stats';

$CONFIG['TABLE_NOTIFY']    = $CONFIG['TABLE_PREFIX']."notify";
$CONFIG['TABLE_BUDDY']         = $CONFIG['TABLE_PREFIX']."buddy";
$CONFIG['TABLE_BUDDY_REQ']     = $CONFIG['TABLE_PREFIX']."buddy_req";
//$CONFIG['TABLE_ONLINE']     = $CONFIG['TABLE_PREFIX']."mod_online";
$CONFIG['TABLE_PMS']         = $CONFIG['TABLE_PREFIX']."pms";
//$CONFIG['TABLE_MASSMAIL'] = $CONFIG['TABLE_PREFIX']."massmail";

// Connect to database
($CONFIG['LINK_ID'] = cpg_db_connect()) || die('<b>Coppermine critical error</b>:<br />Unable to connect to database !<br /><br />MySQL said: <b>' . mysql_error() . '</b>');
// Retrieve DB stored configuration
$results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_CONFIG']}");
while ($row = mysql_fetch_array($results)) {
    $CONFIG[$row['name']] = $row['value'];
} // while
mysql_free_result($results);

// Reference 'site_url' to 'ecards_more_pic_target'
$CONFIG['site_url'] =& $CONFIG['ecards_more_pic_target'];

// Include logger functions
include_once('include/logger.inc.php');

// Include media functions
require 'include/media.functions.inc.php';

// Check for GD GIF Create support
if ($CONFIG['thumb_method'] == 'im' || function_exists('imagecreatefromgif'))
  $CONFIG['GIF_support'] = 1;
else
  $CONFIG['GIF_support'] = 0;

// Include plugin API
require('include/plugin_api.inc.php');
if ($CONFIG['enable_plugins'] == 1) {
    CPGPluginAPI::load();
}

// Set UDB_INTEGRATION if enabled in admin
if ($CONFIG['bridge_enable'] == 1 && !defined('BRIDGEMGR_PHP')) {
    $BRIDGE = cpg_get_bridge_db_values();
} else {
  $BRIDGE['short_name'] = 'coppermine';
  $BRIDGE['use_standard_groups'] = 1;
  $BRIDGE['recovery_logon_failures'] = 0;
  $BRIDGE['use_post_based_groups'] = false;
}

define('UDB_INTEGRATION', $BRIDGE['short_name']);

require_once 'bridge/' . UDB_INTEGRATION . '.inc.php';

/*

Removed temporarily due to non-compliance with bridging system - Nibbler

// Retrieve Array of Admin Groups (used for hiding admin usernames on thumbnails)
$results = cpg_db_query("SELECT group_id FROM {$CONFIG['TABLE_USERGROUPS']} WHERE has_admin_access ");
$CONFIG['ADMIN_GROUPS']=array();
while ($row = mysql_fetch_array($results)) {
    $CONFIG['ADMIN_GROUPS'][]= $row['group_id'];
} // while
mysql_free_result($results);

// Retrieve Array of Admin Users (used for hiding admin usernames on thumbnails)
$results = cpg_db_query("SELECT {$cpg_udb->field['user_id']} as user_id FROM $cpg_udb->usertable WHERE {$cpg_udb->field['usertbl_group_id']} in (" . implode(',',$CONFIG['ADMIN_GROUPS']).')');
$CONFIG['ADMIN_USERS']=array();
while ($row = mysql_fetch_array($results)) {
    $CONFIG['ADMIN_USERS'][] = $row['user_id'];
} // while
mysql_free_result($results);

*/

// Start output buffering
ob_start('cpg_filter_page_html');

// Parse cookie stored user profile
user_get_profile();

// Authenticate
$cpg_udb->authenticate();

// Test if admin mode
$USER['am'] = isset($USER['am']) ? (int)$USER['am'] : 0;
define('GALLERY_ADMIN_MODE', USER_IS_ADMIN && $USER['am']);
define('USER_ADMIN_MODE', USER_ID && USER_CAN_CREATE_ALBUMS && $USER['am'] && !GALLERY_ADMIN_MODE);


// Set error logging level
// Maze's new error report system
if (!USER_IS_ADMIN) {
    if (!$CONFIG['debug_mode']) $cpgdebugger->stop(); // useless to run debugger cos there's no output
    error_reporting(E_PARSE); // hide all errors for visitors
}

// Process theme selection if present in URI or in user profile
if (!empty($_GET['theme'])) {
    $USER['theme'] = $_GET['theme'];
}
// Load theme file
if (isset($USER['theme']) && !strstr($USER['theme'], '/') && is_dir('themes/' . $USER['theme'])) {
    $CONFIG['theme'] = strtr($USER['theme'], '$/\\:*?"\'<>|`', '____________');
} else {
    unset($USER['theme']);
}

if (!file_exists("themes/{$CONFIG['theme']}/theme.php")) $CONFIG['theme'] = 'classic';
require "themes/{$CONFIG['theme']}/theme.php";
require "include/themes.inc.php";  //All Fallback Theme Templates and Functions
$THEME_DIR = "themes/{$CONFIG['theme']}/";


// Process language selection if present in URI or in user profile or try
// autodetection if default charset is utf-8
if (!empty($_GET['lang']))
{
    $USER['lang'] = ereg("^[a-z0-9_-]*$", $_GET['lang']) ? $_GET['lang'] : $CONFIG['lang'];
}

if (isset($USER['lang']) && !strstr($USER['lang'], '/') && file_exists('lang/' . $USER['lang'] . '.php'))
{
    $CONFIG['default_lang'] = $CONFIG['lang'];          // Save default language
    $CONFIG['lang'] = strtr($USER['lang'], '$/\\:*?"\'<>|`', '____________');
}
elseif ($CONFIG['charset'] == 'utf-8' && $CONFIG['lang_autodetect'])
{
    include('include/select_lang.inc.php');
    if (file_exists('lang/' . $USER['lang'] . '.php'))
    {
        $CONFIG['default_lang'] = $CONFIG['lang'];      // Save default language
        $CONFIG['lang'] = $USER['lang'];
    }
}
else
{
    unset($USER['lang']);
}

if (isset($CONFIG['default_lang']) && ($CONFIG['default_lang']==$CONFIG['lang']))
{
        unset($CONFIG['default_lang']);
}

if (!file_exists("lang/{$CONFIG['lang']}.php"))
  $CONFIG['lang'] = 'english';

// We load the chosen language file
require "lang/{$CONFIG['lang']}.php";

// Include and process fallback here if lang <> english
if($CONFIG['lang'] != 'english' && $CONFIG['language_fallback']==1 ){
        require "include/langfallback.inc.php";
}


// See if the fav cookie is set else set it
if (isset($_COOKIE[$CONFIG['cookie_name'] . '_fav'])) {
    $FAVPICS = @unserialize(@base64_decode($_COOKIE[$CONFIG['cookie_name'] . '_fav']));
    foreach ($FAVPICS as $key => $id ){
        $FAVPICS[$key] = (int)$id; //protect against sql injection attacks
    }
} else {
    $FAVPICS = array();
}

// If the person is logged in get favs from DB those in the DB have precedence
if (USER_ID > 0){
        $sql = "SELECT user_favpics FROM {$CONFIG['TABLE_FAVPICS']} WHERE user_id = ".USER_ID;
        $results = cpg_db_query($sql);
        $row = mysql_fetch_array($results);
        if (!empty($row['user_favpics'])){
                $FAVPICS = @unserialize(@base64_decode($row['user_favpics']));
        }else{
                $FAVPICS = array();
        }
}

/**
* CPGPluginAPI::action('page_start',null)
*
* Executes page_start action on all plugins
*
* @param null
* @return N/A
**/

CPGPluginAPI::action('page_start',null);

// load the main template
load_template();
// Remove expired bans
$now = date('Y-m-d H:i:s', localised_timestamp());

$CONFIG['template_loaded'] = true;

cpg_db_query("DELETE FROM {$CONFIG['TABLE_BANNED']} WHERE expiry < '$now'");
// Check if the user is banned
$user_id = USER_ID;
$result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_BANNED']} WHERE (ip_addr='$raw_ip' OR ip_addr='$hdr_ip' OR user_id=$user_id) AND brute_force=0");
if (mysql_num_rows($result)) {
    pageheader($lang_error);
    msg_box($lang_info, $lang_errors['banned']);
    pagefooter();
    exit;
}
mysql_free_result($result);
// Retrieve the "private" album set
if (!GALLERY_ADMIN_MODE && $CONFIG['allow_private_albums']) get_private_album_set();

if (!USER_IS_ADMIN && $CONFIG['offline'] && !strstr($_SERVER["SCRIPT_NAME"],'login')) {
    pageheader($lang_errors['offline_title']);
    msg_box($lang_errors['offline_title'], $lang_errors['offline_text']);
    pagefooter();
    exit;
}

// kick user into user_admin_mode (needed to fix "removed user mode for users" when upgrading)
if (USER_ID && !USER_IS_ADMIN && !$USER['am']) { // user is logged in, but is not gallery admin and not in admin mode
    $USER['am'] = 1;
    pageheader($lang_info, "<META http-equiv=\"refresh\" content=\"1;url=$referer\">");
    msg_box($lang_info, 'Sending you to admin mode', $lang_continue, $referer);
    pagefooter();
    ob_end_flush();
    die();
}

?>


include/debugger.inc.php :

<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2006 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.8
  $Source$
  $Revision: 3116 $
  $Author: gaugau $
  $Date: 2006-06-08 00:11:54 +0200 (Do, 08 Jun 2006) $
**********************************************/

if (!defined('E_STRICT')) {
    define('E_STRICT', 2048); // PHP 5
}

class cpg_debugger {
    // Define variables that store the old error reporting and logging states
    var $old_handler;
    var $old_display_level;
    var $old_error_logging;
    var $old_error_log;

    var $logfile;
    var $report;
    var $active = false;
    var $error_level;
    var $basepath_len;

    function cpg_debugger($log = 'debug.log') {
        $this->logfile = $log;
        $this->basepath_len = strlen(dirname(dirname(__FILE__)));
    }

    function start() {
        if (!$this->active) {
            $this->report = false;
            if (CAN_MOD_INI) {
                $this->old_display_level = ini_set('display_errors', 1);
                $this->old_error_logging = ini_set('log_errors', 0);
            }
            $phpver = explode('.', phpversion());
            $phpver = "$phpver[0]$phpver[1]";
            if ($phpver < 43) {
                $this->old_handler = set_error_handler('cpg_error_handler');
            } else {
                $this->old_handler = set_error_handler(array(&$this, 'handler'));
            }
            if (is_bool($this->old_handler)) {
                error_reporting(E_ALL ^ E_NOTICE);
            }
//            $this->old_error_log = ini_set('error_log', $this->logfile);
            $this->error_level = E_ALL;
            $this->active = true;
        }
    }

    function stop() {
        if ($this->active) {
            // restore the previous state
            if (!is_bool($this->old_handler) && $this->old_handler) {
                set_error_handler($this->old_handler);
            }
            if (CAN_MOD_INI) {
                ini_set('display_errors', $this->old_display_level);
                ini_set('log_errors', $this->old_error_logging);
//                ini_set('error_log', $this->old_error_log);
            }
            $this->active = false;
            return $this->report;
        }
    }

    // user defined error handling function
    function handler($errno, $errmsg, $filename, $linenum, $vars='')
    {
        $filename = substr($filename, $this->basepath_len);
        $errortype = array (
//            E_ERROR          => 'Error',
            E_WARNING        => 'Warning',
//            E_PARSE          => 'Parsing Error',
            E_NOTICE          => 'Notice',
            E_CORE_ERROR      => 'Core Error',
            E_CORE_WARNING    => 'Core Warning',
            E_COMPILE_ERROR  => 'Compile Error',
            E_COMPILE_WARNING => 'Compile Warning',
            E_USER_ERROR      => 'CPG Error',
            E_USER_WARNING    => 'CPG Warning',
            E_USER_NOTICE    => 'CPG Notice',
            E_STRICT          => 'Runtime Notice'
        );
        // NOTE: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR and E_COMPILE_WARNING
        // error levels will be handled as per the error_reporting settings.
        if ($errno == E_USER_ERROR) {
            if (USER_IS_ADMIN) {
                $errmsg = $errortype[$errno]." $filename line $linenum: ".$errmsg;
            } else {
                $errmsg = "A error occured while processing this page.<br />Please report the following error to the owner of this website.<br /><br /><b>$errmsg</b>";
            }
            cpg_die(CRITICAL_ERROR, $errmsg, $filename, $linenum);
        }

        // set of errors for which a var trace will be saved
        if ($errno & $this->error_level) {
            $this->report[$filename][] = $errortype[$errno]." line $linenum: ".$errmsg;
        }

        // save to the error log
        // error_log($err, 0); //message is sent to PHP's system logger
        // error_log($err, 1, 'operator@example.com'); //message is sent by email to the address in the destination
        // error_log($err, 3, $this->logfile); //message is appended to the file destination.
    }
}

function cpg_error_handler($errno, $errmsg, $filename, $linenum, $vars='') {
    global $cpgdebugger;
    $cpgdebugger->handler($errno, $errmsg, $filename, $linenum, $vars);
}
define('CAN_MOD_INI', !ereg('ini_set', ini_get('disable_functions')));

error_reporting(E_ALL);
$cpgdebugger =& new cpg_debugger();
$cpgdebugger->start();


og selve template.html:
<!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "http:/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http:/www.w3.org/1999/xhtml" dir="{LANG_DIR}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}" />
<meta http-equiv="Pragma" content="no-cache" />
<title>{TITLE}</title>
<link rel="stylesheet" type="text/css" href="themes/testing/style.css" />
{META}
<script type="text/javascript" src="scripts.js" ></script>
<!-- $Id: template.html 2808 2006-02-05 22:35:48Z gaugau $ -->
</head>

<body>

<div align="center">
    <table bgColor="#5884a8" border="0" borderColor="#111111" cellPadding="0" height="1" style="BORDER-COLLAPSE: collapse" width="90%">
        <tr>
            <td bgColor="#4A6B84" colSpan="2" height="1" width="786"></td>
        </tr>
        <tr>
            <td bgColor="#496989">{GAL_NAME}{GAL_DESCRIPTION} {LOGIN_FORM} </P>
            </td>
        </tr>

    </table>

    <table border="0" cellPadding="0" cellSpacing="0" width="90%">
        <tr>
            <td align="middle" background="themes/neweb/images/effekt_linie.gif" bgColor="#496989" width="150">
            </td>
            <td bgColor="#496989" height="25" width="24">
            <font face="Verdana" size="1">
            <img border="0" height="25" src="themes/neweb/images/hjoerne.gif" width="25"></font></td>
            <td background="themes/neweb/images/midten_top.gif" bgColor="#B9D7E5" height="10" width="943">
            <center></center></td>
        </tr>
    </table>
    <table bgColor="#B9D7E5" border="0" cellPadding="0" cellSpacing="0" width="90%">
        <tr vAlign="top">
            <td width="150" height="466" vAlign="top" background="themes/neweb/images/tabel_bg.gif" bgColor="#496989">
            <table border="0" cellPadding="0" cellSpacing="0" width="150">
                <tr>
                    <td width="150">
                    <table border="0" cellPadding="0" cellSpacing="0" width="150">
                        <tr>
                            <td colSpan="3" width="150">
                            <font face="Verdana" size="1">
                            <img border="0" height="29" src="themes/neweb/images/menu_top.gif" width="150"></font></td>
                        </tr>
                        <tr>
                            <td background="themes/neweb/images/menu_venstre.gif" width="17">
                            </td>
                            <td bgColor="#FFFFFF" vAlign="top" align="left" width="114" nowrap>
                            <font face="Verdana" size="1">
                            <img height="9" src="themes/neweb/images/pil.gif" width="9">
                            <font class="content" color="#363636"><b>Navigation</b><br>
                            </font></font>
                            <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td>
                                    <p align="left">
                                    <font face="Verdana" size="1">
                                    <font class="content" color="#363636">
                                    </font></font></td>
                                </tr>
                            </table>
                            {SYS_MENU}</font></td>
                            <td background="themes/neweb/images/menu_hoejre.gif" width="19">
                            </td>
                        </tr>
                        <tr>
                            <td colSpan="3" width="150">
                            <font face="Verdana" size="1">
                            <img border="0" height="21" src="themes/neweb/images/menu_ned.gif" width="150"></font></td>
                        </tr>
                    </table>
                    <table border="0" cellPadding="0" cellSpacing="0" width="138">
                        <tr>
                            <td colSpan="3" width="150">
                            <font face="Verdana" size="1">
                            <img border="0" height="29" src="themes/neweb/images/menu_top.gif" width="150"></font></td>
                        </tr>
                        <tr>
                            <td background="themes/neweb/images/menu_venstre.gif" width="17">
                            </td>
                            <td bgColor="#FFFFFF" vAlign="top" align="left" width="114">
                            <font face="Verdana" size="1">
                            <img height="9" src="themes/neweb/images/pil.gif" width="9">
                            <font class="content" color="#363636"><b>Navigation 2</b><br>
                            </font></font>
                            <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td>
                                    <p align="left">
                                    <font face="Verdana" size="1">
                                    <font class="content" color="#363636">
                                    </font></font></td>
                                </tr>
                            </table>
                            {SUB_MENU}</font></td>
                            <td background="themes/neweb/images/menu_hoejre.gif" width="19">
                            </td>
                        </tr>
                        <tr>
                            <td colSpan="3" width="150">
                            <font face="Verdana" size="1">
                            <img border="0" height="21" src="themes/neweb/images/menu_ned.gif" width="150"></font></td>
                        </tr>
                    </table>
                    <table border="0" cellPadding="0" cellSpacing="0" width="147">
                        <tr>
                            <td colSpan="3" width="150">
                            <font face="Verdana" size="1">
                            <img border="0" height="29" src="themes/neweb/images/menu_top.gif" width="150"></font></td>
                        </tr>
                        <tr>
                            <td background="themes/neweb/images/menu_venstre.gif" width="17">
                            </td>
                            <td bgColor="#FFFFFF" vAlign="top" align="left" width="114">
                            <font face="Verdana" size="1">
                            <img height="9" src="themes/neweb/images/pil.gif" width="9">
                            <font class="content" color="#363636"><b>Ugens Billede</b><br>
                            </font></font>                           
                            <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td>
                                    <p align="left">
                                    <font face="Verdana" size="1">
                                    <font class="content" color="#363636">
                                    </font></font></td>
                                </tr>
                            </table>
                    UGENS BILLEDE</font></td>
                            <td background="themes/neweb/images/menu_hoejre.gif" width="19">
                            </td>
                        </tr>
                        <tr>
                            <td colSpan="3" width="150">
                            <font face="Verdana" size="1">
                            <img border="0" height="21" src="themes/neweb/images/menu_ned.gif" width="150"></font></td>
                        </tr>
                    {ADMIN_MENU}
                    </table>
                    <font class="content" color="#000000" face="Verdana" size="1">
                    {THEME_SELECT_LIST}{LANGUAGE_SELECT_LIST}<br>
                    </font></td>
                </tr>
            </table>
            </td>
            <td width="100%">
            <div align="center">
                <table border="0" width="90%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="100%">
                        <img border="0" src="themes/neweb/images/tekst_top.jpg" width="100%" height="8"></td>
                    </tr>
                </table>
                <table border="0" width="90%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="0" bgcolor="#000000" height="0">
                        <img border="0" src="themes/neweb/images/sort.jpg" width="1" height="1"></td>
                        <td width="100%" bgcolor="#FFFFFF">
                        <div align="center">
                            <center>
                            <table width="100%" height="100%">
                                <tr>
                                    <td width="100%">
                                    <div align=center>{GALLERY}</div></td>
                                </tr>
                            </table>
                            </center></div>
                        </td>
                        <td width="0" bgcolor="000000">
                        <img border="0" src="themes/neweb/images/sort.jpg" width="0" height="0"></td>
                    </tr>
                    <tr>
                        <td width="0" height="0">
                        <img border="0" src="themes/neweb/images/0.gif" width="0" height="0"></td>
                        <td width="100%">
                        <img border="0" src="themes/neweb/images/tekst_bund.jpg" width="100%" height="8"></td>
                    </tr>
                </table>
                <p>
                <br>
                </p>
                <table border="0" width="465" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="100%">
                        <img border="0" src="themes/neweb/images/tekst_top.jpg" width="465" height="8"></td>
                    </tr>
                </table>
                <table border="0" width="465" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="0" bgcolor="#000000" height="0">
                        <img border="0" src="themes/neweb/images/sort.jpg" width="1" height="1"></td>
                        <td width="465" bgcolor="#FFFFFF">
                        <div align="center">
                            <center>
                            <table width="98%">
                                <tr>
                                    <td>
                                    <p align="center">{LANGUAGE_SELECT_FLAGS}
                                    </p>
                                    <p align="center">{CUSTOM_FOOTER} {VANITY}
                                    </td>
                                </tr>
                            </table>
                            </center></div>
                        </td>
                        <td width="0" bgcolor="000000">
                        <img border="0" src="themes/neweb/images/sort.jpg" width="0" height="0"></td>
                    </tr>
                    <tr>
                        <td width="0" height="0">
                        <img border="0" src="themes/neweb/images/0.gif" width="0" height="0"></td>
                        <td width="465">
                        <img border="0" src="themes/neweb/images/tekst_bund.jpg" width="465" height="8"></td>
                    </tr>
                </table>
                <br>
&nbsp;<div align="bottom">
                    <font face="Tahoma" color="#000000" size="2">&nbsp;</font></div>
            </div>
            </td>
        </tr>
    </table>
</div>

</body>

</html>
Avatar billede Slettet bruger
21. august 2006 - 15:54 #9
Jeg vil foreslå dig at bruge et forum om Coppermine Photo Gallery til at løse dit problem, eller finde een der også bruger galleriet.

Men er coppermine ikke et onlinegalleri ?

http://coppermine-gallery.net/forum/

Der er en her på eksperten der hedder janemil,  http://www.istockphoto.com/JanEmil du kan søge efter spørgsmål som han deltager i - jeg tror han kan hjælpe dig, hvis det er noget der kan lade sig gøre !!



Jeg kan ikke afsætte tid til det.
Avatar billede rdc Nybegynder
08. januar 2007 - 10:38 #10
lukker
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester