how to create a joomla hit counter
Juanjo vazquez real
Yeni Üye
Posts: 9
9 yıl 1 hafta önce - 9 yıl 1 hafta önce #1087
Yazan: Juanjo vazquez real
how to create a joomla hit counter, Juanjo vazquez real tarafından oluşturuldu
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
Son Düzenleme: 9 yıl 1 hafta önce Düzenleyen:Juanjo vazquez real
Şu kullanıcı(lar) Teşekkür etti: Виталий
Lütfen sohbete katılmak için Giriş ya da Hesap açın.
Andres Maeso
Platin Üye
Posts: 338
9 yıl 1 hafta önce #1088
Yazan: 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.
Andres Maeso tarafından Hits konusunda yanıtlandı
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.
Lütfen sohbete katılmak için Giriş ya da Hesap açın.
Sayfa oluşturma süresi: 0.055 saniye