how to create a joomla hit counter
Juanjo vazquez real
New Member
Posts: 9
9 years 1 week ago - 9 years 1 week ago #1087
by Juanjo vazquez real
how to create a joomla hit counter was created by Juanjo vazquez real
Hello
I finally managed to go well field hits, I will explain as e echo if anyone serves.
We must create a field hits, type TINYINT (11) in our table
Once we have our component in part site / models in our archive item.php add:
within the model class
then in site / item / view file view.html.php
we add this code within the function display
I hope this helps someone
I finally managed to go well field hits, I will explain as e echo if anyone serves.
We must create a field hits, type TINYINT (11) in our table
Once we have our component in part site / models in our archive item.php add:
within the model class
public function hit($id = null)
{
if (empty($id)) {
$id = $this->getState('item.id');// item is the name of our item
}
$item = $this->getTable();
return $item->hit($id);
}
then in site / item / view file view.html.php
we add this code within the function display
$model = $this->getModel();
$model->hit();
I hope this helps someone
Last edit: 9 years 1 week ago by Juanjo vazquez real.
The following user(s) said Thank You: Виталий
Please Log in or Create an account to join the conversation.
Andres Maeso
Platinum Member
Posts: 338
9 years 1 week ago #1088
by Andres Maeso
Andrés Maeso
Customer relations manager at Joomla Component Creator.
This email address is being protected from spambots. You need JavaScript enabled to view it.
Replied by Andres Maeso on topic Hits
Thanks Juanjo. Do you mind if I rename it like "how to create a joomla hit counter"?
Andrés Maeso
Customer relations manager at Joomla Component Creator.
This email address is being protected from spambots. You need JavaScript enabled to view it.
Please Log in or Create an account to join the conversation.
Time to create page: 0.053 seconds