Apeluje wszystkich o pomoc, każdy wie jak wygląda mod usergalerie
przykład :
http://www.japa.y...p?userid=2
a ja bym chciał żeby to było w profilu każdego użytkownika, jego własna galeria
Skopiowałem kod z view_usergalerie.php do profile php i wyszło mi
http://www.japa.y...p?lookup=2
Czemu nie wyświetla mi dalszej części galerii użytkownika ?
o to kod profile.php
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| 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
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."members-profile.php";
include LOCALE.LOCALESET."user_fields.php";
include INCLUDES."ug_comments_include.php";
define("SAFEMODE", @ini_get("safe_mode") ? true : false);
if (!isset($group_id)) {
if (!isset($lookup) || !isNum($lookup)) fallback("index.php");
$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id='$lookup'");
if (dbrows($result)) { $data = dbarray($result); } else { redirect("index.php"); }
opentable($locale['0009']);
echo "<table align='center' cellpadding='3' cellspacing='5' width='650'>
<tr>
<td colspan='3'>
<table align='center' cellpadding='8' cellspacing='5'width='100%'>
<tr>
<b><center><h1>".$data['user_name']."</h1></center></b></td>
<td align='right>".getuserlevel($data['user_level'])."</td>
</tr>
</table>
</td>
<tr>
<td width='1%' style='white-space:nowrap'><b>".$locale['u010']."</b></td>
<td>";
if ($data['user_birthdate'] != "0000-00-00") {
$months = explode("|", $locale['months']);
$user_birthdate = explode("-", $data['user_birthdate']);
echo $months[number_format($user_birthdate['1'])]." ".number_format($user_birthdate['2'])." ".$user_birthdate['0'];
} else {
echo $locale['u048'];
}
echo "</td>
</tr>
<tr>
<td width='1% style='white-space:nowrap'><b>".$locale['u021']."</b></td>
<td>".($data['user_aim'] ? $data['user_aim'] : $locale['u048'])."</td>
<br><br><br><br>
</tr>
<tr>
<td width='1%' style='white-space:nowrap'><b>".$locale['u011']."</b></td>
<td>".($data['user_icq'] ? $data['user_icq'] : $locale['u048'])."</td>
</tr>
<tr>
<td width='1%' style='white-space:nowrap'><b>".$locale['u012']."</b></td>
<td>".($data['user_msn'] ? $data['user_msn'] : $locale['u048'])."</td>
</tr>
<tr>
<td width='1%' style='white-space:nowrap'><b>".$locale['u013']."</b></td>
<td>".($data['user_yahoo'] ? $data['user_yahoo'] : $locale['u048'])."</td>
</tr>
</table>\n";
tablebreak();
echo "<table align='center' cellpadding='0' cellspacing='1' width='600' class='tbl-border'>
<tr>
</tr>
<tr>
</tr>
</table>\n";
if ($data['user_groups']) {
tablebreak();
echo "<table align='center' cellpadding='0' cellspacing='1' width='600' class='tbl-border'>\n";
echo "<tr>\n<td class='tbl2'><b>".$locale['423']."</b></td>\n\n</tr>\n<tr>\n<td class='tbl1'>\n";
$user_groups = (strpos($data['user_groups'], ".") == 0 ? explode(".", substr($data['user_groups'], 1)) : explode(".", $data['user_groups']));
for ($i = 0;$i < count($user_groups);$i++) {
echo "<a href='".FUSION_SELF."?group_id=".$user_groups[$i]."'>".getgroupname($user_groups[$i])."</a>";
if ($i != (count($user_groups)-1)) { echo ",\n"; } else { echo "\n"; }
}
echo "</td>\n</tr>\n</table>\n";
}
} else {
if (!isNum($group_id)) fallback("index.php");
$result = dbquery("SELECT * FROM ".$db_prefix."user_groups WHERE group_id='$group_id'");
if (dbrows($result)) {
$data = dbarray($result);
$result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_groups REGEXP('^\\\.{$group_id}$|\\\.{$group_id}\\\.|\\\.{$group_id}$') ORDER BY user_level DESC, user_name");
opentable($locale['410']);
echo "<table align='center' cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>
<tr>
<td align='center' colspan='2' class='tbl1'><b>".$data['group_name']."</b> (".sprintf((dbrows($result)==1?$locale['411']:$locale['412']), dbrows($result)).")</td>
</tr>
<tr>
<td class='tbl2'><b>".$locale['401']."</b></td>
<td align='center' width='1%' class='tbl2' style='white-space:nowrap'><b>".$locale['402']."</b></td>
</tr>\n";
while ($data = dbarray($result)) {
$cell_color = ($i % 2 == 0 ? "tbl1" : "tbl2"); $i++;
echo "<tr>\n<td class='$cell_color'>\n<a href='profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a></td>\n";
echo "<td align='center' width='1%' class='$cell_color' style='white-space:nowrap'>".getuserlevel($data['user_level'])."</td>\n</tr>";
}
echo "</table>\n";
} else {
fallback(BASEDIR."index.php");
}
}
echo "[<a href='infusions/usergalerie/view_usergalerie.php?userid=".$data['user_id']."''>Galerie</a>]\n";
//////////////////////////
$widththump = 100; //thumb wudth
$heightthump = 100; //thumbheight
function checkImageExists($image_file) {
if(file_exists($image_file)) {
return $image_file;
}
}
if (isset($step) && $step == "delete") {
$result = dbquery("DELETE FROM ".$db_prefix."ug_comments WHERE comment_id='$comment_id'");
redirect("comments.php?ctype=$ctype&cid=$cid");
}
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if (isset($photo) && !isNum($photo)) fallback(FUSION_SELF);
if (isset($userid) && !isNum($userid)) fallback(FUSION_SELF);
opentable("Übersicht");
echo "[ <a href='../../profile.php?lookup=$userid&auswahl=profil'>Profil</a> ] ";
echo "[ <a href='../../profile.php?lookup=$userid&auswahl=gaestebuch'>Gästebuch</a> ] ";
echo "[ <a href='view_usergalerie.php?userid=$userid'>Galerie</a> ] ";
closetable();
if(isset($photo)){
$result=dbquery("UPDATE ".$db_prefix."ug_photos SET photo_views=(photo_views+1) WHERE photo_id='".$photo."'");
$result=dbquery("SELECT tp.*, user_name FROM ".$db_prefix."ug_photos AS tp INNER JOIN ".$db_prefix."users USING (user_id) WHERE photo_id='".$photo."'");
$data=dbarray($result);
opentable($locale['VU19'].$data['photo_title']);
if(dbrows($result)!=1){
echo "<center><br>dupa<br><br></center>\n";
}else{
$img_filename = USERGALERIE.$photo.".jpg";
$imgsize=@getimagesize($img_filename);
$prev=@dbresult(@dbquery("SELECT t2.photo_id FROM ".$db_prefix."ug_photos t1 JOIN ".$db_prefix."ug_photos t2 WHERE t1.photo_order=t2.photo_order+1 AND t1.album_id=t2.album_id AND t1.photo_id='".$photo."'"),0);
$next=@dbresult(@dbquery("SELECT t2.photo_id FROM ".$db_prefix."ug_photos t1 JOIN ".$db_prefix."ug_photos t2 WHERE t1.photo_order=t2.photo_order-1 AND t1.album_id=t2.album_id AND t1.photo_id='".$photo."'"),0);
echo "<div align='center' style='margin:5px 0px;'>
<table align='center' cellpadding='0' cellspacing='1' class='tbl-border'>\n<tr>
<td class='tbl1'><span class='small'><a href='".FUSION_SELF."?".(empty($prev)?"userid=".$data['album_id']:"userid=".$data['album_id']."&photo=".$prev)."'>".$locale['VU29']."</a></span></td>
<td class='tbl2'><span class='small'><a href='".FUSION_SELF."?userid=".$data['album_id']."'>".$locale['VU27']."</a></span></td>
<td class='tbl1'><span class='small'><a href='".FUSION_SELF."?".(empty($next)?"userid=".$data['album_id']:"userid=".$data['album_id']."&photo=".$next)."'>".$locale['VU30']."</a></span></td>
</tr>\n</table>\n</div>
<div align='center' style='margin:5px 0px;'>
<img src='".checkImageExists($img_filename)."' border='1' title='".$data['photo_title']."' title='".$data['photo_title']."' alt='".$locale['VU05']."'>
</div>
<div align='center' style='margin:5px 0px;'>
<span class='small2'>".$locale['VU20'].$imgsize[0]." x ".$imgsize[1].$locale['VU21']."(".parseByteSize(filesize($img_filename)).")<br>
".$locale['VU22']."<b>".$data['user_name']."</b>".$locale['VU23']."<b>".showdate("shortdate", $data['photo_date'])."</b>.<br>
".$locale['VU24']."<b>".$data['photo_views']."</b>".$locale['VU25']."</span>
</div>";
}
closetable();
if($settings['album_comments']=="1") showcomments("P","photos","photo_id",$photo,FUSION_SELF."?userid=".$data['album_id']."&photo=$photo");
}elseif(isset($userid)){
$data=dbarray(dbquery(
"SELECT ta.*, COUNT(photo_id) as photo_count, MAX(photo_date) as max_date, user_name
FROM ".$db_prefix."ug_photo_albums AS ta
LEFT JOIN ".$db_prefix."ug_photos USING (album_id)
LEFT JOIN ".$db_prefix."users USING (user_id)
WHERE ta.album_id='".$userid."' GROUP BY album_id"
));
if ($data['album_title'] != ""){
$piccnt=$data['photo_count'];
opentable($locale['VU08'].$data['album_title']);
echo "<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td width='75%' valign='top'>".($data['album_info']==""?$data['album_title']:$data['album_info'])."</td>
</tr>
<tr>
<td valign='bottom' class='small2'><hr>".$locale['VU09']."<b>".($data['photo_count']>0?"$data[photo_count]</b><br>".$locale['VU10']."<b>".strftime($settings['shortdate'], $data['max_date']+($settings['timeoffset']*3600))."</b>":$locale['VU12']."</b><br /><br />")."</td>
</tr>
<tr>
<td align='center' colspan='2' class='small'><br><a href='".FUSION_SELF."'>".$locale['VU26']."</a></td>
</tr>
</table>";
closetable();
tablebreak();
opentable($locale['VU13']);
$result=dbquery(
"SELECT tp.*, COUNT(comment_item_id) AS comment_count
FROM ".$db_prefix."ug_photos AS tp LEFT JOIN ".$db_prefix."ug_comments
ON photo_id = comment_item_id AND comment_type='P'
WHERE album_id='".$userid."' GROUP BY photo_id
ORDER BY photo_order LIMIT ".$rowstart.",".$settings['thumbs_per_page']
);
if(dbrows($result)>0){
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
$img_cnt=0;
while($data=dbarray($result)){
echo "<td class='gallery' width='".round(100/$settings['thumbs_per_row'])."%' align='center' valign='top'>
<a href='".FUSION_SELF."?userid=".$data['album_id']."&photo=$data[photo_id]' class='gallery'>
<img src='".checkImageExists(USERGALERIE.$data['photo_id']."t.jpg")."' width='$widththump' height='$heighthump' title='".$data['photo_title']."' alt='".$locale['VU05']."'>
</a><br />
".$data['photo_title']."<br />
<span class='small2'>".$locale['VU14']."<b>".($data['photo_views']==0?$locale['VU12']:$data['photo_views'])."</b><br />
".($data['comment_count']==0?$locale['VU15']:"<b>".$data['comment_count']."</b> ".($data['comment_count']==1?$locale['VU16']:$locale['VU17']))."</span>";
if(++$img_cnt%$settings['thumbs_per_row']==0) echo "</tr>\n<tr>\n";
}
echo "</tr>\n</table>\n";
}else{
echo "<center><br />".$locale['VU18']."<br /><br /></center>";
}
closetable();
if ($piccnt != 0) echo "<div align='center' style='margin-top:5px;'>".makePageNav($rowstart,$settings['thumbs_per_page'],$piccnt,3,FUSION_SELF."?userid=$album&")."</div>\n";
}else{
opentable($locale['VU00']);
echo "<center>".$locale['VU31']."</center>";
closetable();
}}
echo "<center>Copyright © 2006 <a href='http://www.pressepage.de/web'>Andreas Niesen (qayqay)</a></center>";
/////////////////////////////
closetable();
//////////////////////////////
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>
PW od moderatora:
- Zmiana nazwy tematu - Pieka 10.06 - 19:19
- Przeniesienie tematu - Pieka 10.06 - 19:19
Edytowane przez Ramage dnia 12.06.2008 00:35:04
|