View of /trunk/ionfiles.php
Parent Directory
|
Revision Log
Revision 2 -
(download)
(annotate)
Sat Mar 7 02:50:39 2009 UTC (4 years, 2 months ago) by andphe
File size: 26822 byte(s)
Sat Mar 7 02:50:39 2009 UTC (4 years, 2 months ago) by andphe
File size: 26822 byte(s)
+ first fixed files for version control
<?php
//defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
//////////////////////////////////////////////
// FileName: ionFile.php
// Date: 05/03/2006
// License: GNU General Public License
// Script Version #: 1.3
// MOS Version #: 4.5 and 4.5.1+
//
//////////////////////////////////////////////
/***************************************************************
// Disable errors
***************************************************************/
error_reporting ( 0 );
/***************************************************************
// Enable magic quotes
***************************************************************/
if (get_magic_quotes_gpc ()) {
// Yes? Strip the added slashes
$_REQUEST = remove_magic_quotes ( $_REQUEST );
$_GET = remove_magic_quotes ( $_GET );
$_POST = remove_magic_quotes ( $_POST );
}
set_magic_quotes_runtime ( 0 );
/***************************************************************
// Globals
***************************************************************/
global $mosConfig_lang, $database;
/***************************************************************
// 1.5 DB
***************************************************************/
$database = get_db ();
/***************************************************************
// Basic Language
***************************************************************/
if (file_exists ( 'components/com_ionfiles/language/' . $mosConfig_lang . '.php' )) {
include_once ('components/com_ionfiles/language/' . $mosConfig_lang . '.php');
} else {
include_once ('components/com_ionfiles/language/english.php');
}
/***************************************************************
// Select our configuration
***************************************************************/
$query = "SELECT * FROM `#__ionfile_conf`";
$database->setQuery ( $query );
$rows = $database->loadObjectList ();
if (count ( $rows ) < 1) {
$query = "INSERT INTO `#__ionfile_conf`
(hdr_text,show_size,show_ver,show_lic,show_icon,show_dl,
show_desc,show_hdr,show_totals,show_hdr_desc,hdr_desc_text,allow_direct)
VALUES ('Downloads',1,0,0,0,1,0,1,0,1,'Description',0);"; //<- May need to be changed in future versions, stores the default config.
$database->setQuery ( $query );
$rows = $database->loadObjectList ();
}
/***************************************************************
// variables
***************************************************************/
$func = GetParams ( "POST", 'func' );
$fileid = GetParams ( "POST", 'fileid' );
$categoryid = GetParams ( "POST", 'categoryid' );
$svalue = GetParams ( "POST", 'svalue' );
/***************************************************************
// Determine our function
// @params: func (user defined function)
***************************************************************/
switch ( $func) {
case 'download' :
downloadFile ( $fileid );
break;
case 'showarchive' :
disp ( 1 );
break;
case 'showcategory' :
disp ( 0, $categoryid );
break;
case 'search' :
disp ( 0, 0, $svalue );
break;
default :
disp ();
break;
}
/***************************************************************
// Display all of the files for th user
// in order for download
// @params onlyArchive (values 0 or 1) displays the archive files
// @params categoryID - Displays a category id only
***************************************************************/
function disp($onlyArchive = 0, $categoryID = 0, $searchTerm = "") {
/***************************************************************
// ensure this file is being included by a parent file
***************************************************************/
if (! defined ( '_JEXEC' ) && ! defined ( '_VALID_MOS' ))
die ( 'Restricted access' );
// Globals
global $my;
$database = get_db ();
// Variables
$hdrText = _IONFILE_HDR;
$showSize = 1;
$showVer = 1;
$showLic = 1;
$showIcon = 0;
$showDl = 0;
$showDesc = 1;
$showTotals = 0;
$showCats = 0;
$hdrDescription = _IONFILE_HDR_DESCRIPTION;
$showHdr = 1;
$allow_direct = 1;
$showHdr_Desc = 1;
$showCats = 1;
// Select the config
$query = "SELECT * FROM #__ionfile_conf" . "\n LIMIT 1";
// Get our settings from the database
$database->setQuery ( $query );
$rows = $database->loadObjectList ();
if ($rows) {
$myConfig = $rows [0];
// Assign our Variables
$hdrText = $myConfig->hdr_text;
$showSize = $myConfig->show_size;
$showVer = $myConfig->show_ver;
$showLic = $myConfig->show_lic;
$showIcon = $myConfig->show_icon;
$showDl = $myConfig->show_dl;
$showDesc = $myConfig->show_desc;
$showHdr = $myConfig->show_hdr;
$showTotals = $myConfig->show_totals;
$allow_direct = $myConfig->allow_direct;
$showHdr_Desc = $myConfig->show_hdr_desc;
$hdrDescription = $myConfig->hdr_desc_text;
$showDate = $myConfig->show_date;
$showSearch = $myConfig->show_search;
$showArchive = $myConfig->show_archive;
$allowCat = $myConfig->allow_category;
$searchpos = $myConfig->search_pos;
$disablesearch = $myConfig->disable_search;
}
if (defined ( '_JEXEC' )) {
$user = & JFactory::getUser ();
$my->gid = $user->get ( 'aid', 0 );
}
// show only one category
$catQuery = '';
if ($categoryID != 0 && $allowCat == 1) {
$catQuery = "\n AND id=$categoryID";
}
$query = "SELECT * FROM #__ionfile_categories" . "\n WHERE published = '1'" . "\n AND access <= " . ( int ) $my->gid . $catQuery . "\n ORDER BY ordering ASC";
// Select all Categories
$database->setQuery ( $query );
$rows = $database->loadObjectList ();
?>
<script type="text/javascript">
<!--
function toggle_all(selectBox) {
var id, i, a;
id = 'iftr' + selectBox.options[selectBox.selectedIndex].innerHTML
+ selectBox.options[selectBox.selectedIndex].value;
// Remove spaces for XHTML
id = removeSpaces(id);
for(i=0; ( a = document.getElementsByTagName('tr')[i]); i++)
{
// Grab our ID
var s = a.id;
if (id != "iftrAll0") {
if (s.substr(0, 4) == 'iftr') {
// Find the first period (used to make
// unique ids)
var posPeriod = s.indexOf(".");
// If posPeriod is > 0 then we are at
// a file and need to remove the .xxxx
if (posPeriod > 0) {
s = s.substr(0, posPeriod);
}
// Remove spaces for XHTML
s = removeSpaces(s);
// Test to see if we have a match
if (s == id) {
a.style.display = '';
}
else {
a.style.display = 'none';
}
}
}
else {
a.style.display = '';
}
}
}
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}
// Remove spaces of ids for XHTML
function removeSpaces(string) {
var tstring = "";
string = '' + string;
splitstring = string.split(" ");
for(i = 0; i < splitstring.length; i++)
tstring += splitstring[i];
return tstring;
}
//-->
</script>
<script language="javascript" type="text/javascript">
<!-- // --><![CDATA[
function flip(img, flipto) {
if(!img.old) {
img.old = img.src;
img.src = flipto;
}
else {
var src = img.src;
img.src = img.old;
img.old = src;
}
}
// ]]></script>
<?php
// CSS for Hiding Description
print '<div style =".demo{ visibility:hidden;}">';
// Print our header information
if ($showHdr == 1) {
print "<div class=\"componentheading\">";
print stripslashes ( $hdrText );
print "</div></div>";
} else
if ($showHdr == 0) {
print "<div class=\"componentheading\">";
print "</div></div>";
}
// Display our header description
if ($showHdr_Desc == 1) {
print "<br />";
print stripslashes ( $hdrDescription );
print "<br /><br />";
}
// Check if there are any categories. If not,
// display an error.
if (count ( $rows ) < 1) {
print "<b>" . _IONFILE_ERROR_NO_FILES_TO_DISPLAY . "</b>";
} else {
// Create our table
print "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" width=\"100%\">";
// We need to count how many
// colums there are to be displayed
$colCount = 1;
// Print Icon
if ($showIcon == 1)
$colCount ++;
// File Name/Title
// Version
if ($showVer == 1)
$colCount ++;
// File Size
if ($showSize == 1)
$colCount ++;
// Type/License
if ($showLic == 1)
$colCount ++;
// Downloads
if ($showDl == 1)
$colCount ++;
// Show Date
if ($showDate == 1)
$colCount ++;
// Show the search bar if admin wants
if (! ($disablesearch == 1 && $categoryID > 0)) {
if ($searchpos == 0 || $searchpos == 2) {
buildSearchBar ( $allowCat, $showSearch, $showArchive, $colCount );
}
}
// Our Header
print "<tr>";
// Print Icon
if ($showIcon == 1) {
print "<td></td>";
}
// File Name/Title
print "<td><div class=\"contentheading\">" . _IONFILE_PRODUCT . "</div></td>";
// Version
if ($showVer == 1) {
print "<td><div class=\"contentheading\">" . _IONFILE_VERSION . "</div></td>";
}
// File Size
if ($showSize == 1) {
print "<td><div class=\"contentheading\">" . _IONFILE_SIZE . "</div></td>";
}
// Type/License
if ($showLic == 1) {
print "<td><div class=\"contentheading\">" . _IONFILE_TYPE . "</div></td>";
}
// Downloads
if ($showDl == 1) {
print "<td><div class=\"contentheading\">" . _IONFILE_DOWNLOADS . "</div></td>";
}
// Show Date
if ($showDate == 1) {
print "<td><div class=\"contentheading\">" . _IONFILE_DATE . "</div></td>";
}
// End of Header
print "</tr>";
// Cycle through categories drawing the Cat Header and listing files
foreach ( $rows as $row ) {
// Set our archive string
if ($onlyArchive == 1 && $showArchive == 1) {
$archString = "AND archived ='1'";
} else {
$archString = "AND archived !='1'";
}
// If the user is searching....
if ($showSearch && $searchTerm != "") {
$archString = "AND (title like '%$searchTerm%' OR description like '%$searchTerm%')";
}
$query = "SELECT * FROM #__ionfile" . "\n WHERE published = '1' " . "\n AND cat_id ='$row->id'" . "\n AND access <= " . ( int ) $my->gid . "\n $archString" . "\n ORDER BY ordering";
// Select all files from the DB in current category
$database->setQuery ( $query );
$file_rows = $database->loadObjectList ();
// Create unique ID for hiding row on cat select
$rowId = 'iftr' . stripslashes ( $row->title ) . $row->id;
// Remove spaces
$rowId = str_replace ( " ", "", $rowId );
if (count ( $file_rows ) > 0) {
// Display the category header
if ($showCats) {
print "<tr id=\"$rowId\"><td width=\"100%\" colspan=\"$colCount\" class=\"sectiontableheader\">";
if ($row->link == 1 && $row->linkURL != "") {
print "<a href=\"$row->linkURL\">";
print stripslashes ( $row->title );
print "</a>";
} else {
print stripslashes ( $row->title );
}
print "</td></tr>";
}
// Setup our counter
$counter = 1;
$totalFileSize = 0;
$totalFileDownloads = 0;
// Cycle through and list every download in the category
foreach ( $file_rows as $dl_row ) {
// Find our grey class
$class = ($counter % 2) ? "sectiontableentry1" : "sectiontableentry2";
// Our Header
print "<tr class=\"$class\" id=\"$rowId.$counter\">";
// Print Icon
if ($showIcon == 1) {
print "<td valign=\"top\" class=\"$class\"><img src=\"$dl_row->icon_url\" width=\"16\" height=\"16\" alt=\"Icon\" /></td>";
}
// File Name/Title
print "<td valign=\"top\"><a href=\"index.php?option=com_ionfiles&func=download&fileid=$dl_row->id\">" . stripslashes ( $dl_row->title ) . "</a>";
// Description
if ($showDesc == 1 && $dl_row->description != "") {
print " <img src=\"components/com_ionfiles/images/dropdown.gif\" alt=\"details\" align=\"top\" onclick=\"flip(this, 'components/com_ionfiles/images/up.gif'); toggle_visibility('ion$dl_row->id'); return false\" />";
}
// End of colum.
print "</td>";
// Version
if ($showVer == 1) {
print "<td valign=\"top\" >$dl_row->file_version</td>";
}
// File Size
if ($showSize == 1) {
print "<td valign=\"top\" >$dl_row->size</td>";
}
$totalFileSize += str_replace ( "kb", "", strtolower ( $dl_row->size ) ); //Assumes no alpha symbols. Assumes all kb values.
// Type/License
if ($showLic == 1) {
print "<td valign=\"top\" >$dl_row->license</td>";
}
// Downloads
if ($showDl == 1) {
print "<td valign=\"top\" align=\"center\" >$dl_row->file_dl</td>";
}
$totalFileDownloads += $dl_row->file_dl;
// Date
if ($showDate == 1) {
print "<td valign=\"top\" align=\"center\" >$dl_row->date</td>";
}
// Increase our counter
$counter = $counter + 1;
print "</tr><tr><td width=\"100%\" colspan=\"$colCount\">";
print "<div id=\"ion$dl_row->id\" style=\"display:none;\">" . stripslashes ( $dl_row->description );
print "<br />";
// Print extra info
if ($dl_row->info_url != "") {
print "<a href=\"$dl_row->info_url\">[" . _IONFILE_MORE . "]</a> | ";
}
if ($dl_row->screenshot != "") {
print "<a href=\"$dl_row->screenshot\">[" . _IONFILE_SCREENSHOTS . "]</a> | ";
}
if (($dl_row->homepage != "") && ($dl_row->author != "")) {
print "<a href=\"$dl_row->homepage\">[$dl_row->author]</a> ";
}
if (($dl_row->homepage != "") && ($dl_row->author == "")) {
print "<a href=\"$dl_row->homepage\">[" . _IONFILE_AUTHOR . "]</a> ";
}
if (($dl_row->homepage == "") && ($dl_row->author != "")) {
print "[$dl_row->author] ";
}
print "</div></td></tr>";
} // End $file_rows for
} // End 0 or more check.
if ($showSize && $showTotals) {
print "<tr><td>" . _IONFILE_TOTAL . " " . _IONFILE_SIZE . ": " . ($totalFileSize / 1024) . "Mb</td></tr>";
}
if ($showDl && $showTotals) {
print "<tr><td>" . _IONFILE_TOTAL . " " . _IONFILE_DOWNLOADS . ": " . $totalFileDownloads . "</td></tr>";
}
// Give a space
if ($showCats && count ( $file_rows ) > 0) {
print "<tr id=\"$rowId.x\"><td colspan=\"$colCount\"><br /></td></tr>";
}
} // Category foreach
// Show the search bar if admin wants
if (! ($disablesearch == 1 && $categoryID > 0)) {
if ($searchpos == 1 || $searchpos == 2) {
buildSearchBar ( $allowCat, $showSearch, $showArchive, $colCount );
}
}
// End our Tables
print "</table>";
// CodeCall Link
/*print "<br />";
print "<center><a href=\"http://forum.codecall.net/community-projects/1321-project-ionfiles-joomla-simple-file-download.html\" target=\"_blank\">ionFiles</a> by";
print " <a href=\"http://www.codecall.net/\" target=\"_blank\">CodeCall Programming</a>";
print "</center>";
print "<br /><br />";*/
} // End else check for 0 files
} // End function disp
/***************************************************************
// Creates/builds the search bar which houses the archive,
// category select and search bar. Needed in multiple places
// And has no return value (just prints directly), for now...
***************************************************************/
function buildSearchBar($allowCat, $showSearch, $showArchive, $colCount) {
// Archive link, Search Bar and Category selection
if ($allowCat || $showSearch || $showArchive) {
print "<tr><td width=\"100%\" colspan=\"$colCount\" class=\"sectiontableheader\" style=\"text-align: center;\">";
// Start a new table
print '<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td>';
// Display the archive link
// That will allow the user to see archived files
if ($showArchive && $onlyArchive == 0) {
print "<a href=\"index.php?option=com_ionfiles&func=showarchive\">" . _IONFILE_ARCHIVE . "</a>";
print "</td>";
} else if ($showArchive && $onlyArchive == 1) {
print "<a href=\"index.php?option=com_ionfiles\">" . _IONFILE_FULL . "</a>";
print "</td>";
}
// Display the category drop-box
if ($allowCat) {
print "<td>";
print build_cat_html ();
print "</td>";
}
// Display the search
if ($showSearch) {
print "<td>";
print "<form action=\"index.php\"><input type=\"text\" name=\"svalue\"
onblur=\"if(this.value=='') this.value='" . _IONFILE_SEARCH . "';\"
onfocus=\"if(this.value=='" . _IONFILE_SEARCH . "') this.value='';\" value=\"" . _IONFILE_SEARCH . "\" />";
print "<input type=\"hidden\" name=\"option\" value=\"com_ionfiles\" />";
print "<input type=\"hidden\" name=\"func\" value=\"search\" />";
print "</form>";
print "</td>";
}
print "</tr></table>";
print "</td></tr>";
}
}
/***************************************************************
// Download Function
***************************************************************/
function downloadFile($uid) {
# If a download has already been selected,
#-----------------------------------------
If ($uid) {
# Define Globals
#-------------------------------
global $mosConfig_live_site, $mainframe;
$database = get_db ();
# SQL Query
$query = "SELECT file_url, download FROM #__ionfile" . "\n WHERE published = '1' AND id = '$uid'" . "\n LIMIT 1";
// Select the file location from the db
$database->setQuery ( $query );
$file_dl = $database->loadObjectList ();
$myFile = $file_dl [0];
# Get the filename to be downloaded
#----------------------------------
$file = $myFile->file_url;
$file = stripslashes ( $file );
$file = htmlspecialchars ( $file );
$download = $myFile->download;
# if the file prefix is to a local folder, append livesite data by Ed
# -------------------------------------------------------------
if (strtolower ( substr ( $file, 0, 7 ) ) != 'http://' && strtolower ( substr ( $file, 0, 6 ) ) != "ftp://") {
if (defined ( '_JEXEC' )) {
$file = JPATH_ROOT . '/' . $file;
} else {
global $mosConfig_absolute_path;
$file = $mosConfig_absolute_path . '/' . $file;
}
}
# Increment download count
#------------------------------------------
$query = "UPDATE #__ionfile" . "\n SET file_dl=file_dl+1" . "\n WHERE id='$uid'";
$database->setQuery ( $query );
if (! $database->query ()) {
echo "$database->getErrorMsg()";
exit ();
}
# Begin the file download
#-------------------------------------------
startDownload($file, $download);
} else {
print _IONFILE_ERROR_NO_FILE_SELECTED;
die ();
}
}
/***************************************************************
// Joomla 1.5/1.0 DB switch for get Params
***************************************************************/
function GetParams($method = "POST", $field, $default = "", $params = "", $type = "") {
if (defined ( '_JEXEC' )) {
// Change the type from old to new
if ($params == "_MOS_ALLOWHTML") {
$params = JREQUEST_ALLOWHTML;
}
if ($params) {
$variable = JRequest::getVar ( $field, $default, $method, $type, $params );
} else {
$variable = JRequest::getVar ( $field );
}
} else {
if ($method == "POST") {
$variable = mosGetParam ( $_REQUEST, $field, $default, $params );
} else {
$variable = mosGetParam ( $_REQUEST, $field, $default, $params );
}
}
return $variable;
}
/***************************************************************
// Misc Functions
***************************************************************/
function remove_magic_quotes($array) {
foreach ( $array as $k => $v ) {
if (is_array ( $v ))
$array [$k] = remove_magic_quotes ( $v ); else
$array [$k] = stripslashes ( $v );
}
return $array;
}
/***************************************************************
// Error Messages
***************************************************************/
function error_msg($message) {
echo "<script> alert('" . $message . "'); window.history.go(-1); </script>\n";
}
/***************************************************************
// Joomla 1.5/1.0 DB switch
***************************************************************/
function get_db() {
if (defined ( '_JEXEC' )) { // 1.5
// This gets the database object using the JFactory class
$database = &JFactory::getDBO ();
} else {
// Use the Joomla 1.0 database
global $database;
}
return $database;
}
/****************************************************************
// Build Category list
***************************************************************/
function build_cat_html() {
global $my;
$database = get_db ();
$categoryid = GetParams ( "POST", 'categoryid' );
$query = "SELECT * FROM #__ionfile_categories" . "\n WHERE published = '1'" . "\n AND access <= " . ( int ) $my->gid . "\n ORDER BY ordering ASC";
// Select all Categories
$database->setQuery ( $query );
$rows = $database->loadObjectList ();
// Build our form
$html = "<form action=\"index.php\" method=\"get\">";
$html = $html . "<input type=\"hidden\" name=\"option\" value=\"com_ionfiles\" />";
$html = $html . "<input type=\"hidden\" name=\"func\" value=\"showcategory\" />";
// Build the select form
$html = $html . ' <select name="categoryid" onchange="javascript:toggle_all(this);" style="width: 150px;"><option value="0">All</option>';
// Cycle through categories drawing the Cat Header and listing files
foreach ( $rows as $row ) {
if ($row->id == $categoryid) {
$html = $html . '<option SELECTED value="' . $row->id . '">' . $row->title . '</option>';
} else {
$html = $html . '<option value="' . $row->id . '">' . $row->title . '</option>';
}
}
$html = $html . '</select></form>';
return $html;
}
/**********************************************
// Code imported from download.php
* v2.4.3 - Initial import - (TkTech)
**********************************************/
function startDownload($file, $download) {
# Make sure program execution doesn't time out
#-------------------------------
set_time_limit(0);
# Get the filename to be downloaded
#----------------------------------
#$file = stripslashes($file);
#$file = htmlspecialchars($file);
# file extension
#-----------------------------------
$fext = strtolower(substr(strrchr($file,"."),1));
# Get the File Size
#-----------------------------------
//$fsize = remotefsize($file);
# Get the mime type
#------------------------------------
$mtype = getmtype($fext);
# Check to see if the file is a link or download
#-------------------------------------------------
if ($download == 1) {
header("Pragma:no-cache");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-type: $mtype");
header("Content-Transfer-Encoding: binary");
header("Content-Disposition: attachment; filename=\"".basename($file)."\"");
if (ini_get('allow_url_fopen')) {
if (extension_loaded('curl')) {
header("Content-Length: " . remotefsize($file));
}
}
header("Accept-Ranges: bytes");
@readfile("$file");
// Exit so that Joomla headers do not
// corrupt the download.
exit();
}
else {
# Forward the user to the file
#--------------------------------------------------
header("Location: " .$file);
}
}
////////////////////////////////////////////////////////////
// Get the mtype
////////////////////////////////////////////////////////////
function getmtype($fext) {
# Mime Types
#-------------------------------
$mine_types = array (
# archives
#-------------------------------
'zip' => 'application/zip',
# documents
#-------------------------------
'pdf' => 'application/pdf',
'doc' => 'application/msword',
'xls' => 'application/vnd.ms-excel',
'ppt' => 'application/vnd.ms-powerpoint',
# executables
#-------------------------------
'exe' => 'application/octet-stream',
# images
#-------------------------------
'gif' => 'image/gif',
'png' => 'image/png',
'jpg' => 'image/jpeg',
'jpeg' => 'image/jpeg',
# audio
#-------------------------------
'mp3' => 'audio/mpeg',
'wav' => 'audio/x-wav',
# video
#-------------------------------
'mpeg' => 'video/mpeg',
'mpg' => 'video/mpeg',
'mpe' => 'video/mpeg',
'mov' => 'video/quicktime',
'avi' => 'video/x-msvideo'
);
# Find the Mime Type
#-------------------------------
if ($mine_types[$fext] == '') {
$mtype = '';
# mime type is not set, get from server settings
#-------------------------------
if (function_exists('mime_content_type')) {
$mtype = mime_content_type($file);
}
else
{
$mtype = "application/force-download";
}
}
else
{
# get mime type defined by admin
#-------------------------------
$mtype = $mine_types[$fext];
}
# Return our Type
#-------------------------------
return $mtype;
}
////////////////////////////////////////////////////////////
// Filesize of remote file
// Grab the filesize of a file hosted on another server
////////////////////////////////////////////////////////////
function remotefsize($url, $user = "", $pw = ""){
ob_start();
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 1);
if(!empty($user) && !empty($pw))
{
$headers = array('Authorization: Basic ' . base64_encode("$user:$pw"));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
}
$ok = curl_exec($ch);
curl_close($ch);
$head = ob_get_contents();
ob_end_clean();
$regex = '/Content-Length:\s([0-9].+?)\s/';
$count = preg_match($regex, $head, $matches);
return isset($matches[1]) ? $matches[1] : "unknown";
}
?>
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

