Пример #1
0
                                                        <a class="right" href="<?php 
            the_permalink();
            ?>
">Zobacz przepis...</a>
                                                    </div>
                                                </div>
                                            </div>
                                            <!-- Podtytuł i ocena przepisu -->
                                            <div class="medium-12 columns">
                                                <h5 class="left"><i class="fa fa-comments-o"></i> <?php 
            comments_number('0 komentarzy', '1 komentarz', '% komentarzy');
            ?>
</h5>
                                                <h5 class="right rating">
                                                    <?php 
            showRating($post->ID);
            ?>
                                                </h5>
                                            </div>
                                        </div>  
                                    <?php 
            if ($close_row) {
                echo '</div>';
            }
            // Zamknięcie kalsy 'row'
            ?>
 
                                <!-- #endregion -->
                            <?php 
        }
        ?>
Пример #2
0
 */
include "../includes/config.inc.php";
//Getting mode..
$mode = $_POST['mode'];
$mode = mysql_clean($mode);
switch ($mode) {
    //Rating function works with every object in similar manner therefore
    //Using the same code in different files we are using it here...
    case "rating":
        $type = mysql_clean(post('type'));
        $id = mysql_clean(post('id'));
        $rating = mysql_clean(post('rating'));
        switch ($type) {
            case "video":
                $result = $cbvid->rate_video($id, $rating);
                echo showRating($result, $type);
                break;
            case "photo":
                $rating = $_POST['rating'] * 2;
                $id = $_POST['id'];
                $result = $cbphoto->rate_photo($id, $rating);
                $result['is_rating'] = true;
                $cbvid->show_video_rating($result);
                $funcs = cb_get_functions('rate_photo');
                if ($funcs) {
                    foreach ($funcs as $func) {
                        $func['func']($id);
                    }
                }
                break;
            case "collection":
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;
Пример #4
0
<?php

/**
 * $Id$
 *
 * For rating
 *
 * $_GET['i'] object id
 * $_GET['t'] rating type (RATE_FILE, RATE_BLOG, RATE_NEWS)
 * $_GET['v'] vote score
 */
require_once 'find_config.php';
if (!$h->session->id || empty($_GET['i']) || !is_numeric($_GET['i']) || empty($_GET['t']) || !is_numeric($_GET['t']) || empty($_GET['v']) || !is_numeric($_GET['v'])) {
    die('bad');
}
$_type = $_GET['t'];
$_id = $_GET['i'];
$_val = $_GET['v'];
rateItem($_type, $_id, $_val);
echo showRating($_type, $_id);
Пример #5
0
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;
}
Пример #6
0
            <!-- #region Sidebar -->
                <?php 
//get_sidebar('restaurants');
?>

            <div class="large-4 column recipe-side">

                <!-- Oceń przepis -->
                <div class="row">
                    <div class="medium-12 column">
                        <h3 style="font-weight:500;">Oceń restaurację:</h3>
                        <div class="row">
                            <div class="medium-11 column medium-centered rating">
                                <?php 
showRating($post->ID, true);
?>
                            </div>
                        </div>
                    </div>
                </div>                

            </div>

            <!-- #endregion -->

        </div>
        <!-- #endregion -->


    </div>