×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
Hits count
Juanjo vazquez real
Yeni Üye
Posts: 9
9 yıl 1 ay önce #1057
Yazan: Juanjo vazquez real
Hits count, Juanjo vazquez real tarafından oluşturuldu
I am trying to create a counter for my items, I'm copying the system joomla articles but can not get a result, some I can lend a hand or guide me in what I'm doing mals, thanks
this in the file model.phpthis in the file view.html.php
this in the file model.php
public function hit($pk = 0)
{
$hitcount = JRequest::getInt('hitcount', 1);
if ($hitcount)
{
// Initialise variables.
$pk = (!empty($pk)) ? $pk : (int) $this->getState('Pelicula.id');
$db = $this->getDbo();
$db->setQuery(
'UPDATE #__todoelcine_peliculas' .
' SET hits = hits + 1' .
' WHERE id = '.(int) $pk
);
if (!$db->query()) {
$this->setError($db->getErrorMsg());
return false;
}
}
return true;
}
$model = $this->getModel();
$model->hit();
Lütfen sohbete katılmak için Giriş ya da Hesap açın.
Sayfa oluşturma süresi: 0.050 saniye