<?php
/********************************************************** ****************
* LATEST FIGURES CENTER PANEL ALIEN *
* *
* Copyright (C) 2017 Catzenjaeger *
* www.aliencollectors.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
if (!defined("IN_FUSION")) { die("Access Denied"); }
include INFUSIONS."figurelib/infusion_db.php";
require_once INCLUDES."infusions_include.php";
require_once INFUSIONS."figurelib/_functions.inc.php";
// CSS
echo "<style type='text/css'>
.badge {
padding: 1px 9px 2px;
font-size: 12.025px;
font-weight: bold;
white-space: nowrap;
color: #ffffff;
background-color: #999999;
-webkit-border-radius: 9px;
-moz-border-radius: 9px;
border-radius: 9px;
}
.badge:hover {
color: #ffffff;
text-decoration: none;
cursor: pointer;
}
.badge-error {
background-color: #b94a48;
}
.badge-error:hover {
background-color: #953b39;
}
.badge-warning {
background-color: #f89406;
}
.badge-warning:hover {
background-color: #c67605;
}
.badge-success {
background-color: #468847;
}
.badge-success:hover {
background-color: #356635;
}
.badge-info {
background-color: #3a87ad;
}
.badge-info:hover {
background-color: #2d6987;
}
.badge-inverse {
background-color: #333333;
}
.badge-inverse:hover {
background-color: #1a1a1a;
}
</style> ";
// LANGUAGE
if (file_exists(INFUSIONS."figurelib/locale/".LOCALESET."locale_figurelib.php")) {
include INFUSIONS."figurelib/locale/".LOCALESET."locale_figurelib.php";
} else {
include INFUSIONS."figurelib/locale/English/locale_figurelib.php";
}
// SEETING FIGURES PER SITE
// ATTENTION - ONLY 6 / 12 / 18
$limit = 6;
// Set Empty Arrays
$info = array("figure_rows" => 0, "page_nav" => false);
$info['item'] = array();
// Count all Figures
$max_rows = dbcount("(figure_id)", DB_FIGURE_ITEMS, "figure_freigabe=1 AND figure_class='2' AND ".groupaccess("figure_visibility")."");
// Check Rowstart
$_GET['rowstartalien'] = isset($_GET['rowstartalien']) && isnum($_GET['rowstartalien']) && $_GET['rowstartalien'] <= $max_rows ? $_GET['rowstartalien'] : 0;
if ($max_rows) {
// DATENBANK AUSLESEN UND DATEN BEREITSTELLEN
$resultalien = dbquery("
SELECT
tb.figure_id, tb.figure_class, tb.figure_submitter, tb.figure_freigabe, tb.figure_pubdate, tb.figure_scale, tb.figure_title, tb.figure_manufacturer, tb.figure_brand, tb.figure_datestamp, tb.figure_cat, tb.figure_clickcount,
tbc.figure_cat_id, tbc.figure_cat_name,
tbu.user_id, tbu.user_name, tbu.user_status, tbu.user_avatar,
tbm.figure_manufacturer_name,
tbb.figure_brand_name,
tbs.figure_scale_id, tbs.figure_scale_name
FROM ".DB_FIGURE_ITEMS." tb
LEFT JOIN ".DB_USERS." tbu ON tb.figure_submitter=tbu.user_id
LEFT JOIN ".DB_FIGURE_CATS." tbc ON tb.figure_cat=tbc.figure_cat_id
LEFT JOIN ".DB_FIGURE_MANUFACTURERS." tbm ON tbm.figure_manufacturer_id = tb.figure_manufacturer
LEFT JOIN ".DB_FIGURE_BRANDS." tbb ON tbb.figure_brand_id = tb.figure_brand
LEFT JOIN ".DB_FIGURE_SCALES." tbs ON tbs.figure_scale_id = tb.figure_scale
".(multilang_table("FI") ? "WHERE figure_language='".LANGUAGE."' AND" : "WHERE")." tb.figure_freigabe='1' AND tb.figure_class='2' AND ".groupaccess("tb.figure_visibility")."
ORDER BY figure_datestamp DESC
LIMIT ".$_GET['rowstartalien'].",".$limit."
");
// Pagenav
//$info['page_nav'] = $max_rows > $limit ? makepagenav($_GET['rowstartalien'], $limit, $max_rows, 6, FUSION_SELF."?") : 0;
$info['page_nav'] = $max_rows > $limit ? makepagenav($_GET['rowstartalien'], $limit, $max_rows, 2, FUSION_SELF."?", "rowstartalien") : 0;
// PANEL ÖFFNEN / ANFANG
$Counter = dbcount("(figure_id)", DB_FIGURE_ITEMS, "figure_freigabe='1' AND figure_class='2'");
//opentable("<b>Last Alien Figures</b> (".$Counter.") ".($info['page_nav'] ? "<span class='pull-right'>".$info['page_nav']."</span>" : "")."");
opentable("<strong>Aliens:</strong> <span class='badge badge-error'> ".$Counter."</span> ".($info['page_nav'] ? "<span class='pull-right'>".$info['page_nav']."</span>" : "")."");
// WENN DATEN UNGLEICH = 0 DANN DARSTELLUNG DER DATEN
if (dbrows($resultalien) != 0) {
echo "<hr>";
echo "<div class='container-fluid'>\n";
echo "<div class='row'>\n";
while($data = dbarray($resultalien)) {
// Get Image
$imageURL = figures_getImagePath("figure", "thumb", $data['figure_id']);
echo "<div class='col-lg-2 col-md-4 col-sm-4 col-xs-4 text-center'>\n";
// Popover über Bild
//echo"<div class='side-small figurelib-inforow-height'>";
echo"<a href='".INFUSIONS."figurelib/figures.php?figure_id=".$data['figure_id']."' class='' tabindex='0' data-toggle='popover' data-trigger='hover' data-popover-content='#".$data['figure_id']."' data-placement='top'><div class='side-small figurelib-inforow-height'><img src='".$imageURL."' alt='".$locale['CLFP_002']." : ".$data['figure_title']."' title='".$locale['CLFP_002']." : ".$data['figure_title']."' style='border:0px;max-height:100px;max-width:100px'/></div></a>";
// Content for Popover
echo"<div id='".$data['figure_id']."' class='hidden'>";
echo"<div class='popover-heading'>Short Preview</div>";
echo"<div class='popover-body'>";
echo"<img src='".$imageURL."' alt='".$locale['CLFP_002']." : ".$data['figure_title']."' title='".$locale['CLFP_002']." : ".$data['figure_title']."' style='border:0px;max-height:250px;max-width:250px'/>";
// COLUMN 2 (name of figure)
echo "<div class='side-small title='".$locale['CLFP_002']." : ".$data['figure_title']."' alt='".$locale['CLFP_002']." : ".$data['figure_title']."'><small><b>Name:</b> ".$data['figure_title']."</small></div>";
// COLUMN 3 (manufacturer)
echo "<div class='side-small title='".$locale['CLFP_003']." : ".$data['figure_manufacturer_name']."' alt='".$locale['CLFP_003']." : ".$data['figure_manufacturer_name']."'><small><b>Manufacturer:</b> ".$data['figure_manufacturer_name']."</small></div>\n";
// COLUMN 4 (brand)
echo "<div class='side-small title='".$locale['CLFP_004']." : ".$data['figure_brand_name']."' alt='".$locale['CLFP_004']." : ".$data['figure_brand_name']."'><small><b>Brand:</b> ".$data['figure_brand_name']."</small></div>\n";
// COLUMN 5 (scale)
echo "<div class='side-small title='".$locale['CLFP_005']." : ".$data['figure_scale_name']."' alt='".$locale['CLFP_005']." : ".$data['figure_scale_name']."'><small><b>Scale:</b> ".$data['figure_scale_name']."</small></div>\n";
// COLUMN 6 (release date)
// No release date or unknown = "no data" / WENN KEIN WERT ZUM DATUM IN DB DANN ZEIGE HINWEIS "NO DATA"
if ($data['figure_pubdate'] == "") {
echo "<div class='side-small title='".$locale['CLFP_006']." : ".$locale['CLFP_008']."' alt='".$locale['CLFP_006']." : ".$locale['CLFP_008']."'><small><b>Release:</b> ".$locale['CLFP_008']."</small></div>\n";
} else {
echo "<div class='side-small' title='".$locale['CLFP_006']." : ".$data['figure_pubdate']."' alt='".$locale['CLFP_006']." : ".$data['figure_pubdate']."'><small><b>Release:</b> ".$data['figure_pubdate']."</small></div>\n";
}
// COLUMN 7 (rating)
$drating = dbarray(dbquery("
SELECT
SUM(rating_vote) sum_rating,
COUNT(rating_item_id) count_votes
FROM ".DB_RATINGS."
WHERE rating_type='FI'
AND rating_item_id='".$data['figure_id']."'
"));
$rating = ($drating['count_votes'] > 0 ? str_repeat("<img src='".INFUSIONS.$inf_folder."/images/starsmall.png'>", ceil($drating['sum_rating']/$drating['count_votes'])) : "-");
echo "<div class='side-small' title='".$locale['CLFP_010']."' alt='".$locale['CLFP_010']."'><small><b>Rating:</b> ".$rating."</small></div>\n";
// COLUMN 8 Usercount
$count = dbcount("(figure_userfigures_id)", DB_FIGURE_USERFIGURES, "figure_userfigures_figure_id='".$data['figure_id']."'");
echo "<div class='side-small' title='".$locale['CLFP_020']." : ".$count."' alt='".$locale['CLFP_020']." : ".$count."'><small><b>Usercount:</b> ".trimlink($count,6)."</small></div>\n";
echo "</div>\n";
echo "</div>\n";
//echo "</div>\n";
// Popover über Name
echo"<a href='".INFUSIONS."figurelib/figures.php?figure_id=".$data['figure_id']."' class='' tabindex='0' data-toggle='popover' data-trigger='hover' data-popover-content='#".$data['figure_id']."' data-placement='top'><small>".trimlink($data['figure_title'],12)."</small></a>";
// Content for Popover
echo"<div id='".$data['figure_id']."' class='hidden'>";
echo"<div class='popover-heading'>Short Preview</div>";
echo"<div class='popover-body'>";
echo"<img src='".$imageURL."' alt='".$locale['CLFP_002']." : ".$data['figure_title']."' title='".$locale['CLFP_002']." : ".$data['figure_title']."' style='border:0px;max-height:250px;max-width:250px'/>";
// COLUMN 2 (name of figure)
echo "<div class='side-small title='".$locale['CLFP_002']." : ".$data['figure_title']."' alt='".$locale['CLFP_002']." : ".$data['figure_title']."'><small><b>Name:</b> ".$data['figure_title']."</small></div>";
// COLUMN 3 (manufacturer)
echo "<div class='side-small title='".$locale['CLFP_003']." : ".$data['figure_manufacturer_name']."' alt='".$locale['CLFP_003']." : ".$data['figure_manufacturer_name']."'><small><b>Manufacturer:</b> ".$data['figure_manufacturer_name']."</small></div>\n";
// COLUMN 4 (brand)
echo "<div class='side-small title='".$locale['CLFP_004']." : ".$data['figure_brand_name']."' alt='".$locale['CLFP_004']." : ".$data['figure_brand_name']."'><small><b>Brand:</b> ".$data['figure_brand_name']."</small></div>\n";
// COLUMN 5 (scale)
echo "<div class='side-small title='".$locale['CLFP_005']." : ".$data['figure_scale_name']."' alt='".$locale['CLFP_005']." : ".$data['figure_scale_name']."'><small><b>Scale:</b> ".$data['figure_scale_name']."</small></div>\n";
// COLUMN 6 (release date)
// No release date or unknown = "no data" / WENN KEIN WERT ZUM DATUM IN DB DANN ZEIGE HINWEIS "NO DATA"
if ($data['figure_pubdate'] == "") {
echo "<div class='side-small title='".$locale['CLFP_006']." : ".$locale['CLFP_008']."' alt='".$locale['CLFP_006']." : ".$locale['CLFP_008']."'><small><b>Release:</b> ".$locale['CLFP_008']."</small></div>\n";
} else {
echo "<div class='side-small' title='".$locale['CLFP_006']." : ".$data['figure_pubdate']."' alt='".$locale['CLFP_006']." : ".$data['figure_pubdate']."'><small><b>Release:</b> ".$data['figure_pubdate']."</small></div>\n";
}
// COLUMN 7 (rating)
$drating = dbarray(dbquery("
SELECT
SUM(rating_vote) sum_rating,
COUNT(rating_item_id) count_votes
FROM ".DB_RATINGS."
WHERE rating_type='FI'
AND rating_item_id='".$data['figure_id']."'
"));
$rating = ($drating['count_votes'] > 0 ? str_repeat("<img src='".INFUSIONS.$inf_folder."/images/starsmall.png'>", ceil($drating['sum_rating']/$drating['count_votes'])) : "-");
echo "<div class='side-small' title='".$locale['CLFP_010']."' alt='".$locale['CLFP_010']."'><small><b>Rating:</b> ".$rating."</small></div>\n";
// COLUMN 8 Usercount
$count = dbcount("(figure_userfigures_id)", DB_FIGURE_USERFIGURES, "figure_userfigures_figure_id='".$data['figure_id']."'");
echo "<div class='side-small' title='".$locale['CLFP_020']." : ".$count."' alt='".$locale['CLFP_020']." : ".$count."'><small><b>Usercount:</b> ".trimlink($count,6)."</small></div>\n";
echo "</div>\n";
echo "</div>\n";
?>
<div style='side-small text-align: center;'>
<!-- Manufacturer -->
<span class="small" title="Manufacturer: <?= $data['figure_manufacturer_name']; ?>"></span><i class="fa fa-fw fa-cogs"></i> <a href="<?= INFUSIONS."figurelib/figures.php?figures.php?manufacturer_id=".$data['figure_manufacturer']; ?>" class="small"> <?= trimlink($data['figure_manufacturer_name'], 10); ?></a><br />
<!-- Views -->
<span class="small" title="Views: <?= $data['figure_clickcount']; ?>"><i class="fa fa-fw fa-eye"></i> <?= $data['figure_clickcount']; ?></span><br />
<?php
// COMMENTS
$comments = dbcount("(comment_id)", DB_COMMENTS, "comment_type='FI' AND comment_item_id='".$data['figure_id']."'");
echo "<span class='small' title='Figure/item comments: ".$comments."'><i class='fa fa-fw fa-comments'></i>".$comments."</span><br />\n";
// <!-- Ratings Counter -->
// Bewertung
$drating = dbarray(dbquery("
SELECT
SUM(rating_vote) sum_rating,
COUNT(rating_item_id) count_votes
FROM ".DB_RATINGS."
WHERE rating_type='FI'
AND rating_item_id='".$data['figure_id']."'
"));
$rating = ($drating['count_votes'] > 0 ? str_repeat("<img src='".INFUSIONS.$inf_folder."/images/starsmall.png'>",ceil($drating['sum_rating']/$drating['count_votes'])) : "-");
echo "<span class='small' title='Rating'><i class='fa fa-fw fa-star'></i>".$rating."</span><br />\n";
//echo "<hr />\n";
?>
<?php if ((iADMIN || iSUPERADMIN) && checkrights("FI")) { ?>
<a href="<?= INFUSIONS."figurelib/admin.php".fusion_get_aidlink()."&section=figurelib_form&action=edit&figure_id=".$data['figure_id']; ?>" class="small"><i class="fa fa-fw fa-pencil"></i> <?= $locale['edit']; ?></a><br />
<?php } ?>
</div>
<?php
echo "</div>\n";
}
echo "</div>\n";
echo "</div>\n";
}
// PAGE NAV
//echo "<hr>";
//echo $info['page_nav'] ? "<div class='text-center'>".$info['page_nav']."</div>" : '';
echo "<hr>";
} else {
echo "<div style='text-align: center;'>".$locale['CLFP_001']."</div>"; // 001 = No figures available"
}
closetable();
// FUNCTION FOR POPUP
add_to_footer("<script type='text/javascript'>$(function(){
$('[data-toggle=popover]').popover({
html : true,
content: function() {
var content = $(this).attr('data-popover-content');
return $(content).children('.popover-body').html();
},
title: function() {
var title = $(this).attr('data-popover-content');
return $(title).children('.popover-heading').html();
}
});
}); </script>");
while($data = dbarray($resultalien)) {
// Get Image
$imageURL = figures_getImagePath("figure", "thumb", $data['figure_id']);
}
Category Forum
Modifications and Requests - 9Labels
None yet
Statistics
3 participants
Notifications
You are not receiving notifications from this thread.
Related Questions