Track phpBB pages with HitBOX Professional

The 2.0.x discussion forum has been locked; this will remain read-only. The 3.0.x discussion forum has been renamed phpBB Discussion.
Locked
mihaialex04
Registered User
Posts: 3
Joined: Thu Jan 29, 2004 6:23 pm

Track phpBB pages with HitBOX Professional

Post 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

mihaialex04
Registered User
Posts: 3
Joined: Thu Jan 29, 2004 6:23 pm

First step passed

Post 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

LifeIsPain
Former Team Member
Posts: 2148
Joined: Tue Oct 01, 2002 7:04 am
Location: Way Way Behind

Post by LifeIsPain »

* LifeIsPain points to the urlencode() function
LifeIsPain - one who needs to be smackedLife is pain, highness! Anyone who says differently is selling something.

Locked

Return to “2.0.x Discussion”