Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] The new functionality "hits" not work

[FIXED] The new functionality "hits" not work 10 Oct 2012 06:26 #4351

  • smarano
  • smarano's Avatar
  • Offline
  • Junior Member
  • Posts: 34
  • Thank you received: 1
  • Karma: 1
The new functionality "hits" not work, the field is not incremented when an item is displayed. Someone can help me? Thank you.
Last Edit: 17 Oct 2012 13:12 by smarano.
The administrator has disabled public write access.

Re: The new functionality "hits" not work 10 Oct 2012 11:59 #4363

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
+1 is the same for me
BUILD => Cook version 2.0 / joomla 2.5
config => jquery - condensed - reduced and DB automatisms = model
Have tried various combinations of the following and it will not increment (front end)

Default value = 0
default value =1
no default value
Pre Fills form = checked
prefills form = unchecked
with fly view brick
with form brick

then created a link on a the collection view field and then followed the URL

Again will not increment

Is there something we are missing

Published default =1 tested
Access = 1 tested
Logged in as admin and various users
Last Edit: 10 Oct 2012 12:18 by BTB300.
The administrator has disabled public write access.

Re: The new functionality "hits" not work 10 Oct 2012 14:43 #4365

  • smarano
  • smarano's Avatar
  • Offline
  • Junior Member
  • Posts: 34
  • Thank you received: 1
  • Karma: 1
yes, I too have tried all the settings, but nothing to do!

I would like at this point to know if anyone does!
The administrator has disabled public write access.

Re: The new functionality "hits" not work 11 Oct 2012 06:53 #4385

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
I think it works, but you must be aware that this functionality is a unique-visitor. Means that if you want to see the incrementation, you must log out and log in again.

Maybe there is a real issue, can you confirm me that you have an issue, even logging out/in ?
Coding is now a piece of cake
The administrator has disabled public write access.

Re: The new functionality "hits" not work 11 Oct 2012 08:32 #4394

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Hi Admin
thanks have created a test project "test hits"
have logged in / out tried different sandbox users
does the hits field require
a default value
or prefill be checked?
does need a link in the collection layout field to a fly layout
or
does it have to be a form layout

Thanks Again
The administrator has disabled public write access.

Re: The new functionality "hits" not work 11 Oct 2012 10:22 #4406

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Hi admin
This may help you...
I Downloaded my test hits component
Cook version 2.0
Installed
When creating menu item for the
Item layout
I got a SQL error in the joomla
menu manager: new menu item
Table database.tableprefix_testhits_testhits doesn't exist
TableSQL= some_test_string from table prefix_testhits_testhits where ID=0
The administrator has disabled public write access.

Re: The new functionality "hits" not work 11 Oct 2012 10:45 #4407

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Hi Admin
I think i found it?
I checked the jmodel.php file and found that the hit is not incremented...
added $hits[] = $id+1; as shown below and it appears to work as you described above

- it will only increment once per logged in user click
- it will increment again if a guest user logs in/out
- it will increment again if the the user logs out/in
		//This item has already been seen during this session
		if (in_array($id, $hits))
			return;

		$hits[] = $id;

		//Increment the hits
		$table = $this->getTable();
		if (!$table->hit($id))
			return false;
		
		$hits[] = $id+1; // <= added this line here (seems to work??)

		$app->setUserState($this->context . '.hits', $hits);

		return true;
Regards BTB300
Last Edit: 11 Oct 2012 11:11 by BTB300.
The administrator has disabled public write access.
The following user(s) said Thank You: JoomGuy

Re: The new functionality "hits" not work 11 Oct 2012 11:13 #4409

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Nice find @BTB3000!

i was going to look there as soon as I'd had a chance to test/use the new hits functionality if it was still not resolved!

Thanks,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.

[FIXED?]The new functionality "hits" now works 11 Oct 2012 15:25 #4417

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Just Tested in sandbox and it works a described above by admin...
(Admin on Holidays... but still secretively working i see :lol: )

@smarano
could you please rebuild your component and test in sand box + confirm if working as described above by admin
(dont forget log out after viewing then log back in)

use the login button at the at top of sandbox - this will then display the logout button - log out and then login again
Last Edit: 11 Oct 2012 15:33 by BTB300.
The administrator has disabled public write access.

Re: [FIXED]The new functionality "hits" now works 12 Oct 2012 11:45 #4431

  • smarano
  • smarano's Avatar
  • Offline
  • Junior Member
  • Posts: 34
  • Thank you received: 1
  • Karma: 1
yes, that was the problem, I had just solved locally. It all works great!
Last Edit: 16 Oct 2012 16:20 by smarano.
The administrator has disabled public write access.

Re: [FIXED]The new functionality "hits" now works 14 Oct 2012 21:37 #4505

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
No, no, I didn't changed anything there. Maybe an angel ...

The fix you propose BTB300 is not changing anything I think because the line:

$table->hit();

is doing the job.

I don't know what happen to you. I think a wrong test, because it is really simple fonctionality with no reason to block.
Maybe a problem with the session ?

Can I close ?
Coding is now a piece of cake
The administrator has disabled public write access.

Re: [FIXED]The new functionality "hits" now works 15 Oct 2012 07:49 #4526

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Hi Admin
whatever the solution was it now works for me... no further issues seen
OK to close from my point of view

Thank you again
Last Edit: 15 Oct 2012 07:50 by BTB300.
The administrator has disabled public write access.
The following user(s) said Thank You: JoomGuy
Time to create page: 0.096 seconds

Get Started