Skip Navigation GutterStar.net Home
"We're all in the gutter, but some of us are looking at the stars." Oscar Wilde


Users currently online:

Email this page...
 
Bookmark with...
 
Listen to Streaming Alternative Rock while browsing...


Support GutterStar.net by donating...
World News Central
Download Center
Audio Entertainment
Web and Software Development
Online Gaming
Graphic and Literary Arts
Forum Archive
Member Login
Manage Subscriptions
Privacy Policy
Contact Us
Try the NEW Advanced Amazon Search Engine, where finding what you want has never been so easy! (Optimized for IE)
GutterStar.net, Bridging Technology and Accessibility

Site News... (Updated: 6/29/2009)


Sponsors
Become a Sponsor

Content Starts Here

The GutterStar.net Dynamic M3U Generator - V3.1!

 
Change Log:
V3.1: Added: Display an optional advertisement for your site within a popup window to discourage hotlinking. To configure this feature, look in the stream_config.php file.
V3.0: Fix: Includes a large bug fix which corrects the calculation of the authorization code when generated towards the end of the month.

Introduction


To give you an example of what this PHP script actually does... The following link will trigger an M3U playlist to be dynamically created. (The streaming audio that is being indexed, is the same as is available from our Streaming Alternative Rock Page.) This will cause all of the MP3 audio files within a folder on the server to be indexed, dynamically written to an M3U file, then opened in your default media player!

That's right! These audio files are not being indexed from a static M3U playlist, but rather, are being generated from scratch based on the mp3 files within the audio folder itself. If any of the audio files are deleted, renamed, or more audio files are added, the changes will automatically be reflected within this dynamically generated M3U playlist.

As if this functionality weren't enough, check this out... When the M3U playlist is created, it includes an automatic timeout feature, which causes the audio stream to timeout after a set interval. The timeout length is totally customizable! For example, you could timeout the stream after 35 seconds, 1 hour and 2 minutes, 1 day and 3 hours, or whatever you like!

Even more, there are built in security features that prevent your listeners from being able to directly download your audio files, or even be able to tell where they are actually located on the server!


In the example implementation above, the current settings will cause the audio stream to time out after 1 hour has elapsed. This countdown will always start at the moment when the link for the script is activated, which will be different for each user. This functionality is truly awesome! When this time out occurs, the user will not be able to listen to anymore of the audio stream without reactivating the script. These settings are fully configurable however, to fit your needs.

How to Configure

 
To configure the script for your website, simply edit the file named "stream_config.php". An excerpt from the code contained within this file follows...

/*
To begin streaming mp3 audio from your website:
1. Configure the variables below.
2. Upload all of these files to the folder where you want to access the script. All should reside within the same logical folder.
3. Create a link to the file named "stream_gen_m3u.php"
*/

// The URL path of the folder where your audio files reside. This path must not end with a "/"
$url_path = 'http://domain.com/folder';

// The relative folder where the audio files are located. This path must start where this script originates, and point to the same location as indicated above. Must not end with a "/".
$folder_path = './folder';

// The extention of your audio files. This must not begin with a "."
$extension = 'mp3';

// The URL path that points to "stream.php"
$stream_url = 'http://domain.com/stream.php';

// The relative path and file name of the schedule script file. This should be fine if left within the same folder as "stream.php"
$schedule_file = './stream_schedule.php';

// The relative path and file name of the M3U file. This will automatically be created.
$m3u_file = './stream_m3u.m3u';

// Set how often the audio stream will expire, so visitors will have to return to your site to continue listening.
// The time will automatically be incremented by whatever numbers you specify below.
// As an example, the default value below, will cause the audio stream to timeout after 1 hour, 30 minutes, and 45 seconds after the script first runs.

// The specified number of months.
$time_months = 0;
// The specified number of days.
$time_days = 0;
// The specified number of hours.
$time_hours = 1;
// The specified number of minutes.
$time_minutes = 30;
// The specified number of seconds.
$time_seconds = 45;

// Encode string, this will encode the Authorization code to prevent tampering within the playlist.
// This string must consist of ten individual letters. You can also change the case of individual letters to increase the security.
// Make sure that there are no repeat characters, and no spaces.
$security_string = 'abcdefghij';

// After uploading this file, set the permission to deny all Read access. Usually 600 will work for this.

Further instructions are included within the download. Simply view the file named "Instructions.htm" for additional details.

Download

 
To be notified automatically whenever a new script release is available, Click here to subscribe to the GutterStar.net Update List.

 
Thank you for visiting GutterStar.net!

Copyright GutterStar.net, all rights reserved.
  PHP   Paradigm  imperative, object-oriented   Appeared in  1995   Designed by  Rasmus Lerdorf   Developer  The PHP Group   Latest release  5.2.5/ 8 November 2007   Typing discipline  Dynamic, weak   Influenced by  C, Perl, Java, C++, Python   OS  Cross-platform   License  PHP License   Website  http://php.net/  table end PHP is a computer scripting language originally designed for producing dynamic web pages. [1] The name PHP is a recursive acronym for PHP: Hypertext Preprocessor. PHP is used mainly in server-side scripting , but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses. The main implementation is produced by The PHP Group and released under the PHP License . This implementation serves to define a de facto standard for PHP, as there is no formal specification . The most recent version of PHP is 5.2.5, released on 8 November 2007 . It is considered to be free software by the Free Software Foundation. [2] PHP was written as a set of Common Gateway Interface (CGI) binaries in the C programming language by the Danish/Greenlandic programmer Rasmus Lerdorf in 1994, to replace a small set of Perl scripts he had been using to maintain his personal homepage. [3] Lerdorf initially created PHP to display his résumé and to collect certain data, such as how much traffic his page was receiving. Personal Home Page Tools was publicly released on 8 June 1995 after Lerdorf combined it with his own Form Interpreter to create PHP/FI (this release is considered PHP version 2). [4] Zeev Suraski and Andi Gutmans , two Israeli developers at the Technion IIT , rewrote the parser in 1997 and formed the base of PHP 3, changing the language's name to the recursive initialism PHP: Hypertext Preprocessor. The development team officially released PHP/FI 2 in November 1997 after months of beta testing. Public testing of PHP 3 began and the official launch came in June 1998. Suraski and Gutmans then started a new rewrite of PHP's core, producing the Zend Engine in 1999. [5] They also founded Zend Technologies in Ramat Gan , Israel, which actively manages the development of PHP. In May 2000, PHP 4, powered by the Zend Engine 1.0, was released. The most recent update released by The PHP Group, is for the older PHP version 4 code branch which, as of January 2008 , is up to version 4.4.8. PHP 4 will be supported by security updates until August 8, 2008. [6] On July 13, 2004 , PHP 5 was released powered by the new Zend Engine II. PHP 5 included new features such as: [7] • Improved support for object-oriented programming • The PHP Data Objects extension, which defines a lightweight and consistent interface for accessing databases • Performance enhancements • Better support for MySQL and MSSQL • Embedded support for SQLite • Integrated SOAP support • Data iterators • Error handling via exceptions Currently, PHP 5.x is the only stable version that is being actively developed; active development on PHP 4 ceased at the end of 2007 . However, critical security updates for PHP 4 will be provided until August 8, 2008. [8] PHP 6 is currently under development, and is slated to release in conjunction with the decommission of PHP 4.[citation needed] As a result of the GoPHP5 initiative, many high profile open source projects ceased to support PHP 4 in new code as of 5 February 2008. [9] PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. PHP generally runs on a web server , taking PHP code as its input and creating Web pages as output. However, it can also be used for command-line scripting and client-side GUI applications. PHP can be deployed on most web servers and on almost every operating system and platform free of charge. The PHP Group also provides the complete source code for users to build, customize and extend for their own use. PHP primarily acts as a filter . The PHP program takes input from a file or stream containing text and special PHP instructions and outputs another stream of data for display. From PHP 4, the PHP parser compiles input to produce bytecode for processing by the Zend Engine , giving improved performance over its interpreter predecessor. PHP 5 uses the Zend Engine II. Originally designed to create dynamic web pages, PHP's principal focus is server-side scripting . While running the PHP parser with a web server and web browser , the PHP model can be compared to other server-side scripting languages such as Microsoft 's ASP.NET system, Sun Microsystems' JavaServer Pages , and mod perl as they all provide dynamic content to the client from a web server. To more directly compete with the "framework" approach taken by these systems, Zend is working on the Zend Framework - an emerging (as of June 2006) set of PHP building blocks and best practices; other PHP frameworks along the same lines include CakePHP, PRADO and Symfony. The LAMP architecture has become popular in the Web industry as a way of deploying inexpensive, reliable, scalable, secure web applications. PHP is commonly used as the P in this bundle alongside Linux, Apache and MySQL , although the P can also refer to Python or Perl . PHP can be used with a large number of relational database management systems , runs on all of the most popular web servers and is available for many different operating systems . This flexibility means that PHP has a wide installation base across the Internet; As of April 2007 , over 20 million Internet domains were hosted on servers with PHP installed. [10] The number of installations is different from the number of sites actually using those installations, but this statistic does reflect the popularity of PHP. Examples of popular open source server-side PHP applications include phpBB, WordPress , and MediaWiki. PHP also provides a command line interface SAPI for developing shell and desktop applications, daemons, log parsing, or other system administration tasks that have traditionally been the domain of Perl, Python, awk , or shell scripting. [11] PHP provides bindings to GUI libraries such as GTK+ (with PHP-GTK), Qt with PHP-Qt and text mode libraries like ncurses in order to facilitate development of a broader range of cross-platform GUI applications. As with many scripting languages, PHP scripts are normally kept as human-readable source code, even on production webservers. While this allows flexibility, it can raise issues with security and performance. Encoders hinder source code reverse engineering . Encoders fall broadly into two types; those that hide source code and those that compile code into "optcode."[citation needed] The downside of this latter approach is that a special extension has to be installed on the server in order to run encoded scripts, however the approach of encoding compiled code and use of an extension offers typically the best performance, security and opportunity for additional features that may be useful for developers. Compiled code solutions may exploit the potential for increased security through the use of their own execution engine, although some simpler solutions rely on the regular PHP engine to execute the compiled code. The most commonly used packages for source code protection are from Zend Technologies and ionCube Ltd. Code optimizers improve the quality of the compiled code by reducing its size and making changes that can reduce the execution time and improve performance. The nature of the PHP compiler is such that there are often many opportunities for code optimization. Accelerators offer performance gains by caching the compiled form of a PHP script in shared memory to avoid the overhead of parsing and compiling the code every time the script runs. They may also perform code optimization to provide increased execution performance. Both commercial (e.g. Zend Platform) and open source accelerators (e.g. xcache, eAccelerator, APC) are available. The PHP Extension and Application Repository (PEAR) project aims to provide reusable libraries and components for PHP development. PEAR projects are usually written in PHP code using the Object-oriented programming paradigm. PHP has a formal development manual that is maintained by the free software community . In addition, answers to many questions can often be found by doing a simple internet search. PHP users assist each other through various media such as chat, forums, newsgroups and PHP developer web sites. In turn, the PHP development team actively participates in such communities, garnering assistance from them in their own development effort (PHP itself) and providing assistance to them as well. There are many help resources [14] available for the novice PHP programmer.