$T_RETURN\n EOF; $output = ""; $home_dir = $base_pgpath; $home_url = $base_url_pg; $home_thumbdir = $home_dir . "/thumbnail"; $home_thumburl = $home_url . "/thumbnail"; if(!isset($pos)){ $pos = 0; } $step = 15; $g_column = 3; $img_thumb_width = $max_img_width_pgthumb; $img_thumb_height = $max_img_height_pgthumb; if(!isset($PGCatID)){ $PGCatID = 0; } if(!isset($act)){ $ps_query = "$PHP_SELF?PGCatID=$PGCatID$lang_pre2$lang_param"; $ps_text = $T_PG_PHOTO; /* --- ID Required --- */ if(!isset($PGCatID)){ $PGCatID = 0; } if($PGCatID == ""){ $PGCatID = 0; } /* --- Display Sub Categories if exists --- */ $output .= GetDisplayPGCat($PGCatID, "$PHP_SELF?PGCatID="); /* --- Display Photos if exists --- */ $sub_dir = GetAltSubDir($PGCatID); $home_dir = $home_dir . "/" . $sub_dir; $home_url = $home_url . "/" . $sub_dir; $home_thumbdir = $home_dir . "/thumbnail"; $home_thumburl = $home_url . "/thumbnail"; if(!isset($pos)){ $pos = 0; } $temp_pos = $pos; $get_count = mysql_query("SELECT COUNT(PGListID) AS Total FROM $pglist_file WHERE PGListCatID='$PGCatID'", $db); $get_row = mysql_fetch_array($get_count); $numrec = $get_row['Total']; $numpage = intval($numrec / $step); if($numrec % $step){ $numpage++; } $get_photos = mysql_query("SELECT * FROM $pglist_file LEFT JOIN $pgcat_file ON($pgcat_file.PGCatID = $pglist_file.PGListCatID) WHERE $pglist_file.PGListCatID='$PGCatID' ORDER BY $pglist_file.PGListID DESC LIMIT $pos, $step", $db); $i = 0; $g_column = 3; $td_width = round(100/$g_column,0) . "%"; $output .= ""; while($get_rows = mysql_fetch_array($get_photos)){ $img_file = $home_dir . "/" . $get_rows['PGListPict']; $img_url = $home_url . "/" . $get_rows['PGListPict']; $thumb_file = $home_thumbdir . "/" . $get_rows['PGListPict']; $PGListDesc = stripslashes(html_entity_decode($get_rows['PGListDesc'])); if(file_exists($img_file)){ $img_info = image_info($img_file); $img_width_r = $img_info[0]; $img_height_r = $img_info[1]; $img_KB = round($img_info[2]/1024,0); $img_to_show = $home_url . "/" . $get_rows['PGListPict']; if(file_exists($thumb_file)){ $img_to_show = $home_thumburl . "/" . $get_rows['PGListPict']; $img_info = image_info($thumb_file); $img_width = $img_info[0]; $img_height = $img_info[1]; }else{ if($img_info[0] > $img_thumb_width){ $img_width = $img_thumb_width; $img_divider = round($img_info[0]/$img_thumb_width,2); $img_height = round($img_info[1]/$img_divider,0); }elseif($img_info[1] > $img_thumb_height){ $img_height = $img_thumb_height; $img_divider = round($img_info[1]/$img_thumb_height,2); $img_width = round($img_info[0]/$img_divider,0); }else{ $img_width = $img_thumb_width; $img_divider = round($img_info[0]/$img_thumb_width,2); $img_height = round($img_info[1]/$img_divider,0); } } $i++; if($i % $g_column == 1){ $output .= "\n"; } //$output .= ""; if($i % $g_column == 0){ $output .= ""; } } } if($i % $g_column != 0){ while($i % $g_column != 0){ $output .= ""; $i++; } $output .= ""; } $output .= "
"; //$get_rows[PGListPict]
if($g_pgcmt_use && $get_rows['PGComment'] > 0){ if($T_WITH_S && $get_rows['PGComment'] > 1){ $cmt_phrase = $T_CMT . "s"; }else{ $cmt_phrase = $T_CMT; } $pgcmt = "$get_rows[PGComment] $cmt_phrase"; }else{ $pgcmt = ""; } $output .= "
"; $output .= ""; $output .= "
$T_PG_PHOTODESC
$pgcmt
$img_KB KBytes
$img_width_r x $img_height_r pixels
"; $output .= "
\"$T_PG_ENLARGE\"

"; $output .= "
 
"; }elseif($act == "detail"){ /* --- ID Required --- */ if(!isset($PGListID)){ header("Location: $PHP_SELF"); } $get_photo = mysql_query("SELECT * FROM $pglist_file WHERE PGListID = '$PGListID' LIMIT 0,1", $db); if(mysql_num_rows($get_photo) != "0"){ $get_row = mysql_fetch_array($get_photo); $PGListCatID = $get_row['PGListCatID']; $PGListDesc = stripslashes(html_entity_decode($get_row['PGListDesc'])); $CatStructure = GetParrentPGCat($PGListCatID,"$PHP_SELF?PGCatID=",1) . " : " . $get_row['PGListPict']; $sub_dir = GetAltSubDir($get_row['PGListCatID']); $home_dir = $base_pgpath . "/" . $sub_dir; $home_thumbdir = $home_dir . "/thumbnail"; $home_url = $base_url_pg . "/" . $sub_dir; $home_thumburl = $home_url . "/thumbnail"; $img_file = $home_dir . "/" . $get_row['PGListPict']; $img_to_show_normal = $home_url . "/" . $get_row['PGListPict']; if(file_exists($img_file)){ $otherphotos_onpagecat = ""; if(!isset($pos)){ $pos = 0; } if($pos === "0"){ $halaman_ini = 1; }else{ $halaman_ini = ($pos / $step) + 1; } $temp_pos = $pos; $get_count = mysql_query("SELECT COUNT(PGListID) AS Total FROM $pglist_file WHERE PGListCatID='$PGListCatID'", $db); $get_row = mysql_fetch_array($get_count); $numrec = $get_row['Total']; $numpage = intval($numrec / $step); if($numrec % $step){ $numpage++; } $ps_query = "$PHP_SELF?PGCatID=$PGListCatID$lang_pre2$lang_param"; $ps_text = $T_PG_PHOTO; $get_otherphotos = mysql_query("SELECT * FROM $pglist_file LEFT JOIN $pgcat_file ON($pgcat_file.PGCatID = $pglist_file.PGListCatID) WHERE $pglist_file.PGListCatID='$PGListCatID' ORDER BY $pglist_file.PGListID DESC LIMIT $pos, $step", $db); $pgid_min = $pgid_max = $PGListID; if(mysql_num_rows($get_otherphotos) > 0){ $otherphotos_onpagecat .= <<

$T_PG_SCROLLT1 $halaman_ini $T_PG_SCROLLT2$T_PG_SCROLLT3$T_PG_SCROLLT4
$T_PG_SCROLLT5

EOF; $pgid_array = array(); while($get_rows_other = mysql_fetch_array($get_otherphotos)){ $img_file = $home_dir . "/" . $get_rows_other['PGListPict']; $thumb_file = $home_thumbdir . "/" . $get_rows_other['PGListPict']; if(file_exists($img_file)){ $img_info = image_info($img_file); $img_width_r = $img_info[0]; $img_height_r = $img_info[1]; $img_KB = round($img_info[2]/1024,0); $img_to_show = $home_url . "/" . $get_rows_other['PGListPict']; if(file_exists($thumb_file)){ $img_to_show = $home_thumburl . "/" . $get_rows_other['PGListPict']; $img_info = image_info($thumb_file); $img_width = $img_info[0]; $img_height = $img_info[1]; }else{ if($img_info[0] > $img_thumb_width){ $img_width = $img_thumb_width; $img_divider = round($img_info[0]/$img_thumb_width,2); $img_height = round($img_info[1]/$img_divider,0); }elseif($img_info[1] > $img_thumb_height){ $img_height = $img_thumb_height; $img_divider = round($img_info[1]/$img_thumb_height,2); $img_width = round($img_info[0]/$img_divider,0); }else{ $img_width = $img_thumb_width; $img_divider = round($img_info[0]/$img_thumb_width,2); $img_height = round($img_info[1]/$img_divider,0); } } $pgid_array[] .= $get_rows_other['PGListID']; $otherphotos_onpagecat .= <<$T_PG_ENLARGE EOF; } } $otherphotos_onpagecat .= "
"; $pgid_min = min($pgid_array); $pgid_max = max($pgid_array); } /* --- Get prev & next photo --- */ $button_prev = $button_next = ""; $get_nextphoto = mysql_query("SELECT * FROM $pglist_file WHERE $pglist_file.PGListCatID = '$PGListCatID' AND $pglist_file.PGListID < '$PGListID' ORDER BY PGListID DESC LIMIT 0,1", $db); if(mysql_num_rows($get_nextphoto) != "0"){ $get_next = mysql_fetch_array($get_nextphoto); if($get_next['PGListID'] < $pgid_min){ $posdtl = $temp_pos + $step; }else{ $posdtl = $temp_pos; } $button_next = "$T_NEXT »"; } $get_prevphoto = mysql_query("SELECT * FROM $pglist_file WHERE $pglist_file.PGListCatID = '$PGListCatID' AND $pglist_file.PGListID > '$PGListID' ORDER BY PGListID ASC LIMIT 0,1", $db); if(mysql_num_rows($get_prevphoto) != "0"){ $get_prev = mysql_fetch_array($get_prevphoto); if($get_prev['PGListID'] > $pgid_max){ $posdtl = $temp_pos - $step; }else{ $posdtl = $temp_pos; } $button_prev = "« $T_PREV"; } /* --- Show Comment Form & Check already comments --- */ if($g_pgcmt_use){ $icon_comment = "$base_url/images/icons/wm_artcmt.gif"; if(file_exists("$base_themepath/$theme/images/wm_artcmt.png")){ $icon_comment = "$base_url_themes/$theme/images/wm_artcmt.png"; } $get_pgcmt = mysql_query("SELECT COUNT(CmID) AS Total FROM $cmt_file WHERE CmPGListID = '$PGListID' AND CmAllow = '1'", $db); $get_row = mysql_fetch_array($get_pgcmt); if($get_row['Total'] > 0){ $pgcmt_link =<< $T_VIEW $T_CMT EOF; }else{ $pgcmt_link = ""; } $size = 40; $sizetarea = $size+round($size/2,0); if(!isset($g_maxcmt)){ $g_maxcmt = 500; } $smiley_list = SmileysList(); $cmt_form = << function ChrCount(field,remaining){ var MaxChr = $g_maxcmt; if (field.value.length > MaxChr){ field.value = field.value.substring(0, MaxChr); }else{ remaining.value = MaxChr - field.value.length; } } function insertSmiley(smiley){ var obj = document.comment.comment; obj.focus(); if (document.selection && document.selection.createRange) // Internet Explorer { sel = document.selection.createRange(); if (sel.parentElement() == obj) sel.text = smiley + " "; } else if (obj != "undefined") // Firefox { var longueur = parseInt(obj.textLength); var selStart = obj.selectionStart; var selEnd = obj.selectionEnd; obj.value = obj.value.substring(0,selStart) + smiley + " " + obj.value.substring(selEnd,longueur); } else obj.value += smiley + " "; obj.focus(); }
$T_CMT:
*) $T_RF_YNA:
$T_RF_YML:
*) $T_CMT_SBJ:
*) $T_CMT:
$g_maxcmt $T_CHARACTER $T_MAXIMUM

$T_CLICK_EMOTIONS: $smiley_list
*) $T_REQUIRED
EOF; } /*
$button_prev$button_next
*/ $seo_url = $base_url . $_SERVER['REQUEST_URI']; $output .= << $CatStructure

Jangan lupa "like" jika Anda suka dengan foto ini...

$PGListDesc
$button_prev$button_next
$otherphotos_onpagecat
$cmt_form EOF; } }else{ header("Location: $PHP_SELF"); } }else{ header("Location: $PHP_SELF"); } if($numpage > 1){ $output .= pagespan($ps_query, $ps_text, $T_WITH_S, 0); } //$output = theme_opencenter_box($T_PG) . $output . theme_closecenter_box(); $output = theme_opendef_box($T_PG) . $output . theme_closedef_box(); /* ------------------------------------ * * Push what we got above on the screen * * ------------------------------------ */ flush(); include("$base_themepath/$theme/header.php"); include("$base_themepath/$theme/body-inside-open.php"); echo $output; //if($numpage > 1){ echo pagespan($ps_query, $ps_text, $T_WITH_S, 0); } echo "
 
"; if(file_exists("$base_datapath/WMN_Komentar_Terakhir_PG.wmn")){ include("$base_datapath/WMN_Komentar_Terakhir_PG.wmn"); } echo "
 
"; if(file_exists("$base_datapath/WMN_PGLastCAT.wmn")){ include("$base_datapath/WMN_PGLastCAT.wmn"); } if(isset($ArtCat) && $ArtCat != "0"){ $randcontent = DisplayRandContent($ArtCat,6); }else{ $randcontent = DisplayRandContent(0,6); } $randcontent = "
 
" . $randcontent; echo $randcontent; echo "
 
"; include("$base_themepath/$theme/body-inside-close.php"); include("$base_themepath/$theme/footer.php"); mysql_close($db); ?>