<?php
/*
Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
@version $Id: config_network_community.php,v 1.2 2004/02/09 18:16:10 ordnas Exp $
@copyright Copyright © 2001-2004 ZZ/OSS GbR, http://www.zzoss.com
@license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
*/
// execute init file
require_once 'inc/init.php';
/***************************************************************************
* PAGE CONTENT *
***************************************************************************/
function zi_process()
{
global $ZZOSS_INSTALLER;
// save the parameters for later installations
$file = $ZZOSS_INSTALLER["application_path"].'installer/config_network_community.reg';
$fp = fopen($file, "w");
fputs( $fp, serialize( $_REQUEST ));
fclose( $fp );
}
function zi_default()
{
global $ZZOSS_INSTALLER;
// if we had a previous installation, we get those values
$file = $ZZOSS_INSTALLER["application_path"].'installer/config_network_community.reg';
if(file_exists($file)){
$fp = fopen($file,"r");
$ser = fread ($fp, filesize ($file));
fclose($fp);
return unserialize($ser);
} else {
// absolute root
$_REQUEST['ZI_VALUES']['community_url'] = 'http://'.$_SERVER['HTTP_HOST'].substr(dirname($_SERVER['PHP_SELF']), 0, strrpos(dirname($_SERVER['PHP_SELF']), '/')).'/';
/*$split = preg_split('/installer/', $_SERVER['PHP_SELF']);
// URL
$_REQUEST['ZI_VALUES']['community_url'] = 'http://'.$_SERVER['HTTP_HOST'].$split[0];*/
return $_REQUEST;
}
}
include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
// initialise widget class of installer
require_once 'ZZOSS_Installer/Widget.php';
$zi_widget = new ZZOSS_InstallerWidget;
if(isset($zi_errors)){
$zi_widget->setErrors($zi_errors);
}
?>
<h1>Network + Community</h1>
<p>If your Web site is supposed to be a partner in a content network, please enter the number of your network and community. Do not forget to provide additional data later in the admin section.</p>
<p>Otherwise, if your Web site is meant to run as a standalone portal, keep the default values.</p>
<table border="0" cellspacing="0" cellpadding="4" align="left">
<?php
$zi_widget->setDefault('network_number', '1');
echo $zi_widget->add('text', 'My network number', 'network_number');
$zi_widget->setDefault('community_number', '1');
echo $zi_widget->add('text', 'My community number', 'community_number');
$zi_widget->setDefault('community_url', $config_global_paths['url']);
echo $zi_widget->add('text', 'My community URL', 'community_url');
?>
</table>
<br clear="all"/>
<?php
$zi_buttons['next'] = 'menu.php';
include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';
?>