⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 feedforall_parse_itunes.inc.php

📁 for news RSS to HTML as ASP
💻 PHP
📖 第 1 页 / 共 2 页
字号:
        $_this->iTunesUsed = 1;        break;                case "ITUNES:DURATION":        $_this->currentItem->iTunes_duration .= $data;        $_this->currentItem->iTunesUsed = 1;        $_this->iTunesUsed = 1;        break;                case "ITUNES:KEYWORDS":        $_this->currentItem->iTunes_keywords .= $data;        $_this->currentItem->iTunesUsed = 1;        $_this->iTunesUsed = 1;        break;                case "ITUNES:AUTHOR":        $_this->currentItem->iTunes_author .= $data;        $_this->currentItem->iTunesUsed = 1;        $_this->iTunesUsed = 1;        break;                case "ITUNES:EXPLICIT":        $_this->currentItem->iTunes_explicit .= $data;        $_this->currentItem->iTunesUsed = 1;        $_this->iTunesUsed = 1;        break;                case "ITUNES:BLOCKED":        $_this->currentItem->iTunes_blocked .= $data;        $_this->currentItem->iTunesUsed = 1;        $_this->iTunesUsed = 1;        break;              }    }    elseif (($_this->insideChannel) && ($_this->level == $_this->level_channel+1)) {      //      // <channel>      switch ($_this->tag) {        case "ITUNES:SUBTITLE":        $_this->iTunes_subtitle .= $data;        $_this->iTunesUsed = 1;        break;                case "ITUNES:SUMMARY":        $_this->iTunes_summary .= $data;        $_this->iTunesUsed = 1;        break;                case "ITUNES:KEYWORDS":        $_this->iTunes_keywords .= $data;        $_this->iTunesUsed = 1;        break;                case "ITUNES:AUTHOR":        $_this->iTunes_author .= $data;        $_this->iTunesUsed = 1;        break;                case "ITUNES:EXPLICIT":        $_this->iTunes_explicit .= $data;        $_this->iTunesUsed = 1;        break;                case "ITUNES:BLOCKED":        $_this->iTunes_blocked .= $data;        $_this->iTunesUsed = 1;        break;              }    }    elseif (($_this->insideChannel) && ($_this->level == $_this->level_channel+2)) {      //      // <channel><itunes:owner>      switch ($_this->tag) {        case "ITUNES:EMAIL":        $_this->iTunes_ownerEmail .= $data;        $_this->iTunesUsed = 1;        break;                case "ITUNES:NAME":        $_this->iTunes_ownerName .= $data;        $_this->iTunesUsed = 1;        break;              }    }  }}Function FeedForAll_parse_iTunes_replaceInChannel($_this, $template) {  $template = FeedForAll_rss2html_str_replace("~~~FeediTunesSubtitle~~~", $_this->iTunes_subtitle, $template);  $template = FeedForAll_rss2html_str_replace("~~~FeediTunesSummary~~~", $_this->iTunes_summary, $template);  if (count($_this->iTunes_categoryArray)) {    $template = FeedForAll_rss2html_str_replace("~~~FeediTunesCategory~~~", $_this->iTunes_categoryArray[0]["Category"], $template);    $template = FeedForAll_rss2html_str_replace("~~~FeediTunesSubCategory~~~", $_this->iTunes_categoryArray[0]["SubCategory"], $template);  } else {    $template = FeedForAll_rss2html_str_replace("~~~FeediTunesCategory~~~", "", $template);    $template = FeedForAll_rss2html_str_replace("~~~FeediTunesSubCategory~~~", "", $template);  }  $template = FeedForAll_rss2html_str_replace("~~~FeediTunesKeywords~~~", $_this->iTunes_keywords, $template);  $template = FeedForAll_rss2html_str_replace("~~~FeediTunesAuthor~~~", $_this->iTunes_author, $template);  $template = FeedForAll_rss2html_str_replace("~~~FeediTunesOwnerEmail~~~", $_this->iTunes_ownerEmail, $template);  $template = FeedForAll_rss2html_str_replace("~~~FeediTunesOwnerName~~~", $_this->iTunes_ownerName, $template);  $template = FeedForAll_rss2html_str_replace("~~~FeediTunesImage~~~", FeedForAll_rss2html_EscapeLink($_this->iTunes_image), $template);  $template = FeedForAll_rss2html_str_replace("~~~FeediTunesExplicit~~~", $_this->iTunes_explicit, $template);  $template = FeedForAll_rss2html_str_replace("~~~FeediTunesBlocked~~~", $_this->iTunes_blocked, $template);  return $template;}Function FeedForAll_parse_iTunes_replaceInItem($currentItem, $item) {  return $item;}Function FeedForAll_parse_iTunes_createXML($currentItem) {  $resultString = "";  if ($currentItem->iTunes_subtitle != "") {    $resultString .= "    <itunes:subtitle>".htmlspecialchars($currentItem->iTunes_subtitle, ENT_NOQUOTES, "UTF-8")."</itunes:subtitle>\n";  }  if ($currentItem->iTunes_summary != "") {    $resultString .= "    <itunes:summary>".htmlspecialchars($currentItem->iTunes_summary, ENT_NOQUOTES, "UTF-8")."</itunes:summary>\n";  }  if ($currentItem->iTunes_duration != "") {    $resultString .= "    <itunes:duration>".htmlspecialchars($currentItem->iTunes_duration, ENT_NOQUOTES, "UTF-8")."</itunes:duration>\n";  }  if ($currentItem->iTunes_keywords != "") {    $resultString .= "    <itunes:keywords>".htmlspecialchars($currentItem->iTunes_keywords, ENT_NOQUOTES, "UTF-8")."</itunes:keywords>\n";  }  if ($currentItem->iTunes_author != "") {    $resultString .= "    <itunes:author>".htmlspecialchars($currentItem->iTunes_author, ENT_NOQUOTES, "UTF-8")."</itunes:author>\n";  }  if ($currentItem->iTunes_explicit != "") {    $resultString .= "    <itunes:excplicit>".htmlspecialchars($currentItem->iTunes_explicit, ENT_NOQUOTES, "UTF-8")."</itunes:excplicit>\n";  }  if ($currentItem->iTunes_blocked != "") {    $resultString .= "    <itunes:blocked>".htmlspecialchars($currentItem->iTunes_blocked, ENT_NOQUOTES, "UTF-8")."</itunes:blocked>\n";  }  return $resultString;}Function FeedForAll_parse_iTunes_addNamespace($_this, $templateString) {  $used = 0;    for ($x = 0; $x < count($_this->Items); $x++) {    if ($_this->Items[$x]->iTunesUsed) {      $used = 1;      break;    }  }    if ($used) {    if (strstr($templateString, "xmlns:itunes=\"http://www.itunes.com/dtds/podcast-1.0.dtd\"") === FALSE) {      // Add the itunes namespace      $templateString = str_replace("<rss ", "<rss xmlns:itunes=\"http://www.itunes.com/dtds/podcast-1.0.dtd\" ", $templateString);    }  }    return $templateString;}Function FeedForAll_parse_iTunes_rss2sql_buildInsert($currentItem, $config, &$fields, &$values) {  if (isset($config["ItemITunesSubtitle"]) && ($config["ItemITunesSubtitle"] != "")) {    $fields .= ",$config[ItemITunesSubtitle]";    $values .= ",'".addslashes($currentItem->iTunes_subtitle)."'";  }  if (isset($config["ItemITunesSummary"]) && ($config["ItemITunesSummary"] != "")) {    $fields .= ",$config[ItemITunesSummary]";    $values .= ",'".addslashes($currentItem->iTunes_summary)."'";  }  if (isset($config["ItemITunesDuration"]) && ($config["ItemITunesDuration"] != "")) {    $fields .= ",$config[ItemITunesDuration]";    $values .= ",'".addslashes($currentItem->iTunes_duration)."'";  }  if (isset($config["ItemITunesKeywords"]) && ($config["ItemITunesKeywords"] != "")) {    $fields .= ",$config[ItemITunesKeywords]";    $values .= ",'".addslashes($currentItem->iTunes_keywords)."'";  }  if (isset($config["ItemITunesAuthor"]) && ($config["ItemITunesAuthor"] != "")) {    $fields .= ",$config[ItemITunesAuthor]";    $values .= ",'".addslashes($currentItem->iTunes_author)."'";  }  if (isset($config["ItemITunesExplicit"]) && ($config["ItemITunesExplicit"] != "")) {    $fields .= ",$config[ItemITunesExplicit]";    $values .= ",'".addslashes($currentItem->iTunes_explicit)."'";  }  if (isset($config["ItemITunesBlocked"]) && ($config["ItemITunesBlocked"] != "")) {    $fields .= ",$config[ItemITunesBlocked]";    $values .= ",'".addslashes($currentItem->iTunes_blocked)."'";  }}Function FeedForAll_parse_iTunes_rss2sql_buildConfig(&$config, &$_POST, $type) {  if ($type == 1) {    //    // Initial defaults    $_POST["ItemITunesSubtitle"] = "ItemITunesSubtitle";    if (isset($config["ItemITunesSubtitle"])) {      $_POST["ItemITunesSubtitle"] = $config["ItemITunesSubtitle"];    }    $_POST["ItemITunesSummary"] = "ItemITunesSummary";    if (isset($config["ItemITunesSummary"])) {      $_POST["ItemITunesSummary"] = $config["ItemITunesSummary"];    }    $_POST["ItemITunesDuration"] = "ItemITunesDuration";    if (isset($config["ItemITunesDuration"])) {      $_POST["ItemITunesDuration"] = $config["ItemITunesDuration"];    }    $_POST["ItemITunesKeywords"] = "ItemITunesKeywords";    if (isset($config["ItemITunesKeywords"])) {      $_POST["ItemITunesKeywords"] = $config["ItemITunesKeywords"];    }    $_POST["ItemITunesAuthor"] = "ItemITunesAuthor";    if (isset($config["ItemITunesAuthor"])) {      $_POST["ItemITunesAuthor"] = $config["ItemITunesAuthor"];    }    $_POST["ItemITunesExplicit"] = "ItemITunesExplicit";    if (isset($config["ItemITunesExplicit"])) {      $_POST["ItemITunesExplicit"] = $config["ItemITunesExplicit"];    }    $_POST["ItemITunesBlocked"] = "ItemITunesBlocked";    if (isset($config["ItemITunesBlocked"])) {      $_POST["ItemITunesBlocked"] = $config["ItemITunesBlocked"];    }  }  elseif ($type == 2) {    //    // Show Configfile    if ($_POST["ItemITunesSubtitle"] != "") {      echo "\$config[\"ItemITunesSubtitle\"] = \"$_POST[ItemITunesSubtitle]\";\n";    }    if ($_POST["ItemITunesSummary"] != "") {      echo "\$config[\"ItemITunesSummary\"] = \"$_POST[ItemITunesSummary]\";\n";    }    if ($_POST["ItemITunesDuration"] != "") {      echo "\$config[\"ItemITunesDuration\"] = \"$_POST[ItemITunesDuration]\";\n";    }    if ($_POST["ItemITunesKeywords"] != "") {      echo "\$config[\"ItemITunesKeywords\"] = \"$_POST[ItemITunesKeywords]\";\n";    }    if ($_POST["ItemITunesAuthor"] != "") {      echo "\$config[\"ItemITunesAuthor\"] = \"$_POST[ItemITunesAuthor]\";\n";    }    if ($_POST["ItemITunesExplicit"] != "") {      echo "\$config[\"ItemITunesExplicit\"] = \"$_POST[ItemITunesExplicit]\";\n";    }    if ($_POST["ItemITunesBlocked"] != "") {      echo "\$config[\"ItemITunesBlocked\"] = \"$_POST[ItemITunesBlocked]\";\n";    }  }  elseif ($type == 3) {    //    // Show Database table creation    if ($_POST["ItemITunesSubtitle"] != "") {      echo "  $_POST[ItemITunesSubtitle] VARCHAR(255) NOT NULL DEFAULT \"\",\n";    }    if ($_POST["ItemITunesSummary"] != "") {      echo "  $_POST[ItemITunesSummary] MEDIUMTEXT NOT NULL DEFAULT \"\",\n";    }    if ($_POST["ItemITunesDuration"] != "") {      echo "  $_POST[ItemITunesDuration] VARCHAR(255) NOT NULL DEFAULT \"\",\n";    }    if ($_POST["ItemITunesKeywords"] != "") {      echo "  $_POST[ItemITunesKeywords] VARCHAR(255) NOT NULL DEFAULT \"\",\n";    }    if ($_POST["ItemITunesAuthor"] != "") {      echo "  $_POST[ItemITunesAuthor] VARCHAR(255) NOT NULL DEFAULT \"\",\n";    }    if ($_POST["ItemITunesExplicit"] != "") {      echo "  $_POST[ItemITunesExplicit] VARCHAR(255) NOT NULL DEFAULT \"\",\n";    }    if ($_POST["ItemITunesBlocked"] != "") {      echo "  $_POST[ItemITunesBlocked] VARCHAR(255) NOT NULL DEFAULT \"\",\n";    }  }  elseif ($type == 4) {    //    // Data entry form    echo "<tr><td colspan=\"2\"><hr></td></tr>\n";    echo "<tr><th valign=\"top\" align=\"left\">ItemITunesSubtitle</th><td><input type=\"text\" name=\"ItemITunesSubtitle\" value=\"$_POST[ItemITunesSubtitle]\" size=\"32\"><br><b>ItemTitle</b> is database field name to store the iTunes&reg; subtitle of the item.</td></tr>\n";    echo "<tr><th valign=\"top\" align=\"left\">ItemITunesSummary</th><td><input type=\"text\" name=\"ItemITunesSummary\" value=\"$_POST[ItemITunesSummary]\" size=\"32\"><br><b>ItemTitle</b> is database field name to store the iTunes&reg; summary of the item.</td></tr>\n";    echo "<tr><th valign=\"top\" align=\"left\">ItemITunesDuration</th><td><input type=\"text\" name=\"ItemITunesDuration\" value=\"$_POST[ItemITunesDuration]\" size=\"32\"><br><b>ItemTitle</b> is database field name to store the iTunes&reg; duration of the item.</td></tr>\n";    echo "<tr><th valign=\"top\" align=\"left\">ItemITunesKeywords</th><td><input type=\"text\" name=\"ItemITunesKeywords\" value=\"$_POST[ItemITunesKeywords]\" size=\"32\"><br><b>ItemTitle</b> is database field name to store the iTunes&reg; keywords of the item.</td></tr>\n";    echo "<tr><th valign=\"top\" align=\"left\">ItemITunesAuthor</th><td><input type=\"text\" name=\"ItemITunesAuthor\" value=\"$_POST[ItemITunesAuthor]\" size=\"32\"><br><b>ItemTitle</b> is database field name to store the iTunes&reg; author of the item.</td></tr>\n";    echo "<tr><th valign=\"top\" align=\"left\">ItemITunesExplicit</th><td><input type=\"text\" name=\"ItemITunesExplicit\" value=\"$_POST[ItemITunesExplicit]\" size=\"32\"><br><b>ItemTitle</b> is database field name to store the iTunes&reg; explicit of the item.</td></tr>\n";    echo "<tr><th valign=\"top\" align=\"left\">ItemITunesBlocked</th><td><input type=\"text\" name=\"ItemITunesBlocked\" value=\"$_POST[ItemITunesBlocked]\" size=\"32\"><br><b>ItemTitle</b> is database field name to store the iTunes&reg; blocked of the item.</td></tr>\n";  }}  ?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -