Php-Seite in Flash anzeigen

mediamacher

Mitglied
Hallo,
ich habe eine Php-Seite, in der meine Ebay-Auktionen angezeigt werden. Ich möchte nun diese Seite in eine Flashdatei integrieren. Hat jemand einen Tip wie man dies via AS macht? Der Anfänger freut sich :-)

Grüsse
 
Hi,

Prinzipiell: Gar nicht! Die PHP-Seite generiert in der Regel html-Content, den Du in Flash nicht anzeigen kannst.

Allerdings: Je nachdem, wie Du auf diese Auktionen zugreifst, kannst Du die Daten auch in Flash darstellen, da Du die Ausgabe von serverseitigen Scripten lesen kannst. Um Dir explizite Tipps zu geben, müsste ich allerdings wissen, um was für Daten es sich handelt, und wie Du darauf zugreifst (ich handele nicht mit Ebay ;) ).

Gruß
.
 
Hallo,
mit diesem Script:

Code:
<html <?php echo HTML_PARAMS; ?>
<head>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<table border="0" width="100%" cellspacing="3" cellpadding="3">
  <tr>

    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
          </tr>
        </table></td>
      </tr>
      <tr>
      </tr>
      <tr>
        <td class="main">
<!-- ------------------------ ----------------- ebay anfang //-->
<?php


// Your Ebay Member Name
$ebayid = "XXX your ebayname XXX";

// Display Thumbnails?
$thumbs = "1";  // 1 = yes 0 = no

// Path to Footer File - blank for none
$header = "header.php";

// Path to Footer File - blank for none
$footer = "footer.php";

// Table Border Color
$table_border_color = "#4C6B9C";

// Table Header Row Color
$table_header_color = "#E5E1D2";

// Table Alt Color Row 1
$table_row1_color = "#F0F3F8";

// Table Alt Color Row 2
$table_row2_color = "#DAE1EF";

// Ebay uses Pacific time zone use this to add hours for your time zone
$timezone = "9";

// Display Ended Auctions (-1 = Current, 1 - 30 = Up to 30 Days in the past)
$since = "-1";

//Sort By (Item Number = 1, Auction Start = 2, Auction End = 3, Current Price = 4, Newest First = 8,)
$sort = "3";

// Display how many per page - Set to a very high number like 999999 for all your listings
$limit = "9999999";

// Start our border table
echo "
	<TABLE border=\"0\" cellPadding=\"10\" cellSpacing=\"0\" width=\"430\">


";


// Build the ebay url
$URL = "http://cgi6.ebay.com/ws/eBayISAPI.dll?MfcISAPICommand=ViewListedItems&userid=$ebayid&since=$since&sort=$sort&rows=0";

// Where to Start grabbing and where to End grabbing
$Start = "Click on the column headers to sort";
// $End = "</p><SCRIPT SRC=\"http://include.ebay.com/aw/pics/js/stats/ss.js\"></SCRIPT><SCRIPT SRC=\"http://include.ebay.com/aw/pics/js/stats/ss2.js\"></SCRIPT><p>" or "indicates that auction has ended.";

// Open the file
$file = fopen("$URL", "r");

// Read the file

if (!function_exists('file_get_contents')) {
     $r = fread($file, 80000);
}
else {
    $r = file_get_contents($URL);
}


// Grab just the contents we want
$stuff = eregi("$Start(.*)$End", $r, $content);

// Get rid of some rubbish we don't need.
// And set things up to be split into lines and items.

$content[1] = ereg_replace("</a><table border=\"1\" cellpadding=\"3\".*</td><br></tr>","",$content[1]);
$content[1] = ereg_replace("<tr bgcolor=\"#CCCCFF\">.*High Bidder \/ Status","",$content[1]);
$content[1] = ereg_replace("<tr bgcolor=\"#CCCCFF\">.*High Bidder \/ Status","",$content[1]);
$content[1] = str_replace("</table>", "", $content[1]);
$content[1] = str_replace("</th>", "", $content[1]);
$content[1] = str_replace("\r\n", "", $content[1]);
$content[1] = str_replace("\n", "", $content[1]);
$content[1] = str_replace("\r", "", $content[1]);
$content[1] = str_replace("<td align=\"center\">", "", $content[1]);
$content[1] = str_replace("<td>", "", $content[1]);
$content[1] = str_replace("<td align=\"right\">", "", $content[1]);
$content[1] = str_replace("<font color=\"\">", "", $content[1]);
$content[1] = str_replace("</font>", "", $content[1]);
$content[1] = str_replace("<tr bgcolor=\"#F9F9F7\">", "", $content[1]);
$content[1] = str_replace("<tr bgcolor=\"#efefef\">", "", $content[1]);
$content[1] = str_replace("<tr bgcolor=\"#efefef\">", "", $content[1]);
$content[1] = str_replace("</td>", "[ITEMS]", $content[1]);
$content[1] = str_replace("</tr>", "[LINES]\n", $content[1]);


// Line used during debug
// echo "<hr>$content[1]<br><br> <hr>";


// Close the file
fclose($file);

$stuff = $content[1];

// Build our first array for EOF
$items = explode("[LINES]",$stuff);

// Loop through our lines

$count = "0";

foreach ($items as $listing) {
	// Break apart each line into individual items

	list($Item,$Start,$End,$Price,$Title ) = explode("[ITEMS]",$listing);

	//Use a countdown to get Time Left
	//We first need to break apart End and convert the months to numbers
	$seperate = split('[- :]', $End);

	$seperate[0] = str_replace("Jan", "1", $seperate[0]);
	$seperate[0] = str_replace("Feb", "2", $seperate[0]);
	$seperate[0] = str_replace("Mar", "3", $seperate[0]);
	$seperate[0] = str_replace("Apr", "4", $seperate[0]);
	$seperate[0] = str_replace("May", "5", $seperate[0]);
	$seperate[0] = str_replace("Jun", "6", $seperate[0]);
	$seperate[0] = str_replace("Jul", "7", $seperate[0]);
	$seperate[0] = str_replace("Aug", "8", $seperate[0]);
	$seperate[0] = str_replace("Sep", "9", $seperate[0]);
	$seperate[0] = str_replace("Oct", "10", $seperate[0]);
	$seperate[0] = str_replace("Nov", "11", $seperate[0]);
	$seperate[0] = str_replace("Dec", "12", $seperate[0]);

    	$month = $seperate[0];
    	$day = $seperate[1];
    	$year = $seperate[2];
    	$hour = $seperate[3]+$timezone;
    	$minute = $seperate[4];
	$second = $seperate[5];

	// mktime is the marked time, and time() is the current time.
	$target = mktime($hour,$minute,$second,$month,$day,$year);
	$diff = $target - time();

	$days = ($diff - ($diff % 86400)) / 86400;
	$diff = $diff - ($days * 86400);
	$hours = ($diff - ($diff % 3600)) / 3600;
	$diff = $diff - ($hours * 3600);
	$minutes = ($diff - ($diff % 60)) / 60;
	$diff = $diff - ($minutes * 60);
	$seconds = ($diff - ($diff % 1)) / 1;

	// next we put it into a presentable format
	$Time_Left =  $days . "T" . " &nbsp; " . $hours . "Std" . " &nbsp; " . $minutes . "Min";

	// and last we want to print auction ended when the auction has ended
	if ($seconds <= 0) {
		$TimeLeft = "Auction ended";
		}
	else {
		$TimeLeft = $Time_Left;
		}

		// Make sure we have content to print out and print it
		if ($Start && $End && $Title && ($count < $limit)) {

			$count++;

			$colour = ( $colour == "$table_row1_color" ) ? "$table_row2_color" : "$table_row1_color";

					$line = "<TR><TD bgcolor=\"$colour\" align=\"center\">$Item</TD><TD bgcolor=\"$colour\">$Title</TD><TD bgcolor=\"$colour\"><b>$Price</b></TD><TD bgcolor=\"$colour\"><div align=\"center\"><font color=\"#C9671C\"><b>$TimeLeft</b></font></TD></div></TR>\n";
                    preg_match('/item=([^"&]*)/', $line, $match);
					$itemnum=$match[1];


				// If Thumbnails are enabled show them
				 if ($thumbs == 1) {
	                echo "<TR><TD bgcolor=\"$colour\" align=\"center\"><a href=\"http://cgi.ebay.de/ws/eBayISAPI.dll?ViewItem&item=$itemnum\" target=\"_blank\"><img src=\"http://thumbs.ebay.com/pict/$itemnum.jpg\" width=\"64\" height=\"64\" border=\"1\" style=\"border-color:#666666\"></a></TD><TD class=massTxt bgcolor=\"$colour\">$Title</TD><TD class=massTxt bgcolor=\"$colour\"><b>$Price</b></TD><TD class=massTxt bgcolor=\"$colour\"><div align=\"center\"></div></TD></TR>\n";
				 }

				// Otherwise just show the Bid Now link
				 else {
	                echo "<TR><TD bgcolor=\"$colour\" align=\"center\">$Item</TD><TD class=massTxt bgcolor=\"$colour\">$Title</TD><TD class=massTxt bgcolor=\"$colour\"><b>$Price</b></TD><TD class=massTxt bgcolor=\"$colour\"><div align=\"center\"><font color=\"#C9671C\"><b>$TimeLeft</b></font></div></TD></TR>\n";
				 }



		}

	}

// Wrap up the border table
echo "</TABLE></td></tr> </table>";



?>
<!-- ------------------------------------------ ebay ende //-->
        </td>
      </tr>

    </table></td>
    </table></td>
  </tr>
</table>

<!-- footer_eof //-->
<br>
</body>
</html>
 
Hi,

na ja, Du müsstest die gesamte Ausgabe (sprich: alles was an Variablen in Deinen Tabellen ausgegeben wird) in URL-codierte Variablen oder einen XML-Baum umleiten, so dass Dein Script z.B. so etwas ausgibt:
Code:
<auction title="bla">
  <name>Wasauchimmer</name>
  <expires>foobar</expires>
  <infos>blablubb</infos>
  <bidlink>http://www.nope</bidlink>
</auction>
...
(oder was auch immer da angezeigt wird; ich habe das Script nur überflogen)

Alles was in PHP mit echo() ausgegeben wird, kannst Du mit Flash einlesen (in meinem Beispiel z.B. in ein XML-Objekt). Die Daten müsstest Du dann auf Flashseite parsen und in eine anständige Form bringen (z.B. entsprechend formatierte Textfelder).

Such mal im hier Forum nach "RSS" oder "RSS-Ticker" - die entsprechenden Themen beschäftigen sich prinzipiell mit der selben Technologie.

Gruß
.
 
Zurück