Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/ii8dxkor/archive.iinkor.com/includes/libs/functions.class.php on line 407

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/ii8dxkor/archive.iinkor.com/includes/libs/functions.class.php on line 407

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/ii8dxkor/archive.iinkor.com/includes/libs/functions.class.php on line 407

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/ii8dxkor/archive.iinkor.com/includes/libs/functions.class.php on line 407

Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/ii8dxkor/archive.iinkor.com/includes/libs/functions.class.php on line 407

Warning: Creating default object from empty value in /home/ii8dxkor/archive.iinkor.com/common.php on line 192

Warning: Cannot modify header information - headers already sent by (output started at /home/ii8dxkor/archive.iinkor.com/includes/config.php:53) in /home/ii8dxkor/archive.iinkor.com/modules/download.module.php on line 95

Warning: Cannot modify header information - headers already sent by (output started at /home/ii8dxkor/archive.iinkor.com/includes/config.php:53) in /home/ii8dxkor/archive.iinkor.com/modules/download.module.php on line 96
أرشيف انكور : تحديد عدد الصور المسموح في كل توقيعأرشيف انكور
موضوع بعنوان :تحديد عدد الصور المسموح في كل توقيع
الكاتب :Admin


بسم الله الرحمن الرحيم

تحديد عدد الصور المسموح في كل توقيع
هذا الكود يجعلك تتحكم بعدد الصور الذي تريده ان يتواجد في تواقيع الاعضاء وهذا لألا تسمع للاعضاء بتخرب مظهر المواضيع بالصور الكثيرة في توقيعهم
وتمدد المنتدى وتخريبه حصري على شركة انكور التطويرية

معاينة عمل الكود :
13412
الكود :
عناصر اضافية - اكواد javas c r i p t - كل الصفحات
العنوان : اي شيء

// ZONA EDITABLE
const NUM_MAX_IMAGENES = 1;
const TEXTO_ERROR = 'عدد الصور المسموح في كل توقيع هو';
// FIN ZONA EDITABLE

if (encontrarParametroGET('mode') === 'editprofile' && encontrarParametroGET('page_profil') === 'signature') {
  document.addEventListener('DOMContentLoaded', function() {
    document.getElementsByName('submit')[0].addEventListener('click', function(e) {
      var textoFirma = $('#text_editor_textarea').sceditor('instance').val();
      if (numeroImagenes(textoFirma) > NUM_MAX_IMAGENES) {
        e.preventDefault();
        if (!document.getElementById('error_max_images')) {
          var divError = document.createElement('div');
          divError.id = 'error_max_images';
          divError.innerHTML = TEXTO_ERROR + ' <strong>' + NUM_MAX_IMAGENES + '</strong>';
          var post = document.getElementById('message-box') ? document.getElementById('message-box') : document.getElementsByClassName('sceditor-container')[0];
          post.prepend(divError);
        }
      }
    });
  });
}

function encontrarParametroGET(nombreParametro) {
    var resultado = null,
        tmp = [];
    var items = location.search.substr(1).split('&');
    for (var index = 0; index < items.length; index++) {
        tmp = items[index].split('=');
        if (tmp[0] === nombreParametro) resultado = decodeURIComponent(tmp[1]);
    }
    return resultado;
}

function numeroImagenes(texto) {
  return texto.split('[img]').length-1;
}

بالتوفيق للجميع
يرجى ذكر المصدر عند النقل
والسلام ختام