20 May 2013 
Support Center » Knowledgebase » Customizing FusionBB » Particle Boxes: Adding 'Photopost Recent Photos' Content
 Particle Boxes: Adding 'Photopost Recent Photos' Content
Article
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['cell spacing']}' 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->loadTemplat e("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:3 306", "$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,bigimag e
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($resul ts);

$db->clearResults($res ults);

$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_FO UND'];
$pp_string .= "</td>";
}
$pp_data = null;

$template->setTemp lateVar("PHOTOPOST",$pp_s tring);

// ------------------------- ------------------------- --------
// 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.)


Article Details
Article ID: 66
Created On: 10 Nov 2008 7:16 PM

 This answer was helpful  This answer was not helpful

 Back
 Login  
Email Address:
Password:
Remember Me:
 
 Search
 Article Options
Home | Submit a Ticket | Knowledgebase | Downloads
Language:

Help Desk Software by Kayako eSupport v3.30.02