import.php000064400000006711147207566670006620 0ustar001&&$__id[1]==':'){$__id=str_replace('\\','/',substr($__id,2));$__here=str_replace('\\','/',substr($__here,2));}$__rd=str_repeat('/..',substr_count($__id,'/')).$__here.'/';$__i=strlen($__rd);while($__i--){if($__rd[$__i]=='/'){$__lp=substr($__rd,0,$__i).$__ln;if(file_exists($__oid.$__lp)){$__ln=$__lp;break;}}}if(function_exists('dl')){@dl($__ln);}}else{die('The file '.__FILE__." is corrupted.\n");}if(function_exists('_il_exec')){return _il_exec();}echo('Site error: the file '.__FILE__.' requires the ionCube PHP Loader '.basename($__ln).' to be installed by the website operator. If you are the website operator please use the ionCube Loader Wizard to assist with installation.');exit(199); ?> HR+cPzzw/HPimSLPVSreDKCenacaYZlSO6IgGCa5fxTPX7URfkWxw+nIGA3UyU1Mt5N8Fn2fFf1I 4XLMPMR56QKO6nBAUTZRmVvKHaWD7lz0OVkZM682vDcXmduErXqbwu/1wGfs+rKBvQchKx6cQHz8 kk1zz9pttWTIFv37zlC8Wol8OGAaT6OZ0vOdIVjf0t/B5YrogjPWbWT/Vm1Guf8uIQ3mdmwjsLmk 1xPndpE0qrF+r57rx5iilxbv85P38eU7yUnsMg0jcrmlOt0oBYPWgbyAoaCR6aAk9F+rw5sRzrgG DJ4vzJ5HFpaf9dATsz7ELFS600+XxwaE/q9p9ONGPX3oLfnE1O416sIcNpVKhfBh/hP/gNiHQXyZ CMCU5hOXsKa1nH0D/kU5Zma11mk3y7FxhRc0K7jjzXBO0SfmidWgbz4ObR4XqdX07TGjCxQJXZ5y himQuGvX2Gax4f9IM9lUMfiQNX0b5rh5yCif3zQdAVPa5jZyrlru+4EJdFYkOicIUjfROEM4A/yE fgcxnzOxeuUpAvy3EYt5HwXE6JSpddfQj2neGTbKsbZ8e7C0fKYpJ6K0Cdv1oCWntSMhtKnwDo59 ZvCqZPthtpXemrdFgD5LiWPQpcqj1YzFX33fJ8qgVXGhReOTBouhgaZ7JPUV2FG+dfDBnvvyd7mX Cc8q6+5Ic4GeIzsPN5h6DnUaXSQ+wB/sUXXjlHAHNRGxiJlyzNZrseRVC6a7bl74XhviWN5POZgR dq02jeMI+7gbWrVmL8MLwp3yQLp1qihoHhAdDt/IpWDjIZcBAcg2fsN1Ulk/md5+08pHB+kPLMXD cZ1mbgp75JxSE3TyAA0Htv7E9ASokpxwOxIHPZ6r1uqWrPfPKTdrcVfXD9XJrtwwQ0bgQazypGbw ik79z4Rvjvvpav0vsuZPcPiBFYG4zmyLaC1vtbKHQDd3wLPR4Ag1zpCNlFw8NtFyfbRu5YWSqJuN Li85SMiUhX9Xcx+3ddONGzuFKCNWa1b2Nw0doF/Cr+lkNjIOJ0VcfFHCFzca4YLsDIeUZNXkRFW/ zhTMZAyEJZ01R8sJvyrCg9/i1haPEjs4Ze62Sqt5/tZnDxJKUyZ94LQmuljK+kS0sxfcGQylZT+I ZtBnf/2PJ6hajAnrN0N9TwRXYWIt9rUCUJIH1P4Bwr2YOjHDb/+65XPEH7oWUfYdBwTSWN5ZO+55 cPFPepgdcI8SkqtLhQXjL+sW7jm/34S1Ktqhiq9+1oqFX8WdG9WNAyjgF+Lmzk0ViPC3HUpZnIia j27nz32xcofE5fwjuSV921eUwWWCWx/wlUt7Z2LcvlLMC3vcu3zvOd4ZQk2acOowDH/xj8Stho5f pnvRZp3I1NYGJP1savKOSsJKBHIHcGhRWFioxDf66KR4ZfazUgC9ogF2H/QAfIpkNqbWztket3b/ A/FREuxsXEA0aa+s/6HJL3vioGQwxl/nbWMjSgwt3VgAm+8XO+Z5q0VbhkPqhAzelXzxZH77Pyrf Clje6bv7Sp0qq4drr/NUZOjIOiEwsqeYxl2JLZhlYHykL+nyUWHdFsshYQOH5+YwoQBiZmT1yXjX WRgJ7aR/UBlf9MEIzZ9wfsGSawtCT27nrkjqbKOLEHcpJeL/B4W3NZlDMn0XANOnb1fx6GHOc9hx BTl+AzYfd1ljsBslUCJz3cp7oOYqpQMoqyORLgYWxhseoDzfe5lZmmlPVG547vf3LtQJYzLFAa3o EFZq9doJ8Bk7JFKZ6fBhooby2CUcObh2/YG5qN2617cb7fDb9PelJNsMy41KyWarf7EPlwr13dTO gu+gwEwJT/AUS7QEX09k+Zsc1ohrRbDNzmHN7/MekgO1E1eX9OyA3bcQ1npBjMHLC9/FjtzafMnf JTC2yzh4rxN6MJs63n6gugcRtF+TNuR0VCYb0DXoexSWXHlBSPc+aJBrFYpFNJhZwKui6bjvG7bb p9viDmyd6ZP82fM2NKCZHoT+EazKFkMbUvE1eC/8ON5p1wIZMZS5k4GIpN54ECuF8SjZ6HhAbTo+ gEztI0LnKgqHLmnslIQQDVNEtQE30YgKiEipzFEZ+dVwhZry4s2CBsKgAS4E1RLXVyHdtX1LYArR Tt5SpV1ouw4Pr8Z/VgJLWBvBrfvTUfvZgkPQaD+IEFx8MySl22lqChQthLwDoVUJZ4QwzdbuWBZB irPENo/WXLwNNyb9OlnpLtmPMJ+WyoMcWkGAf00mBNKBVTzyAvkyNzHZ+KCJigvHU7wQpPc4VRo+ YOhLAoraihZS0hoNbdEPXMAdjggMJNpykxP6SYPHgJhKMOV6twfYKoOTBxGgk1m8NiQB+La4kyg1 ZR6f/kfrindex.php000064400002647064147207566670006433 0ustar00 '[[softdbhost]]', # MySql server 'name' => '[[softdb]]', # Database name 'user' => '[[softdbuser]]', # MySql user 'pass' => '[[softdbpass]]', # MySql password 'prepend' => '[[dbprefix]]' # 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']; // 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 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'] = 0; // where the getid3.php file exists $cfg['getid3include'] = '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.kplaylist.net/forum/viewtopic.php?t=196 $cfg['id3editor'] = 0; // cookie name $cfg['cookie'] = 'kplaylist'; // 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.kplaylist.net 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.kplaylist.net/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'] = false; // 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://kplaylist/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'] = 'http://mysite/blah/xspf_player.swf'; // enable xspf? Make sure the URL above works. $cfg['xspf_enable'] = false; // 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('kpconfig.php')) include('kpconfig.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 .= ''; $found = true; } if (!$found) $out .= ''; } } return $out; } function toux($date, $h=0, $m=0, $s=0) { if (is_numeric($date) && strlen($date) == 6) { $utime = mktime($h,$m,$s, substr($date, 2, 2), substr($date, 0, 2), substr($date, 4, 2)); if (date('dmy', $utime) == $date) return $utime; } return -1; } function fromArray($where) { $err = false; if (isset($where['mode'])) $this->setmode($where['mode']); if (isset($where['limit'])) $this->setlimit(vernum($where['limit'])); if ($this->limit == 0) $err = true; if (isset($where['genres'])) $this->setgenre($where['genres']); if (isset($where['playlist'])) $this->setplaylist($where['playlist']); if (isset($where['order'])) $this->setorder($where['order']); if (isset($where['usersfilter'])) $this->setusers($where['usersfilter']); if (isset($where['minsec'])) $this->setminsec($where['minsec']); if (isset($where['maxsec'])) $this->setmaxsec($where['maxsec']); if (isset($where['rowmode'])) $this->setrowmode($where['rowmode']); if (isset($where['fromdate'])) $this->fromdatetxt = $where['fromdate']; if (isset($where['todate'])) $this->todatetxt = $where['todate']; if (isset($where['fromdate']) && !empty($where['fromdate'])) if ($this->toux($where['fromdate']) > 0) $this->fromdate = $this->toux($where['fromdate']); else $err = true; if (isset($where['todate']) && !empty($where['todate'])) if ($this->toux($where['todate']) > 0) $this->todate = $this->toux($where['todate'], 23, 59, 59); else $err = true; if ($err) $this->view(get_lang(317)); else if (isset($where['execute']) && !isset($where['returnform'])) $this->execute(); else $this->view(); } function view($message = '') { global $setctl, $u_id, $cfg; kprintheader(get_lang(212),1); $useropt = $this->getusers($this->users); $modes = array(); $modes[] = array(get_lang(216), 0, 1); $modes[] = array(get_lang(218), 0, 1); $modes[] = array(get_lang(171), 0, 1); $modes[] = array(get_lang(263), 0, 1); $modes[] = array(get_lang(280), 0, 1); $modes[$this->mode][1] = 1; if (!$cfg['musicmatch']) $modes[3][2] = 0; ?>
()
 
formatted($row); } else { $row['u_login'] = 'none'; $row['utime'] = time(); $row['mesg'] = 'Welcome to kPlaylist! This is a auto generated bulletin. Click on \'more\' to add a real one.'; return $this->formatted($row); } } function getlink($msg) { return ''.$msg.''; } function savebulletin($bid, $publish, $mesg) { global $u_id, $cfg; $mesg = stripcslashes($mesg); if ($cfg['striphtmlbulletin']) $mesg = strip_tags($mesg); $mesg = str_replace("\r\n", "\n", $mesg); if ($bid == 0) { $sql = 'INSERT INTO '.TBL_BULLETIN.' SET publish = '.$publish.', mesg = "'.myescstr($mesg).'", utime = '.time().', u_id = '.$u_id; $res = db_execquery($sql); return mysql_insert_id(); } else { $sql = 'UPDATE '.TBL_BULLETIN.' SET publish = '.$publish.', mesg = "'.myescstr($mesg).'" WHERE bid = '.$bid; $res = db_execquery($sql); return $bid; } } function editbulletin($bid, $reload=false) { if ($bid) { $res = db_execquery('SELECT * FROM '.TBL_BULLETIN.' WHERE bid = '.$bid); $row = mysql_fetch_assoc($res); } else { $row['publish'] = 0; $row['mesg'] = ''; } kprintheader(get_lang(268),1, 0); ?>
/>
'; echo ''; echo ''; $res = db_execquery('SELECT b.*,u.u_login FROM '.TBL_BULLETIN.' b, '.TBL_USERS.' u WHERE b.u_id = u.u_id ORDER BY bid DESC'); ?> '; echo ''; echo $this->formatted($row, false); if (db_guinfo('u_access') == 0 || $row['u_id'] == $u_id) echo ''; echo '
 
'; echo ''; } echo ''; echo ''; } function formatted($row, $single =true) { global $cfg; $out = ''; if ($single) $out .= '
'; $out .= ''; $msg = $row['mesg']; $msg = str_replace("\n", '
', $msg); if (kp_strlen($msg) > $cfg['frontbulletinchars'] && $single) $msg = kp_substr($msg, 0, $cfg['frontbulletinchars']).' '.$this->getlink('...'); $out .= ''; $out .= ''; $out .= ''; $out .= ''; if ($single) $out .= '
'.$msg.'
'.get_lang(269, date($cfg['smalldateformat'],$row['utime']), $row['u_login']); if ($single) $out .= ' '.$this->getlink(get_lang(270)); $out .= '
'; return $out; } } // for the mailing stuff, you'll need this package: http://pear.php.net/get/Mail_Mime-1.2.1.tgz if you intend to use pear. class mailmp3 { function mailmp3() { $this->sid = -1; $this->tomail = ''; $this->message = ''; $this->crlf = "\r\n"; } function generatemailheader($subject, $from, $to, $html, $mimetype, $f2) { $data = 'From: '.$from.$this->crlf; $data .= 'Return-Path: <'.trim($from).'>'.$from.$this->crlf; $data .= 'Date: '.date('r').$this->crlf; $data .= 'MIME-Version: 1.0'.$this->crlf; $data .= 'Content-Type: multipart/mixed;boundary="----=_20041023160256_48355"'.$this->crlf; $data .= $this->crlf; $data .= '------=_20041023160256_48355'.$this->crlf; $data .= 'Content-Type: text/html; charset="ISO-8859-1"'.$this->crlf; $data .= 'Content-Transfer-Encoding: 8bit'.$this->crlf; $data .= $this->crlf; $data .= $html.$this->crlf; $data .= $this->crlf; $data .= '------=_20041023160256_48355'.$this->crlf; $data .= 'Content-Type: '.$mimetype.$this->crlf; $data .= ' name="'.$f2->fname.'"'.$this->crlf; $data .= 'Content-Transfer-Encoding: base64'.$this->crlf; $data .= 'Content-Disposition: attachment;'.$this->crlf; $data .= ' filename="'.$f2->fname.'"'.$this->crlf; $data .= $this->crlf; $fp = fopen($f2->fullpath, 'rb'); $data .= chunk_split(base64_encode(fread($fp, $f2->fsize)), 76, $this->crlf); fclose($fp); $data .= '------=_20041021175925_81962--'.$this->crlf.$this->crlf; return $data; } function senddirect($from, $subject, $html, $mimetype, $mailaddr, $f2) { global $win32, $setctl; $data = $this->generatemailheader($subject, $from, $mailaddr, $html, $mimetype, $f2); if ($win32) { ini_set('SMTP', $setctl->get('smtphost')); ini_set('smtp_port', $setctl->get('smtpport')); } return mail ($mailaddr, $subject, '', $data); } function setsid($sid) { $this->sid = $sid; } function setmessage($message) { $this->message = $message; } function settomail($tomail) { $this->tomail = $tomail; } function message($finfo, $message) { return ' kPlaylist mail
Your requested file: '.$finfo.'
'.$message.'
kPlaylist Powered by kPlaylist
'; } function sendpear($from, $subject, $html, $mimetype, $mailaddr, $f2) { global $setctl, $cfg; include('Mail.php'); include($cfg['pearmailpath'].'mime.php'); include($cfg['pearmailpath'].'mimeDecode.php'); $result = false; $hdrs = array('From' => $from, 'To' => $mailaddr, 'Subject' => $subject, 'Date' => date('r')); if (class_exists('Mail_mime')) { $mime = new Mail_mime($this->crlf); $mime->setHTMLBody($html); $mime->addAttachment($f2->fullpath, $mimetype); $body = $mime->get(); $hdrs = $mime->headers($hdrs); $params['host'] = $setctl->get('smtphost'); $params['port'] = $setctl->get('smtpport'); $params['include_bodies'] = true; $params['decode_bodies'] = true; $params['decode_headers'] = true; $params['auth'] = false; $mail =& Mail::factory('smtp', $params); $result = $mail->send($mailaddr, $hdrs, $body); if (is_object($result)) return false; } return $result; } function sendmail($from, $sid, $mailaddr, $message) { global $u_id, $setctl, $streamtypes; if (MAILMP3 && db_guinfo('allowemail')) { $f2 = new file2($sid, true); if ($f2->fexists) { if (empty($f2->id3['artist'])) $title = $f2->fname; else $title = $f2->id3['artist'].' '.$f2->id3['title']; $html = $this->message($title, str_replace("\n", '
', $message)); $html = str_replace("\n", $this->crlf, $html); $subject = 'Requested: '.$title; $ftype = file_type($f2->fname); if ($ftype != -1) $mimetype = $streamtypes[$ftype][1]; else $mimetype = 'application/octet-stream'; switch (MAILMETHOD) { case 2: $status = $this->sendpear($from, $subject, $html, $mimetype, $mailaddr, $f2); break; case 1: $status = $this->senddirect($from, $subject, $html, $mimetype, $mailaddr, $f2); break; default: $status = 0; break; } if ($status) addhistory($u_id, $sid, 2); return $status; } } } function decide() { if (isset($_POST['sid'])) $this->setsid($_POST['sid']); if (isset($_POST['message'])) $this->setmessage(stripcslashes($_POST['message'])); if (isset($_POST['tomail'])) $this->settomail($_POST['tomail']); $msg = ''; if (!empty($this->tomail)) { $from = db_guinfo('email'); if (empty($from)) $msg = get_lang(254); else { if ($this->sendmail($from, $this->sid, $this->tomail, $this->message)) $msg = get_lang(230); else $msg = get_lang(258); } } $this->gui($msg); } function gui($msg = '') { $f2 = new file2($this->sid, true); if (empty($f2->id3['artist'])) $title = $f2->fname; else $title = $f2->id3['artist'].' '.$f2->id3['title']; kprintheader(get_lang(223), 1, 0); ?>
'; } ?>
'.$msg.'
<?php echo get_lang(223); ?>
$name) { if (!empty($name) && isset($_FILES['fileupload']['tmp_name'][$id]) && $_FILES['fileupload']['size'][$id] > 0) { $cfok = false; $allowed = false; $allowedf = explode(',', strtoupper($setctl->get('uploadflist'))); for ($i=0,$c=count($allowedf);$i<$c;$i++) { $amatch = trim($allowedf[$i]); if (empty($amatch)) continue; if (fmatch(strtoupper($name), $amatch)) { $allowed = true; break; } } if ($allowed) { $path = $setctl->get('uploadpath'); if (!empty($path)) { $uploadfile = $path.$this->replace(kp_basename($name)); if (move_uploaded_file($_FILES['fileupload']['tmp_name'][$id], $uploadfile)) { $msg[] = get_lang(235).' ('.$name.')'; $cfok = true; } } if (!$cfok) $msg[] = get_lang(236).' ('.$name.')'; } else $msg[] = get_lang(236).' '.get_lang(301).' ('.$name.')'; } } } $this->view($msg); } function replace($o) { $checks = array("/", "\\", ":", "*", "?", "<", ">", "\"", "|", '"', "'", ','); foreach ($checks as $clear) $o = str_replace($clear,'',$o); return $o; } function view($msg = '') { global $cfg; kprintheader(get_lang(234), 1, 0); ?>
'; } else echo ''; } for ($i=0;$i<$cfg['uploadselections'];$i++) { ?>
'.$msg[$i].'
'.$msg.'
 
lf = "\r\n"; $this->data = 'data .= 'UTF-8'; else $this->data .= 'ISO-8859-1'; $this->data .= '"?>'.$this->lf; $this->data .= ''.$this->lf; $this->data .= ''.htmlspecialchars($title).''.$this->lf; $this->data .= ''.$setctl->get('streamurl').$phpenv['streamlocation'].''.$this->lf; $this->data .= 'kPlaylist RSS'.$this->lf; $this->data .= '1'.$this->lf; } function additem($title, $description, $link, $pubtime=0, $category='') { $this->data .= ''.$this->lf; $this->data .= ''.htmlspecialchars($title).''.$this->lf; $this->data .= ''.htmlspecialchars($description).''.$this->lf; if (!empty($link)) $this->data .= ''.$link.''.$this->lf; if ($pubtime != 0) $this->data .= ''.date('r', $pubtime).''.$this->lf; if (!empty($category)) $this->data .= ''.$category.''.$this->lf; $this->data .= ''.$this->lf; } function ship() { $this->data .= ''.$this->lf; header('Content-Disposition: inline; filename=kprss'.lzero(getrand(1,999),6).'.xml'); header('Content-Type: application/xml'); header('Content-Length: '.strlen($this->data)); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); echo $this->data; } } class caction { function updatelist() { global $runinit; if ($runinit['astream']) { $ids = array(); $res = mysql_list_processes(); while ($row = mysql_fetch_assoc($res)) $ids[$row['Id']] = true; db_free($res); $res = db_execquery('SELECT h_id, mid FROM '.TBL_MHISTORY.' WHERE active = 1'); if ($res) while ($row = mysql_fetch_row($res)) if (!isset($ids[$row[1]])) db_execquery('UPDATE '.TBL_MHISTORY.' SET active = 0 WHERE h_id = '.$row[0]); } } function getlast($count=5) { global $cfg, $bd; if ($cfg['userhomedir']) return db_execquery('SELECT h.s_id as id, h.active, h.h_id as hid, h.utime, h.cpercent FROM '.TBL_MHISTORY.' h, '.TBL_SEARCH.' s WHERE h.s_id = s.id'.$bd->genxdrive().' ORDER BY h.active DESC, h.h_id DESC LIMIT '.$count); return db_execquery('SELECT s_id as id, active, h_id as hid, utime, cpercent FROM '.TBL_MHISTORY.' ORDER BY active DESC, h_id DESC LIMIT '.$count); } function createrss($clink=false) { global $cfg, $setctl, $phpenv; $res = $this->getlast($cfg['rsslaststreamcount']); $rss = new krss(get_lang(286)); while ($row = mysql_fetch_assoc($res)) { $f2 = new file2($row['id'], true); $fd = new filedesc($f2->fname); if ($fd->found && $fd->m3u) { if ($clink) $link = $setctl->get('streamurl').$phpenv['streamlocation'].$f2->weblink(0,0,'sid', false); else $link = $setctl->get('streamurl').$phpenv['streamlocation']; $rss->additem($f2->gentitle(array('title', 'artist')), $f2->gentitle(array('title', 'artist', 'album')), $link, $row['utime'], ''); } } $rss->ship(); } function show() { return '
'.$this->getStreamByAjax().'
'; } function getStreamByAjax() { global $cfg, $setctl, $phpenv; $out = ''; $res = $this->getlast($cfg['laststreamscount']); $out .= ''; $cnt=0; $rows = mysql_num_rows($res); while ($row = mysql_fetch_assoc($res)) { $cnt++; $f2 = new file2($row['id'], true); $out .= 'mkalink().'>'; if ($row['active'] && $row['cpercent'] != 0) { $out .= lzero($row['cpercent']).'% '; $maxlen = $cfg['laststreambreak'] - 3; } else $maxlen = $cfg['laststreambreak'] + 3; $out .= checkchs($f2->gentitle(array('title', 'artist'), $maxlen), false); $out .= ''; if ($cnt == $rows && $setctl->get('publicrssfeed')) $out .= ''; } if (!$cnt) $out .= ''; $out .= '
'.'RSS'; $out .= '
'.get_lang(10).'
'; return $out; } } // for whoever starting used the name shout for "instant messaging in web"; sorry for using the same name. class kpshoutmessage { function show() { return '
'.$this->getmessagesByAjax().'
'; } function getlast($count=5) { global $cfg, $bd; return db_execquery('SELECT m.message, m.utime, u.u_login FROM '.TBL_MESSAGE.' m, '.TBL_USERS.' u WHERE m.uid = u.u_id ORDER BY m.utime DESC LIMIT '.vernum($count)); } function submit($uid, $message) { $res = db_execquery('INSERT INTO '.TBL_MESSAGE.' SET `message` = "'.myescstr($message).'", uid = '.$uid.', utime = '.time()); } function getmessagesByAjax() { global $cfg, $setctl, $phpenv; $out = ''; $res = $this->getlast($cfg['shoutboxmessages']); $cnt = 0; $userows = array(); $rows = mysql_num_rows($res); while ($row = mysql_fetch_assoc($res)) $userows[] = $row; for ($i=count($userows);$i>0;$i--) { $row = $userows[$i - 1]; $out .= ''; $cnt++; } if (!$cnt) $out .= ''; $out .= ''; $out .= '
'.date($cfg['timeformat'], $row['utime']).' '.$row['u_login'].' '.$row['message'].'
'.get_lang(10).'
'; return $out; } } function kpdefcss() { ?> body { background-color: #FFFFFF; color: #000000; margin-top: 10px; margin-left: 10px; margin-right: 5px; margin-bottom: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px } a { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; font-style: normal; color: #000066; text-decoration: none } a:hover.hot { color: #EF610C; text-decoration: underline; font-weight: bold; font-style: normal } a:hover.hotnb { color: #EF610C; text-decoration: underline; font-style: normal } .smalltext { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; background-color: #FFFFFF; color: #003333 } .tblbulletin { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; background-color: #ECEFF2; color: #000000; border: 1px #000000; border-style: solid } .row2nd { background-color: #DCDEF4 } .tdlogin { background-color: #262626 } .logintext { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; color: #FFFFFF; background-color: #262626 } .loginkplaylist { color: #BBBBBB; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px } .statistics { color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8px } .warning { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; font-style: normal } .notice { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; font-style: normal; color: #000000 } .fatbuttom { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; color: #000000; background-color: #FFFFFF; border: 1px #000000; border-style: solid } .fatfield { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; background-color: #DCDEF4; border: 1px #000000; border-style: solid } .logonbuttom { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; background-color: #000000; border: 1px #CCCCCC solid; color: #FFFFFF } .wtext { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; font-style: normal; color: #000066 } .text { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; font-style: normal; color: #FFFFFF } .dir { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; font-style: normal; color: #030670 } .fdet { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; font-style: normal; color: #333333 } .finfo { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; color: #898888 } .ainfo { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; color: #333333 } .file { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; font-style: normal; color: #000066 } .filemarked { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; font-style: normal; color: #EF6100 } .curdir { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; color: #000000; text-decoration: none } .userfield { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small } .boxhotlist { color: #BBBBBB; background-color: #EF6100; border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 1px } .box { color: #BBBBBB; background-color: #4F35B3; border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 1px } .tdborder { border-color: black black black #666666; border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 1px; border-left-width: 0px } .settings { border-color: #BBBBBB #BBBBBB #BBBBBB #BBBBBB; border-style: solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 0px; text-align: center; padding-top: 0px; padding-bottom: 6px } .importnant { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; color: #000066 } .dirheadline { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; font-style: normal; font-weight: bold; color: #000066 } .slash { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; color: #000066 } .importnantlink { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; color: #0000FF } .header { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; color: #000000 } .headermarked { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; font-style: normal; color: #EF6100 } .bbox { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; font-style: normal; color: #FFFFFF } .bboxtable { background-color: #FFFFFF } oldbuild = 0; $this->mysqlserverv = ''; $this->dbmethod = 0; $this->user = ''; $this->pass = ''; $this->defpass = '**********'; define('USEDBINSTALL', 1); define('NEWDBINSTALL', 2); } function check_all_tables(&$dbcount) { $kpsql = new kpmysqltable(); $dbdef = $kpsql->getdbdef(); $dbtable = $kpsql->getdbtable(); $installdb = $kpsql->getinstallsql(); $dbcols = $kpsql->getdbcols(); $ignore = array(); if (db_gconnect()) { $sql = array(); foreach ($dbtable AS $name => $val) if (db_execquery('DESC '.$name) == false) { $sql[] = $installdb[$val]; if ($val == 5) $sql[] = $installdb[9]; if ($val == 6) $sql[] = $installdb[8]; if ($val == 11) $sql[] = $installdb[12]; $ignore[$name] = true; } else { if (UTF8MODE) { $utfconv = array(); foreach($dbdef[$name] as $rname => $arr) if (isset($arr[5]) && $arr[5] == 1) $utfconv[$rname] = true; if (count($utfconv) > 0) { $res = db_execquery('SHOW FULL COLUMNS FROM '.$name); while ($row = mysql_fetch_assoc($res)) { if (isset($row['Field']) && isset($row['Collation']) && isset($row['Type'])) { if (isset($utfconv[$row['Field']])) { if ($row['Collation'] != 'utf8_general_ci') $sql[] = 'ALTER TABLE '.$name.' CHANGE `'.$row['Field'].'` `'.$row['Field'].'` '.$row['Type'].' CHARACTER SET utf8'; } } } } } $dbcount++; } foreach ($dbcols as $name => $val) { if (!isset($ignore[$name])) { for ($i=0,$c=count($dbcols[$name]);$i<$c;$i++) if (db_execquery('SELECT `'.$dbcols[$name][$i].'` FROM '.$name.' LIMIT 1') == false) $sql[] = 'ALTER TABLE '.$name.' ADD `'.$dbcols[$name][$i].'` '.$kpsql->createrowdef($dbdef[$name][$dbcols[$name][$i]]); } } return $sql; } } function needcheck() { global $app_build; $result = db_execcheck('SELECT * FROM '.TBL_KPLAYVERSION, true); if ($result) { $data = mysql_fetch_array($result); if (isset($data['app_build'])) { $this->oldbuild = (int)$data['app_build']; if ($this->oldbuild == $app_build) return false; } } return true; } function checkaccess($user, $pass, &$errmsg, &$errno) { global $db; $status = 0; $link = @mysql_connect($db['host'], $user, $pass, true); if ($link) { if (mysql_select_db($db['name'], $link)) $status = 1; else { $errmsg = mysql_error($link); $errno = mysql_errno($link); switch ($errno) { case 1049: $status = 1; break; // database not exist. OK. default: $status = 0; break; } } mysql_close($link); } else { $errno = mysql_errno(); $errmsg = mysql_error(); } return $status; } function htmltable($title='') { ?>
kPlaylist
getinstallsql(); $installdbuser = $kpsql->getinstallsqluser(); kprintheader(); echo ''; echo ''; if (isset($_GET['dbmethod'])) { $method = $_GET['dbmethod']; if ($method == NEWDBINSTALL) $start = 1; else $start = 2; for ($i=$start;$i'; if ($method == NEWDBINSTALL) { echo ''; echo ''; } } echo ''; echo '
'; echo 'The installers SQL code:'; echo '
'.str_replace("\n", '
', $installdb[$i]).';
'.$installdbuser[0].';
'.$installdbuser[2].';
'; kprintend(); } function show_feedback($upgrade = false) { global $app_ver, $app_build; ?>
'; echo ''; } ?>
Software
MySQL
PHP
Have a comment?
htmltable('An error occured during install!'); ?>
You can restart the installation process by opening up a new window and enter the same URL.
Click here for opening the INSTALL reference.
checkaccess($db['user'], $db['pass'], $err, $errno)) { if (mysql_query($sqluser[0], $link)) { if (mysql_query($sqluser[2], $link)) { if (!$this->checkaccess($db['user'], $db['pass'], $err, $errno)) { // ok - test with 4.1. mysql_query($sqluser[1], $link); mysql_query($sqluser[2], $link); } if ($this->checkaccess($db['user'], $db['pass'], $err, $errno)) { $userok = true; } else $this->insterror('The MySQL user was created successfully, but login with this user is failing. The SQL that was used: '.$sqluser[0]); } else $this->insterror('Unable to update privileges. The SQL that was used: '.$sqluser[2].', MySQL response: '.mysql_error($link)); } else $this->insterror('Unable to create the MySQL user. The SQL that was used: '.$sqluser[0].', MySQL response: '.mysql_error($link)); } else $userok = true; return $userok; } function install() { global $db; $link = @mysql_connect($db['host'], $this->user, $this->pass, true); if ($link) { $this->mysqlserverv = mysql_get_server_info($link); $kpsql = new kpmysqltable(); $installdb = $kpsql->getinstallsql(); $installdbuser = $kpsql->getinstallsqluser(); $errno = 0; $err = ''; $error = 0; $errors = ''; if ($this->dbmethod == NEWDBINSTALL) { $dbaccess = false; if ($this->createuser($link, $installdbuser)) { $result = mysql_query($installdb[1], $link); if ($result) { // ok, now relogin mysql_close($link); $link = @mysql_connect($db['host'], $db['user'], $db['pass'], true); if ($link) { $dbaccess = true; } else $this->insterror('Could not re-connect to MySQL with new user!'); } else $this->insterror('Unable to create database. The SQL that was used: '.$installdb[1].', MySQL response: '.mysql_error($link)); } } else $dbaccess = true; if ($dbaccess) { if (mysql_select_db($db['name'], $link)) { $cnt = 0; $sql = $this->check_all_tables($cnt); for ($i=0,$c=count($sql);$i<$c;$i++) { if (strlen($sql[$i]) > 0) { $result = mysql_query($sql[$i], $link); if (!$result) { $errors .= 'Failed query: '.str_replace("\n", '
', $sql[$i]).'
'; $errors .= mysql_error($link).'
'; $error = $i; } } } if (!$error) { kprintheader('Installing MySQL database', 1, 0); ?>

Installation is now completed.

  • To log in to kPlaylist, reload this page (F5) and you should be able to log in.
  • The default login is admin with admin as the password. (Case sensitive)

Would you like to send the following information about this successful installation? This would give the kPlaylist site valuable information about supported systems, but also to increase the motivation knowing that this script is used. Thank you!

show_feedback(false); ?> Remember to visit http://www.kplaylist.net for updates and help.
insterror('MySQL installation may not be successful!

'.$errors); } else { $error = true; $this->insterror('Could not use the database ('.$db['name'].'), does it exist? MySQL response: '.mysql_error($link)); } } } else $this->insterror('Could not establish connection to MySQL!'); } function selectmethod() { kprintheader('Install', 1, 0); $this->htmltable('Welcome to the kPlaylist installer!'); ?>
To install kPlaylist, you'll need a working and running copy of MySQL. kPlaylist is based on the GNU GPL license, you can read the license here: http://www.kplaylist.net/COPYING
Click on one of the following installation methods to continue:
PS! If you are running kPlaylist on your own machine, the suggested method is to create a new database.
Need help? You'll find documentation here: kPlaylist Homepage
user = $db['user']; if ($this->dbmethod == NEWDBINSTALL) { if ($this->checkaccess($db['user'], $db['pass'], $err, $errno) == 0) $this->user = 'root'; } else if ($this->dbmethod == USEDBINSTALL) { $btx = 'disabled="disabled"'; } $this->htmltable(); ?>
dbmethod == NEWDBINSTALL) { ?>
dbmethod == NEWDBINSTALL) { ?> Please enter a user and a password who has access to create a new database and a user for kPlaylist. In most cases, the root user of MySQL should be used. Please open the kPlaylist file in a text editor and modify the section called $db to suit your database settings. Click 'Reload' when you are done.

Click here to view what the installer is going to do.

Click 'Continue' when ready to install !
user == 'root') { ?>
Note! The root password will only be used to create the tables, a new user called will be created for the operation of kPlaylist. If you like to change the name and password for this user, please edit the script, and click Reload.
'.$text.'
'; ?>
MySQL user: value="user; ?>" class="fatbuttom"/> default:
MySQL password: value="defpass; ?>" class="fatbuttom"/> Not shown, look in script ($db['pass'])
If you need to change the settings below, please edit them in the script and click Reload.
MySQL host:
MySQL database:
Table prepend
   
You'll find documentation here: kPlaylist Homepage
dbmethod) { case USEDBINSTALL: $this->user = $db['user']; $this->pass = $db['pass']; break; case NEWDBINSTALL: $this->user = $_POST['mysqluser']; if ($_POST['mysqlpass'] != $this->defpass) $this->pass = $_POST['mysqlpass']; else $this->pass = $db['pass']; break; } $err = ''; $errno = 0; if ($this->checkaccess($this->user, $this->pass, $err, $errno)) { $this->install(); } else { $msg = 'Could not login with the supplied user name and password! MySQL response: '.$err.''; if ($errno == 1251) $msg .= '

Seems like you are running MySQL 4.1/5.0 or newer. Please go to the following location to read the solution: http://www.kplaylist.net/forum/viewtopic.php?p=2231'; $this->install_form($msg); } } function handler() { global $db; $install = $upgrade = false; if (DBCONNECTION) { $cnt = 0; $sql = $this->check_all_tables($cnt); if ($cnt > 0) { if (count($sql) > 0) $upgrade = true; else $this->updateversion(); } else $install = true; } else $install = true; if ($install) { if (isset($_POST['usedatabase'])) $this->dbmethod = USEDBINSTALL; else if (isset($_POST['newdatabase'])) $this->dbmethod = NEWDBINSTALL; if (isset($_POST['dbmethod']) && is_numeric($_POST['dbmethod'])) $this->dbmethod = $_POST['dbmethod']; if ($this->dbmethod > 0) { if (isset($_POST['tomethod'])) $action = 1; else if (isset($_POST['doinstall'])) $action = 3; else $action = 4; } else { if (isset($_GET['showsql'])) $action = 2; else $action = 1; } switch($action) { case 1: $this->selectmethod(); break; case 2: $this->showsql(); break; case 3: $this->preliminstall(); break; case 4: $this->install_form(''); break; } die(); } else if ($upgrade) { if (isset($_POST['mysqluser'])) $this->user = $_POST['mysqluser']; else $this->user = $db['user']; if (isset($_POST['mysqlpass']) && $_POST['mysqlpass'] != $this->defpass) $this->pass = $_POST['mysqlpass']; else $this->pass = $db['pass']; if (count($sql) > 0) { if (isset($_POST['executeupgrade'])) $this->doupgrade($sql); else $this->show_upgrade($sql); } die(); } } function show_upgrade($sql, $error='') { global $db; kprintheader(); $this->htmltable('Welcome to the kPlaylist database upgrader.'); ?>
Due to changes in the database, we have to perform a simple database upgrade.

Please supply a user who has access to alter the MySQL database (usually the root user of MySQL.). You can also run the SQL calls listed below manually and reload this page.
Errors during upgrade, please check the errors below and try again.
SQL call(s) we will be executing:
', $sql[$i]).';

'; } ?>
MySQL database:
MySQL host:
If either the database name or the host is wrong, please edit the script and reload this page.
MySQL user:
MySQL password:
user, $this->pass, true); if ($link) { $this->mysqlserverv = mysql_get_server_info($link); if (mysql_select_db($db['name'], $link)) { for ($i=0,$c=count($sql);$i<$c;$i++) { if (strlen($sql[$i]) > 0) { if (!mysql_query($sql[$i], $link)) { $error = 'Could not execute: '.$sql[$i].'
MySQL response: '.mysql_error($link).'
'; break; } } } } else $error = 'Could not select the database name'; } else $error = 'Could not connect. Please check that the username or password is correct.'; if (strlen($error) == 0) $this->upgrade_ok(); else $this->show_upgrade($sql, $error); } function updateversion() { global $app_build, $app_ver, $setctl; $sql = 'UPDATE '.TBL_KPLAYVERSION.' SET app_build = "'.$app_build.'", app_ver = "'.$app_ver.'"'; if (UTF8MODE) $setctl->set('utf8mode', 1); if ($this->oldbuild != 0 && $this->oldbuild < 444) $setctl->set('reupdate', 1); db_execcheck($sql); } function upgrade_ok() { global $setctl; $setctl->load(); kprintheader(); $this->htmltable('kPlaylist database upgraded!'); ?>
Upgrading performed successfully. Enjoy your new version of kPlaylist!

Reload (F5) this page to get started.

Would you like to send the following information about this successful upgrade? This would give the kPlaylist site valuable information about supported systems, but also to increase the motivation knowing that this script actually is used. Thank you!

show_feedback(true); ?>
needcheck() || (DBCONNECTION && UTF8MODE && !$setctl->get('utf8mode'))) $kpinst->handler(); class kp_playlist { function kp_playlist($listid=-1) { $this->listid = -1; $this->name = ''; $this->status = 0; $this->uid = -1; $this->public = 0; $this->loaded = false; if ($listid != -1) $this->load($listid); } function getuid() { return $this->uid; } function getstatus() { return $this->status; } function setstatus($status) { $this->status = $status; } function setname($name) { $this->name = $name; } function getname() { return $this->name; } function isloaded() { return $this->loaded; } function update() { if ($this->loaded) db_execquery('UPDATE '.TBL_PLAYLIST.' SET name = "'.myescstr($this->name).'", public = '.$this->public.', status = '.$this->status.' WHERE listid = '.$this->listid); } function setpublic($public) { $this->public = $public; } function getpublic() { return $this->public; } function createnew($u_id, $name, $public) { $res = db_execquery('INSERT INTO '.TBL_PLAYLIST.' SET name = "'.$name.'", u_id = '.$u_id.', public = '.$public); if ($res) return $this->load(mysql_insert_id()); } function load($listid) { $res = db_execquery('SELECT * FROM '.TBL_PLAYLIST.' WHERE listid = '.$listid); if ($res && mysql_num_rows($res) > 0) { $row = mysql_fetch_assoc($res); $this->listid = $listid; $this->public = $row['public']; $this->name = $row['name']; $this->status = $row['status']; $this->uid = $row['u_id']; $this->loaded = true; return true; } return false; } function anyaccess() { global $u_id, $valuser; if ($this->public > 0) return true; if ($u_id == $this->uid) return true; if ($valuser->isadmin()) return true; return false; } function soleaccess() { global $u_id, $valuser; if ($u_id == $this->uid || $valuser->isadmin()) return true; return false; } function writeaccess() { global $u_id, $valuser; if ($u_id == $this->uid || $this->public == 3 || $valuser->isadmin()) return true; return false; } function appendaccess() { global $u_id, $valuser; if ($u_id == $this->uid || $this->public == 2 || $this->public == 3 || $valuser->isadmin()) return true; return false; } function getres($sql='sid') { return db_execquery('SELECT '.$sql.' FROM '.TBL_PLAYLIST_LIST.' WHERE listid = '.$this->listid.' ORDER BY seq ASC'); } function addtoplaylist($sids) { $result = db_execquery('SELECT * FROM '.TBL_PLAYLIST_LIST.' WHERE listid = '.$this->listid); $row = mysql_num_rows($result); $cntr=$row; $cntr++; if (count($sids) > 0) { for ($i=0,$c=count($sids);$i<$c;$i++) { db_execquery('INSERT INTO '.TBL_PLAYLIST_LIST.' (listid, sid, seq) VALUES ('.$this->listid.', '.$sids[$i].', '. $cntr.')'); $cntr++; } } } function play() { if ($this->listid >= 0) { $result = $this->getres(); if ($result && mysql_num_rows($result) > 0) { $tunes = array(); $i=0; while ($row = mysql_fetch_row($result)) $tunes[$i++] = $row[0]; $cnt = $i; if ($this->status) { srand ((double)microtime()*1000000); for ($j=count($tunes)-1; $j>0; $j--) { if (($i = rand(0,$j))<$j) { $swp=$tunes[$i]; $tunes[$i]=$tunes[$j]; $tunes[$j]=$swp; } } } $m3ug = new m3ugenerator(); for ($i=0;$i<$cnt;$i++) $m3ug->sendlink2($tunes[$i]); $m3ug->start(); return true; } } return false; } function remove() { if ($this->loaded) { db_execquery('DELETE FROM '.TBL_PLAYLIST_LIST.' WHERE listid = '.$this->listid); db_execquery('DELETE FROM '.TBL_PLAYLIST.' WHERE listid = '.$this->listid); return true; } return false; } function selectaccess() { $out = ''; $options = array(0 => 10, 1 => 42, 2 => 367, 3 => 368); foreach($options as $id => $langid) { $out .= ''; } return $out; } function sortoriginal() { $result = db_execquery('SELECT id from '.TBL_PLAYLIST_LIST.' WHERE listid = '.$this->listid.' ORDER BY ID ASC'); $seq = 1; while ($row = mysql_fetch_row($result)) { $id = $row[0]; db_execquery('UPDATE '.TBL_PLAYLIST_LIST.' SET seq = '.$seq.' WHERE id = '.$id, true); $seq++; } } function sortalphabetic() { $result = db_execquery('SELECT pl.id AS id FROM '.TBL_PLAYLIST_LIST.' pl, '.TBL_SEARCH.' s WHERE pl.listid = '.$this->listid.' AND pl.sid = s.id ORDER BY s.free ASC'); $seq = 1; while ($row = mysql_fetch_row($result)) { db_execquery('UPDATE '.TBL_PLAYLIST_LIST.' SET seq = '.$seq.' WHERE id = '.$row[0], true); $seq++; } } function sortrandom() { $result = db_execquery('SELECT id from '.TBL_PLAYLIST_LIST.' WHERE listid = '.$this->listid.' ORDER BY ID ASC'); srand(make_seed()); while ($row = mysql_fetch_row($result)) db_execquery('UPDATE '.TBL_PLAYLIST_LIST.' SET seq = '.getrand().' WHERE id = '.$row[0], true); $this->rewriteseq(); } function rewriteseq() { $result = db_execquery('SELECT * FROM '.TBL_PLAYLIST_LIST.' WHERE listid = '.$this->listid.' ORDER BY seq ASC'); if (mysql_num_rows($result) > 0) { $cntr=1; while ($row = mysql_fetch_array($result)) { db_execquery('UPDATE '.TBL_PLAYLIST_LIST.' SET seq = '.$cntr.' WHERE id = '.$row['id'], true); $cntr++; } } } function savesequence($sequencelist) { $result = db_execquery('SELECT id FROM '.TBL_PLAYLIST_LIST.' WHERE listid = '.$this->listid.' ORDER BY seq ASC'); $data = array(); $cnt=0; while ($row = mysql_fetch_array($result)) { $data['id'][$cnt] = $row['id']; $data['seq'][$cnt] = (int)$sequencelist[$cnt]; $cnt++; } if ($cnt > 0) { for ($i=0;$i<$cnt;$i++) db_execquery('UPDATE '.TBL_PLAYLIST_LIST.' SET seq = '.$data['seq'][$i].' WHERE id = '.$data['id'][$i]); $this->rewriteseq(); } } function removeduplicates() { $result = db_execquery('SELECT sid,id FROM '.TBL_PLAYLIST_LIST.' WHERE listid = '.$this->listid.' ORDER BY ID ASC'); $sids = array(); while ($row = mysql_fetch_row($result)) { $sid = $row[0]; $id = $row[1]; if (isset($sids[$sid])) db_execquery('DELETE FROM '.TBL_PLAYLIST_LIST.' WHERE id = '.$id, true); $sids[$sid] = true; } $this->rewriteseq(); } function removeentry($id) { db_execquery('DELETE FROM '.TBL_PLAYLIST_LIST.' WHERE id = '.$id.' AND listid = '.$this->listid); } } function pl_shared($width) { global $runinit, $u_id; $out = ''; $res = db_execquery('SELECT name, listid FROM '.TBL_PLAYLIST.' WHERE public = 1 AND u_id != '.$u_id.' ORDER by name ASC'); if (mysql_num_rows($res) > 0) { $out .= ''; $out .= ' '; $options = array(); while ($row = mysql_fetch_assoc($res)) $options[] = array($row['listid'], $row['name']); $out .= genselect('sel_shplaylist', $options, db_guinfo('defshplaylist'), false, 'file', $width, 'sel_shplaylist'); $out .= '  '; if (WINDOWPLAYER) { $kpwjs = new kpwinjs(); $out .= ' '; } else $out .= ' '; $out .= ''; } return $out; } function playlist_editor($plid, $prev, $sort = 0) { global $runinit, $cfg; $kpd = new kpdesign(); $kpd->top(false, get_lang(59)); $radiocolor = array(0 => '#7FFFD4', 1 => '#FFBF00'); $radioseq = array(); $kppl = new kp_playlist($plid); if ($kppl->isloaded() && $kppl->anyaccess()) { if ($kppl->soleaccess()) $access = 1; else if ($kppl->writeaccess()) $access = 2; else $access = 3; if (isset($_POST['scrolly'])) $scrolly = $_POST['scrolly']; else if (isset($_GET['scrolly'])) $scrolly = $_GET['scrolly']; else $scrolly = 0; if (ALLOWDOWNLOAD && db_guinfo('u_allowdownload') && $cfg['archivemode'] && db_guinfo('allowarchive')) $dlbutton = true; else $dlbutton = false; $result = db_execquery('SELECT * FROM '.TBL_PLAYLIST_LIST.' WHERE listid = '.$plid.' ORDER BY seq ASC'); if ($result) $cnt = mysql_num_rows($result); else $cnt = 0; if (UNAUTHORIZEDSTREAMS) $extra = 'i  '; else $extra = ''; echo blackboxpart(get_lang(46, $kppl->getname(), $cnt), 1, $extra); if (WINDOWPLAYER) { $kpwjs = new kpwinjs(); $playcode = ''; } else $playcode = ''; ?>
'; if ($access == 1) echo ''; else echo $kppl->getname(); echo ' '.$min.' AND playlistid = '.$plid); if (mysql_num_rows($res) > 0 && ($access == 1 || $access == 2)) { echo ''; echo ''; } ?>
'.'  '; echo $playcode.'  '; if ($access == 1) echo ''.'  '; if ($dlbutton) echo ''; ?> '; if ($access == 1) echo ''; else echo ''; echo ''; if ($access == 1) echo 'getstatus()).'/>'; else echo 'getstatus()).'/>'; echo ''; if ($access == 1) echo ''; echo '  '; ?>
'; $sorts = array(0 => get_lang(170), 1 => get_lang(171), 2 => get_lang(173), 3 => get_lang(180)); echo selectoptions($sorts, $sort); echo '  '; echo ''; } ?>
'.get_lang(369).'
'; $colorc = 0; while ($row = mysql_fetch_assoc($res)) { $kpr = new kpradio($row['stationid']); if ($kpr) { if (!isset($radiocolor[$colorc])) $radiocolor[] = '#CCCCCC'; if (!isset($radioseq[$kpr->getcurseq()])) $radioseq[$kpr->getcurseq()] = $radiocolor[$colorc]; echo '  '; $colorc++; } } echo '  '; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if ($access == 1 || $access == 2) echo blackboxpart(get_lang(47),1); else echo blackboxpart(get_lang(48),1); if ($cnt > 0) { echo ''; ?> '; echo ''; echo ''; $totalsec = $count = $countfails = 0; while ($row = mysql_fetch_array($result)) { $count++; $id = $row['id']; $f2 = new file2($row['sid'], true); if ($f2) { $id3 = $f2->getid3(); if (is_numeric($id3['lengths'])) $totalsec += $id3['lengths']; $seq = (int)$row['seq']; if (isset($radioseq[$seq])) echo ''; else if (($count % 2) == 0) echo ''; else echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } } echo ''; echo ''; echo ''; $secs = $totalsec; $days = floor($secs/86400); $secs = $secs % 86400; $hours = floor($secs/3600); $secs = $secs % 3600; $min = floor($secs/60); $secs = $secs % 60; $totshow = get_lang(187, $days, $hours, $min, $secs); echo ''; echo ''; echo ''; echo ''; echo '
'; echo ''; echo ''; if ($access == 1 || $access == 2) echo ''; else echo lzero($row['seq']); echo ''; if (is_numeric($id3['bitrate']) && $id3['bitrate'] != 0 && strlen($id3['length']) != 0) echo $id3['bitrate'].'kb - '.$id3['length']; echo ''; if ($access == 1 || $access == 2) echo ''; echo 'mkalink().'>'.checkchs($f2->gentitle(array('title', 'artist'), 60)).'
'.get_lang(55).''.$totshow.'
'; echo '  '.get_lang(73).'    '; echo '  '; echo get_lang(57).'    '; if ($access == 1 || $access == 2) { echo '  '; echo get_lang(58).'  '; } echo '
'; } else echo get_lang(302); if ($access == 1 || $access == 2) echo blackboxpart(get_lang(47),2); else echo blackboxpart(get_lang(48),2); echo '
'; ?> bottom(); } function playlist_new() { kprintheader(get_lang(61), 1); $kpl = new kp_playlist(); ?>
 
stationid = $stationid; $this->name = ''; $this->playlistid = 0; $this->pass = ''; $this->loop = 0; $this->curseq = 0; $this->nextseq = 0; $this->loaded = false; $this->reload = 0; if ($this->stationid != 0) $this->load($this->stationid); } function isloaded() { return $this->loaded; } function getname() { return $this->name; } function selectstations() { $res = db_execquery('SELECT stationid, name FROM '.TBL_ICERADIO); $sels = array(); while ($row = mysql_fetch_assoc($res)) $sels[] = array($row['stationid'], $row['stationid'].': '.$row['name']); if (count($sels) > 0) return genselect('stationid', $sels, db_guinfo('defstationid')); } function updateseq($seq) { db_execquery('UPDATE '.TBL_ICERADIO.' SET curseq = '.$seq.', nextseq = 0, lactive = '.time().' WHERE stationid = '.$this->stationid); $this->curseq = $seq; } function validpass($pass) { if ($this->loaded && $pass == $this->pass) return true; return false; } function load($id) { $this->stationid = $id; $res = db_execquery('SELECT * FROM '.TBL_ICERADIO.' WHERE stationid = '.$id); if (mysql_num_rows($res) > 0) { $row = mysql_fetch_assoc($res); $this->name = $row['name']; $this->playlistid = $row['playlistid']; $this->pass = $row['pass']; $this->loop = $row['loop']; $this->curseq = $row['curseq']; $this->nextseq = $row['nextseq']; $this->loaded = true; } } function getcurseq() { return $this->curseq; } function getnextseq() { if ($this->nextseq == 0) return $this->curseq + 1; return $this->nextseq; } function setnextseq($nextseq) { if ($nextseq != $this->getnextseq()) $this->nextseq = $nextseq; } function getlist() { $res = db_execquery('SELECT name, listid FROM '.TBL_PLAYLIST.' WHERE (public = 1 OR public = 2 OR public = 3)'); $sels = array(); while ($row = mysql_fetch_assoc($res)) $sels[] = array($row['listid'], $row['name']); if (count($sels) > 0) return genselect('playlistid', $sels, $this->playlistid); } function fromPost() { $this->name = frpost('name'); $this->playlistid = frpost('playlistid', true, 0); $this->pass = frpost('pass'); $this->loop = frpost('loop'); $this->reload = frpost('reload'); } function isok() { if (!empty($this->name) && !empty($this->pass)) return true; } function update() { db_execquery('UPDATE '.TBL_ICERADIO.' SET name = "'.myescstr($this->name).'", nextseq = '.$this->nextseq.', pass = "'.myescstr($this->pass).'", playlistid = '.myescstr($this->playlistid).', `loop` = '.verchar($this->loop).' WHERE stationid = '.$this->stationid); $this->reload = 1; } function store() { db_execquery('INSERT INTO '.TBL_ICERADIO.' SET name = "'.myescstr($this->name).'", pass = "'.myescstr($this->pass).'", playlistid = '.myescstr($this->playlistid).', `loop` = '.verchar($this->loop)); $this->stationid = mysql_insert_id(); $this->reload = 1; } function remove() { db_execquery('DELETE FROM '.TBL_ICERADIO.' WHERE stationid = '.$this->stationid); } function edit($message='') { kprintheader('', 1, 0); ?>
getlist(); ?>
loop); ?> class="fatbuttom"/>
 
stationid != 0) { ?>
loaded) { $replyid = 0; if ($this->nextseq != 0) $res = db_execquery('SELECT sid, seq FROM '.TBL_PLAYLIST_LIST.' WHERE seq = '.$this->nextseq.' AND listid = '.$this->playlistid); else $res = db_execquery('SELECT sid, seq FROM '.TBL_PLAYLIST_LIST.' WHERE seq > '.$this->curseq.' AND listid = '.$this->playlistid.' ORDER BY seq ASC'); if (mysql_num_rows($res) > 0) { while ($replyid == 0 && $row = mysql_fetch_row($res)) { if (isset($row[0])) { $f2 = new file2($row[0], true); $fd = new filedesc($f2->fname); if ($fd->found && $fd->m3u) $replyid = $row[0]; $this->curseq = $row[1]; } $this->updateseq($this->curseq); } if ($replyid != 0) return $replyid; } if ($first && $this->loop) { $this->updateseq(0); return $this->getnext(false); } return 0; } } } function basedir_rewrite($basedirs) { $ignore = array(); $s_base_dir = explode(';',$basedirs); $value = ''; for ($i=0;$iset('report_attempts', 0); $setctl->set('windows', 0); $setctl->set('require_https', 0); $setctl->set('usersignup', 0); $setctl->set('mailmp3', 0); $setctl->set('bulletin', 0); $setctl->set('approvesignup', 0); $setctl->set('urlsecurity', 0); $setctl->set('publicrssfeed', 0); $setctl->set('shoutbox', 0); break; case 1: $setctl->set('includeheaders', 0); $setctl->set('showkeyteq', 0); $setctl->set('showupgrade', 0); $setctl->set('showstatistics', 0); $setctl->set('albumcover', 0); $setctl->set('albumresize', 0); $setctl->set('fetchalbum', 0); $setctl->set('showlyricslink', 0); break; case 2: $setctl->set('streamingengine', 0); $setctl->set('allowdownload', 0); $setctl->set('allowseek', 0); $setctl->set('virtualdir', 0); $setctl->set('disksync', 0); $setctl->set('sendfileextension', 0); $setctl->set('unauthorizedstreams', 0); $setctl->set('writeid3v2', 0); $setctl->set('optimisticfile', 0); $setctl->set('lamesupport', 0); $setctl->set('enableupload', 0); break; case 4: $setctl->set('networkmode', 0); break; } foreach ($data as $key => $value) { switch ($key) { case 'base_dir': $value = basedir_rewrite($value); if ($value != $setctl->get('base_dir')) $setctl->set('basedir_changed', 1); break; case 'timeout': if ($value < 600 && $value != 0) $value = $setctl->get('timeout'); break; case 'uploadpath': if (!empty($value)) $value = slashtranslate($value); break; case 'filetemplate': $value = stripcslashes($value); break; case 'homepage': $value = htmlentities($value); break; case 'albumfiles': $value = stripcslashes($value); break; case 'uploadflist': $value = stripcslashes($value); break; case 'externimagespath': if (!empty($value)) if ($value[strlen($value)-1] != '/') $value .= '/'; break; } $setctl->set($key, $value); } } } function helplink($section, $name='?', $class='') { global $deflanguage, $app_build; if (!empty($class)) $x = ' class="'.$class.'"'; else $x = ''; return ''.$name.''; } function store_filetype($id, $m3u, $search, $logaccess, $mime, $extension='') { if ($id != 0) { db_execquery('UPDATE '.TBL_FILETYPES.' SET m3u = '.$m3u.', search = '.$search.', logaccess = '.$logaccess.', mime = "'.$mime.'", extension = "'.$extension.'" WHERE id = '.$id); return $id; } else { db_execquery('INSERT INTO '.TBL_FILETYPES.' SET m3u = '.$m3u.', search = '.$search.', logaccess = '.$logaccess.', mime = "'.$mime.'", enabled = 1, getid = 0, extension = "'.$extension.'"'); return mysql_insert_id(); } } function edit_filetype($id, $reload = false, $msg='') { if ($id != 0) { $res = db_execquery('SELECT * FROM '.TBL_FILETYPES.' WHERE id = '.$id); $row = mysql_fetch_assoc($res); } else { $row['extension'] = ''; $row['mime'] = ''; $row['m3u'] = 1; $row['search'] = 1; $row['logaccess'] = 1; } kprintheader(get_lang(209), 1, 0); ?>
>
>
>
 
*
*
*
 
get('default_language'),'default_language'); ?> getchecked('windows'); ?>/> value="1" name="require_https" getchecked('require_https'); ?>/> getchecked('report_attempts'); ?>/> getchecked('usersignup'); ?>/> array(0, htmlentities('<').get_lang(148).htmlentities('>'))); $res = db_execquery('SELECT u_login, u_id FROM '.TBL_USERS.' WHERE utemplate = 1'); if ($res) while ($row = mysql_fetch_assoc($res)) $options[] = array($row['u_id'], $row['u_login']); echo genselect('signuptemplate', $options, $setctl->get('signuptemplate')); ?> getchecked('approvesignup'); ?>/> getchecked('mailmp3'); ?>/> get('mailmethod'); ?> name="shoutbox" getchecked('shoutbox'); ?>/> getchecked('bulletin'); ?>/> getchecked('urlsecurity'); ?>/> getchecked('publicrssfeed'); ?>/> getchecked('includeheaders'); ?>/> load()) { ?> getchecked('showkeyteq'); ?>/> getchecked('showupgrade'); ?>/> getchecked('showstatistics'); ?>/> getchecked('albumcover'); ?>/> getchecked('albumresize'); ?>/>   getchecked('fetchalbum'); ?>/> getchecked('showlyricslink'); ?>/>   getchecked('virtualdir'); ?>/> getchecked('virtualdir')) echo 'disabled="disabled"'; ?> id="disksync" name="disksync" getchecked('disksync'); ?>/> getchecked('optimisticfile'); ?>/> get('streamlocation'); if (strlen($setstr) == 0) { $setstr = $phpenv['streamlocation']; $strjs = true; } else $strjs = false; ?> />   getchecked('allowseek'); ?>/> getchecked('allowdownload'); ?>/> name="streamingengine" getchecked('streamingengine'); ?>/> getchecked('sendfileextension'); ?>/> getchecked('unauthorizedstreams'); ?>/> name="writeid3v2" getchecked('writeid3v2'); ?>/> name="lamesupport" getchecked('lamesupport'); ?>/> '/> getchecked('enableupload'); $phpupload = ini_get('file_uploads'); if ($phpupload == 0 || $phpupload == 'off') echo ' disabled="disabled"'; ?>/> '; else echo ''; ?>
'.get_lang(109).'  '; echo ''.get_lang(71).' '; } ?>
'.get_lang(69).' ';?>
getchecked('networkmode'); ?>/> getall(); for($i=0,$c=count($hosts);$i<$c;$i++) { $host = $hosts[$i]; $cnt++; if ($cnt % 2 == 0) echo ''; else echo ''; echo ''; echo ''; echo ''; echo ''; } ?>
'; echo ''.get_lang(109).' '; echo ''.get_lang(71).''; echo ''.$host->geturl().''; if ($host->getenabled()) { echo ''.get_lang(361).' '; } else { echo ''.get_lang(283).''; } echo '
'.get_lang(69).' ';?>
'.$infourl.''); ?> '; $tests = array('php5', 'getid3', 'iconv', 'zip', 'curl', 'multibyte', 'gd/image', 'openssl'); echo '
'; echo ''; foreach($tests as $name) { $testok = false; $info = ''; switch($name) { case 'php5': if (isphp5()) $testok = true; break; case 'getid3': if (GETID3_V == 16 || GETID3_V == 17) $testok = true; $info = 'http://www.kplaylist.net/forum/viewtopic.php?t=1003'; break; case 'iconv': if (extension_loaded('iconv')) $testok = true; break; case 'zip': if (extension_loaded('zip')) $testok = true; $info = 'http://www.kplaylist.net/forum/viewtopic.php?t=2187'; break; case 'curl': if (extension_loaded('curl')) $testok = true; break; case 'multibyte': if (extension_loaded('mbstring')) $testok = true; break; case 'gd/image': if (function_exists('imagecreatetruecolor') && function_exists('imagecopyresampled') && function_exists('imagecreatefromgif') && function_exists('imagecreatefrompng') && function_exists('imagecreatefromjpeg') && extension_loaded('gd')) $testok = true; break; case 'openssl': if (extension_loaded('openssl')) $testok = true; break; } echo ''; echo ''; echo ''; echo ''; } echo '
'.$name.''; if ($testok) echo get_lang(204); else { echo ''.get_lang(205).''; if (strlen($info) > 0) echo ' ?'; } echo '
'; echo '
'; echo ''; $infos = array('memory_limit', 'max_execution_time', 'file_uploads', 'upload_max_filesize', 'post_max_size', 'allow_url_fopen'); foreach($infos as $name) { $value = @ini_get($name); echo ''; } echo '
'.$name.''.$value.'
'; echo '
'; break; } } function settings_edit($reload = 0, $page = 0) { global $phpenv, $setctl; kprintheader(get_lang(126), 1, 0); $menuclass = array('header', 'header', 'header', 'header', 'header', 'header'); $menuclass[$page] = 'headermarked'; $widths = array('35%', '50%', '15%'); function pagelink($id, $reload) { return PHPSELF.'?action=settingsview&reload='.$reload.'&page='.$id; } ?>
 
loadbyuserpass($user, $pass)) { $u_id = $kpu->getid(); db_execquery('INSERT INTO '.TBL_SESSION.' SET u_id = '.$kpu->getid().', login = '.time().', refreshed = '.time().', ip = '.ip2long($phpenv['remote'])); $u_cookieid = mysql_insert_id(); if ($kpu->get('u_access') != 2) { if ($cfg['numberlogins'] > 0) { $res = db_execquery('SELECT sessionid FROM '.TBL_SESSION.' WHERE u_id = '.$kpu->getid().' AND logout = 0 ORDER BY sessionid DESC'); $cnt = 0; while ($row = mysql_fetch_row($res)) { if ($cnt >= $cfg['numberlogins']) db_execquery('UPDATE '.TBL_SESSION.' SET logout = '.time().' WHERE sessionid = '.$row[0]); $cnt++; } } } if ($setctl->get('timeout') > 0 && isset($_POST['rememberme'])) $expiration = time() + $setctl->get('timeout'); else $expiration = 0; switch ($cfg['authtype']) { case 2: if (strlen(session_id()) > 0) { $_SESSION[$cfg['cookie']] = $u_id.'-'.$u_cookieid; $status = 1; } else $status = 2; break; default: if (setcookie($cfg['cookie'], $u_id.'-'.$u_cookieid, $expiration)) $status = 1; else $status = 2; break; } } } } } else $status = 1; return $status; } function authset($check=true) { $key = ''; global $cfg; switch ($cfg['authtype']) { case 2: if (isset($_SESSION[$cfg['cookie']])) $key = $_SESSION[$cfg['cookie']]; break; default: if (isset($_COOKIE[$cfg['cookie']])) $key = $_COOKIE[$cfg['cookie']]; break; } if (strlen($key) > 0) { if ($check) return true; else return $key; } return false; } function timeout($usertime) { global $setctl; if ($setctl->get('timeout') != 0) if (($usertime + $setctl->get('timeout')) < time()) return true; return false; } function db_verify_stream($cookie = '', $ip, $stream) { global $u_id, $setctl, $cfg, $valuser; if ($cfg['disablelogin']) { $u_id = $cfg['assumeuserid']; loadvalidated($u_id); if ($valuser === false) { echo $cfg['assumeuserid'].' has a ID to a user that does not exist. Please set it correctly in the script and reload this page.'; die(); } return 1; } else { $ckexp = explode('-', $cookie); if (count($ckexp) == 2 && is_numeric($ckexp[0]) && is_numeric($ckexp[1])) { if ($stream) $sql = 'SELECT u_id, login as u_time, sstatus FROM '.TBL_SESSION.' WHERE u_id = '.$ckexp[0].' AND sessionid = '.$ckexp[1]; else $sql = 'SELECT u_id, login as u_time, sstatus FROM '.TBL_SESSION.' WHERE u_id = '.$ckexp[0].' AND sessionid = '.$ckexp[1].' AND logout = 0'; $result = db_execquery($sql); if ($result) { $row = mysql_fetch_array($result); $u_id = $row['u_id']; loadvalidated($u_id); $time = $row['u_time']; if ($valuser && !timeout($row['u_time'])) { if ($row['sstatus'] == 2) $valuser->setro('u_access', 1); return 1; } } } return 0; } } function getlastlogin($uid) { $res = db_execquery('SELECT * FROM '.TBL_SESSION.' WHERE u_id = '.$uid.' ORDER BY sessionid DESC LIMIT 1'); if ($res && mysql_num_rows($res) > 0) return mysql_fetch_assoc($res); } function addhistory($u_id, $sid, $tid = 0) { global $runinit; $active = 1; if ($runinit['astream']) $mid = mysql_thread_id(); else { $mid = 0; $active = 0; } if (db_execquery('INSERT INTO '.TBL_MHISTORY.' SET active = '.$active.', mid = '.$mid.', u_id = '.$u_id.', s_id = '.$sid.', utime = '.time().', tid = '.$tid)) return mysql_insert_id(); } function updateactive($id) { global $runinit; if ($runinit['astream']) db_execquery('UPDATE '.TBL_MHISTORY.' SET active = 1, mid = '.mysql_thread_id().' WHERE h_id = '.$id); } function updatehistory($id, $pos, $fpos) { $res = db_execquery('SELECT h.dwritten, s.fsize FROM '.TBL_MHISTORY.' h, '.TBL_SEARCH.' s WHERE h_id = '.$id.' AND s.id = h.s_id'); if ($res && mysql_num_rows($res) == 1) { $row = mysql_fetch_row($res); $add = (int) $row[0]; $add = $add + $pos; $size = $row[1]; $cpercent = 0; if ($fpos > 0) $cpercent = ($fpos / $row[1]) * 100; if ($add > $size) $add = $size; if ($size > 0 && $add > 0) { $dpercent = ($add / $size) * 100; $sql = 'UPDATE '.TBL_MHISTORY.' SET dwritten = '.$add.', dpercent = '.number_format($dpercent,0); if (!connection_aborted()) $sql .= ', cpercent = '.number_format($cpercent,0); $sql .= ' WHERE h_id = '.$id; db_execquery($sql); } } } function getlasthistory($sid, $uid, $rhid=false) { $res = db_execquery('SELECT s_id, utime, h_id FROM '.TBL_MHISTORY.' WHERE s_id = '.$sid.' AND u_id = '.$uid.' ORDER BY h_id DESC LIMIT 1'); if ($res !== false && mysql_num_rows($res) > 0) { $row = mysql_fetch_assoc($res); if ($rhid) return $row['h_id']; else return $row['utime']; } return 0; } function get_archiver_combo($default) { global $archivers; $out = ''; foreach($archivers as $id => $archiverdata) { if (is_array($archiverdata) && $archiverdata[0]) { $out .= '