Oscommerce Türkçe İndir
Cevapla 
 
Derecelendir
  • 0 Oylar - 0 Yüzde
  • 1
  • 2
  • 3
  • 4
  • 5
Kategori resmini silme butonu eklemek
Yazar Mesaj
snowbird Çevrimdışı
Administrator
*******

Mesajlar: 721
Katılma Tarihi: Jul 2008
Rep Puanı: 6
Mesaj: #1
Kategori resmini silme butonu eklemek
Benim anladığım kategori resmini iptal etmek ise bu kategori düzenle bölümüne buton ekleyip kategori resmini silmemizi sağlar

Şu 3 dosyayı değiştireceğiz

PHP Kod:
catalog/admin/categories.php
catalog
/admin/includes/languages/turkish/categories.php  (varsa diğer diller)
catalog/admin/includes/functions/general.php 

catalog/admin/categories.php
_____________________________

Aşağıdakini bulalım

PHP Kod:
case 'delete_category_confirm':
        if (isset(
$HTTP_POST_VARS['categories_id'])) {
          
$categories_id tep_db_prepare_input($HTTP_POST_VARS['categories_id']);

          
$categories tep_get_category_tree($categories_id'''0'''true);
          
$products = array();
          
$products_delete = array();

          for (
$i=0$n=sizeof($categories); $i<$n$i++) {
            
$product_ids_query tep_db_query("select products_id from " TABLE_PRODUCTS_TO_CATEGORIES " where categories_id = '" . (int)$categories[$i]['id'] . "'");

            while (
$product_ids tep_db_fetch_array($product_ids_query)) {
              
$products[$product_ids['products_id']]['categories'][] = $categories[$i]['id'];
            }
          }

          
reset($products);
          while (list(
$key$value) = each($products)) {
            
$category_ids '';

            for (
$i=0$n=sizeof($value['categories']); $i<$n$i++) {
              
$category_ids .= "'" . (int)$value['categories'][$i] . "', ";
            }
            
$category_ids substr($category_ids0, -2);

            
$check_query tep_db_query("select count(*) as total from " TABLE_PRODUCTS_TO_CATEGORIES " where products_id = '" . (int)$key "' and categories_id not in (" $category_ids ")");
            
$check tep_db_fetch_array($check_query);
            if (
$check['total'] < '1') {
              
$products_delete[$key] = $key;
            }
          }

// removing categories can be a lengthy process
          
tep_set_time_limit(0);
          for (
$i=0$n=sizeof($categories); $i<$n$i++) {
            
tep_remove_category($categories[$i]['id']);
          }

          
reset($products_delete);
          while (list(
$key) = each($products_delete)) {
            
tep_remove_product($key);
          }
        }

        if (
USE_CACHE == 'true') {
          
tep_reset_cache_block('categories');
          
tep_reset_cache_block('also_purchased');
        }

       
tep_redirect(tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath));
        break; 

Hemen altın şunu ekleyelim:

PHP Kod:
case 'delete_category_image_confirm':
        if (isset(
$HTTP_POST_VARS['categories_id'])) {
          
$categories_id tep_db_prepare_input($HTTP_POST_VARS['categories_id']);
            
tep_remove_category_image($categories_id);

        }

        if (
USE_CACHE == 'true') {
          
tep_reset_cache_block('categories');
          
tep_reset_cache_block('also_purchased');
        }

        
tep_redirect(tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath));
        break; 


Aşağıdakini bualım

PHP Kod:
case 'delete_category':
        
$heading[] = array('text' => '<b>' TEXT_INFO_HEADING_DELETE_CATEGORY '</b>');

        
$contents = array('form' => tep_draw_form('categories'FILENAME_CATEGORIES'action=delete_category_confirm&cPath=' $cPath) . tep_draw_hidden_field('categories_id'$cInfo->categories_id));
        
$contents[] = array('text' => TEXT_DELETE_CATEGORY_INTRO);
        
$contents[] = array('text' => '<br><b>' $cInfo->categories_name '</b>');
        if (
$cInfo->childs_count 0$contents[] = array('text' => '<br>' sprintf(TEXT_DELETE_WARNING_CHILDS$cInfo->childs_count));
        if (
$cInfo->products_count 0$contents[] = array('text' => '<br>' sprintf(TEXT_DELETE_WARNING_PRODUCTS$cInfo->products_count));
        
$contents[] = array('align' => 'center''text' => '<br>' tep_image_submit('button_delete.gif'IMAGE_DELETE) . ' <a href="' tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath '&cID=' $cInfo->categories_id) . '">' tep_image_button('button_cancel.gif'IMAGE_CANCEL) . '</a>');
        break; 

aşağıdakini altına ekleyelim:

PHP Kod:
case 'delete_category_image':
        
$heading[] = array('text' => '<b>' TEXT_INFO_HEADING_DELETE_CATEGORY_IMAGE '</b>');
        
        
$contents = array('form' => tep_draw_form('categories'FILENAME_CATEGORIES'action=delete_category_image_confirm&cPath=' $cPath) . tep_draw_hidden_field('categories_id'$cInfo->categories_id));
        
$contents[] = array('text' => TEXT_DELETE_CATEGORY_IMAGE_INTRO);
        
$contents[] = array('text' => '<br><b>' $cInfo->categories_name '</b>');
        
$contents[] = array('align' => 'center''text' => '<br>' tep_image_submit('button_delete_image.gif'IMAGE_DELETE) . ' <a href="' tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath '&cID=' $cInfo->categories_id) . '">' tep_image_button('button_cancel.gif'IMAGE_CANCEL) . '</a>');

        break; 

Aşağıdakini bulalım

PHP Kod:
$contents[] = array('align' => 'center''text' => '<a href="' tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath '&cID=' $cInfo->categories_id '&action=edit_category') . '">' tep_image_button('button_edit.gif'IMAGE_EDIT) . '</a> <a href="' tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath '&cID=' $cInfo->categories_id '&action=delete_category') . '">' tep_image_button('button_delete.gif'IMAGE_DELETE) . '</a> <a href="' tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath '&cID=' $cInfo->categories_id '&action=move_category') . gory_image') . '">' . tep_image_button('button_delete_image.gif', IMAGE_DELETE) . '</a>'); 

aşağıdaki ile değiştirelim:

PHP Kod:
$contents[] = array('align' => 'center''text' => '<a href="' tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath '&cID=' $cInfo->categories_id '&action=edit_category') . '">' tep_image_button('button_edit.gif'IMAGE_EDIT) . '</a> <a href="' tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath '&cID=' $cInfo->categories_id '&action=delete_category') . '">' tep_image_button('button_delete.gif'IMAGE_DELETE) . '</a> <a href="' tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath '&cID=' $cInfo->categories_id '&action=move_category') . '">' tep_image_button('button_move.gif'IMAGE_MOVE) . '</a> <a href="' tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath '&cID=' $cInfo->categories_id '&action=delete_category_image') . '">' tep_image_button('button_delete_image.gif'IMAGE_DELETE) . '</a>'); 

Aşağıdakini bulalım

PHP Kod:
contents[] = array('text' => '<br>' tep_info_image($cInfo->categories_image$cInfo->categories_nameHEADING_IMAGE_WIDTHHEADING_IMAGE_HEIGHT) . '<br>' $cInfo->categories_image); 

Altın şunu ekleyelim
PHP Kod:
if ($cInfo->categories_image$contents[] = array('text' =>'<br><a href="' tep_href_link(FILENAME_CATEGORIES'cPath=' $category_path_string '&cID=' $cInfo->categories_id '&action=delete_category_image') . '">' tep_image_button('button_delete_image.gif'IMAGE_DELETE) . '</a>'); 
________________________________________________________________________________ ______________
catalog/admin/includes/languages/turkish/categories.php
________________________________________________________________________________ ______________

aşağıdaki tanımları ekleyelim:

PHP Kod:
define('TEXT_INFO_HEADING_DELETE_CATEGORY_IMAGE''Kategori resmini sil');
define('TEXT_DELETE_CATEGORY_IMAGE_INTRO''Kategori resmi silinecek emin misiniz?'); 
________________________________________________________________________________ ______________
catalog/admin/includes/functions/general.php
________________________________________________________________________________ ______________
aşağıdakini bulalım

PHP Kod:
function tep_remove_category($category_id) {
    
$category_image_query tep_db_query("select categories_image from " TABLE_CATEGORIES " where categories_id = '" . (int)$category_id "'");
    
$category_image tep_db_fetch_array($category_image_query);

    
$duplicate_image_query tep_db_query("select count(*) as total from " TABLE_CATEGORIES " where categories_image = '" tep_db_input($category_image['categories_image']) . "'");
    
$duplicate_image tep_db_fetch_array($duplicate_image_query);

    if (
$duplicate_image['total'] < 2) {
      if (
file_exists(DIR_FS_CATALOG_IMAGES $category_image['categories_image'])) {
        @
unlink(DIR_FS_CATALOG_IMAGES $category_image['categories_image']);
      }
    }

    
tep_db_query("delete from " TABLE_CATEGORIES " where categories_id = '" . (int)$category_id "'");
    
tep_db_query("delete from " TABLE_CATEGORIES_DESCRIPTION " where categories_id = '" . (int)$category_id "'");
    
tep_db_query("delete from " TABLE_PRODUCTS_TO_CATEGORIES " where categories_id = '" . (int)$category_id "'");

    if (
USE_CACHE == 'true') {
      
tep_reset_cache_block('categories');
      
tep_reset_cache_block('also_purchased');
    }
  } 

Hemen altına şunu ekleyelim:

PHP Kod:
function tep_remove_category_image($category_id) {
  
    
$category_image_query tep_db_query("select categories_image from " TABLE_CATEGORIES " where categories_id = '" . (int)$category_id "'");
    
$category_image tep_db_fetch_array($category_image_query);

    
$duplicate_image_query tep_db_query("select count(*) as total from " TABLE_CATEGORIES " where categories_image = '" tep_db_input($category_image['categories_image']) . "'");
    
$duplicate_image tep_db_fetch_array($duplicate_image_query);

    if (
$duplicate_image['total'] < 2) {
      if (
file_exists(DIR_FS_CATALOG_IMAGES $category_image['categories_image'])) {
        
unlink(DIR_FS_CATALOG_IMAGES $category_image['categories_image']);
      }
    }

    
tep_db_query("update " TABLE_CATEGORIES " set categories_image ='' where categories_id = '" . (int)$category_id "'");

    if (
USE_CACHE == 'true') {
      
tep_reset_cache_block('categories');
      
tep_reset_cache_block('also_purchased');
    }
  } 

Son olarak
button_delete_image.gif" butonu oluşturup /catalog/admin/includes/languages/[DİL]/images/buttons altına koyunuz

Bundan sonra kategori düzenleye girdiğimizde bir buton çıkacak ve kat. resmini silmemizi sağlayacak
13-09-2008 05:55
Tüm Mesajlarını Bul Alıntı Yaparak Cevapla
rescued Çevrimdışı
Member
***

Mesajlar: 92
Katılma Tarihi: Aug 2008
Rep Puanı: 1
Mesaj: #2
RE: Kategori resmini silme butonu eklemek
Anlayamadığım nokta buresmin kendisinimi siliyor yoksa web sayfasında görünmesinimi engelliyor
13-09-2008 11:41
Tüm Mesajlarını Bul Alıntı Yaparak Cevapla
snowbird Çevrimdışı
Administrator
*******

Mesajlar: 721
Katılma Tarihi: Jul 2008
Rep Puanı: 6
Mesaj: #3
RE: Kategori resmini silme butonu eklemek
Görünmesini engellemek bir iki satırda halledilirdi. Bu resmi sunucudan silip görünmesinide engelliyor ayrıca
13-09-2008 12:06
Tüm Mesajlarını Bul Alıntı Yaparak Cevapla
busybody Çevrimdışı
oscommerceden vazgeçemez
*****

Mesajlar: 466
Katılma Tarihi: Jul 2008
Rep Puanı: 1
Mesaj: #4
RE: Kategori resmini silme butonu eklemek
teşekkür ederim . bana çok faydası oldu. bugün kullandım. yukarıda yazanları yaptım. hiçbir sorun çıkmadı.
tekrar teşekkür ederim. emeğinize sağlık Smile

butonuda benden olsun.
rengi uymayan kendi butonunu yapabilir ama nasılsa admin panelde kimse görmüyo derseniz buyrun Smile


Ekli Dosya(lar)
.gif  button_delete_image.gif (Boyut: 1.04 KB / İndirme: 28)

-----Hayat Hep Son Sözü Söyler ,Ama Benimde Cümlelerim Var-----
(Bu Mesaj 16-09-2008 12:00 değiştirilmiştir. Değiştiren : busybody.)
16-09-2008 10:45
Tüm Mesajlarını Bul Alıntı Yaparak Cevapla
rescued Çevrimdışı
Member
***

Mesajlar: 92
Katılma Tarihi: Aug 2008
Rep Puanı: 1
Mesaj: #5
RE: Kategori resmini silme butonu eklemek
$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=edit_category') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=delete_category') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=move_category') . gory_image') . '">' . tep_image_button('button_delete_image.gif', IMAGE_DELETE) . '</a>');


aşağıdaki ile değiştirelim:

PHP Kodu:
$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=edit_category') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=delete_category') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=move_category') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=delete_category_image') . '">' . tep_image_button('button_delete_image.gif', IMAGE_DELETE) . '</a>');

burayı bulamadım
04-10-2008 16:09
Tüm Mesajlarını Bul Alıntı Yaparak Cevapla
erta77 Çevrimdışı
Member
***

Mesajlar: 72
Katılma Tarihi: Jul 2008
Rep Puanı: 0
Mesaj: #6
RE: Kategori resmini silme butonu eklemek
Bende ilgili satırı bulamadım ama kod çalışıyor sorun olur mu?

Bu satıra en benzer satır şu:

PHP Kod:
$contents[] = array('align' => 'center''text' => '<a href="' tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath '&pID=' $pInfo->products_id '&action=new_product') . '">' tep_image_button('button_edit.gif'IMAGE_EDIT) . '</a> <a href="' tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath '&pID=' $pInfo->products_id '&action=delete_product') . '">' tep_image_button('button_delete.gif'IMAGE_DELETE) . '</a> <a href="' tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath '&pID=' $pInfo->products_id '&action=move_product') . '">' tep_image_button('button_move.gif'IMAGE_MOVE) . '</a> <a href="' tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath '&pID=' $pInfo->products_id '&action=copy_to') . '">' tep_image_button('button_copy_to.gif'IMAGE_COPY_TO) . '</a>'); 
04-10-2008 19:00
Tüm Mesajlarını Bul Alıntı Yaparak Cevapla
snowbird Çevrimdışı
Administrator
*******

Mesajlar: 721
Katılma Tarihi: Jul 2008
Rep Puanı: 6
Mesaj: #7
RE: Kategori resmini silme butonu eklemek
Evet o satırlar illada o şekilde olmayabilir. Butonların gösterildiği yer.
button_delete.gif şeklinde aratıp oraya ulaşabilirsiniz sanırım
05-10-2008 08:56
Tüm Mesajlarını Bul Alıntı Yaparak Cevapla
rescued Çevrimdışı
Member
***

Mesajlar: 92
Katılma Tarihi: Aug 2008
Rep Puanı: 1
Mesaj: #8
RE: Kategori resmini silme butonu eklemek
Warning: unlink(C:/Vhosts/bigtech.biz/subdomains/shop/httpdocs/images/) [function.unlink]: Permission denied in C:\Vhosts\bigtech.biz\subdomains\shop\httpdocs\admin\includes\functions\general.php on line 891

Warning: Cannot modify header information - headers already sent by (output started at C:\Vhosts\bigtech.biz\subdomains\shop\httpdocs\admin\includes\functions\general.php:891) in C:\Vhosts\bigtech.biz\subdomains\shop\httpdocs\admin\includes\functions\general.php on line 22
09-10-2008 07:58
Tüm Mesajlarını Bul Alıntı Yaparak Cevapla
snowbird Çevrimdışı
Administrator
*******

Mesajlar: 721
Katılma Tarihi: Jul 2008
Rep Puanı: 6
Mesaj: #9
RE: Kategori resmini silme butonu eklemek
Sevgili rescued;

php öyle güzel bir dildirki yaşadığı gördüğü hataları kullanıcısına genelde çok net bir dille anlatır.

derki "Permission denied in "

Kılasördeki resimlerin silinebilir haklara sahip olup olmadığına bakmak faydalı olacaktır
09-10-2008 17:22
Tüm Mesajlarını Bul Alıntı Yaparak Cevapla
« Önceki | Sonraki »
Cevapla 


Forum Atla: