コード例 #1
0
ファイル: index.php プロジェクト: jestrella04/iGallery1x
function showPic()
{
    global $db, $prefix, $iConfig, $moduleName, $user;
    $picturesPath = $iConfig['pictures_path'];
    $popCount = intval($iConfig['pop_count']);
    //$inlineJS = '';
    AddJSToHead('includes/jquery/jquery.js', 'file');
    AddJSToHead('modules/' . $moduleName . '/includes/jquery/jquery.MetaData.js', 'file');
    AddJSToHead('modules/' . $moduleName . '/includes/jquery/jquery.rating.js', 'file');
    AddCSSToHead('modules/' . $moduleName . '/includes/jquery/jquery.rating.css', 'file');
    //AddJSToHead( $inlineJS,'inline' );
    galleryHeader();
    echo '<div id="show-picture-wrapper">' . PHP_EOL;
    $pictureId = $_GET['pictureid'];
    $picture = $db->sql_fetchrow($db->sql_query('SELECT * FROM ' . $prefix . '_igallery_pictures WHERE picture_id=' . $pictureId . ' LIMIT 0,1'));
    $filename = $picture['picture_file'];
    $albumId = $picture['album_id'];
    $pictureTitle = $picture['picture_title'];
    $pictureType = $picture['picture_type'];
    $description = $picture['picture_desc'];
    $counter = $picture['picture_counter'];
    $dateAdded = $picture['picture_date'];
    $userId = $picture['picture_userid'];
    $album = $db->sql_fetchrow($db->sql_query('SELECT album_title, album_folder FROM ' . $prefix . '_igallery_albums WHERE album_id=\'' . $albumId . '\' LIMIT 0,1'));
    $albumTitle = $album['album_title'];
    $folderName = $album['album_folder'];
    showTopLinks($albumId, $pictureId);
    echo '<br /><br />' . PHP_EOL;
    picTopMenu($pictureId, $albumId);
    echo '<div id="show-pic">' . PHP_EOL;
    echo '	' . showNewEmblem($dateAdded) . showPopEmblem($counter, $popCount) . '<br />' . PHP_EOL;
    echo '	<img class="show-pic" src="modules.php?name=' . $moduleName . '&amp;op=getImg&amp;pictureid=' . $pictureId . '" alt="' . $filename . '" title="' . $pictureTitle . '" />' . PHP_EOL;
    echo '</div>' . PHP_EOL;
    echo '<div class="content-box"><b>' . $pictureTitle . '</b>: ' . $description . '</div>' . PHP_EOL;
    showDetails($pictureId);
    echo '<br />' . PHP_EOL;
    echo '<div id="comment-button"><button>' . _IG_POSTCOMMENT . '</button></div>' . PHP_EOL;
    commentForm($pictureId);
    echo '<script type="text/javascript">//<![CDATA[' . PHP_EOL;
    echo '	$("button").click(function () {' . PHP_EOL;
    echo '		$("#post-comment").show("slow");' . PHP_EOL;
    echo '	});' . PHP_EOL;
    echo '//]]></script>' . PHP_EOL;
    displayComments($pictureId);
    echo '</div>' . PHP_EOL;
    galleryFooter();
}
コード例 #2
0
get_lang($blockModuleName);
include_once NUKE_BASE_DIR . 'modules/' . $blockModuleName . '/includes/settings.php';
include_once NUKE_BASE_DIR . 'modules/' . $blockModuleName . '/includes/functions.php';
$content = '<center>' . PHP_EOL;
$result = $db->sql_query('SELECT *, (SELECT count(comment_pictureid) FROM ' . $prefix . '_igallery_comments WHERE comment_pictureid=picture_id) AS m_total FROM ' . $prefix . '_igallery_pictures ORDER BY rand() LIMIT 0,' . $showPic . ' ;');
while ($picture = $db->sql_fetchrow($result)) {
    $pictureId = intval($picture['picture_id']);
    $albumId = intval($picture['album_id']);
    $title = $picture['picture_title'];
    $counter = intval($picture['picture_counter']);
    $totalRates = intval($picture['picture_rating']);
    $totalVotes = intval($picture['picture_votes']);
    $totalComments = intval($picture['m_total']);
    $date = $picture['picture_date'];
    $popCount = $iConfig['pop_count'];
    $content .= '	' . showNewEmblem($date) . showPopEmblem($counter, $popCount) . PHP_EOL;
    $thumbSrc = 'modules.php?name=' . $blockModuleName . '&amp;op=getThumb&amp;pictureid=' . $pictureId;
    $content .= '	<a href="modules.php?name=' . $blockModuleName . '&amp;op=showPic&amp;pictureid=' . $pictureId . '"><img style="max-width: 90%; border: 0px none;" src="' . $thumbSrc . '" title="' . $title . '" alt="" /></a>' . PHP_EOL;
    //if($showDetails) {
    $content .= '<br /><a href="modules.php?name=' . $blockModuleName . '&amp;op=showPic&amp;pictureid=' . $pictureId . '">' . $title . '</a><br />' . PHP_EOL;
    if ($totalRates !== 0 && $totalVotes !== 0) {
        $content .= '	' . showRating($totalRates / $totalVotes) . '<br />' . PHP_EOL;
        //echo '	<b>'._IG_TOTALVOTES.'</b>: '.$totalVotes.'<br />'.PHP_EOL;
    } else {
        $content .= '	' . showRating(0) . '<br />' . PHP_EOL;
    }
    $content .= '	<b>' . $counter . '</b> ' . _IG_HITS . '<br />' . PHP_EOL;
    $content .= '	<b>' . $totalComments . '</b> ' . _IG_TOTALCOMMENTS . '<br /><br />' . PHP_EOL;
    //}
}
$content .= '</center>' . PHP_EOL;
コード例 #3
0
ファイル: functions.php プロジェクト: jestrella04/iGallery1x
function showSubPics($albumId)
{
    global $db, $prefix, $moduleName, $iConfig, $ofsppg, $ofsbgn;
    $showDetails = intval($iConfig['show_details']);
    $showColumns = intval($iConfig['show_columns']);
    $thumbsPath = $iConfig['thumbs_path'];
    $thumbsFormat = strtolower($iConfig['thumbs_format']);
    $popCount = intval($iConfig['pop_count']);
    $albumInfo = $db->sql_fetchrow($db->sql_query('SELECT album_folder, album_desc FROM ' . $prefix . '_igallery_albums WHERE album_id=' . $albumId . ''));
    $folderName = $albumInfo['album_folder'];
    $column = 1;
    $srow = 1;
    echo '<table class="show-child" cellspacing="5" cellpadding="5"><tr>' . PHP_EOL;
    $result = $db->sql_query('SELECT * FROM ' . $prefix . '_igallery_pictures WHERE album_id=' . $albumId . ' ORDER BY picture_id ASC LIMIT ' . $ofsbgn . ',' . $ofsppg . '');
    while ($picture = $db->sql_fetchrow($result)) {
        $pictureId = intval($picture['picture_id']);
        $catId = intval($picture['album_id']);
        $title = $picture['picture_title'];
        $description = $picture['picture_desc'];
        $filename = $picture['picture_file'];
        $counter = intval($picture['picture_counter']);
        $totalRates = intval($picture['picture_rating']);
        $totalVotes = intval($picture['picture_votes']);
        if ($totalRates !== 0 && $totalVotes !== 0) {
            $rating = $totalRates / $totalVotes;
        } else {
            $rating = 0;
        }
        $date = $picture['picture_date'];
        $totalComments = intval($db->sql_numrows($db->sql_query('SELECT comment_id FROM ' . $prefix . '_igallery_comments WHERE comment_pictureid=' . $pictureId . '')));
        echo '<td class="sub-album">' . PHP_EOL;
        echo '	<div class="thumb-target">' . PHP_EOL;
        $thumbSrc = 'modules.php?name=' . $moduleName . '&amp;op=getThumb&amp;pictureid=' . $pictureId;
        echo '		<a href="modules.php?name=' . $moduleName . '&amp;op=showPic&amp;pictureid=' . $pictureId . '"><img class="sub-album" src="' . $thumbSrc . '" alt="' . $title . '" /></a>' . PHP_EOL;
        echo '		<div class="tooltip_description">' . PHP_EOL;
        echo '			<p><span class="title">' . $title . '</span>';
        echo showNewEmblem($date) . showPopEmblem($counter, $popCount);
        echo '<br />' . PHP_EOL;
        if ($description) {
            echo '			<span>' . $description . '</span>';
        }
        echo '			</p>';
        if ($totalRates && $totalVotes && $rating) {
            echo '			<p>' . showRating($rating) . '</p>' . PHP_EOL;
            //echo '			<p>'.PHP_EOL:
            echo '			<b>' . number_format($rating, 2, ' .', '') . '</b> ' . _IG_WITH . ' ' . $totalVotes . ' ' . _IG_TOTALVOTES . '<br />' . PHP_EOL;
        } else {
            echo '			<p>' . showRating(0) . '</p>' . PHP_EOL;
        }
        echo '			<b>' . $counter . '</b> ' . _IG_HITS . '<br />' . PHP_EOL;
        echo '			<b>' . $totalComments . '</b> ' . _IG_TOTALCOMMENTS . '<br />' . PHP_EOL;
        echo '		</div>';
        echo '	</div>' . PHP_EOL;
        echo '</td>' . PHP_EOL;
        if ($column % $showColumns == 0) {
            echo '</tr><tr>' . PHP_EOL;
            $srow++;
        }
        $column++;
    }
    echo '<td></td></tr></table>' . PHP_EOL;
}