Call us Toll-Free:
1-800-218-1525
Email us

 Sponsors

Collaborative Workspace

Code Wizard, 12-30-2006

Collaborative Workspace is a web-based program written in PHP. It allows users of a website to upload video to that site and generates a webpage for each uploaded video. Users have the ability to provide detailed information about their video and/or work and can have, if they choose, a simple message board feedback system with their page.

<!-- INSTALL.txt -->

collaborative workspace v1.1
by morgen dye

Please Read This File Completely!!!

////////////////////////////////////////////////////////////////////////////
This program is 100% free and open-source.
You are free to modify and use it however you please.
However, the maker of this program will not be held
accountable for any damage this program may somehow
cause towards your life and/or computing systems. ie. If this
program burns down your house, eats your children, or crashes
your computer -- it's your own fault! I have personally
never seen any of these things happen when using this program
-- but again, i'm not saying it can't happen!
////////////////////////////////////////////////////////////////////////////

if you end up using this program, making fixes, discover bugs, etc.
please email me at dyemor23@evergreen.edu

if you need help or have questions, you can email me at the same
address. i'll do my best to answer you in a timely manner

you can see how i've been using it at http://mediaspace.evergreen.edu


----------------------------------------------------------------------------

I. What's inlcuded in the .tar.gz or .zip file

under the directory "workspace/" you should find:

1. directory.php
2. generator.php
3. tmp.php
4. tmp_no_board.php
5. upload.html
6. thanks.html
7. INSTALL.txt (the file your reading right now)


II. What you need to run the worksapce

**has been tested on linux systems, but should probably run on anything**

1. a webserver or access to one
2. PHP installed on the server (4.0 or better recommended)
--i have tested this with PHP installed as a module of Apache webserver,
but not as a cgi interpreter
3. QuickTime Streaming Server or equivalent -- just a webserver if you are
going to be using "progressive downloads" only.

Note: This program can easily be modified for other media formats -- you
need to correctly modify the media player located in both tmp.php and
tmp_no_board.php to get the program to work with other formats (ie Real
Video), but don't mess around with it unless you know what you are doing!


III. Installing the Workspace

1. uncompress the .zip or .tar.gz file

.zip --> "unzip collaborative_workspace_1.1.zip"

.tar.gz --> "gunzip collaborative_workspace_1.1.tar.gz"
then unpack the tarball -->
"tar -xvf collaborative_workspace_1.1.tar"

2. open up your favorite text editor. in your text editor open up
"directory.php"

follow the commented instructions -- they begin with "//"
edit accordingly and save.

do the same thing with generator.php, tmp.php, and tmp_no_board.php
again, follow the commented instuctions on each page.

you should also edit the file thanks.html to inlcude the correct site admin
email address

in many of these files you will see reference to a directory called "posts".
when told to, inlcude it in the path name. don't worry (and sorry if i confused you) -- you will be creating that directory in just a few minutes.

3. after you have edited all of the above files correctly, use an ftp client
to upload all the files to your server. all of
the files should be located in the same directory. of course, to make
things easier for yourself you can just upload the whole "workspace"
directory. in the same directory that contains all of these files, create
a new directory named "posts".

4. set correct permissions. you need to have the file "directory.php" and
the directory "posts" be writable by the server

chmod 777 directory.php
chmod 777 posts/

5. open up a browser and open up the page "directory.php"
--> http://www.yoursite.com/workspace/directory.php

6. Test it out!

Use the link to go to the upload form.
Fill out the form and hit submit.
Assuming that you edited all of the files correctly your workspace should
now be working. If you get errors, go back through all of the files and
double check that you edited the specified lines correctly. If all else
fails, email me.




<!-- directory.php -->

<html>
<body bgcolor="#ffffff" text="#000000" link="#164a72" vlink="#164a72">
<table align="right">
<tr>
<td>
<font size="1" face="helvetica">
<b>collaborative workspace v.
1.1</b>
</font>
</td></tr></table> <br>
<font size="2" face="verdana,
helvetica, arial">

// ## EDIT THIS ###
//edit the name of your wokspace

<center> <b>Name of Workspace Here</b></center>
<br><br>

<a href="upload.html">Upload to the Workspace</a><br>

<br>
<br>
<b>Recent Entries in the Workspace: </b> <p>

</font>
</body>
</html>





<!-- generator.php -->

//WARNING!!!
//unless you know what you are doing
//only edit those lines that are explicitly mentioned


<?php


if ($newfile1)
{

// ### EDIT THIS ###
//absolute path on your server to the "posts" directory
// ie. "/var/www/workspace/posts/"

$checkfile = "/path/to/the/directory/posts/" . $newfile1 . ".php";
if (file_exists ($checkfile))
{
print "A file with the name you have chosen already exists! Please use the
back button on your browser to return to the upload form and choose a
different name."; die; }
else {


for($i=0;$i<sizeof($userfile);$i++)
{
if(!$userfile_size[$i])
continue;
$file1 = $userfile_name[$i];
$UPLOAD = fopen( $userfile[$i], "r" );
$contents = fread( $UPLOAD,$userfile_size[$i]);
fclose( $UPLOAD );

// ### EDIT THIS ###
// the absolute path on your server to the directory
// where your QuickTime movie files are held
// ie. "/var/www/quicktime/"

$SAVEFILE = fopen("/path/to/your/quicktime/files/".$userfile_name[$i], "wb");
fwrite( $SAVEFILE, $contents,$userfile_size[$i] );
fclose($SAVEFILE );
}


if ($yesmessage1)
{
$filename = "tmp.php";

// ### EDIT THIS ###
//absolute path on your server to the "posts" directory
// ie. "/var/www/workspace/posts/"

copy($filename, "/path/to/the/directory/posts/" . $filename);
chdir("posts");
rename($filename, $newfile1 . ".php");


$fp=fopen(($newfile1) . ".php", "a");
fclose ($fp);
$fp=fopen(($newfile1) . ".php", "r+");
$rf = fread($fp,50000);
fclose ($fp);
$fp2=fopen(($newfile1) . ".php", "w+");

$data = ereg_replace("

", "
<P>", $data);
$data = "<html><?php
$TITLE_POST = "$title1";
$DESCRIPTION_PROJECT_POST = "$description_project1";
$NAME_POST = "$name1";
$FILE_POST = "$file1";
$DESCRIPTION_CLIP_POST = "$description_clip1";
$YOUR_EMAIL_POST = "$your_email1";
$URL_POST = "$url1";
$NEWFILE_POST = "$newfile1";
?>
";
}

if ($nomessage1)
{
$filename = "tmp_no_board.php";

// ### EDIT THIS ###
//absolute path on your server to the "posts" directory
// ie. "/var/www/workspace/posts/"

copy($filename, "/path/to/the/directory/posts/" . $filename);
chdir("posts");
rename($filename, $newfile1 . ".php");


$fp=fopen(($newfile1) . ".php", "a");
fclose ($fp);
$fp=fopen(($newfile1) . ".php", "r+");
$rf = fread($fp,50000);
fclose ($fp);
$fp2=fopen(($newfile1) . ".php", "w+");

$data = ereg_replace("

", "
<P>", $data);
$data = "<html><?php
$TITLE_POST = "$title1";
$DESCRIPTION_PROJECT_POST = "$description_project1";
$NAME_POST = "$name1";
$FILE_POST = "$file1";
$DESCRIPTION_CLIP_POST = "$description_clip1";
$YOUR_EMAIL_POST = "$your_email1";
$URL_POST = "$url1";
$NEWFILE_POST = "$newfile1";
?>
";
}

fwrite ($fp2, stripslashes($data));
fclose ($fp2);
$fp3=fopen(($newfile1) . ".php", "a+");
fwrite ($fp3, $rf);
fclose ($fp3);

// ### EDIT THIS ###
//absolute path on your server to the directory where
//the workspace resides
// ie. "/var/www/workspace/"

chdir("/path/to/workspace/");

$fp=fopen("directory.php", "a");
$newentry = ereg_replace("

", "
<P>", $newentry);
$date = date("l, F j Y, h:i a");
$newentry = "<b>

// ## EDIT THIS ##
// URL to the "posts" directory
// this is not the same as the server path
// it starts with "http://"
// ie. "http://www.yoursite.com/workspace/posts/"
// leave "$newfile1.php -- or else it won't work!

<a
href="http://www.yoursite.com/workspace/posts/$newfile1.php"
target="_top">$title1</a></b><br><b>Uploaded on:</b> <i>$date</i><BR><HR>";
fputs($fp, stripslashes($newentry)); fclose ($fp); } @readfile("thanks.html"); }



?>



<-- thanks.html -->

<html>
<body bgcolor="#ffffff" text="#000000">
<br><br><Br><br><br><br>
<center><font face="helvetica, verdana, arial" size="3"><b>Thanks! Your file
has been uploaded.<p> Please <a href="directory.php">return to the
directory</a> and make sure that a <br>link has been created that points to
your new page.<p>
If you experience any problems, please contact <a
href="mailto:admin@this-site.com">admin@this-site.com</a> </center>
</body> </html>



<!-- tmp.php -->


<body bgcolor="#ffffff" text="#000000" leftmargin="0" rightmargin="0"
bottommargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="100%" height="95% cellpading="0" cellspacing="0"><tr>

<td width="50%" height="100%" valign="top">

<center>
<b>
<?php
echo ($TITLE_POST);
?>
</b>

<p>
<i>
<b>by:
<?php
echo ($NAME_POST);
?>
</b>
</i>
</center>

<center>

// ### EDIT THIS ###
// This is the QuickTime embedded player
// URL of the site where your QuickTime movies are located
// ie. "rtsp://www.yoursite.com"
// or "http://www.yoursite.com"
// "rtsp" or "http" depends on what protocol you are using for
// your movies. details on the differences are located at the apple site.
// DO NOT REMOVE $FILE_POST !!!

<?php
echo ("<embed src="$FILE_POST" type="video/quicktime"
qtsrc="rtsp://www.yoursite.com/$FILE_POST" width="207" height="186"
autoplay="false" control="true">"); ?>
</center>

<blockquote>

<font
size="2" face="verdana, helvetica,
arial"color="#000000">
<b>Description of Clip:</b>
<p>
<?php
echo ($DESCRIPTION_CLIP_POST);
?>
<p>

<b>Description of Full Project:</b>
<p>
<?php
echo ($DESCRIPTION_PROJECT_POST);
?>
<p>

<b>About the Filmmaker:</b>
<p>
<?php
echo ($DESCRIPTION_MAKER);
?>
<p>
<b>How to Contact the Filmmaker:</b>
<p>
<?php
echo ("<a href="mailto:$YOUR_EMAIL_POST">");
?>
<?php
echo ($YOUR_EMAIL_POST);
?>
</a> <p>
<b>To Find Out More:</b>
<p>
<?php
echo ("<a href="http://$URL_POST" target="new">");
?>
<?php
echo ($URL_POST);
?>
</a>
<p> <br><br>

</font>

</blockquote>

</td>

<td bgcolor="#cccccc" width="50%" height="95%" valign="top">

<blockquote>

<br>

<font size="2" face="helvetica, verdana, arial">
<b>Recent Comments About
<?php
echo ($TITLE_POST);
?>:</b><p><br><br> </font>


<font size="2" face="helvetica, verdana, arial">

<?php

if ($message)
{
$message = ereg_replace("

", "
<P>", $message);
$date = date("l, F j Y, h:i a");
$message = "<B>$name </B> -- <b><a href="mailto:$email">$email</a></b><p> <i>$date</i><P> $message<BR><HR>";
$fp = fopen (basename($PHP_SELF) . ".comment", "a");
fclose ($fp);
$fp = fopen (basename($PHP_SELF) . ".comment", "r+");
$rf = fread($fp,32000);
fclose ($fp);
$fp2 = fopen (basename($PHP_SELF) . ".comment", "w+");
fwrite ($fp2, $message);
fclose ($fp2);
$fp3 = fopen (basename($PHP_SELF) . ".comment", "a+");
fwrite ($fp3, $rf);
fclose ($fp3);
}
@readfile(basename(($PHP_SELF . ".comment")));
?>

</font>


<font size="2" face="helvetica, verdana, arial"><b>Give Your
Feedback</b></font><p>
<font size="2" face="helvetica, verdana, arial">

<form method="post">
Name:<P>
<input name="name" type="text" size="30"><p>
Your Email Address (Optional):<P>
<input name="email" type="text" size="30"><p>
Your Message:<p>
<textarea name="message" rows="10" cols="30" wrap="soft"></textarea><p>
<input name="submit" type="submit" value="submit message">
<input name="clear" type="reset" value="clear form">
</form>

</font>

</blockquote>


</td>

</tr></table>
</body>
</html>




<!-- tmp_no_board.php -->


<body bgcolor="#ffffff" text="#000000" leftmargin="0" rightmargin="0"
bottommargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="100%" height="95% cellpading="0" cellspacing="0"><tr>

<td width="50%" height="100%" valign="top">

<center>
<b>
<?php
echo ($TITLE_POST);
?>
</b>

<p>
<i>
<b>by:
<?php
echo ($NAME_POST);
?>
</b>
</i>
</center>

// ### EDIT THIS ###
// This is the QuickTime embedded player
// URL of the site where your QuickTime movies are located
// ie. "rtsp://www.yoursite.com"
// or "http://www.yoursite.com"
// "rtsp" or "http" depends on what protocol you are using for
// your movies. details on the differences are located at the apple site.
// DO NOT REMOVE $FILE_POST !!!

<center>
<?php
echo ("<embed src="$FILE_POST" type="video/quicktime"
qtsrc="rtsp://www.yoursite.com/$FILE_POST" width="207" height="186"
autoplay="false" control="true">"); ?>
</center>

<blockquote>

<font
size="2" face="verdana, helvetica,
arial"color="#000000">
<b>Description of Clip:</b>
<p>
<?php
echo ($DESCRIPTION_CLIP_POST);
?>
<p>

<b>Description of Full Project:</b>
<p>
<?php
echo ($DESCRIPTION_PROJECT_POST);
?>
<p>

<b>About the Filmmaker:</b>
<p>
<?php
echo ($DESCRIPTION_MAKER);
?>
<p>
<b>How to Contact the Filmmaker:</b>
<p>
<?php
echo ("<a href="mailto:$YOUR_EMAIL_POST">");
?>
<?php
echo ($YOUR_EMAIL_POST);
?>
</a> <p>
<b>To Find Out More:</b>
<p>
<?php
echo ("<a href="http://$URL_POST" target="new">");
?>
<?php
echo ($URL_POST);
?>
</a>
<p> <br><br>

</font>

</blockquote>



</td>

<td bgcolor="#cccccc" width="50%" height="95%" valign="top">


<blockquote>

<br>



<font size="2" face="helvetica, verdana, arial"><b>No
Message Board Available.</b><p>If you want to give feedback please email the
video makers if an address is available</font>






</blockquote>


</td>

</tr></table>
</body>
</html>



<!-- upload.html -->


<html>
<head><title>collaborative workspace upload</title></head>
<body bgcolor="#ffffff" text="#000000">
<blockquote> <br><br>
<font size="2" face="helvetica, verdana, arial">

Please fill in the form to upload your video to the workspace:<p>
<form method="post" action="generator.php" enctype="multipart/form-data">
<b>Title of Film or Video:</b><br>
<input type="text" size="30" name="title1">
<p>
<b>Description of Project:</b><br>
<textarea rows="10" cols="30" wrap="soft"
name="description_project1"></textarea> <p>
<b>Names of Film/Video Makers:</b><br>
<i>If more than one, please dedicate one line per name.</i><br>
<textarea rows="5" cols="30" name="name1"></textarea>
<p>
<br>
<b>File to Upload:</b><br>
<input type="file" size="30" name="userfile[]">
<p>

<b>Description of Clip (If different than project description):</b><br>
<textarea rows="10" cols="30" wrap="soft" name="description_clip1"></textarea>
<p>
<br>
<b>CONTACT INFO</b>
<p>
<b>Email Address:</b><br>
<input type="text" size="30" name="your_email1">
<p>
<b>Would You Like to Include a Message Board?</b><br>
Yes<input type="radio" name="yesmessage1">&#160;&#160;&#160;No<input type="radio" name="nomessage1">
<p>
<b>You Can Provide a Link to a Website that Contains More Info:</b><br>
<i>Do not inlcude "http://". If you do, the link will not work!</i><br>
<input type="text" size="30" name="url1">
<p>
<br>
<b>** REQUIRED ** Create File Name for Site (no spaces):</b><br>
<input type="text" size="30" name="newfile1"> <p>
<input type="submit" value="Submit">
<input type="reset" value="Reset">


</form>

</font>

</blockquote>
<br><br><br>

</body>
</html>






























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions