Get animated number value from database - Forum | JoomShaper
Staff replied SP Page Builder

Get animated number value from database

Asked by Massimo 5 years ago Last activity 5 years ago

Hi,
how can I retrieve the value of "Animated number addon" from database?

Thanks
Max

5 replies

Toufiq Senior Staff

Hi there,

Thanks for contacting us. The animated value does not retrieve from the database. Abimated value retrieve from the Javascript file.

-Thanks

Massimo Asked this

ok, but how can I retrieve a value from database ?
I don't want to set it manually

Toufiq Senior Staff

There is no way to do this. Thanks

Massimo Asked this
5 years ago · edited

... I found a solution

STEP 1 - Override Animated number addons

Copy

components/com_sppagebuilder/addons/animated_number/admin.php

in

templates/yourTemplate/sppagebuilder/addons/animated_number/admin.php

STEP 2 - Edit admin.php and change the field type

Around line 28 change from

 'number'=>array(
                                        'type'=>'number',

to

 'number'=>array(
                                        'type'=>'text',

STEP 3 - Install sourcerer

Install sourcerer plugin

STEP 4 - Edit Animated number addons

From the "Animated number addons" of SPPagebuider page set in the field "Counter Digit" something like (Replace PHP_open and PHP_close with corresponding php tag)

{source}PHP_open $db->setQuery("SELECT count(id) FROM yourTable WHERE yourFilter=VALUE;");echo $db->loadResult();PHP_close{/source}

That's all, value retrieved.

I hope this possibility can be included in the future releases

Max

Toufiq Senior Staff

Noted and Thanks

Log in to reply.