1
Mods & Plugins (Releases & Support) / Re: [Mod] Like me
« on: February 27, 2011, 08:05:11 PM »
delete, and member's favorite pictures can also be done to show appreciation
Check the new Tutorial subforum with helpfull guides and tutorials for modifications and tweaks.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
$site_template->register_vars("new_images", $new_images);
unset($new_images);
//-----------------------------------------------------
//--- Show New Images By Category ---------------------
//-----------------------------------------------------
$imgtable_width = ceil(intval($config['image_table_width']) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
$imgtable_width .= "%";
}
$additional_sql = "";
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", i.".$key;
}
}
$num_news_images_bycat = $config['image_cells'];
// Option Start
$bycat_in = array(72,132); // Change the Number in your category-id - ID ripping by commas
// Ändere die Nummer in deine Kategorie-ID - ID trennen durch Komma
// Option Ende
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").") AND i.cat_id IN (".implode(", ", $bycat_in).")
ORDER BY i.image_date DESC
LIMIT $num_news_images_bycat";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
if (!$num_rows) {
$news_images_bycat = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
$news_images_bycat .= $lang['no_news_images_bycat'];
$news_images_bycat .= "</td></tr></table>";
}
else {
$news_images_bycat = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
$count = 0;
$bgcounter = 0;
while ($image_row = $site_db->fetch_array($result)){
if ($count == 0) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$news_images_bycat .= "<tr class=\"imagerow".$row_bg_number."\">\n";
}
$news_images_bycat .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
show_image($image_row);
$news_images_bycat .= $site_template->parse_template("thumbnail_bit");
$news_images_bycat .= "\n</td>\n";
$count++;
if ($count == $config['image_cells']) {
$news_images_bycat .= "</tr>\n";
$count = 0;
}
} // end while
if ($count > 0) {
$leftover = ($config['image_cells'] - $count);
if ($leftover >= 1) {
for ($f = 0; $f < $leftover; $f++) {
$news_images_bycat .= "<td width=\"".$imgtable_width."\">\n \n</td>\n";
}
$news_images_bycat .= "</tr>\n";
}
}
$news_images_bycat .= "</table>\n";
} // end else
$site_template->register_vars("news_images_bycat", $news_images_bycat);
unset($news_images_bycat);
$bycat_in = array(72,132);
kısmı değiştirererk hangi kategorilerinizden gösterilmesini istiyorsunuz belirtebilirsiniz.{news_images_bycat}kodunu resimlerin görünmesini istediğiniz yere yazıyorsunuz
<?
# Create Google Sitemap for 4images
# Created by Mai Minh (minh@maingo.com http://www.vna2z.com)
# Modified by Oliver van der Werf (info@flash-webdesign.de http://www.flash-webdesign.de)
# Adapted for [MOD] Google Friendly Urls by Fábio Dantas (fabio@amopiaui.com http://www.famosasx.info)
# Date: 28/11/2006 | 02.01.2007 | 16/06/2008
# You can send ping to Google with this request: http://www.google.com/webmasters/sitemaps/ping?sitemap=http://www.resimli.net/arama.xml
#---------------------------------
require("config.php");
# 4images top page (with trailing slash)
$gallery_url = 'http://www.resimli.net/';
# Choose the URL format
# 0 is http://www.site.com/cat123.htm
# 1 is http://www.site.com/details.php?image_id=123
# 2 is http://www.site.com/r-category-1-subcategory-2-image-123.htm
$shortURL = 2; // 0 or 1 or 2
# If $shortURL is different of 2, you can delete these three lines below:
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$link=mysql_connect("$db_host","$db_user","$db_password");
mysql_select_db("$db_name") or die ("Cannot connect database!");
# Priotity
//select between 0.0 and 1.0
//0.0 identifies the lowest priority page(s) on your website
//1.0 identifies the highest priority page(s) on your website
$prio_arama = 1.0;
# Frequency
//"always", "hourly", "daily", "weekly", "monthly", "yearly" or "never"
$freq_arama = 'monthly';
# Print XML header
xml_head();
# Print URLs
$arama = mysql_query('SELECT word_id,word_text FROM 4images_wordlist ORDER by word_id ');
while ($arama = mysql_fetch_array($arama))
{
$aramaid = $arama['word_id'];
$date = $arama['word_id'];
$date = date("Y-m-d",$date)."T".date("H:i:s",$date)."+00:00";
$arama_url = $gallery_url.'search.htm?search_keywords='.$aramaid;
print_xml($arama_url,$prio_arama,$date,$freq_arama);
}
# Print XML footer
xml_foot();
function xml_head() {
$freq = 'daily';
$priority = '1.0';
$mod = date("Y-m-d")."T".date("H:i:s")."+00:00";
echo "<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">";
}
#-----------------------------------------------
# xml_foot
#-----------------------------------------------
function xml_foot() {
echo "
</urlset>";
}
#-----------------------------------------------
# print_xml
#-----------------------------------------------
function print_xml($url,$priority,$lastmod,$changefreq) {
$temp = "<url>
<loc>$url</loc>";
$temp .= " <priority>$priority</priority>";
if ($lastmod != '') {
$temp .=" <lastmod>$lastmod</lastmod>";
}
$temp .= " <changefreq>$changefreq</changefreq>
</url>";
echo $temp;
}
?>
<?php
$folder = '.';
$extList = array();
$extList['gif'] = 'image/gif';
$extList['jpg'] = 'image/jpeg';
$extList['jpeg'] = 'image/jpeg';
$extList['png'] = 'image/png';
$img = null;
if (substr($folder,-1) != '/') {
$folder = $folder.'/';
}
if (isset($_GET['img'])) {
$imageInfo = pathinfo($_GET['img']);
if (
isset( $extList[ strtolower( $imageInfo['extension'] ) ] ) &&
file_exists( $folder.$imageInfo['basename'] )
) {
$img = $folder.$imageInfo['basename'];
}
} else {
$fileList = array();
$handle = opendir($folder);
while ( false !== ( $file = readdir($handle) ) ) {
$file_info = pathinfo($file);
if (
isset( $extList[ strtolower( $file_info['extension'] ) ] )
) {
$fileList[] = $file;
}
}
closedir($handle);
if (count($fileList) > 0) {
$imageNumber = time() % count($fileList);
$img = $folder.$fileList[$imageNumber];
}
}
if ($img!=null) {
$imageInfo = pathinfo($img);
$contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ];
header ($contentType);
readfile($img);
} else {
if ( function_exists('imagecreate') ) {
header ("Content-type: image/png");
$im = @imagecreate (100, 100)
or die ("Cannot initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 0,0,0);
imagestring ($im, 2, 5, 5, "IMAGE ERROR", $text_color);
imagepng ($im);
imagedestroy($im);
}
}
?>