The problem is that I'm using the Modpack from stramm, which great and I've install the picture of the week system.. My problem is now that I want to only take the picture of the week out of the code, and set it into my template.php.
The Picture Of the week systems code is:
<?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();
?>
You can see the template here: www.rdc.lir.dk .
I've tried to make a copy of the code for Picture of the week, and make a example file, to test... but when I'm trying to load it here from: http://www.rdc.lir.dk/themes/neweb/includer.php .
That gives me the following to errors:
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
And when I'm changing a little bit in theinclude/init.inc.php file on line 26, then everything goes wrong, and the system crashes....
How can I modify the gallery, so I can add {PICTURE_OF_THE_WEEK} just like {SUB_MENU} in the theme.php . If that is possible, then I could insert {PICTURE_OF_THE_WEEK} into the template.html file and hope that it will work
Quote from: GauGau on August 19, 2006, 05:27:08 AM
Stramm's modpack doesn't get supported here. The POTD mod by Casper goes unsupported but on the thread that deals with it.
Did my reply on the other thread mean anything to you, where I told you that you can't get support for mods on the regular support board?
My answer to your question "is this possible" is: "yes, if you code it. If you don't understand the code that you're trying to modify, then hire someone to code this for you".
A better choice of subjects might make supporters more inclined to look into your issues in the future.
okay, sorry GauGau... Can't you just then move my question the "regular support board" that you are talking about, for I 'cant find it....
You are on the regular support board. But mods don't get supported on it (as I told you various times already). Mods only go supported on the very thread that announces them. What you're asking doesn't get supported at all: you want to change entirely the behaviour of a particular mod. As I suggested: you will have to do this on your own, without anybody's help.
GauGau you can close the questin... I've dropped it... it's okay now