(Applies to version 1.0 of FusionBB)
Adding the following code will allow you to create a particle box for Photopost Recent Photos (as well as some code to
add the Recent Photos to the Forum Index page, as an alternative).
Disclaimer: Please backup every file you intend to modify.
If the modification modifies the database, it's a good idea to
backup your database before doing so.
Note: If you choose to modify your FusionBB code, you may be giving up your right for "official" support from InteractivePHP,Inc.
If you need official support, you'll need to restore unmodified files.
This code works under FusionBB 1.0
*Files Altered:
/templates/fusionbb/board_details.php
/fusionbb.php
This coding will add three Recent Photos above your "Icon Legend" box at the bottom of the Forum Index. (Any specific URLs and other information below is included just for demonstration purposes. You will need to substitute information specific to your boards.)
1) Open /templates/fusionbb/board_details.php
FIND
return <<<EOF
ADD below it
{$skin['tableopen']}
<table border='0' cellpadding='3'
cellspacing='{$skin['cellspacing']}' width='100%'>
<tr>
<th class='theader' align='left' width='100%' colspan='3'>
Recent PhotoPosts
</th>
</tr>
<tr>
<!--PHOTOPOST-->
</tr>
</table>
{$skin['tableclose']}
2) Open /fusionbb.php
FIND
$template->loadTemplate("board_details");
ADD below it (*Substitute your specific files/information for the ones used in the example*)
// ----------------------------------------------------------
// PHOTOPOST RECENT PHOTOS ADD
$pp_host="localhost";
$pp_database="medar_db";
$pp_mysql_user="medar";
$pp_mysql_password="medar_pw";
$pp_url="http://www.bladekeep.com/gallery";
$pp_limit=3;
//End Config
$pp_link = mysql_connect("$pp_host:3306", "$pp_mysql_user",
"$pp_mysql_password") or die ('I cannot connect to the PhotoPost
database.[$php_errormsg]');
mysql_select_db ("$pp_database",$pp_link)or die("Could not connect
to
PhotoPost database". mysql_error() );
$sql = "SELECT id,title,cat,date,bigimage
FROM $pp_database.photos
WHERE bigimage!=''
AND approved='1'
ORDER BY date DESC
LIMIT $pp_limit"
;
if(!$results=$db->executeQuery($sql)) {
dieHere(1,$lang_str['BAD_QUERY'],__LINE__,__FILE__,$sql);
}
$pp_data['results']=$db->fetchArray($results);
$db->clearResults($results);
$pp_string = '';
$sizeofpp = sizeof($pp_data['results']);
for ($i=0;$i<$sizeofpp;$i++) {
$pp_string .= "<td align='center' valign='middle'
class='color1'>";
$pp_string .= "<a href=\"$pp_url/showphoto.php/photo/" .
$pp_data['results'][$i]['id'] . "/limit/recent\">
$pp_string .= "<a href=\"$pp_url/showphoto.php?photo=" .
$pp_data['results'][$i]['id'] . "\">
<img border=\"0\" src=\"$pp_url/data/" .
$pp_data['results'][$i]['cat'] . "/thumbs/" .
$pp_data['results'][$i]['bigimage'] . "\" alt=\"" .
$pp_data['results'][$i]['title'] .
"\"/></a><br/><span class='mini'>"$pp_data['results'][$i]['title'].
"</span>";
$pp_string .= "</td>";
}
if ($i == 0) {
$pp_string .= "<td align='left' valign='top'
class='color1'>";
$pp_string .= "• " . $lang_str['NO_PICTURES_FOUND'];
$pp_string .= "</td>";
}
$pp_data = null;
$template->setTemplateVar("PHOTOPOST",$pp_string);
// ----------------------------------------------------------
// PHOTOPOST RECENT PHOTOS END
(Credit for this modification goes to Medar, CT, and Dave (all members of FusionBB) as well to the unknown designer
of the original 'Photopost Recent Photos' hack for Threads, upon which this modification is based on.)