Przerobiłem kod z random_photo_panel.php (losowej fotki):
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2006 maxi999 & bednar
| Strona: http://www.nimbus.ncse.pl
| Wersja: 1.1
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
if (file_exists(INFUSIONS."random_photo_panel/locale/".$settings['locale'].".php")) {
include INFUSIONS."random_photo_panel/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."random_photo_panel/locale/Polish.php";
}
$result = dbquery(
"SELECT tp.photo_id, tp.photo_title, tp.photo_thumb1, ta.album_id, ta.album_title FROM ".DB_PHOTOS." tp
LEFT JOIN ".DB_PHOTO_ALBUMS." ta USING(album_id)
WHERE ".groupaccess('album_access')." ORDER BY RAND() LIMIT 1"
);
if (dbrows($result)) {
$data = dbarray($result);
define("R_SAFEMODE", @ini_get("safe_mode") ? true : false);
define("R_PHOTODIR", PHOTOS.(!R_SAFEMODE ? "album_".$data['album_id']."/" : ""));
openside($locale['FOT_001']);
echo "<div align='center'>\n";
echo "<a href='".BASEDIR."photogallery.php?photo_id=".$data['photo_id']."' class='photogallery_album_photo_link'>\n";
if ($data['photo_thumb1'] && file_exists(R_PHOTODIR.$data['photo_thumb1'])) {
echo "<img src='".R_PHOTODIR.$data['photo_thumb1']."' alt='".$data['photo_title']."' style='border:0px' class='photogallery_album_photo' />\n";
} else {
echo "<img src='".IMAGES."imagenotfound.jpg' alt='".$data['photo_title']."' style='border:0px' class='photogallery_album_photo' />\n";
}
echo "</a>\n";
echo "<br />\n";
echo "<a href='".BASEDIR."photogallery.php?photo_id=".$data['photo_id']."' class='side'></a>\n";
echo "<br />\n";
echo "<a href='".BASEDIR."photogallery.php?album_id=".$data['album_id']."' class='side'></a>\n";
echo "</div>\n";
closeside();
}
?>
Na kod aby wyświetlał fotki z prywatnych galerii użytkowników random_user_photo_panel.php :
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2006 maxi999 & bednar
| Strona: http://www.nimbus.ncse.pl
| Wersja: 1.1
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
if (file_exists(INFUSIONS."random_user_photo_panel/locale/".$settings['locale'].".php")) {
include INFUSIONS."random_user_photo_panel/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."random_user_photo_panel/locale/Polish.php";
}
$result = dbquery(
"SELECT tp.photo_id, tp.photo_title, tp.photo_thumb1, ta.album_id, ta.album_title FROM ".DB_USERPHOTOS." tp
LEFT JOIN ".DB_USERPHOTO_ALBUMS." ta USING(album_id)
WHERE ".groupaccess('album_access')." ORDER BY RAND() LIMIT 1"
);
if (dbrows($result)) {
$data = dbarray($result);
define("R_SAFEMODE", @ini_get("safe_mode") ? true : false);
define("R_PHOTODIR", USERPHOTOS.(!R_SAFEMODE ? "album_".$data['album_id']."/" : ""));
openside($locale['FOT_001']);
echo "<div align='center'>\n";
echo "<a href='".BASEDIR."userphotogallery.php?photo_id=".$data['photo_id']."' class='userphotogallery_album_photo_link'>\n";
if ($data['photo_thumb1'] && file_exists(R_PHOTODIR.$data['photo_thumb1'])) {
echo "<img src='".R_PHOTODIR.$data['photo_thumb1']."' alt='".$data['photo_title']."' style='border:0px' class='userphotogallery_album_photo' />\n";
} else {
echo "<img src='".IMAGES."imagenotfound.jpg' alt='".$data['photo_title']."' style='border:0px' class='userphotogallery_album_photo' />\n";
}
echo "</a>\n";
echo "<br />\n";
echo "<a href='".BASEDIR."userphotogallery.php?photo_id=".$data['photo_id']."' class='side'></a>\n";
echo "<br />\n";
echo "<a href='".BASEDIR."userphotogallery.php?album_id=".$data['album_id']."' class='side'></a>\n";
echo "</div>\n";
closeside();
}
?>
Wydaje mi się byc wszystko dobrze lecz zamiast fotek wyświetla ten obrazek imagenotfound.jpg . Co jest źle w tym kodzie ? |