Page 1 of 1

Track phpBB pages with HitBOX Professional

Posted: Thu Jan 29, 2004 6:30 pm
by mihaialex04
Dear Friends,

I would like to add HitBOX Professional to the whole pphBB forum.


The idea is to NOT use a common title, but to force phpBB fill out the following HitBOX tracking code as follows:

Code: Select all

var _pn="FORUM+TITLE"; //page name(s)


1. For the Forum pages:

Code: Select all

var _pn="{FORUM_NAME}"; //page name(s)
With the only one mention that the forum name should not contain special characters, and the white spaces between words should be converted to “+” symbols.



2. For the Topic pages:

Code: Select all

var _pn="{TOPIC_TITLE}"; //page name(s)
With the only one mention that the topic title should not contain special characters, and the white spaces between words should be converted to “+” symbols.



Can you give me any idea on how can I eliminate the special characters and also on how can I convert the White spaces such as “ “ between words into “+”.

Is there something on phpBB that can do it?

Thinking about writing a function for the + sign I think it should look something like:

Code: Select all

$s =~ tr! !+!s;
[/i]


I look forward your kind opinions,

With my Best Regards,
Mihai Alexandru Bocsaru

First step passed

Posted: Thu Jan 29, 2004 10:00 pm
by mihaialex04
I have found a valuable resource that allowed me to replace the empty spaces with "+" signs.

Code: Select all

<?php 

$forumname = 'FORUM_NAME';

// convert a space to plus
$finalname = preg_replace ('/(\s{1,})/', '+', $forumname); 

// get rid of space at the beginning and end of the string 
$finalname = trim($finalname);

echo "<pre>'{$forumname}'</pre> converted to <pre>'{$finalname}'</pre>"; 

?>

Unfortunately FORUM_NAME is not the correct code for getting the Forum name.

What should I put there so that when I will be visiting:
http://www.domain.com/phpbb/viewforum.php?f=15

The $forumname value would be the Name of the #15th Forum.



I look forward your kind feedback,

With my Best Regards,
Mihai Alexandru Bocsaru

Posted: Thu Jan 29, 2004 10:16 pm
by LifeIsPain
* LifeIsPain points to the urlencode() function