Panel ostatnio dodane z przesuwanymi zakładkami
|
jozio_94 |
Dodany dnia 18.07.2012 14:04:52
|
Przedszkolak
Postów: 84 Pomógł: 7 Ostrzeżeń: 2
Data rejestracji: 15.02.2011 21:39
|
Witam. W dzienniku błędów pojawia mi się taki komunikat: mysql_result() [<a href='function.mysql-result'>function.mysql-result</a>]: Unable to jump to row 0 on MySQL result index 179 Linia: 214 Wskazuje na plik maincore.php (linia 214), natomiast problem znika kiedy wyłączę jeden z paneli na stronie o nazwie zakladki_panel.php:
<?php
require_once "../../maincore.php";
require_once THEMES."templates/header.php";
echo '<link rel="stylesheet" type="text/css" href="'.INCLUDES.'tabs/style.css" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="'.INCLUDES.'tabs/style-ie.css" />
<![endif]-->
<script src=\''.INCLUDES.'tabs/jquery-1.2.6.min.js\' type=\'text/javascript\'></script>
<script src="'.INCLUDES.'tabs/jquery-easing.1.2.js" type=\'text/javascript\'></script>
<script src="'.INCLUDES.'tabs/jquery-easing-compatibility.1.2.js" type=\'text/javascript\'></script>
<script src="'.INCLUDES.'tabs/coda-slider.1.1.1.js" type=\'text/javascript\'></script>
<script type=\'text/javascript\'>
$(function () {
$("#blogSlider").codaSlider();
});
</script>';
echo "<table cellpadding='0' cellspacing='0'><tr><td valign='top' background='".THEME."images/tlo_ostatnio_dodane.png' width='49' height='176'>\n";
echo "<div style='padding: 7px 0 8px 10px;'><img src='".THEME."images/ostatnio_dodane.png'></div>";
echo '
<div id="blogSliderWrap">
<div id="blogSlider">
<div class="innerWrap">
<div class="panelContainer">
<div class="panel" title="">
<div class="wrapper">';
$num_articles = 1;
$x= 1;
function display_articles($article,$a_author) {
$display_article = "<tr>\n<td style='padding-top: 8px; padding-right: 6px; padding-left: 2px;'>
<img src='".THEME."images/artykuly.png'>
</td><td align='left' valign='top' width='100%' style='font-size: 10px; color: #444444; padding-top: 9px;'><div style='padding-bottom: 4px;'><a href='".BASEDIR."readarticle.php?article_id=".$article['article_id']."' class='side2' target='_top'>".trimlink($article['article_subject'], 30)."</a></div>
<div style='padding-bottom: 2px;'><b>Dodał:</b> <a href='".BASEDIR."profile.php?lookup=".$article['article_name']."' class='autor_art' target='_top'>".$a_author."</a></div>
<div style='padding-bottom: 2px;'><b>Data dodania:</b> ".$article['article_datestamp']."</div>
<div>".trimlink(stripslashes($article['article_snippet']), 145)."</td></tr>";
return $display_article;
}
$most_recent_articles = dbquery("SELECT * FROM ".DB_ARTICLES." ORDER BY article_id DESC");
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n<tr>\n";
if (dbrows($most_recent_articles)) {
// Only display articles that exist
while($article = dbarray($most_recent_articles)) {
if ( $x <= $num_articles ) {
// Calculate date submitted
$article['article_datestamp'] = showdate("shortdate", $article['article_datestamp']);
// Look up Author
$result = dbquery("SELECT user_name FROM ".DB_USERS." WHERE user_id='".$article['article_name']."'");
$a_author = dbresult($result,0);
// Display articles
echo display_articles($article,$a_author);
$x++;
}
}
} else {
echo "<tr><td colspan='5' align='center'><p>Brak</p></td></tr>";
}
echo "</table>";
echo '</div>
</div>
<div class="panel" title="">
<div class="wrapper"> ';
$num_downloads = 1;
$x= 1;
function display_downloads($download,$category,$download_author,$srednia) {
$display_download = "<tr>\n<td rowspan='3' style='padding-top: 4px; padding-right: 6px; padding-left: 2px;'>
<img src='".THEME."images/pliki.png'>
</td><td align='left' valign='top' colspan='2' width='100%' style='padding-top: 9px;'><div><a href='".BASEDIR."downloads.php?cat_id=".$download['download_cat']."&info_id=".$download['download_id']."' class='side2' target='_top'>".trimlink($download['download_title'], 30)."</a></div></td></tr><tr><td width='100%' style='font-size: 10px; color: #444444;'>
<div style='padding-bottom: 1px;'><b>Waga:</b> ".$download['download_filesize']."</div>
<div style='padding-bottom: 1px;'><b>Autor:</b> <a href='".BASEDIR."profile.php?lookup=".$download['download_user']."' class='autor_art' target='_top'>".$download['download_author']."</a></div>
<div style='padding-bottom: 1px;'><b>Dodane:</b> ".$download['download_datestamp']."</div>
<div style='padding-bottom: 1px;'><b>Pobierano:</b> ".$download['download_count']."</div>
<div><b>Ocena:</b> $srednia</div></td>
<td style='padding-top: 3px;'><a href='".BASEDIR."downloads.php?cat_id=".$download['download_cat']."&info_id=".$download['download_id']."' target='_top'><img src='".THEME."images/pob.png' border='0'></a></td></tr>";
return $display_download;
}
$most_recent_downloads = dbquery("SELECT * FROM ".DB_DOWNLOADS." ORDER BY download_id DESC");
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n<tr>\n";
if (dbrows($most_recent_downloads)) {
// Only display articles that exist
while($download = dbarray($most_recent_downloads)) {
if ( $x <= $num_downloads ) {
// Calculate date submitted
$download['download_datestamp'] = showdate("shortdate", $download['download_datestamp']);
// Look up Category
$result = dbquery("SELECT * FROM ".DB_DOWNLOAD_CATS." WHERE download_cat_id='".$download['download_cat']."'");
$category = dbresult($result,0);
// Look up Author
$result = dbquery("SELECT user_name FROM ".DB_USERS." WHERE user_id='".$download['download_user']."'");
$a_author = dbresult($result,0);
$srednia = dbresult(dbquery("
SELECT ROUND(AVG((SELECT AVG(rating_vote) FROM ".DB_RATINGS." WHERE (rating_item_id=download_id) AND rating_type='D')), 2) AS srednia
FROM ".DB_DOWNLOADS.""),0);
// Display articles
echo display_downloads($download,$category,$a_author,$srednia);
$x++;
}
}
} else {
echo "<tr><td colspan='5' align='center'><p>Brak</p></td></tr>";
}
echo "</table>";
echo '</div>
</div>
<div class="panel" title="">
<div class="wrapper"> ';
$video = dbarray(dbquery("SELECT * FROM ".$db_prefix."videos ORDER BY video_datestamp DESC LIMIT 1"));
$user = dbarray(dbquery("SELECT user_name FROM ".$db_prefix."users WHERE user_id='".$video['video_user']."' LIMIT 1"));
$voutes = dbquery("SELECT * FROM ".$db_prefix."ratings WHERE rating_type='V' AND rating_item_id='".$video['video_id']."'");
$voutecount = dbrows($voutes);
$voutescountv = 0;
while($dd = dbarray($voutes)){
$voutescountv = $voutescountv + $dd['rating_vote'];
}
$rating = $voutescountv/$voutecount;
$v = round($rating, 2);
echo " <table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<tr>
<td rowspan='3' style='padding-top: 4px; padding-right: 6px; padding-left: 2px;'>
<img src='".THEME."images/odcinki_online.png'>
</td></tr><tr><td align='left' colspan='2' valign='top' width='100%' style='padding-top: 9px;'><div style='padding-bottom: 4px;'><a href='".BASEDIR."infusions/fusion_tube/view.php?cat_id=".$video['video_cat']."&video_id=".$video['video_id']."'' class='side2' target='_top'>".$video['video_name']."</a></div></td></tr><tr><td width='100%' style='font-size: 10px; color: #444444;'>
<div style='padding-bottom: 1px;'><b>Czas:</b> ".$video['video_time']."</div>
<div style='padding-bottom: 1px;'><b>Dodał:</b> <a href='".BASEDIR."profile.php?lookup=".$video['video_user']."' class='autor_art' target='_top'>".$user['user_name']."</a></div>
<div style='padding-bottom: 1px;'><b>Data:</b> ".date("d.m.Y", $video['video_datestamp'])."</div>
<div style='padding-bottom: 1px;'><b>Ogl±dano:</b> ".($video['video_views']-1)."</div>
<div><b>Ocena:</b> $v</div></td>
<td style='padding-top: 3px;' align='center'><a href='".BASEDIR."infusions/fusion_tube/view.php?cat_id=".$video['video_cat']."&video_id=".$video['video_id']."' target='_top'><img src='".THEME."images/play.png' border='0'></a></td></tr></table> ";
echo ' </div>
</div>
</div>
</div>
</div>
';
echo "</td></tr></table>";
echo "</body></html>";
?>
Panel ten pokazuje ostatni artykuł, ostatnio dodany plik oraz film video. Prawdopodobnie coś jest nie tak między 103 a 135 linijką kodu tego panelu:
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n<tr>\n";
if (dbrows($most_recent_downloads)) {
// Only display articles that exist
while($download = dbarray($most_recent_downloads)) {
if ( $x <= $num_downloads ) {
// Calculate date submitted
$download['download_datestamp'] = showdate("shortdate", $download['download_datestamp']);
// Look up Category
$result = dbquery("SELECT * FROM ".DB_DOWNLOAD_CATS." WHERE download_cat_id='".$download['download_cat']."'");
$category = dbresult($result,0);
// Look up Author
$result = dbquery("SELECT user_name FROM ".DB_USERS." WHERE user_id='".$download['download_user']."'");
$a_author = dbresult($result,0);
$srednia = dbresult(dbquery("
SELECT ROUND(AVG((SELECT AVG(rating_vote) FROM ".DB_RATINGS." WHERE (rating_item_id=download_id) AND rating_type='D')), 2) AS srednia
FROM ".DB_DOWNLOADS.""),0);
// Display articles
echo display_downloads($download,$category,$a_author,$srednia);
$x++;
}
}
} else {
echo "<tr><td colspan='5' align='center'><p>Brak</p></td></tr>";
}
echo "</table>";
Co może być nie tak w tym kodzie?
Moja wersja PHP-Fusion 7.02.05.
PW od moderatora:
- Zmiana nazwy tematu - Pieka 18.07.2012 15:58
- Przeniesienie tematu - Pieka 18.07.2012 16:13
- Odświeżenie tematu - khaman 17.08.2012 13:49
Edytowane przez jozio_94 dnia 18.07.2012 16:15:31
|
|
|
|
Wścibski Gość |
Dodany dnia 23.12.2024 05:47:14
|
Pan Kontekstualny
Postów: n^x
Data rejestracji: Zawsze
|
|
IP: localhost |
|
|
bartek124 |
Dodany dnia 18.07.2012 15:45:01
|
Weteran
Postów: 3264 Pomógł: 236
v7.02.06 Data rejestracji: 26.05.2007 12:25
|
Ten kod jest zły. Jest źle napisany i nieoptymalny.
Spróbuj tego, aczkolwiek nie miałem jak przetestować działania:
<?php
require_once "../../maincore.php";
require_once THEMES."templates/header.php";
echo '<link rel="stylesheet" type="text/css" href="'.INCLUDES.'tabs/style.css" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="'.INCLUDES.'tabs/style-ie.css" />
<![endif]-->
<script src=\''.INCLUDES.'tabs/jquery-1.2.6.min.js\' type=\'text/javascript\'></script>
<script src="'.INCLUDES.'tabs/jquery-easing.1.2.js" type=\'text/javascript\'></script>
<script src="'.INCLUDES.'tabs/jquery-easing-compatibility.1.2.js" type=\'text/javascript\'></script>
<script src="'.INCLUDES.'tabs/coda-slider.1.1.1.js" type=\'text/javascript\'></script>
<script type=\'text/javascript\'>
$(function () {
$("#blogSlider").codaSlider();
});
</script>';
echo "<table cellpadding='0' cellspacing='0'><tr><td valign='top' background='".THEME."images/tlo_ostatnio_dodane.png' width='49' height='176'>\n";
echo "<div style='padding: 7px 0 8px 10px;'><img src='".THEME."images/ostatnio_dodane.png'></div>";
echo '
<div id="blogSliderWrap">
<div id="blogSlider">
<div class="innerWrap">
<div class="panelContainer">
<div class="panel" title="">
<div class="wrapper">';
$num_articles = 1;
$x= 1;
function display_articles($article) {
$display_article = "<tr>\n<td style='padding-top: 8px; padding-right: 6px; padding-left: 2px;'>
<img src='".THEME."images/artykuly.png'>
</td><td align='left' valign='top' width='100%' style='font-size: 10px; color: #444444; padding-top: 9px;'><div style='padding-bottom: 4px;'><a href='".BASEDIR."readarticle.php?article_id=".$article['article_id']."' class='side2' target='_top'>".trimlink($article['article_subject'], 30)."</a></div>
<div style='padding-bottom: 2px;'><b>Dodał:</b> <a href='".BASEDIR."profile.php?lookup=".$article['user_id']."' class='autor_art' target='_top'>".$article['user_name']."</a></div>
<div style='padding-bottom: 2px;'><b>Data dodania:</b> ".$article['article_datestamp']."</div>
<div>".trimlink(stripslashes($article['article_snippet']), 145)."</td></tr>";
return $display_article;
}
$most_recent_articles = dbquery("SELECT a.article_subject, a.article_snippet, a.article_datestamp, a.article_id, u.user_name, u.user_id
FROM ".DB_ARTICLES." a
INNER JOIN ".DB_USERS." u ON u.user_id=a.article_name
ORDER BY article_id DESC
LIMIT 0,".$num_articles);
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n<tr>\n";
if (dbrows($most_recent_articles)) {
// Only display articles that exist
while($article = dbarray($most_recent_articles)) {
// Calculate date submitted
$article['article_datestamp'] = showdate("shortdate", $article['article_datestamp']);
// Display articles
echo display_articles($article);
}
} else {
echo "<tr><td colspan='5' align='center'><p>Brak</p></td></tr>";
}
echo "</table>";
echo '</div>
</div>
<div class="panel" title="">
<div class="wrapper"> ';
$num_downloads = 1;
$x= 1;
function display_downloads($download) {
$display_download = "<tr>\n<td rowspan='3' style='padding-top: 4px; padding-right: 6px; padding-left: 2px;'>
<img src='".THEME."images/pliki.png'>
</td><td align='left' valign='top' colspan='2' width='100%' style='padding-top: 9px;'><div><a href='".BASEDIR."downloads.php?cat_id=".$download['download_cat']."&info_id=".$download['download_id']."' class='side2' target='_top'>".trimlink($download['download_title'], 30)."</a></div></td></tr><tr><td width='100%' style='font-size: 10px; color: #444444;'>
<div style='padding-bottom: 1px;'><b>Waga:</b> ".$download['download_filesize']."</div>
<div style='padding-bottom: 1px;'><b>Autor:</b> <a href='".BASEDIR."profile.php?lookup=".$download['download_user']."' class='autor_art' target='_top'>".$download['download_author']."</a></div>
<div style='padding-bottom: 1px;'><b>Dodane:</b> ".$download['download_datestamp']."</div>
<div style='padding-bottom: 1px;'><b>Pobierano:</b> ".$download['download_count']."</div>
<div><b>Ocena:</b> ".$download['srednia']."</div></td>
<td style='padding-top: 3px;'><a href='".BASEDIR."downloads.php?cat_id=".$download['download_cat']."&info_id=".$download['download_id']."' target='_top'><img src='".THEME."images/pob.png' border='0'></a></td></tr>";
return $display_download;
}
$most_recent_downloads = dbquery("SELECT *, ROUND(AVG((SELECT AVG(rating_vote) FROM ".DB_RATINGS." WHERE (rating_item_id=d.download_id) AND rating_type='D')), 2) AS srednia
FROM ".DB_DOWNLOADS." d
INNER JOIN ".DB_USERS." u ON d.download_user=u.user_id
INNER JOIN ".DB_DOWNLOAD_CATS." dc ON d.download_cat=dc.download_cat_id
ORDER BY download_id DESC");
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n<tr>\n";
if (dbrows($most_recent_downloads)) {
// Only display articles that exist
while($download = dbarray($most_recent_downloads)) {
// Calculate date submitted
$download['download_datestamp'] = showdate("shortdate", $download['download_datestamp']);
// Display articles
echo display_downloads($download);
}
} else {
echo "<tr><td colspan='5' align='center'><p>Brak</p></td></tr>";
}
echo "</table>";
echo '</div>
</div>
<div class="panel" title="">
<div class="wrapper"> ';
$video = dbarray(dbquery("SELECT * FROM ".$db_prefix."videos ORDER BY video_datestamp DESC LIMIT 1"));
$user = dbarray(dbquery("SELECT user_name FROM ".$db_prefix."users WHERE user_id='".$video['video_user']."' LIMIT 1"));
$voutes = dbquery("SELECT * FROM ".$db_prefix."ratings WHERE rating_type='V' AND rating_item_id='".$video['video_id']."'");
$voutecount = dbrows($voutes);
$voutescountv = 0;
while($dd = dbarray($voutes)){
$voutescountv = $voutescountv + $dd['rating_vote'];
}
$rating = $voutescountv/$voutecount;
$v = round($rating, 2);
echo " <table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<tr>
<td rowspan='3' style='padding-top: 4px; padding-right: 6px; padding-left: 2px;'>
<img src='".THEME."images/odcinki_online.png'>
</td></tr><tr><td align='left' colspan='2' valign='top' width='100%' style='padding-top: 9px;'><div style='padding-bottom: 4px;'><a href='".BASEDIR."infusions/fusion_tube/view.php?cat_id=".$video['video_cat']."&video_id=".$video['video_id']."'' class='side2' target='_top'>".$video['video_name']."</a></div></td></tr><tr><td width='100%' style='font-size: 10px; color: #444444;'>
<div style='padding-bottom: 1px;'><b>Czas:</b> ".$video['video_time']."</div>
<div style='padding-bottom: 1px;'><b>Dodał:</b> <a href='".BASEDIR."profile.php?lookup=".$video['video_user']."' class='autor_art' target='_top'>".$user['user_name']."</a></div>
<div style='padding-bottom: 1px;'><b>Data:</b> ".date("d.m.Y", $video['video_datestamp'])."</div>
<div style='padding-bottom: 1px;'><b>Ogl±dano:</b> ".($video['video_views']-1)."</div>
<div><b>Ocena:</b> $v</div></td>
<td style='padding-top: 3px;' align='center'><a href='".BASEDIR."infusions/fusion_tube/view.php?cat_id=".$video['video_cat']."&video_id=".$video['video_id']."' target='_top'><img src='".THEME."images/play.png' border='0'></a></td></tr></table> ";
echo ' </div>
</div>
</div>
</div>
</div>
';
echo "</td></tr></table>";
echo "</body></html>";
?>
Nie pomagam na komunikatorach oraz PW!
|
|
|
|
jozio_94 |
Dodany dnia 18.07.2012 15:57:09
|
Przedszkolak
Postów: 84 Pomógł: 7 Ostrzeżeń: 2
Data rejestracji: 15.02.2011 21:39
|
Dzięki Bartek za zainteresowanie W dzienniku brak błędów, ale nie pokazuje mi danych w ostatnio dodanych plikach. Poza tym wszystko ok. Chyba jeszcze czegoś brakuje. Wiesz może co jest nie tak? |
|
|
|
bartek124 |
Dodany dnia 18.07.2012 16:18:11
|
Weteran
Postów: 3264 Pomógł: 236
v7.02.06 Data rejestracji: 26.05.2007 12:25
|
To download powodował błąd. Czy ten plik został dodany przez istniejącego usera czy przez gościa?
Spróbuj jeszcze tak:
<?php
require_once "../../maincore.php";
require_once THEMES."templates/header.php";
echo '<link rel="stylesheet" type="text/css" href="'.INCLUDES.'tabs/style.css" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="'.INCLUDES.'tabs/style-ie.css" />
<![endif]-->
<script src=\''.INCLUDES.'tabs/jquery-1.2.6.min.js\' type=\'text/javascript\'></script>
<script src="'.INCLUDES.'tabs/jquery-easing.1.2.js" type=\'text/javascript\'></script>
<script src="'.INCLUDES.'tabs/jquery-easing-compatibility.1.2.js" type=\'text/javascript\'></script>
<script src="'.INCLUDES.'tabs/coda-slider.1.1.1.js" type=\'text/javascript\'></script>
<script type=\'text/javascript\'>
$(function () {
$("#blogSlider").codaSlider();
});
</script>';
echo "<table cellpadding='0' cellspacing='0'><tr><td valign='top' background='".THEME."images/tlo_ostatnio_dodane.png' width='49' height='176'>\n";
echo "<div style='padding: 7px 0 8px 10px;'><img src='".THEME."images/ostatnio_dodane.png'></div>";
echo '
<div id="blogSliderWrap">
<div id="blogSlider">
<div class="innerWrap">
<div class="panelContainer">
<div class="panel" title="">
<div class="wrapper">';
$num_articles = 1;
$x= 1;
function display_articles($article) {
$display_article = "<tr>\n<td style='padding-top: 8px; padding-right: 6px; padding-left: 2px;'>
<img src='".THEME."images/artykuly.png'>
</td><td align='left' valign='top' width='100%' style='font-size: 10px; color: #444444; padding-top: 9px;'><div style='padding-bottom: 4px;'><a href='".BASEDIR."readarticle.php?article_id=".$article['article_id']."' class='side2' target='_top'>".trimlink($article['article_subject'], 30)."</a></div>
<div style='padding-bottom: 2px;'><b>Dodał:</b> <a href='".BASEDIR."profile.php?lookup=".$article['user_id']."' class='autor_art' target='_top'>".$article['user_name']."</a></div>
<div style='padding-bottom: 2px;'><b>Data dodania:</b> ".$article['article_datestamp']."</div>
<div>".trimlink(stripslashes($article['article_snippet']), 145)."</td></tr>";
return $display_article;
}
$most_recent_articles = dbquery("SELECT a.article_subject, a.article_snippet, a.article_datestamp, a.article_id, u.user_name, u.user_id
FROM ".DB_ARTICLES." a
INNER JOIN ".DB_USERS." u ON u.user_id=a.article_name
ORDER BY article_id DESC
LIMIT 0,".$num_articles);
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n<tr>\n";
if (dbrows($most_recent_articles)) {
// Only display articles that exist
while($article = dbarray($most_recent_articles)) {
// Calculate date submitted
$article['article_datestamp'] = showdate("shortdate", $article['article_datestamp']);
// Display articles
echo display_articles($article);
}
} else {
echo "<tr><td colspan='5' align='center'><p>Brak</p></td></tr>";
}
echo "</table>";
echo '</div>
</div>
<div class="panel" title="">
<div class="wrapper"> ';
$num_downloads = 1;
$x= 1;
function display_downloads($download) {
$display_download = "<tr>\n<td rowspan='3' style='padding-top: 4px; padding-right: 6px; padding-left: 2px;'>
<img src='".THEME."images/pliki.png'>
</td><td align='left' valign='top' colspan='2' width='100%' style='padding-top: 9px;'><div><a href='".BASEDIR."downloads.php?cat_id=".$download['download_cat']."&info_id=".$download['download_id']."' class='side2' target='_top'>".trimlink($download['download_title'], 30)."</a></div></td></tr><tr><td width='100%' style='font-size: 10px; color: #444444;'>
<div style='padding-bottom: 1px;'><b>Waga:</b> ".$download['download_filesize']."</div>
<div style='padding-bottom: 1px;'><b>Autor:</b> <a href='".BASEDIR."profile.php?lookup=".$download['download_user']."' class='autor_art' target='_top'>".$download['download_author']."</a></div>
<div style='padding-bottom: 1px;'><b>Dodane:</b> ".$download['download_datestamp']."</div>
<div style='padding-bottom: 1px;'><b>Pobierano:</b> ".$download['download_count']."</div>
<div><b>Ocena:</b> ".$download['srednia']."</div></td>
<td style='padding-top: 3px;'><a href='".BASEDIR."downloads.php?cat_id=".$download['download_cat']."&info_id=".$download['download_id']."' target='_top'><img src='".THEME."images/pob.png' border='0'></a></td></tr>";
return $display_download;
}
$most_recent_downloads = dbquery("SELECT *, ROUND(AVG((SELECT AVG(rating_vote) FROM ".DB_RATINGS." WHERE (rating_item_id=d.download_id) AND rating_type='D')), 2) AS srednia
FROM ".DB_DOWNLOADS." d
LEFT JOIN ".DB_USERS." u ON d.download_user=u.user_id
INNER JOIN ".DB_DOWNLOAD_CATS." dc ON d.download_cat=dc.download_cat_id
WHERE d.download_user>0
ORDER BY download_id DESC");
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n<tr>\n";
if (dbrows($most_recent_downloads)) {
// Only display articles that exist
while($download = dbarray($most_recent_downloads)) {
// Calculate date submitted
$download['download_datestamp'] = showdate("shortdate", $download['download_datestamp']);
// Display articles
echo display_downloads($download);
}
} else {
echo "<tr><td colspan='5' align='center'><p>Brak</p></td></tr>";
}
echo "</table>";
echo '</div>
</div>
<div class="panel" title="">
<div class="wrapper"> ';
$video = dbarray(dbquery("SELECT * FROM ".$db_prefix."videos ORDER BY video_datestamp DESC LIMIT 1"));
$user = dbarray(dbquery("SELECT user_name FROM ".$db_prefix."users WHERE user_id='".$video['video_user']."' LIMIT 1"));
$voutes = dbquery("SELECT * FROM ".$db_prefix."ratings WHERE rating_type='V' AND rating_item_id='".$video['video_id']."'");
$voutecount = dbrows($voutes);
$voutescountv = 0;
while($dd = dbarray($voutes)){
$voutescountv = $voutescountv + $dd['rating_vote'];
}
$rating = $voutescountv/$voutecount;
$v = round($rating, 2);
echo " <table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<tr>
<td rowspan='3' style='padding-top: 4px; padding-right: 6px; padding-left: 2px;'>
<img src='".THEME."images/odcinki_online.png'>
</td></tr><tr><td align='left' colspan='2' valign='top' width='100%' style='padding-top: 9px;'><div style='padding-bottom: 4px;'><a href='".BASEDIR."infusions/fusion_tube/view.php?cat_id=".$video['video_cat']."&video_id=".$video['video_id']."'' class='side2' target='_top'>".$video['video_name']."</a></div></td></tr><tr><td width='100%' style='font-size: 10px; color: #444444;'>
<div style='padding-bottom: 1px;'><b>Czas:</b> ".$video['video_time']."</div>
<div style='padding-bottom: 1px;'><b>Dodał:</b> <a href='".BASEDIR."profile.php?lookup=".$video['video_user']."' class='autor_art' target='_top'>".$user['user_name']."</a></div>
<div style='padding-bottom: 1px;'><b>Data:</b> ".date("d.m.Y", $video['video_datestamp'])."</div>
<div style='padding-bottom: 1px;'><b>Ogl±dano:</b> ".($video['video_views']-1)."</div>
<div><b>Ocena:</b> $v</div></td>
<td style='padding-top: 3px;' align='center'><a href='".BASEDIR."infusions/fusion_tube/view.php?cat_id=".$video['video_cat']."&video_id=".$video['video_id']."' target='_top'><img src='".THEME."images/play.png' border='0'></a></td></tr></table> ";
echo ' </div>
</div>
</div>
</div>
</div>
';
echo "</td></tr></table>";
echo "</body></html>";
?>
Nie pomagam na komunikatorach oraz PW!
|
|
|
|
jozio_94 |
Dodany dnia 18.07.2012 16:29:29
|
Przedszkolak
Postów: 84 Pomógł: 7 Ostrzeżeń: 2
Data rejestracji: 15.02.2011 21:39
|
Napisałem ten plik i dodałem przesuwające zakładki. Niestety nie pomogło, nadal brak danych w ostatnio dodanym pliku. |
|
|
|
bartek124 |
Dodany dnia 19.07.2012 16:44:53
|
Weteran
Postów: 3264 Pomógł: 236
v7.02.06 Data rejestracji: 26.05.2007 12:25
|
Nie wyświetla też żadnych błędów?
Nie pomagam na komunikatorach oraz PW!
|
|
|
|
jozio_94 |
Dodany dnia 19.07.2012 16:53:39
|
Przedszkolak
Postów: 84 Pomógł: 7 Ostrzeżeń: 2
Data rejestracji: 15.02.2011 21:39
|
Nie wyświetla błędów, tylko nie ma tych informacji w downloadzie. |
|
|
|
bartek124 |
Dodany dnia 19.07.2012 17:13:00
|
Weteran
Postów: 3264 Pomógł: 236
v7.02.06 Data rejestracji: 26.05.2007 12:25
|
Coś musi być skopane z zawartością tabel, konkretnie dotyczących złączeń. Pokaż zrzut kilku wierszy z tabeli downloads.
Nie pomagam na komunikatorach oraz PW!
|
|
|
|
jozio_94 |
Dodany dnia 19.07.2012 17:22:47
|
Przedszkolak
Postów: 84 Pomógł: 7 Ostrzeżeń: 2
Data rejestracji: 15.02.2011 21:39
|
Czy o to chodzi?
http://i45.tinypi...epj8qw.png |
|
|
|
bartek124 |
Dodany dnia 19.07.2012 17:27:19
|
Weteran
Postów: 3264 Pomógł: 236
v7.02.06 Data rejestracji: 26.05.2007 12:25
|
Tak, ale zrzuty konkretnych wierszy, a nie strukturę. Ale dobrze że to dałeś, bo jest coś niejasnego. Czym się różnią dane w kolumnie download_user a download_author?
Nie pomagam na komunikatorach oraz PW!
|
|
|
|
jozio_94 |
Dodany dnia 17.08.2012 13:49:24
|
Przedszkolak
Postów: 84 Pomógł: 7 Ostrzeżeń: 2
Data rejestracji: 15.02.2011 21:39
|
download_author: http://i45.tinypi...copfue.jpg
download_user: http://i46.tinypi...dc53sm.jpg
Korzystam z wtyczki FMC Download v1.08 i po jej zainstalowaniu zostały dodane kolumny: download_author, download_screen, download_copyright, download_os.
Edit: W porządku, problem rozwiązany, poprawny kod znajduje się w pierwszym poście bartka. Dziękuję za pomoc :)
Edit: Witam. Niestety mam ponowny problem z tym panelem. Mianowicie, jeśli dodam jeden plik do downloadu, to wyświetla się prawidłowo, natomiast gdy dodam kolejny, niestety już nie i cały czas wyświetla się ten pierwszy. Chciałbym również, aby w przypadku gdy plik nie otrzyma oceny wyświetlało się "0". Poza tym, mam problem jeszcze z ostatnio dodanym video. Korzystam z FusionTube'a i jeśli plik nie otrzyma oceny, to dostaję w dzienniku taki komunikat:
Division by zero Linia: 136
Domyślam się, że dotyczy to dzielenia przez zero, ale nie wiem jak to naprawić. Czy ktoś jest w stanie pomóc?
Oto kod panelu:
<?php
require_once "../../maincore.php";
require_once THEMES."templates/header.php";
echo '<link rel="stylesheet" type="text/css" href="'.INCLUDES.'tabs/style.css" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="'.INCLUDES.'tabs/style-ie.css" />
<![endif]-->
<script src=\''.INCLUDES.'tabs/jquery-1.2.6.min.js\' type=\'text/javascript\'></script>
<script src="'.INCLUDES.'tabs/jquery-easing.1.2.js" type=\'text/javascript\'></script>
<script src="'.INCLUDES.'tabs/jquery-easing-compatibility.1.2.js" type=\'text/javascript\'></script>
<script src="'.INCLUDES.'tabs/coda-slider.1.1.1.js" type=\'text/javascript\'></script>
<script type=\'text/javascript\'>
$(function () {
$("#blogSlider").codaSlider();
});
</script>';
echo "<table cellpadding='0' cellspacing='0'><tr><td valign='top' background='".THEME."images/tlo_ostatnio_dodane.png' width='49' height='176'>\n";
echo "<div style='padding: 7px 0 8px 10px;'><img src='".THEME."images/ostatnio_dodane.png'></div>";
echo '
<div id="blogSliderWrap">
<div id="blogSlider">
<div class="innerWrap">
<div class="panelContainer">
<div class="panel" title="">
<div class="wrapper">';
$num_articles = 1;
$x= 1;
function display_articles($article) {
$display_article = "<tr>\n<td style='padding-top: 8px; padding-right: 6px; padding-left: 2px;'>
<img src='".THEME."images/artykuly.png'>
</td><td align='left' valign='top' width='100%' style='font-size: 10px; color: #444444; padding-top: 9px;'><div style='padding-bottom: 4px;'><a href='".BASEDIR."readarticle.php?article_id=".$article['article_id']."' class='side2' target='_top'>".trimlink($article['article_subject'], 30)."</a></div>
<div style='padding-bottom: 2px;'><b>Dodał:</b> <a href='".BASEDIR."profile.php?lookup=".$article['user_id']."' class='autor_art' target='_top'>".$article['user_name']."</a></div>
<div style='padding-bottom: 2px;'><b>Data dodania:</b> ".$article['article_datestamp']."</div>
<div>".trimlink(stripslashes($article['article_snippet']), 145)."</td></tr>";
return $display_article;
}
$most_recent_articles = dbquery("SELECT a.article_subject, a.article_snippet, a.article_datestamp, a.article_id, u.user_name, u.user_id
FROM ".DB_ARTICLES." a
INNER JOIN ".DB_USERS." u ON u.user_id=a.article_name
ORDER BY article_id DESC
LIMIT 0,".$num_articles);
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n<tr>\n";
if (dbrows($most_recent_articles)) {
// Only display articles that exist
while($article = dbarray($most_recent_articles)) {
// Calculate date submitted
$article['article_datestamp'] = showdate("shortdate", $article['article_datestamp']);
// Display articles
echo display_articles($article);
}
} else {
echo "<tr><td colspan='5' align='center'><p>Brak</p></td></tr>";
}
echo "</table>";
echo '</div>
</div>
<div class="panel" title="">
<div class="wrapper"> ';
$num_downloads = 1;
$x= 1;
function display_downloads($download) {
$display_download = "<tr>\n<td rowspan='3' style='padding-top: 4px; padding-right: 6px; padding-left: 2px;'>
<img src='".THEME."images/pliki.png'>
</td><td align='left' valign='top' colspan='2' width='100%' style='padding-top: 9px;'><div><a href='".BASEDIR."downloads.php?cat_id=".$download['download_cat']."&info_id=".$download['download_id']."' class='side2' target='_top'>".trimlink($download['download_title'], 30)."</a></div></td></tr><tr><td width='100%' style='font-size: 10px; color: #444444;'>
<div style='padding-bottom: 1px;'><b>Waga:</b> ".$download['download_filesize']."</div>
<div style='padding-bottom: 1px;'><b>Autor:</b> ".$download['download_author']."</div>
<div style='padding-bottom: 1px;'><b>Dodane:</b> ".$download['download_datestamp']."</div>
<div style='padding-bottom: 1px;'><b>Pobierano:</b> ".$download['download_count']."</div>
<div><b>Ocena:</b> ".$download['srednia']."</div></td>
<td style='padding-top: 3px;'><a href='".BASEDIR."downloads.php?cat_id=".$download['download_cat']."&info_id=".$download['download_id']."' target='_top'><img src='".THEME."images/pob.png' border='0'></a></td></tr>";
return $display_download;
}
$most_recent_downloads = dbquery("SELECT *, ROUND(AVG((SELECT AVG(rating_vote) FROM ".DB_RATINGS." WHERE (rating_item_id=d.download_id) AND rating_type='D')), 2) AS srednia
FROM ".DB_DOWNLOADS." d
LEFT JOIN ".DB_USERS." u ON d.download_user=u.user_id
INNER JOIN ".DB_DOWNLOAD_CATS." dc ON d.download_cat=dc.download_cat_id
ORDER BY download_id DESC");
echo "<table width='100%' cellpadding='0' cellspacing='0'>\n<tr>\n";
if (dbrows($most_recent_downloads)) {
// Only display articles that exist
while($download = dbarray($most_recent_downloads)) {
// Calculate date submitted
$download['download_datestamp'] = showdate("shortdate", $download['download_datestamp']);
// Display articles
echo display_downloads($download);
}
} else {
echo "<tr><td colspan='5' align='center'><p>Brak</p></td></tr>";
}
echo "</table>";
echo '</div>
</div>
<div class="panel" title="">
<div class="wrapper"> ';
$video = dbarray(dbquery("SELECT * FROM ".$db_prefix."videos ORDER BY video_datestamp DESC LIMIT 1"));
$user = dbarray(dbquery("SELECT user_name FROM ".$db_prefix."users WHERE user_id='".$video['video_user']."' LIMIT 1"));
$voutes = dbquery("SELECT * FROM ".$db_prefix."ratings WHERE rating_type='V' AND rating_item_id='".$video['video_id']."'");
$voutecount = dbrows($voutes);
$voutescountv = 0;
while($dd = dbarray($voutes)){
$voutescountv = $voutescountv + $dd['rating_vote'];
}
$rating = $voutescountv/$voutecount;
$v = round($rating, 2);
echo " <table width='100%' cellpadding='0' cellspacing='0'>
<tr>
<tr>
<td rowspan='3' style='padding-top: 4px; padding-right: 6px; padding-left: 2px;'>
<img src='".THEME."images/odcinki_online.png'>
</td></tr><tr><td align='left' colspan='2' valign='top' width='100%' style='padding-top: 9px;'><div style='padding-bottom: 4px;'><a href='".BASEDIR."infusions/fusion_tube/view.php?cat_id=".$video['video_cat']."&video_id=".$video['video_id']."'' class='side2' target='_top'>".$video['video_name']."</a></div></td></tr><tr><td width='100%' style='font-size: 10px; color: #444444;'>
<div style='padding-bottom: 1px;'><b>Czas:</b> ".$video['video_time']."</div>
<div style='padding-bottom: 1px;'><b>Dodał:</b> <a href='".BASEDIR."profile.php?lookup=".$video['video_user']."' class='autor_art' target='_top'>".$user['user_name']."</a></div>
<div style='padding-bottom: 1px;'><b>Data:</b> ".date("d.m.Y", $video['video_datestamp'])."</div>
<div style='padding-bottom: 1px;'><b>Ogl±dano:</b> ".($video['video_views']-1)."</div>
<div><b>Ocena:</b> $v</div></td>
<td style='padding-top: 3px;' align='center'><a href='".BASEDIR."infusions/fusion_tube/view.php?cat_id=".$video['video_cat']."&video_id=".$video['video_id']."' target='_top'><img src='".THEME."images/play.png' border='0'></a></td></tr></table> ";
echo ' </div>
</div>
</div>
</div>
</div>
';
echo "</td></tr></table>";
echo "</body></html>";
?>
Edytowane przez khaman dnia 17.08.2012 13:48:50
|
|
|