'localhost', # MySql server
'name' => 'replaylist', # Database name
'user' => 'replaylist', # MySql user
'pass' => 'replaylist', # MySql password
'prepend' => 'rp_' # To prepend before the table names
);
// what to prepend before the table names, don't change this after installing! Do it before.
$cfg['dbprepend'] = $db['prepend'];
// which theme you would like to use. See themes/readme.txt for details on creating your own.
$cfg['theme'] = 'default';
// If you use the Bad Blue webserver, set the following value to 1
$cfg['badblue'] = 0;
// If you want to disable logins and let everybody with http access to your
// site get in, change the two following options. (WARNING! ALL SECURITY WILL NOW VANISH.)
$cfg['disablelogin'] = 0;
// If you disable logins, a default user has to be chosen. Setting this to 1 means
// the first user which is usually the admin.
$cfg['assumeuserid'] = 1;
// enable the getid3 package. getid package must reside under getid3/ under the directory
// this file exists. If it does not, please change the 'include' statement below.
$cfg['enablegetid3'] = 1;
// where the getid3.php file exists
$cfg['getid3include'] = 'getid3/getid3/getid3.php';
//how many titles of one album do we need to treat as a album? Turn to zero to show all.
$cfg['titlesperalbum'] = 0;
// for multiple downloads.
$cfg['archivemode'] = false;
$cfg['archivefilelist_cr'] = "\n";
// turn this on to show commands when creating INSTEAD of executing
$cfg['archivemodedebug'] = false;
// where archivemode stores data. For UNIX it should be /tmp/, For win32 it should be: c:\\tmp\\
$cfg['archivetemp'] = '/tmp/';
// Read here before enabling: http://www.replaylist.org/forum/viewtopic.php?t=196
$cfg['id3editor'] = 0;
// cookie name
$cfg['cookie'] = 'RE_Playlist';
// list of directories to ignore.
$cfg['dirignorelist'] = array('..' => 1, '.' => 1, 'lost+found' => 1);
// For use of automatic search engine update via lynx / cron. Turn to 1 to enable. Check
// www.replaylist.org for information how to run this update automatically.
$cfg['autoupdate'] = 0;
$cfg['autoupdatehost'] = '127.0.0.1';
$cfg['autoupdateuser'] = 'autooperate';
// what date format to use. if you want to change, look here: http://php.net/date/ for the format
$cfg['dateformat'] = 'd.m.y H:i';
$cfg['timeformat'] = 'H:i';
// format when listing periods in what's hot
$cfg['dateformatwhatshot'] = 'M Y';
// small format
$cfg['smalldateformat'] = 'd.m.y';
// if the dir count exceeds this count, it will not be considered a 'album' directory and albums will not be shown
$cfg['isalbumdircount'] = 1;
// sort the root? does not affect sorting in subdirs.
$cfg['sortroot'] = true;
// to reopen an uri after logon
$cfg['accepturi'] = true;
// where to cut the front bulletin message
$cfg['frontbulletinchars'] = 120;
// where to break 'last stream' titles
$cfg['laststreambreak'] = 33;
// miniumum hits to show in whats'hot
$cfg['whatshotminimumhits'] = 5;
// lame command (transcode)
$cfg['lamecmd'] = '/usr/local/bin/lame --silent --nores --nohist --mp3input -h -m s -b %bitrate% "%file%" -';
// ogg command (transcode)
$cfg['oggcmd'] = '/usr/bin/oggdec -Q "%file%" -o - | /usr/bin/oggenc - --quiet --managed -b %bitrate% -o -';
// enable ogg transcoding, look the line above for the command, check this before enabling
$cfg['oggtranscode'] = false;
$lamebitrates = array(0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320);
// enabled (0/1) extension cmd (%D = destination file, %F source OR %LIST if using filelist.) mime name
// YOU MUST SUIT THESE ARCHIVERS TO YOUR OWN NEED. DO NOT USE THE DEFAULT BLINDLY.
$archivers = array();
$archivers[] = array(1, 'zip', '/usr/bin/zip -j -0 %D "%F"', 'application/zip', 'zip');
$archivers[] = array(1, 'tar','/bin/tar cf %D --files-from "%LIST"', 'application/x-tar', 'tar');
$archivers[] = array(0, 'rar', 'C:\Programfiler\WinRAR\rar.exe -m0 a %D "%F"', 'application/x-rar', 'rar');
// stream 'engine' finetune settings.
$streamsettings =
array(
'preload' => 215,
'buffer' => 105,
'sleep' => 0.999,
'bitrates' => array(32, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 512),
'defaultrate' => 288,
'precision' => 1000,
'forcedefaultrate' => 0
);
// syntax: .filename, mime header, file in M3U, get id function, viewable, log access
$streamtypes_default = array(
0 => array ('mp3', 'audio/mpeg', 1, 1, 1, 1),
1 => array ('mp2', 'audio/mpeg', 1, 1, 1, 1),
2 => array ('ogg', 'application/x-ogg', 1, 2, 1, 1),
3 => array ('wav', 'audio/wave', 1, 0, 1, 1),
4 => array ('wma', 'audio/x-ms-wma', 1, 0, 1, 1),
5 => array ('mpg', 'video/mpeg', 1, 0, 1, 1),
6 => array ('mpeg', 'video/mpeg', 1, 0, 1, 1),
7 => array ('avi', 'video/avi', 0, 0, 1, 1),
8 => array ('wmv', 'video/x-ms-wmv', 1, 0, 1, 1),
9 => array ('asf', 'application/vnd.ms-asf', 0, 0, 1, 1),
10 => array ('m3u', 'audio/x-mpegurl', 0, 0, 0, 0),
11 => array ('flac', 'audio/x-flac', 1, 0, 1, 1),
12 => array ('jpg' , 'image/jpeg', 0, 0, 1, 0),
13 => array ('gif' , 'image/gif', 0, 0, 1, 0),
14 => array ('png' , 'image/png', 0, 0, 1, 0)
);
// filetypes to include or ignore when showing statistics
// use * for everything, "-" and "+" for ignore and include. NB! If change, do an (normal) update.
$cfg['stat_count_ftype'] = array('*'); // example for everything except jpg, gif, png: array('*', '-12', '-13', '-14');
// files to look for to detect basedirs
$cfg['detecttypes'] = array('.mp3' => 1, '.mp2' => 1, '.ogg' => 1, '.wma' => 1);
// dirs to ignore when detecting base dirs (find tool)
$cfg['detectignoredirs'] = array('temp', 'tmp', 'temporary internet files', 'documents and settings', 'winnt', 'windows', 'win32', 'win nt');
// when using getid3 and id3 tags - highest most importnant, 0 to disable
$cfg['id3tagspri'] = array('id3v1' => 1, 'id3v2' => 2);
// maximum size in bytes for album images (if and when auto id3v2 tag.)
$cfg['maxtagimagesize'] = 1048576; // set to zero for no limit - default 1 mb.
// if you enabled urlsecurity in settings, you can specify how long a url will be valid (in seconds) (0 for no limit)
$cfg['urlsecurityvalidtime'] = 0;
// order by tracks
$cfg['ordertrack'] = true;
// when resizing jpeg album
$cfg['jpeg-quality'] = 90;
// resize album images the same way via web as with stream?
$cfg['id3v2albumresize'] = true;
// map design to files instead of inbuilt ('' means inbuilt). set one or each to a relevant filename to customize,
// download the template from here: http://www.replaylist.org/getdesign.php
$cfg['designmap'] =
array(
'login' => '',
'infobox' => '',
'endmp3table' => '',
'top' => '',
'bottom' => '',
'blackbox' => '',
'detailedview' => '',
'dirheader' => ''
);
// all
// how many last stream titles to show
$cfg['laststreamscount'] = 6;
// if using pear (mailmp3), where should we include pear mail files? (relevant to php general include path, pear lib should be in this)
$cfg['pearmailpath'] = 'Mail/';
$cfg['striphtmlbulletin'] = true; // strip away tags from bulletin (when storing.)
// many file select boxes in upload
$cfg['uploadselections'] = 3;
// many streams in rss?
$cfg['rsslaststreamcount'] = 25;
// how to group artist/albums from whatsnew. Default: album, artist (before build 420)
$cfg['albumartistgroup'] = array('album', 'artist');
// can be switched to false after installing for improved security
$cfg['installerenabled'] = true;
// merge root directories? (to avoid duplicate directory names)
$cfg['mergerootdir'] = false;
// convert filesystem (directories) during display? Needs iconv support.
$cfg['convertcharset'] = false;
// which charset to convert from. for other charsets, please look here: http://no.php.net/manual/en/ref.iconv.php
$cfg['filesystemcharset'] = 'UTF-8';
// count of logins (many times one can login concurrently with the same credentials), 0 means indefinite.
$cfg['numberlogins'] = 0;
// dirlist: sort each row (1) or each column (2)?
$cfg['columnsorttype'] = 2;
// enable httpQ support
$cfg['httpq_support'] = false;
$cfg['httpq_parm'] = array(
'server' => 'localhost',
'port' => 4800,
'pass' => 'test'
);
// ajax update live streams -- requires that Settings->Customize->AJax url is filled out (and correct.)
$cfg['livestreamajax'] = true;
// number of milliseconds to update (interval) (default 5 seconds.)
$cfg['livestreamajaxupdatetime'] = 5000;
// number of milliseconds to update (interval) (default 5 seconds.)
$cfg['shoutboxupdatetime'] = 5000;
// how many messages to show
$cfg['shoutboxmessages'] = 5;
// enable radio functionality? (NEED icecast/ices2++) Read forum.
$cfg['radio'] = false;
// use _ in hotselect for a new line. If UTF-8 characters, make sure your editor supports it!
$cfg['hotselectchars'] = '*0abcdefghijklmnopqrstuvwxyz';
// customized/personal genres, if adding/changing needs an re-update with id3rebuild for changes to take effect.
// example: = array('My genre', 'Another genre', 'My genre 3');
$cfg['custom_genres'] = array();
// allow users their own homedir (set homedir in usereditor)
$cfg['userhomedir'] = false;
// operate in UTF-8 mode? Recommended if you have any users speaking other
// languages than english and if you have music with other titles than english.
// NB!! Do not switch this to true unless you know what you're doing.
$cfg['utf8mode'] = false;
// if you wish to use URL's such as http://RE_Playlist/music/04343/File.mp3 instead of the ones
// with streamsid, cookieid, etc. This currently only works with stream urls and it REQUIRES
// that your web server redirects calls.
$cfg['filepathurl'] = false;
// start, but do not end with slash
$cfg['filepathurlprepend'] = '/music';
// authtype, cookie default, session is the alternative
$cfg['authtype'] = 1; // 1=cookie, 2=session
$cfg['musicmatch'] = true; // inbuilt music match support? Default true (randomizer feature.)
// size of window for "external" player
$cfg['window_x'] = 420;
$cfg['window_y'] = 220;
// edit this to suit your setup
$cfg['xspf_url'] = 'xspf/xspf_player.swf';
// enable xspf? Make sure the URL above works.
$cfg['xspf_enable'] = true;
// JW: edit this to suit your setup
$cfg['jw_urls'] =
array(
'swf' => 'jw/mediaplayer.swf',
'js' => 'jw/swfobject.js'
);
// size of window for "external" player
$cfg['jw_window_x'] = 500;
$cfg['jw_window_y'] = 550;
// enable jw player? Make sure the URLs above works.
$cfg['jw_enable'] = false;
// end of configuration
if (file_exists('rpconfig.php')) include('rpconfig.php');
function verchar($in)
{
if ($in == '1' || $in == '0') return $in; else return 0;
}
function geturi()
{
global $phpenv;
if (isset($_POST['uri'])) $uri = $_POST['uri']; else $uri = urlencode($phpenv['uri']);
return stripslashes(strip_tags($uri));
}
function vernum($in)
{
if (is_numeric($in)) return $in; else return 0;
}
function vernumset($in, $value)
{
if (is_numeric($in)) return $in; else return $value;
}
function make_seed() {
list($usec, $sec) = explode(' ', microtime());
return (float) $sec + ((float) $usec * 100000);
}
function mkor($arr, $name)
{
$sql = '';
if (is_array($arr))
{
$sql = $name;
foreach($arr as $g) $sql .= ' = '.$g.' OR '.$name;
return substr($sql, 0, strlen($sql) - (strlen($name) + 4));
}
return $sql;
}
function frpost($name, $numeric=false, $numvalue=0)
{
if (isset($_POST[$name])) return $_POST[$name];
if ($numeric) return $numvalue; else return '';
}
function fruser($name, $numeric=false, $numvalue=0)
{
if (isset($_POST[$name])) return $_POST[$name];
if (isset($_GET[$name])) return $_GET[$name];
if ($numeric) return $numvalue; else return '';
}
function fruserset($name)
{
if (isset($_POST[$name]) || isset($_GET[$name])) return true;
return false;
}
function fruserempty($name)
{
$data = fruser($name);
if (empty($data)) true;
return false;
}
function access_denied()
{
echo 'Access denied.';
die();
}
function refreshurl($url)
{
?>
0) $out .= ' id="'.$id.'"';
if ($width > 0) $out .= ' style="width:'.$width.'px"';
if ($disabled) $out .= ' disabled="disabled"';
$out .= '>';
for ($i=0,$c=count($options);$i<$c;$i++)
{
$out .= '
';
}
}
return $out;
}
function chsessionstatus($cookie, $status=0)
{
global $cfg;
$ckexp = explode('-', $cookie);
if (count($ckexp) == 2 && is_numeric($ckexp[0]) && is_numeric($ckexp[1]))
{
db_execquery('UPDATE '.TBL_SESSION.' SET sstatus = '.$status.' WHERE sessionid = '.$ckexp[1]);
return true;
}
return false;
}
function adminlogout($uid)
{
db_execquery('UPDATE '.TBL_SESSION.' SET logout = '.time().' WHERE u_id = '.$uid.' AND logout = 0');
}
class saveuser
{
function saveuser()
{
$this->kpu = new rpuser();
$this->id = -1;
}
function setid($id)
{
$this->id = $id;
$this->kpu->id = $id;
$this->kpu->load($this->id);
}
function usernameok()
{
$result = db_execquery('SELECT u_id FROM '.TBL_USERS.' WHERE u_login = "'.$this->kpu->get('u_login').'"');
if (mysql_num_rows($result) > 0)
{
$row = mysql_fetch_row($result);
if ($row[0] != $this->id) return false;
}
return true;
}
function fromtemplate($id)
{
$this->setid($id);
$this->setid(-1);
}
function frompost()
{
global $setctl;
$this->kpu->setallowed(array('u_booted', 'u_allowdownload', 'lameperm', 'forcelamerate', 'allowemail', 'u_name', 'u_login', 'u_comment', 'u_access', 'udlrate', 'email', 'lang', 'utemplate', 'streamengine', 'allowarchive', 'archivesize', 'homedir', 'network'));
$this->kpu->set('u_booted', 0);
$this->kpu->set('u_allowdownload', 0);
$this->kpu->set('lameperm', 0);
$this->kpu->set('allowemail', 0);
$this->kpu->set('allowarchive', 0);
$this->kpu->set('network', 0);
if ($setctl->get('streamingengine')) $this->kpu->set('streamengine', 0);
foreach($_POST as $name => $value) $this->kpu->set($name, $value, true);
}
function validname()
{
$name = $this->kpu->get('u_name');
$login = $this->kpu->get('u_login');
if ($this->kpu->get('utemplate'))
{
if (empty($login)) return false;
} else if (empty($name) || empty($login)) return false;
return true;
}
}
function save_user()
{
global $setctl;
$form = true;
$id = frpost('u_id', -1);
$tempid = frpost('templateid', 0);
$sv = new saveuser();
$sv->setid($id);
if (isset($_POST['passchange']) && $id != -1) $changepw = 1; else $changepw = 0;
if (isset($_POST['password'])) $pass = myescstr($_POST['password']); else $pass = '';
if ($tempid > 0 && $id == -1) $sv->fromtemplate($tempid);
$sv->frompost();
if ($sv->validname())
{
if ($sv->usernameok())
{
$sv->kpu->set('homedir', slashtranslate(frpost('homedir')));
$text = get_lang(262);
if ($changepw)
{
if (empty($pass)) $text = get_lang(310);
else
{
$text = get_lang(157);
$sv->kpu->set('u_pass', md5($pass));
$sv->kpu->update();
}
} else
{
if ($id == -1)
{
$sv->kpu->set('u_pass', md5($pass));
$sv->kpu->set('created', time());
if ($tempid == 0)
{
$sv->kpu->set('lang', $setctl->get('default_language'));
$sv->kpu->store();
$text = get_lang(259);
} else $sv->kpu->store(false);
$tempid = 0;
} else $sv->kpu->update();
}
} else $text = get_lang(312);
} else
{
switch($sv->kpu->get('utemplate'))
{
case 0: $text = get_lang(311); break;
case 1: $text = get_lang(323); break;
}
}
show_userform($sv->kpu, $text, $changepw, $tempid);
}
function show_userform($rpu, $text='', $changepass=0, $templateid=0)
{
global $u_id, $setctl, $lamebitrates;
if ($rpu->id == -1) $title = get_lang(96); else $title = get_lang(95);
if ($rpu->get('utemplate') == 1)
{
$template = true;
$title = get_lang(321);
} else $template = false;
rprintheader($title, 1, 0);
?>