NameSilo

Really very important problem

Spaceship Spaceship
Watch
Impact
0
who help me???
My site is hosted at http://www.dreamhost.com and they don't allow the fopen function I get this error.

Warning: fopen() [function.fopen]: URL file-access is disabled in the server configuration in /home/.booboo/user/domain/admin/import.php on line 90

Any solution to this yet?

Again this error shows when I try to import videos

my code is ;
PHP:
<?php
/*------------------------------------------------------------------------*/
// Product: PHP MELODY - MUSIC VIDEO CMS
// Version: 1.1
// Released: 14th OCTOBER 2007
// Copyright: (c) 2004-2007. All rights reserved.
/*------------------------------------------------------------------------*/
$showm = '2';
include('header.php');

// CHECK IF YOUTUBE DEV ID IS FILLED.
$q = mysql_query("SELECT yt_api FROM pm_config WHERE id = '1'");
$r = mysql_fetch_array($q);

if(empty($r['yt_api'])) {
$info_msg = '<div class="info_msg_errimg"><B>WARNING!</B> You can\'t import videos from Youtube.com unless you have a Youtube Developer ID. Please <a href="settings.php">click here</a> to change your current settings.</div>';
}

?>
<div id="sub_menu">
<li><a href="addvideo.php">Add new video</a></li>
<li><a href="import.php">Import from Youtube</a></li>
<li><a href="reports.php">Reported Videos</a></li>
<li><a href="voth.php">Change video of the day</a></li>
</div>
<div id="content">
<h2>Import from Youtube</h2>
<?=$info_msg?>
<div class="info_msg">
Search Youtube for the latest and hottest videos and instantly import them into your own database.<br />
<br />To import a video just fill in the form on the left and press <strong>'Import'</strong>.<br />
<strong>*</strong> Titles you should consider adding have a red background. 
</div>
<form action="import.php" method="post">
<input name="keyword" type="text" onclick='value=""' value="<?=$_POST['keyword']?>" size="30" maxlength="30"/>
<input name="submit" type="submit" value="Find" class="inputbutton" />
</form>
<table width="100%" border="0" cellspacing="2" cellpadding="10">
  <tr class="table_head">
    <td width="40%">Youtube Title / Views</td>
    <td width="30%">Thumbnails</td>
    <td>Import</td>
  </tr>
  
<?
if($_POST['submit'] && !empty($_POST['keyword'])) {
$v = str_replace(" ", "+", $_POST['keyword']);

$file = "http://www.youtube.com/api2_rest?method=youtube.videos.list_by_tag&dev_id="._YT_DEV."&page=1&per_page=25&tag=".$v."";
$youtube = array();
$youtube_index = "";
$youtube_array_counter = 0;

function startElement($parser, $name, $attrs) {
   	global $youtube, $youtube_array_counter, $youtube_index;
   	switch($name) {
   		case "VIDEO":
   		case "VIDEO_LIST":
   			$youtube_index = "";
   			break;
		default:
			$youtube_index = $name;
			$youtube[$youtube_array_counter][$youtube_index] = "";
			break;
	}
}

function endElement($parser, $name) {
   	global $youtube, $youtube_index, $youtube_array_counter;
   	switch($name) {
   		case "VIDEO":
   			$youtube_array_counter++;
   			break;
   	}
   	$youtube_index = "";
}

function characterData($parser, $data) {
	global $youtube, $youtube_array_counter, $youtube_index;
	if ($youtube_index != "") {
		$youtube[$youtube_array_counter][$youtube_index] .= trim($data);
	}
	
}

$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
if (!($fp = fopen($file, "r"))) {
	die("could not open XML input");
}

while ($data = fread($fp, 4096)) {
	if (!xml_parse($xml_parser, $data, feof($fp))) {
		die(sprintf("XML error: %s at line %d",
					xml_error_string(xml_get_error_code($xml_parser)),
					xml_get_current_line_number($xml_parser)));
	}
}
xml_parser_free($xml_parser);

// begin formatting
	$alt = '0';
for($i = 0;$i < count($youtube);$i++) {
		
	$title = $youtube[$i]["TITLE"];
	$id = $youtube[$i]["ID"];
	$time = $youtube[$i]["LENGTH_SECONDS"];
	$thumb = $youtube[$i]["THUMBNAIL_URL"];
	$views = $youtube[$i]["VIEW_COUNT"];
	$u_id = md5($id);
	$u_id = substr($u_id, 0, 9);  // abcd

	$song = str_replace("+", " ", $song);
	$song = addslashes($song);
	$artist = str_replace("+", " ", $artist);
	$artist = addslashes($artist);

	if($time > '120') {
		$check = mysql_query("SELECT yt_id FROM pm_videos WHERE yt_id = '$id'");
		$result = @mysql_fetch_array($check);

		if($id != $result['yt_id']) { 
	$col = ($alt % 2) ? 'table_row1' : 'table_row2';
	$alt++;
	if($views > 2000000) { $col = 'hot'; $h3class = 'yt_title_hot'; } else { $h3class = 'yt_title'; }

?>
  <tr>
    <td class="<?=$col?>">
	<h3><A href="http://www.youtube.com/watch?v=<?=$id?>" target="_blank" class="<?=$h3class?>"> <?=$title?><img src="images/go_open.gif" alt="Go" border="0" /></A></h3>
	<strong>Youtube Views:</strong> <?=$views?>
	</td>
    <td class="<?=$col?>">
<img src="http://img.youtube.com/vi/<?=$id?>/1.jpg" alt="1" width="100" height="76" border="0"/>
<img src="http://img.youtube.com/vi/<?=$id?>/2.jpg" alt="2" width="100" height="76" border="0"/>
<img src="http://img.youtube.com/vi/<?=$id?>/3.jpg" alt="3" width="100" height="76" border="0"/>
	</td>
    <td bgcolor="#FFFFFF">
	<iframe src="import_add.php?videoid=<?=$id?>" marginwidth="0" marginheight="0" width="170" height="100" border="0" frameborder="0" style="border:none;" scrolling="no"></iframe>
	</td>
  </tr>
<?
}

	} else {
}

}

}
echo '
</table>
</div>
';
include('footer.php');
?>


how i convert to the cURL ???
thanks for help
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Appraise.net
Unstoppable Domains
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back