Get Animated Number Value From Database - Question | JoomShaper

Get Animated Number Value From Database

M

Massimo

SP Page Builder 4 years ago

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

Thanks Max

0
5 Answers
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 years ago #13323

Hi there,

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

-Thanks

0
M
Massimo
Accepted Answer
4 years ago #13330

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

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 years ago #13334

There is no way to do this. Thanks

0
M
Massimo
Accepted Answer
4 years ago #13385

... 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

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 years ago #13469

Noted and Thanks

0