*

danads

  • ***
  • 43 posts
item-post.php
« on: April 19, 2021, 01:37:52 AM »
If admin agrees I can post and maybe someone can help me.
I want to introduce a step in front of the ad ads. - item-post.php -(site information and ad rules)
I understand that this is customization but maybe someone is willing to help me.
I modified the file but I have an error.
When I want to add a new ad it shows me directly the second step of adding ad details not my first step whit information.
I understand that I need to modify the file Global.js but I fail.
If anyone guides me exactly what lines to change to resolve the error and steps to appear in the order 1, 2 , 3 , 4 (plugins)

Thank you.
« Last Edit: April 19, 2021, 01:40:14 AM by danads »

*

MB Themes

Re: item-post.php
« Reply #1 on: April 19, 2021, 03:59:25 PM »
@danads
This is not simple task and require to first update item-post.php with new section (and put correct IDs and counter for steps) and then update global.js, section bellow comment:
Code: [Select]
// PUBLISH - MOVE BETWEEN STEPS
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

danads

  • ***
  • 43 posts
Re: item-post.php
« Reply #2 on: April 19, 2021, 10:52:51 PM »
Thanks for the information.
I try my best and from all the information I find on the net to change, I don't want to give up.
I changed the item-post.php , I realised one more new section and recounter all steps from 1 to 4 now
I update global.js but when I try to ad a new ads it is opens in step two not in one the new one.
"intro" --it is the new step one


// PUBLISH MOVE BETWEEN STEPS
  $('.post-navigation .btn').click(function(e){
    e.preventDefault();

    var current = $(this).attr('data-current-step');
    var next = $(this).attr('data-next-step');
    var prev = $(this).attr('data-prev-step');
    var total = parseInt($('fieldset.intro .total-steps').text());

    $('html, body').animate({
      scrollTop: $('body').offset().top
    }, 300);

    if( $(this).hasClass('post-next') ) {

      // Check for required fields
      $('fieldset[data-step-id="' + current + '"] input, fieldset[data-step-id="' + current + '"] select, fieldset[data-step-id="' + current + '"] textarea').each(function(){
        if( $(this).attr('id') != 'ir_image_check' && (typeof($(this).attr('id')) == 'undefined' || (typeof($(this).attr('id')) !== 'undefined' && !($(this).attr('id')).startsWith("atr_")))) {
          $("form[name=item]").validate().element($(this));
        }
      });

      // Fix functionality of image required plugin
      if($('input#ir_image_check').length) {
        if(current != 3) {
          $('input#ir_image_check').attr('disabled', true);
        } else {
          $('input#ir_image_check').attr('disabled', false);
          $("form[name=item]").validate().element($('input#ir_image_check'));
        }
      }

      // Fix functionality of attributes plugin
      if($('[id^="atr_"]').length) {
        $('[id^="atr_"]').each(function(){
          if(next != 4) {
            $(this).attr('disabled', true);
          }
        });
      }

      if($("form[name=item]").valid()) {
          $('fieldset[data-step-id="' + current + '"]').animate({marginLeft: "-1000px", opacity:0}, 300, function(){
          $('fieldset[data-step-id="' + current + '"]').hide(0);
          $('fieldset[data-step-id="' + next + '"]').css('display', 'inline-block').css('margin-left', '1000px').css('opacity', '0');
          $('fieldset[data-step-id="' + next + '"]').animate({marginLeft: "0px", opacity:1}, 300);

          // Show submit button
          if(parseInt(current) == (total-1) && parseInt(next) == total) {
            $('.buttons-block').css('display', 'inline-block').css('margin-left', '1000px').css('opacity', '0');
            $('.buttons-block').animate({marginLeft: "0px", opacity:1}, 300);
          }

          // If there are only 2 steps, hide next button on 2nd step
          if(total < 4) {
            $('fieldset.photos .post-next').hide(0);
          } else {
            $('fieldset.photos .post-next').show(0);
          }
        });
      }

      // Fix functionality of attributes plugin
      if($('[id^="atr_"]').length) {
        $('[id^="atr_"]').each(function(){
          if(next == 4) {
            $(this).attr('disabled', false);
          }
        });
      }

    } else if ( $(this).hasClass('post-prev') ) {
        $('fieldset[data-step-id="' + current + '"]').animate({marginLeft: "1000px", opacity:0}, 300, function(){
        $('fieldset[data-step-id="' + current + '"]').hide(0);
        $('fieldset[data-step-id="' + prev + '"]').css('display', 'inline-block').css('margin-left', '-1000px').css('opacity', '0');
        $('fieldset[data-step-id="' + prev + '"]').animate({marginLeft: "0px", opacity:1}, 300);
      });

      // Hide submit button
      $('.buttons-block').animate({marginLeft: "1000px", opacity:1}, 300, function() {
        $('.buttons-block').hide(0);
      });
    }
   
  });

*

danads

  • ***
  • 43 posts
Re: item-post.php
« Reply #3 on: April 26, 2021, 10:55:39 PM »
....... if anyone wants to help me I am grateful.