I'm trying to add a visitor counter to my web site powered by drupal. I thought to modify xtemplates and add the code for the counter. I use bbclone and the code to add is

define("_BBC_PAGE_NAME", $title);
define("_BBCLONE_DIR", "~/bbclone/");
define("COUNTER", _BBCLONE_DIR."mark_page.php");
if (is_readable(COUNTER)) include_once(COUNTER);

but I don't understand where to put this code (some where in xtemplates.theme). It should be on every page and $title should be the title or an identifier of the page.

thanks
Marco

Comments

emptyset’s picture

I solved my problem. I wrote a drupal module which uses BBClone as visitor counter. This module is an early version, but it works. Here is the link

http://emptyset.altervista.org/blog/?q=book/view/24

pss0ft’s picture

Hi,

When installing this beware of changing the path in the MODULE with your absolute server path. Otherwise it will not work at all.

Grtz. Henk

emptyset’s picture

thanks! you're right!

pss0ft’s picture

Hi,

I am a newbie in PHP programming, but I have a history of more than 20 years in programming in other languages such as Basic and Visual Basic. Also I have some experiences with C++, Pascal, Delphi, HTML etz...

So I studied your MODULE source. When clicking on my Website on more I got only an empty page. I can access BBclone by putting in the direct URL, but I think more must me lead the user to some statistics defined in the module. Or am I wrong about that?

Anyway: nothing happens except an empty page with only the title.

PSE help me? TNX in advance. Further it works perfectly.

Grtz. Henk

emptyset’s picture

I'm sorry, but I've not finished that part yet! "more" should show other statistics (similar to those at the BBClone address), but I haven't implemented that.

bye

pss0ft’s picture

Hi,

Do you plann to make this work? It would be nice. I am looking at your code, but still not figured out how to proceed further. My knowledge is to limited yet.

I know what PHP is for 3 months now and still learning by looking at other peoples code. :-)

I know 'Drupal' even shorter. I am glad to xome as far as I am now. Maybe we can give it a look together.

Grtz. Henk
http://pd5dp.ham-radio.ch
pd5dp@amsat.org

emptyset’s picture

I'm very busy now, so I'm not planning to complete this module by October. You can find a nice tutorial on PHP at www.php.org. There is a manual on Drupal somewhere in this site (look for "module developement"), if you read it, you should understand what I do.

If you want to develop this module with me (or without me), it's OK!

bye

pss0ft’s picture

Hi,

I will take a look, but my knowledge of PHP is yet very limited. Less than 6 months ago I did not even know what PHP was. :-)

But... I will trie to understand what you were trying to do. If I successfully have altered or added something I will let you know. It is a pitty you do not have the time. I think that it is for you a less effort than when I have to try to make this work. Maybe it is a challenge. Let's see it this way.

Please comment also on my message about the THEME problem. It still is present. I do not know yet where to search for the course of messing up the layout.

Grtz. Henk. TNX for you comments.

pss0ft’s picture

Hi again,

Another issue. I have installed your module and enabled it in the blocks section. After this there are several themes which display the layout not right anymore. For example Marvin_2K.

Any idea what causes this? Without the counter everything seems right.

Grtz. Henk

euchrid9’s picture

I updated the handbook at: http://drupal.org/node/43840 to cover the initial question at the top of the page.

Basically, you add the code (slightly different to that above) to the index.php in the Drupal root, not in a template.

I note the link to the above module is not currently working. A search on the site for BBClone does not bring anything up. It is not necessary, anyway; the information at the above link seems to work fine.

[euchrid]
www.euchrid.co.uk

heine’s picture

Thanks for the guide, but it's location in Site recipes isn't optimal (it's not a site recipe).

Also the comment on http://drupal.org/handbook/modules/statistics is unwarranted. This page describes the functionality of statistics, not all the potential alternatives.

--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.

euchrid9’s picture

No problem - but where should it go?

Not being funny, but site recipes says: "A recipe is a set of instructions that show how to prepare or make something...By examining these guides, you will be able to decide for yourself what is appropriate for your site."

This seemed more relevant than 'Basic Site Configuration' (as it's not something everyone would want to do) and did not seem to belong in the 'Advanced User's Guide'. There didn't seem to be anywhere else to put such pieces of advice and information.

Let me know where it should go and why, and I'll happily move it, and ensure I know what to do next time.

The same goes for the comment on the Statistics module; it seemed the only place to put such a comment (and the comment applies to this module, because it addresses the fact that it may not suit every user, and highlights the fact that there are others that are compatible with Drupal). It is, after all, a comment on that module - not a criticism or a judgement, just a comment that someone else might find helpful.

Again, I'm not being funny and not taking offense, but it's really hard to work out where things belong on this site, and I've spent a long time looking. I keep seeing comments like this where others are confused, too; what can be done to make it easier?

If there is a clear, definite way in which things must be done and clear, definite guidelines for adding comments and content, then perhaps all drupal.org members and subscribers could be mailed or directed in the right way?

Not everyone that has something to contribute to the site is a developer or programmer, and perhaps this is where these misunderstandings come from. Hope it can be sorted out!

[euchrid]
www.euchrid.co.uk