We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

make counter work in view page | Forum

Ken
Ken Oct 29 '20

    public function playCount() {
  
        $itemId = $_GET['id'];
        $viewCount = PLUGINS _BOL_Service::getInstance()->increasePlayCount( $itemId );

        exit(json_encode(array('id' => $itemId, 'count' => $playCount)));
  

}
The counter Increase works in list page but Only shows in view page doesn’t increase count can someone tell me why please.....
The Forum post is edited by Ken Oct 29 '20
dave Leader
dave Oct 31 '20

Whatever you are counting should be +1


in other words


$val = 0;

$val = $val +1;


then it will increment by 1 each loop.  I dont know what that function does.  But  if the count is stored in the db thats fine, if not then youll either need to create a table to store it in or use $_SESSION variable to store it per visit or maybe with a cookie.  But db is better depending on what your doing.



Ken
Ken Nov 1 '20
Dave yours worked but the views wouldn’t save and wouldn’t increase after 1 but I accidentally figured it out using 


     $playCount = $playCount ++;

        PLUGIN_BOL_ItemDao::getInstance()->save($item);

        return $item->playCount;

         $itemId = $_GET['id'];

dave Leader
dave Nov 2 '20
great glad you got it sorted..
ReginaldAgustin
ReginaldAgustin Feb 21 '22
The discussion here doesn't look too good to me, and I am disappointed now as it is not related to my interest and it is more technical. I was looking to get some help in How to choose reliable essay writing service today, but that's not what has happened today. Hopefully, something will change here soon.
Nikita
Nikita Mar 15 '22
Shopian Escort ❤️ Umaria Escort ❤️ Viluppuram Escort ❤️ West Singhbhum Escort ❤️ Aizwal Escort ❤️ Amroha Escort ❤️ Anantnag Escort ❤️ Dakshin Dinajpur Escort ❤️ Jamui Escort ❤️ Kadapa Escort ❤️ Pathankot Escort ❤️ Prakasam Escort ❤️ Rajouri Escort ❤️ Surguja Escort ❤️ Valsad Escort ❤️ Bishnupur Escort ❤️ Champawat Escort ❤️ Harda Escort ❤️ Kanker Escort ❤️ Kishanganj Escort ❤️ Kurnool Escort ❤️ Ambala Escort ❤️ Barnala Escort ❤️ Lunglei Escort ❤️ Guna Escort ❤️ Mawkyrwat Escort ❤️ Perambalur Escort ❤️ Chamarajanagar Escort ❤️ Darrang Escort ❤️ Ghaziabad Escort ❤️ Rupnagar Escort ❤️ Bhandara Escort ❤️ Dhemaji Escort ❤️ Ernakulam Escort ❤️ Jalgaon Escort ❤️ Niwari Escort ❤️ Reasi Escort ❤️ Sahebganj Escort ❤️ Senapati Escort ❤️ Shravasti Escort ❤️ Upper Dibang Valley Escort ❤️ Virudhunagar Escort ❤️ William Nagar Escort ❤️ Akola Escort ❤️ Andaman And Nicobar Escort ❤️ Daman Escort ❤️ Janjgir Champa Escort ❤️ Kadmat Escort ❤️ Patiala Escort ❤️ Pratapgarh U P Escort ❤️ Rajourigarden Escort ❤️ Tamenglong Escort ❤️ Biswanath Escort ❤️ Champhai Escort ❤️ Hardoi Escort ❤️ Kannauj Escort ❤️ Kishtwar Escort ❤️ Kurukshetra Escort ❤️ Ambedkar Nagar Escort ❤️ Barpeta Escort ❤️ Madhepura Escort ❤️ Guntur Escort ❤️ Mayurbhanj Escort ❤️ Peren Escort ❤️ Daryaganj Escort ❤️ Ghazipur Escort ❤️ Sabarkantha Escort ❤️ Dhenkanal Escort ❤️ Erode Escort ❤️ Jalna Escort ❤️ Noklak Escort ❤️ Resubelpara Escort ❤️ Saiha Escort ❤️ Seoni Escort ❤️ Siang Escort ❤️ Upper Siang Escort ❤️ Visakhapatnam Escort ❤️ Wokha Escort ❤️ Alappuzha Escort ❤️ Andrott Escort ❤️ Damoh Escort ❤️ Jashpur Escort ❤️ Kagatsinghapur Escort ❤️ Preetvihar Escort ❤️ Ramanagara Escort ❤️ Tapi Escort ❤️ Bokaro Escort ❤️ Chandauli Escort ❤️ Haridwar Escort ❤️ Kanniyakumari Escort ❤️ Kodagu Escort ❤️ Kurung Kumey Escort ❤️ Amethi Escort ❤️ Barwan Escort ❤️ Madhubani Escort ❤️ Gurdaspur Escort ❤️ Meerut Escort ❤️ Phek Escort ❤️