Author Topic: [MOD] Ayný Resimden Ýki Tane Varmý Kontrol Eden Eklenti v1.0  (Read 10301 times)

0 Members and 1 Guest are viewing this topic.

Offline sanko86

  • Sr. Member
  • ****
  • Posts: 310
    • View Profile
    • Elemegim
[MOD] Ayný Resimden Ýki Tane Varmý Kontrol Eden Eklenti v1.0

Aç member.php
Ara

Code: [Select]
  if (!$error) {
    // Start Upload
    include(ROOT_PATH.'includes/upload.php');

Bu kodu bulunca üstüne alttaki kodu ekleyin
Code: [Select]
/*
  MOD CHECK FOR DUPLICATE IMAGES
  START INSERT
*/
##########
# CONFIG #
##########

  $check_admin = true; //do check when administrator is uploading? (true/false)
  $show_image = true; //show link to the image that was previously uploaded? (true/false)
  $show_member = true; //show name and link to profile page of the member who previously uploaded that file? (true/false)

##############
# END CONFIG #
##############

  $md5 = "";
  unset($HTTP_POST_VARS['image_md5']);
  if ($user_info['user_level'] != ADMIN || $check_admin)
  {
    if (!empty($HTTP_POST_FILES['media_file']['tmp_name']) && $HTTP_POST_FILES['media_file']['tmp_name'] != "none")
    {
      $md5 = md5_file($HTTP_POST_FILES['media_file']['tmp_name']);
      $file = $HTTP_POST_FILES['media_file']['filename'];
    }
    elseif ($remote_media_file)
    {
      $md5 = md5($remote_media_file);
      $file = $remote_media_file;
    }
    if ($md5)
    {
      $sql = "SELECT image_id, image_name, cat_id, user_id
              FROM ".IMAGES_TABLE."
              WHERE image_md5 = '".$md5."'
              LIMIT 1";
      if ($row = $site_db->query_firstrow($sql))
      {

        $row['image_name'] = stripslashes($row['image_name']);
        if (function_exists('multilang')) $row['image_name'] = multilang($row['image_name']);
        $user_row = get_user_info($row['user_id']);
//        $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$file."</b><br />";
        $msg .= (($msg != "") ? "<br />" : "").(($user_info['user_level'] > GUEST && $user_info['user_id'] == $user_row['user_id']) ? $lang['image_md5_duplicate_self'] : sprintf(($show_member ? $lang['image_md5_duplicate_more'] : $lang['image_md5_duplicate_simple']), "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$user_row['user_id'])."\">".$user_row['user_name']."</a>"));
        if ($show_image && (($user_info['user_level'] > GUEST && $user_info['user_id'] != $user_row['user_id']) || (check_permission("auth_viewcat", $row['cat_id'] && check_permission("auth_viewimage", $row['cat_id'])))))
        {
          $msg .= ": <a href=\"".$site_sess->url(ROOT_PATH."details.php?image_id=".$row['image_id'])."\">".$row['image_name']."</a>";
        }
        $error = 1;
      }
      else
      {
        $sql = "SELECT image_id, image_name, user_id
                FROM ".IMAGES_TEMP_TABLE."
                WHERE image_md5 = '".$md5."'
                LIMIT 1";
        if ($row = $site_db->query_firstrow($sql))
        {
          $user_row = get_user_info($row['user_id']);
//          $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$file."</b><br />";
          $msg .= (($msg != "") ? "<br />" : "").(($user_info['user_level'] > GUEST && $user_info['user_id'] == $row['user_id']) ? $lang['image_md5_duplicate_validation_self'] : sprintf(($show_member ? $lang['image_md5_duplicate_validation_more'] : $lang['image_md5_duplicate_validation_simple']), "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$user_row['user_id'])."\">".$user_row['user_name']."</a>"));
          $error = 1;
        }
      }
      $HTTP_POST_VARS['image_md5'] = $md5;
    }
  }
/*
  MOD CHECK FOR DUPLICATE IMAGES
  END INSERT
*/

Aç lang/<senin dil klasörü>/main.php
bu iþaretten önce kodu ekle ?>
Code: [Select]
$lang['image_md5'] = "Image MD5 hash";
$lang['image_md5_duplicate_self'] = "You have submitted this file before";
$lang['image_md5_duplicate_more'] = "This file has been previously submitted by %s";
$lang['image_md5_duplicate_simple'] = "This file has been previously submitted";
$lang['image_md5_duplicate_validation_self'] = "You have submitted this file before and awaiting validation.";
$lang['image_md5_duplicate_validation_more'] = "This file has been previously submitted by %s and awaiting validation.";
$lang['image_md5_duplicate_validation_simple'] = "This file has been previously submitted and awaiting validation.";

Aç includes/db_field_definitions.php
 Bu iþaretten önce kodu ekleyin ?> :

Code: [Select]
$additional_image_fields['image_md5'] = array($lang['image_md5'], "text", 0);

Sonra ekli dosyadaki  image_md5_hash.php yi admin/plugins klasörü içine atýnýz

Sonrasýnda yine siteyi açýp admin paneline girin plugins menüsü var solda oradan "Image MD5 hash update" ye týklayýn ve gönder diyin.

Sonrasýnda
Çift resim varmý kontrol etmek için Image ID to start at alanýna  yazýp gönder diyiniz.

Web site:http://www.anlatiyoruz.com
Hayat zorluklarla doludur.Ama en zoru insanýn insana düþmanlýðýdýr.

Offline abdullah

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: [MOD] Ayný Resimden Ýki Tane Varmý Kontrol Eden Eklenti v1.0
« Reply #1 on: May 26, 2008, 02:54:05 PM »
kardeş muthis bir mod yarar bakımından ancak hatalı kurdum yani kurulamadi :)

Offline sanko86

  • Sr. Member
  • ****
  • Posts: 310
    • View Profile
    • Elemegim
Re: [MOD] Ayný Resimden Ýki Tane Varmý Kontrol Eden Eklenti v1.0
« Reply #2 on: May 27, 2008, 12:27:12 PM »
4images 1.7.6 kendiside kontrol ediyor ayný resimden varmý yokmu diye admin panelinde üzerine yaz yükleme gibi seçimlerde yapýlabiliyor.
Web site:http://www.anlatiyoruz.com
Hayat zorluklarla doludur.Ama en zoru insanýn insana düþmanlýðýdýr.

Offline abdullah

  • Full Member
  • ***
  • Posts: 108
    • View Profile
Re: [MOD] Ayný Resimden Ýki Tane Varmý Kontrol Eden Eklenti v1.0
« Reply #3 on: May 27, 2008, 02:00:09 PM »
benim 1,7.4 olmaz mi

Offline sanko86

  • Sr. Member
  • ****
  • Posts: 310
    • View Profile
    • Elemegim
Re: [MOD] Ayný Resimden Ýki Tane Varmý Kontrol Eden Eklenti v1.0
« Reply #4 on: May 28, 2008, 08:52:16 AM »
Denemedim dediðim ayar kýsmýna bak ve deneme yap.
Web site:http://www.anlatiyoruz.com
Hayat zorluklarla doludur.Ama en zoru insanýn insana düþmanlýðýdýr.

 

Post your comments here