PDA

View Full Version : Add Who's Online to any eSyndiCat


Bryan Ex
12-30-2006, 12:12 AM
I found a wonderful little pluggin that does a nice job of not only adding new stats to your directory page but gives you a full page of admin stats.

Just go to www.ep-dev.com and download their EP-Dev Counter Script (http://www.ep-dev.com/modules.php?name=Downloads&d_op=viewdownload&cid=1), install it, and then add to your eSyndiCat statistics box the following code (edit it to your full server path);
{php}include("/full/server/path/to/counter/counter.php");{/php}

What this does is add the number of users online, the number of visitors that day, total number of visitors, and total number of page hits. See my sample screen shot but note that I do not use current users online in my stats so I've edited that part out. My feeling is that people do not stay on a directory site for long periods like a forum so users online will never be impressive enough to show.

Advantages...

- It's a free download
- Helps to show advertisers how busy your site is
- Easy to install and integrate with eSyndiCat
- Can use either a database or text file for stat storage
- Various config settings
- Full admin stats for your site

Disadvantage...

- You must be experienced enough to install your own scripts (instructions are included in the download).


I am not a coder and can not support their script but I most likely can assist you if you are having difficulties getting it to work in eSyndiCat.

.

Michael Krein
12-30-2006, 03:25 PM
Nice one :) Thanks Bryan! :good:

Bryan Ex
12-30-2006, 04:11 PM
Hope it turns out to be handy for you Michael. Here's a partial screen shot of the type of stats you can get from this little addition...

Samhan
12-30-2006, 04:51 PM
Bryan Ex
very nice :applause:
Thank You..

bunny
12-30-2006, 05:56 PM
Yeah more stats on my site , gonaa try it out.Before i launch my new directory :)

But do we really need :

{php}include("/full/server/path/to/counter/counter.php");{/php}

Can't just {include file="/full/server/path/to/counter/counter.php"} work too cause its using smarty?

Edit: Guess not , only php one works :)

Bryan Ex
12-30-2006, 06:25 PM
I don't think it will be parsed correctly as the templates are HTML based but feel free to try it out. There are several posts here with references to including php or jave code and in all cases {php} or {literal} were needed. Doesn't hurt to try though and easy enough to change if it doesn't work. All I can say is that what I posted above does work...

bunny
12-30-2006, 06:29 PM
Yup php is needed i edited my post :).

Works nice though now will need to customize its font now :).

Bryan Ex
12-30-2006, 06:36 PM
It depends on where you are placing the stats (in it's own box or part of "Statistics") but you should be able to add your directory CSS classes to counter-display.html. The way I went was to edit it into table rows and include it in the stats table.

<tr>
<td align="right">Visitors today(GMT):</td>
<td align="left">!COUNTER-TODAY!</td>
</tr>
<tr>
<td align="right">Total visitors:</td>
<td align="left">!COUNTER-VISITS!</td>
</tr>
<tr>
<td align="right">Total page hits:</td>
<td align="left">!COUNTER-HITS!</td>
</tr>

sdedman1
01-06-2007, 11:10 AM
Hello

Would anyone be able to help me install this script and integrate it into esyndicat pro? I've tried to install it, but can't follow their install instructions. I'm not a complete novice, but need guidance to get me through the first time!

Thanks

Bryan Ex
01-06-2007, 12:36 PM
sdedman1 ... I could probably help walk you through the process. Two questions to start with - are we starting right from the beginning or are you stuck at a certain point of the install process AND are you planning on using a database (recommended) or the flat file (text file for storing your data)?

sdedman1
01-06-2007, 12:38 PM
Thanks Bryan

Probably best to start from the beginning, if that's ok. Yes I would be using a database

Bryan Ex
01-06-2007, 12:46 PM
No problem at all. Have you run the two queries to add the two new stats tables yet? If you have we may need to remove them to start from the beginning. Not a big deal either way... it just avoids errors and do you have access to phpMyAdmin for your database?

sdedman1
01-06-2007, 12:49 PM
So Far I have uploaded the files to a directory called counter and created a Db called counter and created a user with all privileges access. It's the editing of the config files etc and inserting the code into esyndicat I'm having problems with

sdedman1
01-06-2007, 12:49 PM
yes I have phpmyadmin

Bryan Ex
01-06-2007, 01:01 PM
Okay, great. There are two files to edit so we'll start with the easy one first - config_mysql.php. Any questions on that file? It's basically just your database access info and should be similar to what you've used for your directory except for the actual database name.

sdedman1
01-06-2007, 01:04 PM
Ok, made those changes

Bryan Ex
01-06-2007, 01:29 PM
Alrighty... next file to edit is counter.php and this is the larger of the two so what I'm going to do is give you a cheat sheet to fill in all the settings I've used (in order). That will get you up and running to start with and then you can always adjust any you wish to later on. As you fill these in read what each setting does and feel free to ask if you don't understand (so you will know later on). The only one you will need to edit is the second setting for full path to your counter directory.

$DB['type'] = 1;
$OPTION['Absolute_Path'] = "/home/public_html/esyndicat/counter/"; <-- edit
$OPTION['OnlineTime'] = 15;
$OPTION['RecentMode'] = 1;
$OPTION['VisitLength'] = 1;
$OPTION['TrimDatabase'] = 1;
$OPTION['ArchiveStats'] = 1;
$OPTION['DebugMode'] = 1;
$OPTION['Hits_Offset'] = 0;
$OPTION['Visits_Offset'] = 0;
$OPTION['time_offset'] = 0;
$OPTION['IP_Ignore'] = array("");
$OPTION['IP_Block'] = array("");
$OPTION['Block_Page'] = "http://www.yahoo.com";
$OPTION['Log_Referrers'] = 1;
$OPTION['Graphical'] = 0;
$OPTION['Images_Dir'] = "images/default/";
$OPTION['Image_ext'] = ".jpg";
$OPTION['Counter_Spaces'] = 4;
$OPTION['Add_Char'] = 1;
$OPTION['Hide_Counter'] = 0;
$OPTION['IP_Clean'] = 0;


These settings will give you text output for stats, visitors per day will be based on GMT, each user will be considered online for 15 minutes between page refreshes, you will have full admin stats. Give me a shout with any questions or for the next step....

sdedman1
01-06-2007, 01:39 PM
That's done. Having a look round your site, like it a lot

Bryan Ex
01-06-2007, 01:52 PM
Thanks very much... I'm rather pleased with how it's turned out myself. Still some things I want to do with it but then there always is.

Two steps left to do and while they're technically easy it can have you pulling your hair out trying to format it correctly. The way this little script works is it outputs the final html with all your stats and not just the stats like eSyndiCat variables so what we need to do is edit the html in the file called counter-display.html

The default source code is...
<b>People Online:</b> !COUNTER-ONPAGE! <br>
<b>Today's Visitors:</b> !COUNTER-TODAY! <br>
<b>Total Visitors:</b> !COUNTER-VISITS! <br>
<b>Total Hits:</b> !COUNTER-HITS!

The way I managed to get this to fit eSyndiCat is by editing counter-display to match the tables used for the Statistics section in eSyndiCat and this part may vary for you depending on your template. All I've really done is to add additional table rows to what was already there. What I ended up with was the following code for my counter-display.html file...
<tr>
<td align="right">Visitors today(GMT):</td>
<td align="left">!COUNTER-TODAY!</td>
</tr>
<tr>
<td align="right">Total visitors:</td>
<td align="left">!COUNTER-VISITS!</td>
</tr>
<tr>
<td align="right">Total page hits:</td>
<td align="left">!COUNTER-HITS!</td>
</tr>

Note: In my example I do not use Users Online so that table row is omitted but easy enough to add back in following the same format.

sdedman1
01-06-2007, 02:05 PM
That's done, I have the same thing with my directory - always wanting to do more with it. Glad I found esyndicat, can't wait to migrate my Db from existing directory and re-launch my site :)

Bryan Ex
01-06-2007, 02:21 PM
Last step is to edit the full path to counter.php and add to your index template...
{php}include("/home/myaccount/public_html/mydomain/counter/counter.php");{/php}

Be sure to add it AFTER a closing table row tag --> </tr>

I use two different stats sections on my site but the table for the one that includes these stats looks like this...
<table cellpadding="3" cellspacing="2">
<tr>
<td align="right">{$lang.total_num_links}</td>
<td align="left">{$num_links}</td>
</tr>
<tr>
<td align="right">{$lang.total_num_clicks}</td>
<td align="left">{$total_clicks}</td>
</tr>
{php}include("/home/myaccount/public_html/mydomain/counter/counter.php");{/php}
</table>



Once it's installed you can then hit your directory index page and then hit refresh to have it appear. You will find your admin stats at http://www.yourdomain/counter/stats/index.php (of whatever the actual URL is for your install).

sdedman1
01-06-2007, 02:38 PM
Great, it's worked!

I'll play around with where I want it on the page later. Last question, the enhanced statistics mod that gives you newest link etc. Can I just follow the instructions on the thread for the current version?

Bryan Ex
01-06-2007, 02:44 PM
Table structures are a little different for version 2.x so I'm guessing the queries would need to be altered. I don't plan on changing ftom 1.2 so I can't say for sure either way.

sdedman1
01-06-2007, 02:45 PM
Ok thanks for your help

sdedman1
01-06-2007, 04:32 PM
Tried to implement the enhanced stats mod, but I don't appear to have an english.php file to modify, so I've put this to one side!

Bryan Ex
01-06-2007, 05:29 PM
That's right... for version 2.x the language files are now in the database rather than a separate php file. I believe there is a language editor in the admin panel or you could do it directly through phpMyAdmin and add them manually... OR... you could just remove the language variables in the templates and code your phrases in for each stat (which is what I did for a couple).

Greg
01-06-2007, 08:05 PM
As Bryan said:
With ProVersion 2.0 this has to be done thru the admin panel.
Click on "Language Manager" in left side menu.
English - Click on Edit / Translate English phrases
Then "Add Phrase"

By the way great instructions on installing this Bryan. :good:

bunny
01-06-2007, 08:14 PM
Its working on site : http://www.sbclansite.com :)

Bryan Ex
01-06-2007, 09:19 PM
As Bryan said:
LOL... only because you pointed that out to me in another thread otherwise I'd still be directing people to just edit their language files.

By the way great instructions on installing this Bryan. :good:I for one know all too well how frustrating it can be when you have everything you need for a new feature or bug fix but can't quite figure out how to plug it all in and get it working. The way I see it is that Dave Baker has helped me out extensively in December so it's only fair I try to pass on help when or how I can. The old adage of "what goes around, comes around".

Bryan Ex
01-06-2007, 09:23 PM
Its working on site : http://www.sbclansite.com :)
I'm not sure if you wanted these stats specifically in bold but if you did not... just edit out all the bold tags <b> & </b> in counter-display.html in the counter directory and then they will match your other stats.

bunny
01-06-2007, 10:04 PM
I'm not sure if you wanted these stats specifically in bold but if you did not... just edit out all the bold tags <b> & </b> in counter-display.html in the counter directory and then they will match your other stats.

Yaa will do when i get some time, trying to figure out and clear out other bugs and issues i am facing first. Otherwise its back to phpld for me .