It's becoming one. We've just about got it finished for D6 and starting on D7 shortly. It'll be a freebie just to see if anyone wants to create an even larger module and offer it for free. Any ideas on this thing would be greatly appreciated. I'm about to start posting the code that has to do with these images just to see if anyone can pick it off.
Actually, screw it. Here's the functions we're using in inc/classes/BxDolClassRooms.php Anyone see where I'm screwin' up here?
function ShowClroomsGalleryPage() {
global $logged;
global $site;
$iNameIndex = 7775;
$sHeaderT = _t( "_Clroom gallery" );
$sHeader = _t( "_Clroom gallery" );
$sMainCode = '';
if( $logged['member'] = member_auth( 0, false ) )
$iMemberID = (int)$_COOKIE['memberID'];
else {
$iMemberID = 0;
$logged['admin'] = member_auth( 1, false );
}
$iClroomsID = (int)$_REQUEST['ID'];
if ( !$iClroomsID ) {
Header( "Location: {$site['url']}{$this->sCurrFile}" );
exit;
}
if ( $aClroomsInfo = $this->getClroomsInfo( $iClroomsID ) ) {
$aClroomsInfo['Name_html'] = htmlspecialchars_adv( $aClroomsInfo['Name'] );
if ( (int)$aClroomsInfo['hidden_clroom'] and !$this->isClroomsMember( $iMemberID, $iClroomsID ) and !$logged['admin'] )
$sMainCode = _t( "_You cannot view gallery while not a clroom member" );
else {
if( $aClroomsInfo['status'] == 'Active' or $aClroomsInfo['creatorID'] == $iMemberID or $logged['admin'] ) {
$sHeader = _t( "_Clroom gallery" );
$sMainCode = $this->PCGenClroomsGallery($iMemberID, $iClroomsID, $aClroomsInfo);
} else {
$iNameIndex = 0;
$sHeader = _t( "_Clroom is suspended" );
$sHeaderT = _t( "_Clroom is suspended" );
$sMainCode = _t( "_Sorry, clroom is suspended" );
}
}
} else
$sMainCode = _t( "_Clroom not found_desc" );
return array($iNameIndex, $sHeader, $sHeaderT, $sMainCode);
}
function PCGenClroomsGallery($iMemberID, $iClroomsID, $aClroomsInfo) {
global $site;
$sUploadedByC = _t('_Uploaded by');
$sSetAsThumbC = _t('_Set as thumbnail');
$sDelImgC = _t('_Delete image');
$sUploadImageC = _t('_Upload image');
$sClroomsLink = $this->getClroomsUrl($iClroomsID, $aClroomsInfo['Uri']);
$sBreadCrumbs = <<<EOJ
<div class="clrooms_breadcrumbs">
<a href="{$site['url']}">{$site['title']}</a> /
<a href="{$site['url']}{$this->sCurrFile}">__Clrooms__</a> /
<a href="{$sClroomsLink}">{$aClroomsInfo['Name_html']}</a> /
<span class="active_link">__Clroom gallery__</span>
</div>
EOJ;
$sBreadCrumbs = str_replace( "__Clrooms__", _t( "_Clrooms" ), $sBreadCrumbs );
$sBreadCrumbs = str_replace( "__Clroom gallery__", _t( "_Clroom gallery" ), $sBreadCrumbs );
$sQuerySQL = "
SELECT `ClroomsGallery`.*, `Profiles`.`NickName`
FROM `ClroomsGallery`
LEFT JOIN `Profiles` ON `ClroomsGallery`.`by`=`Profiles`.`ID`
WHERE `ClroomsGallery`.`clroomID`='{$iClroomsID}'
ORDER BY `ClroomsGallery`.`ID`
";
$resPics = db_res( $sQuerySQL );
$sRetHtml = <<<EOF
{$sBreadCrumbs}
<div class="clroom_gallery_wrapper">
<div class="clear_both"></div>
EOF;
while( $arrPic = mysql_fetch_assoc( $resPics ) ) {
$sGalNick = htmlspecialchars_adv($arrPic['NickName']);
$iNewJSW = $arrPic['width']+20;
$iNewJSH = $arrPic['height']+20;
$sRetHtml .= <<<EOF
<div class="clroom_gallery_pic" style="">
<a href="{$site['clrooms_gallery']}{$arrPic['clroomsID']}_{$arrPic['ID']}_{$arrPic['seed']}.{$arrPic['ext']}"
title="{$sUploadedByC} {$sGalNick}" alt="window.open(this.href, '_blank', 'width={$iNewJSW},height={$iNewJSH}');return false;">
<img src="{$site['clrooms_gallery']}{$arrPic['clroomsID']}_{$arrPic['ID']}_{$arrPic['seed']}_.{$arrPic['ext']}"
style="width:{$arrPic['width_']}px;height:{$arrPic['height_']}px" alt="" />
</a>
EOF;
if( $aClroomsInfo['thumb'] != $arrPic['ID'] and $aClroomsInfo['creatorID'] == $iMemberID ) {
$sRetHtml .= <<<EOF
<br />
<a href="{$site['url']}clroom_actions.php?ID={$iClroomsID}&a=def&img={$arrPic['ID']}" class="clroom_set_thumb">{$sSetAsThumbC}</a>
EOF;
}
if( $aClroomsInfo['creatorID'] == $iMemberID or $arrPic['by'] == $iMemberID ) {
$sRetHtml .= <<<EOF
<br />
<a href="{$site['url']}clroom_actions.php?ID={$iClroomsID}&a=delimg&img={$arrPic['ID']}" class="clroom_set_thumb" alt="return confirm('<?=_t('_Are you sure want to delete this image?')?>');">{$sDelImgC}</a>
EOF;
}
$sRetHtml .= '</div>';
}
$sRetHtml .= '<div class="clear_both"></div></div>';
if( ( (int)$aClroomsInfo['members_post_images'] and $this->isClroomsMember( $iMemberID, $iClroomsID ) ) or $aClroomsInfo['creatorID'] == $iMemberID ) {
$sRetHtml .= <<<EOF
<a href="{$site['url']}clroom_actions.php?a=upload&ID={$iClroomsID}" class="actions">{$sUploadImageC}</a>
EOF;
}
return $sRetHtml;
}