Hi, Cellarius !
Maybe it will be useful for somebody with photopost :
includes/class_bbcode.php in function
handle_bbcode_img_match($link) find
PHP Code:
return '<img src="' . $link . '" border="0" alt="" />';
and replace with
PHP Code:
$cat = "";
$big = "";
$search = "photopost/data";
$i = strpos ( $link, $search );
if ( $i != 0 )
{
$cat = substr ( $link, $i + strlen ( $search ) + 1 );
$cat = str_replace ( "medium/" , "", $cat );
$i = strpos ($cat, "/" );
$big = substr ( $cat, $i + 1 );
$cat = substr ( $cat, 0, $i );
$query = "SELECT * FROM `pp_photos` WHERE (cat = " . $cat . " AND bigimage = '" . $big . "') OR (storecat = " . $cat . " AND bigimage = '" . $big . "') ";
$results = $this->registry->db->query_read("$query" );
if ($this->registry->db->num_rows($results) > 0)
{
while ($result = $this->registry->db->fetch_array($results))
{
$corr = $result['id'];
$tit = $result['title'];
}
}
$gal = 'http://www.art-in-exile.com/forums/photopost/showgallery.php?cat=' . $cat;
$pic = 'http://www.art-in-exile.com/forums/photopost/showphoto.php?photo=' . $corr;
$linkg = '<td align="left"><div class="smallfont"><a href="' . $pic . '" target="_blank">' . $tit . '</a></div></td><td align="right"><div class="smallfont"><a href="' . $gal . '" target="_blank">Gallery</a></div></td>';
return '<table><tr><td colspan=2><img src="' . $link . '" border="0" alt="" /></td></tr><tr>' . $linkg . '</tr></table>';
}
else
{
return '<img src="' . $link . '" border="0" alt="" />';
}
This adds links to gallery and photo below image ( [IМG] tag ), only if image is in photopost datastore. Links addition on-fly, during show (showthread e.g.), not during posting or editing.
Sorry, i've no time to do it well, so this code needs some replacement for user's config :
1. path to photopost (2 lines)
2. determine photopost in link to image : $search = "photopost/data";
3. photopost tables prefix : pp_
DEMO
here
Maybe somebody can do it better
This code needs yet one replacement in another file, who is interested in it - PM, please