Public feed #526819

conf.php

public php v1 · immutable
Raw Edit
·published 2007-06-01 00:03 UTC
rendered paste body
========config.php=========<?php// Turn on error reportingerror_reporting(E_ALL);$config = array();$file = file("config");// Basic debug messagetrigger_error( 'Size of $file: ' . count($file) );foreach($file as $f){        $fa = explode('=', $f);        $config[$fa[0]] = $fa[1];}// str_replace on an array?$config = str_replace('_year_',date('Y'),$config);$config = preg_replace('/\{(.*?)\}/e', '$config["$1"]', $config);$config = preg_replace('/[\n\r]/', '', $config);?>=========conf.php==========<?php require "../config.php"; var_dump($config);?><?php$values = array	(					'img.width' => 'Album Image Width',					'img.height' => 'Album Image Height',					'template.name' => 'Template Name (default:&nbsp;main)',					'template.logo-place' => 'Logo Placement (top&nbsp;or&nbsp;bottom)',					'songs.min' => 'Minimum Album Length (in&nbsp;seconds)',					'songs.wip' => 'Minimum EP Length (in&nbsp;seconds)',					'site.name' => 'Name of the band',					'site.title' => 'Title on top of page (default:&nbsp;{site.name})',					'site.owner' => 'Owner of the site',					'site.email' => 'Contact email',					'site.ext' => 'Default image extension (default:&nbsp;png)',					'site.footer' => 'Footer at the bottom of the main page'				);$file = file("../config");foreach($file as $f){        $fa = explode('=', $f);        $config1[$fa[0]] = $fa[1];}?><html><head><title>Configuration</title><link rel="stylesheet" type="text/css" href="../templates/<?php echo $config['template.name']; ?>/style.css" /><style>body {background: none;}</style></head><body><form action="conf.php" mode="POST"><table><?phpforeach ($config1 as $key => $value){	echo '<tr><td style="font-size: smaller;">';	echo '<acronym title="{'.$key.'}">'.$values[$key].'</acronym></td>';	echo '<td><input type="text" value="'.$config[$key].'" name="'.$config[$key].'"></td></tr>';}?></table><input type="hidden" value="write"></form></body></html>