Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
310 views
in Plugins by
Hi

I have coded out the following events so they don't write to database and this works for me:

q_vote_up
q_vote_nil
a_vote_up
a_vote_nil

I would like to do the same with the following:

in_q_vote_up
in_a_vote_up

Unfortunately it doesn't seem to work and they still write to the database.

Any ideas? Code below... Thank you for your time.

This is the original code in page 'qa-event-logger.php'

line 150

    public function process_event($event, $userid, $handle, $cookieid, $params)
    {
        if (qa_opt('event_logger_to_database')) {
            $paramstring='';
            foreach ($params as $key => $value)
                $paramstring.=(strlen($paramstring) ? "\t" : '').$key.'='.$this->value_to_text($value);

            qa_db_query_sub(
                'INSERT INTO ^eventlog (datetime, ipaddress, userid, handle, cookieid, event, params) '.
                'VALUES (NOW(), $, $, $, #, $, $)',
                qa_remote_ip_address(), $userid, $handle, $cookieid, $event, $paramstring
            );
        }

This is the code I have amended in page 'qa-event-logger.php'

line 150

            public function process_event($event, $userid, $handle, $cookieid, $params)
    {
        if (qa_opt('event_logger_to_database') && $event!='q_vote_up') {
            $paramstring='';
        if (qa_opt('event_logger_to_database') && $event!='q_vote_nil') {
            $paramstring='';
        if (qa_opt('event_logger_to_database') && $event!='a_vote_up') {
            $paramstring='';
        if (qa_opt('event_logger_to_database') && $event!='a_vote_nil') {
            $paramstring='';
        if (qa_opt('event_logger_to_database') && $event!='in_q_vote_up') {
            $paramstring='';
        if (qa_opt('event_logger_to_database') && $event!='in_a_vote_up') {
            $paramstring='';
            foreach ($params as $key => $value)
                $paramstring.=(strlen($paramstring) ? "\t" : '').$key.'='.$this->value_to_text($value);

            qa_db_query_sub(
                'INSERT INTO ^eventlog (datetime, ipaddress, userid, handle, cookieid, event, params) '.
                'VALUES (NOW(), $, $, $, #, $, $)',
                qa_remote_ip_address(), $userid, $handle, $cookieid, $event, $paramstring
            );
        }
        }
        }
        }
        }
        }
Q2A version: 1.7.3

Please log in or register to answer this question.

...