Reset members activity

Karl

Member
When I reset my members from temporary inactive to active is it possible that their inactive days could be reset to 0 in the days inactive count?
 

Basti

Administrator
Staff member
That only happens if they sent a hit in or have a pageview. They are inactive, changing their status manually should not change that.
 

Karl

Member
The reason I asked is that I have listings that do not link back so they will not have hits in which means there status would remain as temporally inactive. I could change the setting "Inactive members removed from public view after this many days (set to 0 to turn off)" to 0 but I use this as a way of checking if the sites are still up and running, once a member hits the 30 days I can check the site then reset it. At this stage it is the only semi automatic way of checking sites statuses without have to go through all of the members manually on a regular basis if the setting was set to 0 which could be a large task if there are a lot of members.
 

Basti

Administrator
Staff member
Then you will need a plugin to grab inactive status before updating the site
http://visiolist.com/community/threads/live-stats-plugin.1584/#post-10102 see here for plugin structure
Point #1 - #5
Just rename the plugin name

#6
file admin_edit_process_form.php
Code:
    // Old status
    list($old_status) = $DB->fetch("SELECT active FROM {$CONF['sql_prefix']}_sites WHERE username = '{$TMPL['username']}'", __FILE__, __LINE__);

    // If old status 3 ( temp. inactive ) and new status 1 ( active ), reset inactive days
    if($old_status == 3 && $TMPL['active'] == 1)
    {
        $DB->query("UPDATE {$CONF['sql_prefix']}_stats SET days_inactive = 0 WHERE username = '{$TMPL['username']}", __FILE__, __LINE__);
    }
 
Last edited:

Karl

Member
Hi that worked for the ones I had already reactivated but when I try reactivate any others I now get

Fatal error
: Database error in "/home/bescorts/public_html/topsite/sources/admin/edit.php(425) : eval()'d code" on line 2
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''londonescortslocal' at line 1 in /home/bescorts/public_html/topsite/sources/sql/mysql.php on line 89
 

Mark

Administrator
Staff member
Missing a single quote in that first query


Should be:
Code:
    // Old status
    list($old_status) = $DB->fetch("SELECT active FROM {$CONF['sql_prefix']}_sites WHERE username = '{$TMPL['username']}'", __FILE__, __LINE__);
 

Basti

Administrator
Staff member
Right, my bad. But looking closer this thing will not work. By the time we get"$old_status" it is already updated and $old_status and $TMPL['active'] will have both the same value.
You may need to rename the plugin file to admin_edit_process_form.php
So the inactive query can run before the main member update query
 
Top