how to create a joomla hit counter

9 år 1 vecka sedan - 9 år 1 vecka sedan #1087 av Juanjo vazquez real
how to create a joomla hit counter skapades av 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
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 år 1 vecka sedan by Juanjo vazquez real.
Följande användare sa tack: Виталий

Be Logga in eller Skapa ett konto ansluta till konversationen.

9 år 1 vecka sedan #1088 av Andres Maeso
Svar från Andres Maeso i ämnet 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.

Den här e-postadressen skyddas mot spambots. Du måste tillåta JavaScript för att se den.

Be Logga in eller Skapa ett konto ansluta till konversationen.

Sidan laddades på: 0.049 sekunder
Powered by Kunena Forum

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.