### Board mmajunke.de ###
http://forum.mmajunke.de/

Show compact visitor counter horizontally
http://forum.mmajunke.de/viewtopic.php?f=2&t=255
Seite 1 von 1

Autor:  amsharma [ Di 27. Sep 2016, 04:32 ]
Betreff des Beitrags:  Show compact visitor counter horizontally

Hello,

I wanted to know if I can show visitor counter horizontally in a compact form on a single line, something like:
Code:
Yesterday: 345xxx, All Days: 230xxx


Thanks
Amal

Autor:  micha [ Di 27. Sep 2016, 10:30 ]
Betreff des Beitrags:  Re: Show compact visitor counter horizontally

Hi Amal,

easiest way would be the usage of EXPRESSIONS in PRE- or POST-Field.
Bild

Simple add in one of the field the following text :
Code:
Yesterday: $countToday$ , All Days: $countAll$


and, of course disable the other views.

You can use also HTML, simplest example :
Code:
<b>Yesterday:</b> <i>$countToday$</i> , <b>All Days:</b> <i>$countAll$</i>


For all possible EXPRESSIONS have a look at here:
Expressions

Regards,
Micha

PS. see also

Autor:  amsharma [ Fr 30. Sep 2016, 05:31 ]
Betreff des Beitrags:  Re: Show compact visitor counter horizontally

Thanks, it works. Three more queries:
- Can I show the figures with a comma for every thousand, like All Days: 62,355 or All Days: 3,546,783
- Can I possibly show the Digit Counter and another figure like "Yesterday" together on the same line.
- I just upgraded my counter to version for Joomla 3. I saw the upgrade instructions which ask me to execute a SQL file. I couldn't find that file.

Thanks
Amal

PS I didn't get a mail about your reply so I saw this late.

Autor:  micha [ Fr 30. Sep 2016, 09:28 ]
Betreff des Beitrags:  Re: Show compact visitor counter horizontally

Hi Amal,

amsharma hat geschrieben:
- Can I show the figures with a comma for every thousand, like All Days: 62,355 or All Days: 3,546,783

Such a "user formated" output of the numbers is currently not implemented.
You need this only within the Pre/Post-Expression ? Then it is possible a little change which you can do easily.

Simplest way: there is a change needed within file "helper.php" and there within method "replacePREANDPOSTREPLACES".

important is red marked line/part
"
else if ( $value == '$countAll$' ) {
$replacing = str_replace( $value,
"" . $this->all_visitors,
$replacing );
"

replace this with:
"" . number_format($this->all_visitors, 0, '.', ',') ,
OR better, because the number-chars depends on your joomla-language setting :
"" . number_format($this->all_visitors, 0, JText::_('DECIMALS_SEPARATOR'), JText::_('THOUSANDS_SEPARATOR') ) ,

amsharma hat geschrieben:
- Can I possibly show the Digit Counter and another figure like "Yesterday" together on the same line.

generally you can do all what you need/want with the "Expressions" :)
If you not familiar with HTML, please show me a "template / image / .." from your design of your whish and I try to prepare the Pre/Post-value for you.

amsharma hat geschrieben:
- I just upgraded my counter to version for Joomla 3. I saw the upgrade instructions which ask me to execute a SQL file. I couldn't find that file.

The counter-delivery-file for Joomla 3 no longer contains that script. From which version you come from ? The SQL-Script was only needed from a version 1.9.x to 2.x..

amsharma hat geschrieben:
PS I didn't get a mail about your reply so I saw this late.

yes..since a while, my site-hoster is little bit "troubling"

Regards,
Micha

Autor:  amsharma [ Sa 8. Okt 2016, 04:54 ]
Betreff des Beitrags:  Re: Show compact visitor counter horizontally

@micha, thanks for your detailed reply and answering everything point by point. Fantastic support for a free product.
I was able to achieve all what I wanted.

A small spelling mistake I found which you can change for your next version: "Initital Value" should be "Initial Value".
Your documentation still talks about a parameter "Start value". I couldn't find that.

Thanks
Amal

Autor:  micha [ Sa 8. Okt 2016, 10:16 ]
Betreff des Beitrags:  Re: Show compact visitor counter horizontally

Hi Amal,

thank you for the praise :)

Zitat:
A small spelling mistake I found which you can change for your next version: "Initital Value" should be "Initial Value".
Your documentation still talks about a parameter "Start value". I couldn't find that.


oh yes.. wrong typo within the english language file ( language/en-GB.mod_vvisit_counter.ini ):

INITIAL_VALUE_LBL="Initital Value"
INITIAL_VALUE_DESC="Initital Value. Default value: 0 visitor"

I put it on the "ToDo" list ;)

The meaning is same : "Start value" and "Initial value"
(
german language file :
INITIAL_VALUE_LBL="Startwert"
INITIAL_VALUE_DESC="Hier kann ein Startwert des Counters eingestellt werden. Default: 0"
)

Regards,
Micha

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/