sub directory configuration

Help for using / installing BetterAWStats

sub directory configuration

Postby alternapop » 15 Sep 2009 04:53

i have betterawstats configured to work with a bunch of different subdomains and it works.

eg:

housing.example.edu
with the config file called "awstats.housing.example.edu.conf"

i know that i can use the OnlyFiles directive to include only specified subdirectories.

eg:
housing.example.edu/main/
OnlyFiles="main"

the problem i'm having is that is appears that betterawstats uses the name of the conf file to create the live links within the report for "Pages-URL". so naming the conf file like these examples breaks these links:
awstats.housing-main.conf
awstats.housing.example.edu-main.conf

and like this fails to update returning an error:
awstats.housing.example.edu/main.conf

what is the best way to have multiple subdirectories, for one domain, using multiple conf files so that these links work properly?

thanks!
alternapop
 
Posts: 2
Joined: 15 Sep 2009 04:50

Re: sub directory configuration

Postby Oliver » 17 Sep 2009 13:37

good question.

You will have to edit the code for this. The best thing would be to create a new array somewhere that maps the filename to the correct URL that should be making the link and then replace the filename used with the correct link automatically in the display of the section for the URLs.

So first you add the array to a file preferably the config.php:

Code: Select all
$BAW_CONF['new_urls']= array(
'filename1' => 'correct_url1',
'filename2' => 'correct_url2',
'filename3' => 'correct_url3',
);


and then, you go to to /core/display.inc.php and make a call to that array to insert the correct data. Find the function

function baw_display_urls($set) {

and there the line

Code: Select all
$link = baw_create_link($linktext, "http://{$BAW_CURR['site_name']}{$data[0]}", array(), true);


so you can replace that line with

Code: Select all
$new_url =$BAW_CONF['new_urls'][$BAW_CURR['site_name']];
$link = baw_create_link($linktext, "http://{$new_url}{$data[0]}", array(), true);


make sure you add the appropriate slashes where needed.
Also please note that this code might not be 100% correct since I did not try it out. It's more a guidance on how to solve the problem.

Hope you get it done.

Oliver
Oliver
BetterAWStats Creator/Admin
User avatar
Oliver
Site Admin
 
Posts: 139
Joined: 10 Mar 2008 19:09

Re: sub directory configuration

Postby alternapop » 18 Sep 2009 04:28

i don't think awstats handles this in the same manner. the conf filename is irrelevant. why does betterawstats change this behavior? has no else tried this with subdirectories? that's what "OnlyFIles" is used for, right?

i tried the code and it doesn't seem to be working... or i'm not understanding it.

cheers,
chris
alternapop
 
Posts: 2
Joined: 15 Sep 2009 04:50

Re: sub directory configuration

Postby Oliver » 18 Sep 2009 07:50

betterawstats handles it this way since it does not parse the PERL-language awstats config files.

let me check the code again later (quite busy recently) and I will see if I can come up with a better example for you.
Oliver
BetterAWStats Creator/Admin
User avatar
Oliver
Site Admin
 
Posts: 139
Joined: 10 Mar 2008 19:09


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron