hey guys im not so new at coding but new at this copermine and took me a while to figure this out and got it working perfectly.
If you guys have a guestbook that you want intergrated into copermine read this its really neat.
First copy your CPG/search.php file and rename the coppied file to guestbook.php.
Secont move the guestbook.php back to same location as search.php.
Third edit the guestbook.php and do the following.
This is the contents of search.php that you copied and renamed to guestbook.php.
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2007 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.12
$Source$
$Revision: 3636 $
$Author: gaugau $
$Date: 2007-06-29 11:35:30 +0200 (Fr, 29 Jun 2007) $
**********************************************/
define('IN_COPPERMINE', true);
define('SEARCH_PHP', true);
require('include/init.inc.php');
if (!USER_ID && $CONFIG['allow_unlogged_access'] == 0) {
$redirect = $redirect . "login.php";
header("Location: $redirect");
exit();
}
pageheader($lang_search_php['title']);
echo <<< EOT
<form method="post" action="thumbnails.php" name="searchcpg">
EOT;
starttable('60%', $lang_search_php['title']);
$ip = GALLERY_ADMIN_MODE ? '
<tr>
<td>
<input type="checkbox" name="pic_raw_ip" class="checkbox" id="pic_raw_ip" /><label for="pic_raw_ip" class="clickable_option">'.$lang_search_php['ip_address'].'</label>
</td>
</tr>' :
'<tr>
<td> </td>
<td> </td>
</tr>';
$customs = '';
$result = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_CONFIG']} WHERE name LIKE 'user_field%_name' AND value <> '' ORDER BY name ASC");
while ($row = mysql_fetch_assoc($result)){
$name = str_replace(array('_field', '_name'), '', $row['name']);
$customs .= <<< EOT
<tr>
<td><input type="checkbox" name="$name" id="$name" class="checkbox" /><label for="$name" class="clickable_option">{$row['value']}</label></td>
</tr>
EOT;
}
echo <<< EOT
<tr>
<td class="tableb" align="center" >
<input type="text" style="width: 80%" name="search" maxlength="255" value="" class="textinput" />
<input type="submit" value="{$lang_search_php['submit_search']}" class="button" />
<input type="hidden" name="album" value="search" />
</td>
</tr>
<tr>
<td class="tableb">
<table align="center" width="60%">
<tr>
<td>{$lang_search_php['fields']}:</td>
<td align="center">{$lang_search_php['age']}:</td>
</tr>
<tr>
<td><input type="checkbox" name="title" id="title" class="checkbox" checked="checked" /><label for="title" class="clickable_option">{$lang_adv_opts['title']}</label></td>
<td align="right">{$lang_search_php['newer_than']} <input type="text" name="newer_than" size="3" maxlength="4" class="textinput" /> {$lang_search_php['days']}</td>
</tr>
<tr>
<td><input type="checkbox" name="caption" id="caption" class="checkbox" checked="checked" /><label for="caption" class="clickable_option">{$lang_adv_opts['caption']}</label></td>
<td align="right">{$lang_search_php['older_than']} <input type="text" name="older_than" size="3" maxlength="4" class="textinput" /> {$lang_search_php['days']}</td>
</tr>
<tr>
<td><input type="checkbox" name="keywords" id="keywords" class="checkbox" checked="checked" /><label for="keywords" class="clickable_option">{$lang_adv_opts['keywords']}</label></td>
<td> </td>
</tr>
<tr>
<td><input type="checkbox" name="owner_name" id="owner_name" class="checkbox" /><label for="owner_name" class="clickable_option">{$lang_adv_opts['owner_name']}</label></td>
<td align="right"><select name="type" class="listbox">
<option value="AND" selected="selected">{$lang_search_php['all_words']}</option>
<option value="OR">{$lang_search_php['any_words']}</option></select>
</td>
</tr>
<tr>
<td><input type="checkbox" name="filename" id="filename" class="checkbox" /><label for="filename" class="clickable_option">{$lang_adv_opts['filename']}</label></td>
<td> </td>
</tr>
$customs
$ip
</table>
</td>
</tr>
EOT;
endtable();
echo '</form>';
if ($CONFIG['clickable_keyword_search'] != 0) {
include('include/keyword.inc.php');
}
echo <<< EOT
<script language="javascript" type="text/javascript">
<!--
document.searchcpg.search.focus();
-->
</script>
EOT;
pagefooter();
ob_end_flush();
?>
Everything in the above code FROM "echo <<< EOT" TO "ob_end_flush();" must be removed EXEPT "pagefooter();" and replaced WITH CODE BELOW.
echo "<iframe src=\"http://www.xxxxxxxx.com/guest/mjguest.php\" name=\"frame1\" scrolling=\"auto\" frameborder=\"yes\" align=\"center\" height = \"600px\" width = \"100%\">\n";
echo "</iframe>\n";
Your guestbook.php file you coppied looks like this now with the new added code.
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2007 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.12
$Source$
$Revision: 3636 $
$Author: gaugau $
$Date: 2007-06-29 11:35:30 +0200 (Fr, 29 Jun 2007) $
**********************************************/
define('IN_COPPERMINE', true);
define('SEARCH_PHP', true);
require('include/init.inc.php');
if (!USER_ID && $CONFIG['allow_unlogged_access'] == 0) {
$redirect = $redirect . "login.php";
header("Location: $redirect");
exit();
}
pageheader($lang_search_php['title']);
echo "<iframe src=\"http://www.xxxxxxxx.com/guest/mjguest.php\" name=\"frame1\" scrolling=\"auto\" frameborder=\"yes\" align=\"center\" height = \"600px\" width = \"100%\">\n";
echo "</iframe>\n";
pagefooter();
?>
All you need to do after this is replace the "
http://www.xxxxxxxx.com/guest/mjguest.php" with the site address of your guestbook's index page and than go to your settings in copermine and under theme settings add your custom link as guestbook and the loocation to your guestbook.php file.
here is an example on my page
www.on-my-space.com/photos/guestbook.phpENJOY