Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Rate stopped being written to ClickTrack....

Quote Reply
Rate stopped being written to ClickTrack....
Hi:



Weirdest thing... The "Rate" info stopped being writted to Clicktrack... the "Hits" info is still there, and current, but not the "Rate" info.



It stopped yesterday around 4 PM. I was doing a LOT of futzing around, but with httpd.conf, and not really with Links, so I do not have a clue what could have caused this. Especially since Hits is still written! And I KNOW I did NOT edit Rate.cgi/pm... (I even changes the jump script today so "hits" was written as "Rate", and it wrote "Rate", so I know you an write to ClickTrack..._)



Doing testing today, like I said, I changed Jump.cgi to write "Rate" instead of "Hits"- that worked... I also wrote a fake Rate with my IP addy, and I could still Rate, so it is not even doing the check to see if you have already rated...



I also resynced ClickTrack...



The only thing I can think of that comes close to maybe messinf this up, is I did restore from a Backup yesterday.



So, any Ideas why the Hits keep getting written, but the Rate stuff does not? I am pulling my hair out!



Thanks!\



Dave
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Rate stopped being written to ClickTrack.... In reply to
Here is the code currently online. Note that I have seperated ClickTrack Table to be just Hits, and RateTrack Table to be just the Ratings:



Quote:




# Let's get the link information.

my $db = $DB->table('Links');

my $rec = $db->get ($id);

$rec or return { error => Links::language('RATE_INVALIDID', $id) };

# Set date variable to today's date.

Links::init_date();

my $today = GT::Date::date_get (time + (7 * 86400));

if (date_is_smaller($today, $rec->{Add_Date})) {

return { error => Links::language ('RATE_DATE') };

}

else {

# Update the rating unless they have already voted.

my $click_db = $DB->table ('RateTrack');

my $rows = $click_db->count ( { LinkID => $id, IP => $ENV{REMOTE_ADDR}, ClickType => 'Rate' } );

if (!$rows) {

return { error => Links::language('RATE_VOTED', $id) };

}

else {

my $tmp = $rec->{Rating} * $rec->{Votes};

$rec->{Rating} = ($rec->{Rating} * $rec->{Votes}) + $rating;

$rec->{Votes} = $rec->{Votes} + 1;

$rec->{Rating} = $rec->{Rating} / $rec->{Votes};

$db->update ( { Votes => $rec->{Votes}, Rating => $rec->{Rating} }, { ID => $rec->{ID} });

$click_db->add ( { LinkID => $id, IP => $ENV{REMOTE_ADDR}, ClickType => 'Rate', Created => \"NOW()" } );

return $rec;


Note the bit I added to test the Date added, returning 'RATE_DATE'... that is so no one can rate a cartoon not yet in release. The code WORKS up to that point... but fails at the "my $rows = $click_db->count " test (As I said in my previous post, I faked a "Rate" that should have set this test off, but it did NOT catch it...



Dave
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Rate stopped being written to ClickTrack.... In reply to
I forgot to mention.... it DOES update Links, so the Rate and vote is recorded in Links, just not in Clicktrack...
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Rate stopped being written to ClickTrack.... In reply to
Maybe get debugging info

Code:


$click_db->debug_level(10); # > STDERR reams of info

my $rows = $click_db->count ( { LinkID => $id, IP => $ENV{REMOTE_ADDR}, ClickType => 'Rate' } );
Quote Reply
Re: [Aki] Rate stopped being written to ClickTrack.... In reply to
Thanks Aki:



OK, I put that code in, and now (no matter what), it errors out to "You Have Already Rated This Cartoon" (whether I have or not!)



Also, it did not supply any error info.... does it write the error report somewhere I need to go to get, or should it just reply onscreen?
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Rate stopped being written to ClickTrack.... In reply to
Aki:



I noticed a small code error [ if (!$rows) should be if ($rows) ], so I fixed that, and re-ran the code. I could keep rating, over and over, and while the Rating and Votes were again recorded in Links, the Rate Track was NOT recorded in ClickTrack... and no error code appeared on screen...




dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Rate stopped being written to ClickTrack.... In reply to
It puts the debugging messages into your server's error_log file.

The add/insert methods are occasionally a bit tricky in that if a column is passed that doesn't exist or required to be defined it will refuse to insert.
Quote Reply
Re: [Aki] Rate stopped being written to ClickTrack.... In reply to
In Reply To:
It puts the debugging messages into your server's error_log file.

The add/insert methods are occasionally a bit tricky in that if a column is passed that doesn't exist or required to be defined it will refuse to insert.
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Rate stopped being written to ClickTrack.... In reply to
Itchy trigger finger? If we ever go huntin for Bugs, you're taking point Angelic

*tease*
Quote Reply
Re: [Aki] Rate stopped being written to ClickTrack.... In reply to
Ha ah! And Whoops!



I DID write something there....



I looked at the log file, and it is VERY Verbose! Should I post it for you to look at?



dave



BTW, I already have Bugs haning on my wall!
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Rate stopped being written to ClickTrack.... In reply to
Gone with the wind it seems. Sure, can you attach the error log for me to take a look at?

Hehe, we've got Tweety bird hanging on the wall over here Wink Makes a lovely calendar.
Quote Reply
Re: [Aki] Rate stopped being written to ClickTrack.... In reply to
OK, You Asked for it. Here is the result of me making TWO ratings on the same cartoon. The cartoon ID = 5625:



Quote:




GT::SQL::Driver::MYSQL (19487): New driver object loaded from table: ClickTrack. at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Driver.pm line 53.

GT::SQL::Driver::MYSQL (19487): Using stored connection: DBI:mysql:cartoon:userdb.aros.net at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Driver.pm line 77.

GT::SQL::Table (19487): Query: SELECT COUNT(*) FROM ClickTrack WHERE LinkID = ? AND IP = ? AND ClickType = ?

GT::SQL::Driver::MYSQL (19487): Preparing query: SELECT COUNT(*) FROM ClickTrack WHERE LinkID = ? AND IP = ? AND ClickType = ? at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Driver/MYSQL.pm line 35.

GT::SQL::Driver::MYSQL (19487): Creating GT::SQL::Driver::MYSQL::sth object at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Driver/MYSQL.pm line 38.

GT::SQL::Driver::MYSQL::sth (19487): OBJECT CREATED at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Driver.pm line 553.

GT::SQL::Driver::MYSQL::sth (19487): Executing query: SELECT COUNT(*) FROM ClickTrack WHERE LinkID = 5625 AND IP = '66.219.218.212' AND ClickType = 'Rate'

GT::Base (19487): GT::SQL::Driver::MYSQL::sth::execute called at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Table.pm line 949 with arguments

(GT::SQL::Driver::MYSQL::sth=HASH(0x90dd374), 5625, 66.219.218.212, Rate).

GT::Base (19487): GT::SQL::Table::do_query called at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Table.pm line 865 with arguments

(GT::SQL::Table=HASH(0x90bc2a8), SELECT COUNT(*) FROM ClickTrack WHERE LinkID = ? AND IP = ? AND ClickType = ? , ARRAY(0x9066584)).

GT::Base (19487): GT::SQL::Table::select called at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Base.pm line 273 with arguments

(GT::SQL::Table=HASH(0x90bc2a8), HASH(0x84bbd84), ARRAY(0x84bbf10)).

GT::Base (19487): GT::SQL::Base::count called at /hd2/web/c/cartoon/public_html/bcdb/rate.cgi line 92 with arguments

(GT::SQL::Table=HASH(0x90bc2a8), HASH(0x84bbd84)).

GT::Base (19487): Apache::ROOTwww_2ebcdb_2ecom::bcdb::rate_2ecgi::rate_it called at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/Plugins.pm line 108 with arguments

(HASH(0x8fdf4d0)).

GT::Base (19487): GT::Plugins::dispatch called at /hd2/web/c/cartoon/public_html/bcdb/rate.cgi line 35 with arguments

(GT::Plugins, /hd2/web/c/cartoon/public_html/bcdb/admin/Plugins, rate_link, CODE(0x8fbd2a8), HASH(0x8fdf4d0)).

GT::Base (19487): Apache::ROOTwww_2ebcdb_2ecom::bcdb::rate_2ecgi::main called at /hd2/web/c/cartoon/public_html/bcdb/rate.cgi line 15 with no arguments.

GT::Base (19487): Apache::ROOTwww_2ebcdb_2ecom::bcdb::rate_2ecgi::handler called at /usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd/Apache/Registry.pm line 149 with arguments

(Apache=SCALAR(0x8df7068)).

GT::Base (19487): (eval) called at /usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd/Apache/Registry.pm line 149 with arguments

(Apache=SCALAR(0x8df7068)).

GT::Base (19487): Apache::Registry::handler called at /dev/null line 0 with arguments

(Apache=SCALAR(0x8df7068)).

GT::Base (19487): (eval) called at /dev/null line 0 with arguments

(Apache=SCALAR(0x8df7068)).



GT::SQL::Driver::MYSQL::sth (19487): OBJECT DESTROYED at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Driver.pm line 685.

GT::SQL::Table (19487): Column ReviewID cannot be left blank. at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Table.pm line 1853.

GT::Base (19487): GT::SQL::Table::insert called at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Table.pm line 219 with arguments

    (GT::SQL::Table=HASH(0x90bc2a8), HASH(0x84bbd84)).

GT::Base (19487): GT::SQL::Table::add called at /hd2/web/c/cartoon/public_html/bcdb/rate.cgi line 102 with arguments

    (GT::SQL::Table=HASH(0x90bc2a8), HASH(0x84bbd84)).

GT::Base (19487): Apache::ROOTwww_2ebcdb_2ecom::bcdb::rate_2ecgi::rate_it called at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/Plugins.pm line 108 with arguments

    (HASH(0x8fdf4d0)).

GT::Base (19487): GT::Plugins::dispatch called at /hd2/web/c/cartoon/public_html/bcdb/rate.cgi line 35 with arguments

    (GT::Plugins, /hd2/web/c/cartoon/public_html/bcdb/admin/Plugins, rate_link, CODE(0x8fbd2a8), HASH(0x8fdf4d0)).

GT::Base (19487): Apache::ROOTwww_2ebcdb_2ecom::bcdb::rate_2ecgi::main called at /hd2/web/c/cartoon/public_html/bcdb/rate.cgi line 15 with no arguments.

GT::Base (19487): Apache::ROOTwww_2ebcdb_2ecom::bcdb::rate_2ecgi::handler called at /usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd/Apache/Registry.pm line 149 with arguments

    (Apache=SCALAR(0x8df7068)).

GT::Base (19487): (eval) called at /usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd/Apache/Registry.pm line 149 with arguments

    (Apache=SCALAR(0x8df7068)).

GT::Base (19487): Apache::Registry::handler called at /dev/null line 0 with arguments

    (Apache=SCALAR(0x8df7068)).

GT::Base (19487): (eval) called at /dev/null line 0 with arguments

    (Apache=SCALAR(0x8df7068)).

GT::SQL::Driver::MYSQL (19487): Destroyed GT::SQL::Driver::MYSQL=HASH(0x84bbc1c) in package main at /dev/null line 0. at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/Base.pm line 91.

GT::SQL::Driver::MYSQL (19455): New driver object loaded from table: ClickTrack. at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Driver.pm line 53.

GT::SQL::Driver::MYSQL (19455): Using stored connection: DBI:mysql:cartoon:userdb.aros.net at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Driver.pm line 77.

GT::SQL::Table (19455): Query: SELECT COUNT(*) FROM ClickTrack WHERE LinkID = ? AND IP = ? AND ClickType = ?

GT::SQL::Driver::MYSQL (19455): Preparing query: SELECT COUNT(*) FROM ClickTrack WHERE LinkID = ? AND IP = ? AND ClickType = ? at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Driver/MYSQL.pm line 35.

GT::SQL::Driver::MYSQL (19455): Creating GT::SQL::Driver::MYSQL::sth object at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Driver/MYSQL.pm line 38.

GT::SQL::Driver::MYSQL::sth (19455): OBJECT CREATED at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Driver.pm line 553.

GT::SQL::Driver::MYSQL::sth (19455): Executing query: SELECT COUNT(*) FROM ClickTrack WHERE LinkID = 5625 AND IP = '66.219.218.212' AND ClickType = 'Rate'

GT::Base (19455): GT::SQL::Driver::MYSQL::sth::execute called at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Table.pm line 949 with arguments

(GT::SQL::Driver::MYSQL::sth=HASH(0x9022140), 5625, 66.219.218.212, Rate).

GT::Base (19455): GT::SQL::Table::do_query called at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Table.pm line 865 with arguments

(GT::SQL::Table=HASH(0x9024d00), SELECT COUNT(*) FROM ClickTrack WHERE LinkID = ? AND IP = ? AND ClickType = ? , ARRAY(0x8f9941c)).

GT::Base (19455): GT::SQL::Table::select called at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Base.pm line 273 with arguments

(GT::SQL::Table=HASH(0x9024d00), HASH(0x8ff9ee0), ARRAY(0x8ff9f40)).

GT::Base (19455): GT::SQL::Base::count called at /hd2/web/c/cartoon/public_html/bcdb/rate.cgi line 92 with arguments

(GT::SQL::Table=HASH(0x9024d00), HASH(0x8ff9ee0)).

GT::Base (19455): Apache::ROOTwww_2ebcdb_2ecom::bcdb::rate_2ecgi::rate_it called at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/Plugins.pm line 108 with arguments

(HASH(0x8f93788)).

GT::Base (19455): GT::Plugins::dispatch called at /hd2/web/c/cartoon/public_html/bcdb/rate.cgi line 35 with arguments

(GT::Plugins, /hd2/web/c/cartoon/public_html/bcdb/admin/Plugins, rate_link, CODE(0x8f6702c), HASH(0x8f93788)).

GT::Base (19455): Apache::ROOTwww_2ebcdb_2ecom::bcdb::rate_2ecgi::main called at /hd2/web/c/cartoon/public_html/bcdb/rate.cgi line 15 with no arguments.

GT::Base (19455): Apache::ROOTwww_2ebcdb_2ecom::bcdb::rate_2ecgi::handler called at /usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd/Apache/Registry.pm line 149 with arguments

(Apache=SCALAR(0x83b9128)).

GT::Base (19455): (eval) called at /usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd/Apache/Registry.pm line 149 with arguments

(Apache=SCALAR(0x83b9128)).

GT::Base (19455): Apache::Registry::handler called at /dev/null line 0 with arguments

(Apache=SCALAR(0x83b9128)).

GT::Base (19455): (eval) called at /dev/null line 0 with arguments

(Apache=SCALAR(0x83b9128)).



GT::SQL::Driver::MYSQL::sth (19455): OBJECT DESTROYED at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Driver.pm line 685.

GT::SQL::Table (19455): Column ReviewID cannot be left blank. at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Table.pm line 1853.

GT::Base (19455): GT::SQL::Table::insert called at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/SQL/Table.pm line 219 with arguments

    (GT::SQL::Table=HASH(0x9024d00), HASH(0x8ff9ee0)).

GT::Base (19455): GT::SQL::Table::add called at /hd2/web/c/cartoon/public_html/bcdb/rate.cgi line 102 with arguments

    (GT::SQL::Table=HASH(0x9024d00), HASH(0x8ff9ee0)).

GT::Base (19455): Apache::ROOTwww_2ebcdb_2ecom::bcdb::rate_2ecgi::rate_it called at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/Plugins.pm line 108 with arguments

    (HASH(0x8f93788)).

GT::Base (19455): GT::Plugins::dispatch called at /hd2/web/c/cartoon/public_html/bcdb/rate.cgi line 35 with arguments

    (GT::Plugins, /hd2/web/c/cartoon/public_html/bcdb/admin/Plugins, rate_link, CODE(0x8f6702c), HASH(0x8f93788)).

GT::Base (19455): Apache::ROOTwww_2ebcdb_2ecom::bcdb::rate_2ecgi::main called at /hd2/web/c/cartoon/public_html/bcdb/rate.cgi line 15 with no arguments.

GT::Base (19455): Apache::ROOTwww_2ebcdb_2ecom::bcdb::rate_2ecgi::handler called at /usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd/Apache/Registry.pm line 149 with arguments

    (Apache=SCALAR(0x83b9128)).

GT::Base (19455): (eval) called at /usr/local/lib/perl5/site_perl/5.6.1/i386-freebsd/Apache/Registry.pm line 149 with arguments

    (Apache=SCALAR(0x83b9128)).

GT::Base (19455): Apache::Registry::handler called at /dev/null line 0 with arguments

    (Apache=SCALAR(0x83b9128)).

GT::Base (19455): (eval) called at /dev/null line 0 with arguments

    (Apache=SCALAR(0x83b9128)).

GT::SQL::Driver::MYSQL (19455): Destroyed GT::SQL::Driver::MYSQL=HASH(0x8ffb110) in package main at /dev/null line 0. at /hd2/web/c/cartoon/public_html/bcdb/admin/GT/Base.pm line 91.
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Rate stopped being written to ClickTrack.... In reply to
OK, I think I spotted something. See near the end (where it would be adding inti ClickTrack...) where it says "Column ReviewID cannot be left blank"



There is no column ReviewID involved here! That is for the table Review. Is this what is causing the problem?



Gonna run a test. I am gonna manually insert my IP address in on a cartoon, and try to rate it, and see if it kicks it out as already rated... Will post the results in a second!
dave

Big Cartoon DataBase
Big Comic Book DataBase
Post deleted by Aki In reply to
Quote Reply
Re: [carfac] Rate stopped being written to ClickTrack.... In reply to
OK, Good News!



I put this into ClckTrack:

LinkID IP ClickType Created

5625 66.219.218.212 Rate 20020808134809



Then I tried to rate this cartoon... it said I already rated it... so it is working up to that point. It is just not writing the Rate data... provbably because it thinks there needs to be a ReviewID.



Should I set up a fake page, and put in a "ReviewID" as a hidden value, and see what happens?
dave

Big Cartoon DataBase
Big Comic Book DataBase

Last edited by:

carfac: Aug 8, 2002, 12:52 PM
Quote Reply
Re: [carfac] Rate stopped being written to ClickTrack.... In reply to
This got me thinking. I looked into ClickTrack.def, and discovered this:



'pk' => [

'LinkID',

'IP',

'ClickType',

'ReviewID',

'LinkID',

'IP',

'ClickType',

'ReviewID',

'LinkID',

'IP',

'ClickType',

'ReviewID',

'LinkID',

'IP',

'ClickType',

'ReviewID'

],



So, should I just ZAP all the lines with ReviewID in them, or what?

dave

Big Cartoon DataBase
Big Comic Book DataBase

Last edited by:

carfac: Aug 8, 2002, 12:59 PM
Quote Reply
Re: [carfac] Rate stopped being written to ClickTrack.... In reply to
Not sure if this would help, but here's my installation's def file.

Last edited by:

Aki: Aug 8, 2002, 2:10 PM
Quote Reply
Re: [Aki] Rate stopped being written to ClickTrack.... In reply to
Aki:



Thanks for that- Tried it, and STILL could not get it to work. So, in disgust, I just started a NEW table, and I am writing the Rating data to that! That is now up and working...



Thanks!



Dave
dave

Big Cartoon DataBase
Big Comic Book DataBase