Allow multi-site support

bottdev - October 12, 2007 - 14:38
Project:FireStats
Version:4.7.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Firestats standalone offers multisite support but the current drupal module does not. The following snippets can be added to firestats.module to allow statisitcs reporting for a multisite drupal installation.

Allow user to enter the site ID assigned in Firestats standalone:
Include the following additions (marked by "added bottdev") in function firestats_settings()

  $form['firestats_settings']['firestats_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Firestats path'),
    '#default_value' => variable_get('firestats_path', ''),
    '#description' => t('Enter the path relative to your server root. Without trailing slash.<br />Example: <em>/var/www/html/firestats</em>.'),
  );
  //Added bottdev - include multi site ID number (from FireStats)
  $form['firestats_settings']['firestats_multisite_id'] = array(
    '#type' => 'textfield',
    '#title' => t('Firestats MultiSite ID'),
    '#default_value' => variable_get('firestats_multisite_id', ''),
    '#size' => 2,
    '#description' => t('Enter the multisite ID for this site. This is obtained from your Firestats standalone installation on the Sites Management tab.<br />Note: you must enter this Drupal site on that tab before configuring this ID.'),
  );
  //End Added bottdev
  $form['firestats_settings']['firestats_test'] = array(
    '#type' => 'markup',
    '#value' => $test,
  );

and then to associate the captured statistics with each specific site, enter the following (marked by "added bottdev") in function firestats_exit():

  elseif ($file_exists = file_exists(FS_INSTALL_PATH)) {
    require_once(FS_INSTALL_PATH);
    //Added bottdev - include Site ID in call
$site_id = variable_get('firestats_multisite_id', 1);
    fs_add_hit(null,true,$site_id);
    //End Added bottdev
    return;
  }

I have not tested this for universality with non-multisite Drupal installations.

I hope this helps.

#1

msn - October 29, 2007 - 10:18

Firestats 1.4.3-RC1 with Drupal V 5.x has multiside support.
Consider also http://firestats.cc/ticket/478
Worked for me..

#2

Gurpartap Singh - November 9, 2007 - 19:42
Status:active» fixed

Firestats already has multi site support.

#3

bottdev - November 13, 2007 - 16:21

I appreciate the two comments above. Unfortunately, the multi-site support does not work in Drupal 4.7.x without the fix I suggested above as nothing is passing the multi-site id from the drupal site to firestats.

I have also considered the Firestats ticket 478 as I was the one that created the ticket.

I hope this helps others still on Drupal 4.7.x.

#4

Anonymous - November 27, 2007 - 16:22
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.