Advertisement:

Author Topic: Only one ad for each user  (Read 2377 times)

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Only one ad for each user
« Reply #30 on: December 29, 2017, 02:40:48 pm »
The user deletes the advertisement - he continues to receive the message - "only one ad per user"

???

Normally the count of User ads is decreased when an ad is deleted. It works correctly here...

Regards

c4

  • Newbie
  • *
  • Posts: 25
Re: Only one ad for each user
« Reply #31 on: December 29, 2017, 03:24:18 pm »
in the osclass administration panel, the users option is a table:
status, email, login, first name, date, offers (AD), update the date. The offer table (AD) is the number of all ads ever activated by the user.

I dug the base and in basename_t_user I changed the value of i_items from 1 to 0 for the test user. After this change, another advertisement can be published.

Gentlemen (and Ladies, if they occur here :) What and where to change so that you do not have to do it manually?

Regards and thank you for your help

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: Only one ad for each user
« Reply #32 on: December 29, 2017, 03:31:01 pm »
in the osclass administration panel, the users option is a table:
status, email, login, first name, date, offers (AD), update the date. The offer table (AD) is the number of all ads ever activated by the user.

I dug the base and in basename_t_user I changed the value of i_items from 1 to 0 for the test user. After this change, another advertisement can be published.

Gentlemen (and Ladies, if they occur here :) What and where to change so that you do not have to do it manually?

Regards and thank you for your help
I told you in my previous post

c4

  • Newbie
  • *
  • Posts: 25
Re: Only one ad for each user
« Reply #33 on: December 30, 2017, 08:10:57 am »
I added en entry to cron.php
Quote
            // WARN EXPIRATION EACH HOUR (COMMENT TO DISABLE)
            // NOTE: IF THIS IS ENABLE, SAME CODE SHOULD BE DISABLE ON CRON DAILY

            $items = Item::newInstance()->findByHourExpiration(1);
                foreach($items as $item) {
                    User::newInstance()->decreaseNumItems($item['fk_i_user_id']);
                }
            if(is_numeric(osc_warn_expiration()) && osc_warn_expiration()>0) {
                $items = Item::newInstance()->findByHourExpiration(24*osc_warn_expiration());
                foreach($items as $item) {
                    osc_run_hook('hook_email_warn_expiration', $item);

                }
            }

I added an advertisement to the test user. Then I removed the advertisement. Yesterday (4 hours ago) Still 1 in i_items :(

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: Only one ad for each user
« Reply #34 on: December 30, 2017, 12:50:39 pm »
Hmm. My method decreases the number when the items expire. I'll check to see if when deleting an item the number of items is decreased.
How did you delete the item?

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: Only one ad for each user
« Reply #35 on: December 30, 2017, 01:03:45 pm »
I tested with deletion from admin and from user dashboard. The number is decreased.(I don't use plugins.)

c4

  • Newbie
  • *
  • Posts: 25
Re: Only one ad for each user
« Reply #36 on: January 02, 2018, 11:15:03 am »
after turning off the more edit plugin .........  it worked:)

I'm now testing different cases of deleting an ad:
- user
- admin
- expiration
...