[RSS Feed Creator Pics] mehrere Kategorien, Bilder

Gesperrt
djw
Beiträge: 129
Registriert: Di 6. Apr 2004, 21:27
Wohnort: Baden
Kontaktdaten:

[RSS Feed Creator Pics] mehrere Kategorien, Bilder

Beitrag von djw » Sa 19. Apr 2008, 02:14

So hab mal ein bischen gebastelt (anderst kann man es nicht nennen:
Aus
RSS Feed Creator
und

Article List Advanced V4.6.x V1.4 von HerrB
wurde
RSS Feed Creator Pics

Features:
  • Bilder können per RSS ausgegeben werden
    Auswahl von mehreren Kategorien
Ihr benötigt die functions.input.helper.php im includes Verzeichniss

Demo Feed:
Backend (Flash Film):
Modul-Package:

Der Code ist noch recht unsauber.
Support kann ich leider keinen geben - zu wenig Zeit - sorry. - Wenn dann übers Forum.

Installation: Getestet auf:
  • 4.8.1

malsdgtac
Beiträge: 717
Registriert: Fr 12. Mär 2004, 15:50
Kontaktdaten:

Beitrag von malsdgtac » Do 15. Mai 2008, 20:29

das wäre genau das was ich brauchen könnte. Doch leider erhalte ich beim Import einen Fehler

Code: Alles auswählen

Warning: Invalid argument supplied for foreach() in /www/htdocs/v139888/contenido/classes/contenido/class.module.php on line 441
Ich habe allerdings auch eine 4.6.23 am Laufen, vielleicht liegt es ja daran.

djw
Beiträge: 129
Registriert: Di 6. Apr 2004, 21:27
Wohnort: Baden
Kontaktdaten:

Beitrag von djw » Do 15. Mai 2008, 21:24

ok hier der code:
INPUT:

Code: Alles auswählen

?><?php

/***********************************************
* CONTENIDO MODUL - INPUT
*
* Modulname  :      RSS Feed Creator Pics
* Author(s)   :     Markus Grampp Eventspezialeinheit.info
* Created     :     19.04.2008
************************************************/
#Includes
cInclude("frontend", "includes/functions.input.helper.php");
# Initialization
$bDebug      = false;
$iDataStart  = 20;
$sSubmitLink = '<a href="javascript:if (document.tplcfgform.send) {document.tplcfgform.send.value = 0}; document.tplcfgform.submit();"><img src="images/submit.gif" /></a>';
unset ($aSettings);

# Base settings
$aSettings = array();
$aSettings["ArticlePerPage"]     = "CMS_VALUE[1]";
$aSettings["SortBy"]             = "CMS_VALUE[2]";
$aSettings["SortDir"]            = "CMS_VALUE[3]";
$aSettings["ShowStart"]          = "CMS_VALUE[4]";
$aSettings["Category"]           = "CMS_VALUE[5]";
$aSettings["SampleCat"]          = "CMS_VALUE[12]";
$aSettings["SampleArt"]          = "CMS_VALUE[6]";
$aSettings["HeadlineIdentifier"] = "CMS_VALUE[7]";
$aSettings["HeadlineLength"]     = "CMS_VALUE[8]";
$aSettings["Elements"]           = "CMS_VALUE[9]";
$aSettings["CatTypeSel"]         = "CMS_VALUE[10]";
$aSettings["AddCats"]            = "CMS_VALUE[11]";
$aSettings["DateType"]           = "CMS_VALUE[97]";
$aSettings["Date"]               = "CMS_VALUE[98]";


$rss_title = "CMS_VALUE[104]";
if ("CMS_VALUE[105]" == '') {
    $rss_link = $cfgClient[$client]['path']['htmlpath'];
} else {
    $rss_link = "CMS_VALUE[105]";
}
$rss_description = "CMS_VALUE[106]";
if ("CMS_VALUE[107]" == '') {
    $rss_language = 'de';
} else {
    $rss_language = "CMS_VALUE[107]";
}
$rss_copyright = "CMS_VALUE[108]";
$rss_image_title = "CMS_VALUE[109]";
$rss_image_url = "CMS_VALUE[1010]";
$rss_image_link = "CMS_VALUE[1011]";
$rss_managingEditor = "CMS_VALUE[1012]";
$rss_webMaster = "CMS_VALUE[1013]";
$rss_maxCount = "CMS_VALUE[1014]";
$rss_ttl = "CMS_VALUE[1015]";


if (!is_numeric($aSettings["ArticlePerPage"]) || $aSettings["ArticlePerPage"] < 0) {
   $aSettings["ArticlePerPage"] = 0; // Deactivating page browsing
}
if (!is_numeric($aSettings["Category"]) || $aSettings["Category"] <= 0) {
   $aSettings["Category"] = 0;
}
if (!is_numeric($aSettings["SampleCat"]) || $aSettings["SampleCat"] <= 0) {
   $aSettings["SampleCat"] = $aSettings["Category"];
}
if (!is_numeric($aSettings["SampleArt"]) || $aSettings["SampleArt"] < 0) {
   $aSettings["SampleArt"] = 0;
}
if (strlen($aSettings["HeadlineIdentifier"]) > 50) {
   $aSettings["HeadlineIdentifier"] = "";
}
if (!is_numeric($aSettings["HeadlineLength"]) || $aSettings["HeadlineLength"] < 0) {
   $aSettings["HeadlineLength"] = 0;
}
if (!is_numeric($aSettings["Elements"]) || $aSettings["Elements"] < 0) {
   $aSettings["Elements"] = 0;
}
if ($aSettings["CatTypeSel"] == "" || ($aSettings["AddCats"] == "" && $aSettings["CatTypeSel"] == "selected")) {
   $aSettings["CatTypeSel"] = "none";
}

# Detail settings
if ($aSettings["Elements"] > 0) {
   for ($i = 0; $i < $aSettings["Elements"]; $i++) {
      $iElementType       = $iDataStart + ($i * 5);
      $iElementIdentifier = $iElementType + 1;
      $iElementWidth      = $iElementType + 2;
      $iElementHeight     = $iElementType + 3;


      $aSettings["k".$i] = array();
      $aSettings["k".$i]["ElementType"]    = "CMS_VALUE[$iElementType]"; // Text, Image, ExtractedImage
      $aSettings["k".$i]["Identifier"]     = "CMS_VALUE[$iElementIdentifier]";
      $aSettings["k".$i]["ElementWidth"]   = "CMS_VALUE[$iElementWidth]"; // Textlength or ImageWidth
      $aSettings["k".$i]["ElementHeight"]  = "CMS_VALUE[$iElementHeight]";

      # Check detail settings
      if ($aSettings["k".$i]["ElementType"] == "") {
         $aSettings["k".$i]["ElementType"] == "Text";
      }
      if ($aSettings["k".$i]["ElementType"] == "Text") {
         $aSettings["ElementHeight"] = 0;
         if (!is_numeric($aSettings["k".$i]["ElementWidth"]) || $aSettings["k".$i]["ElementWidth"] < 0) {
            $aSettings["k".$i]["ElementWidth"] = 50;
         }
      } else if (!is_numeric($aSettings["k".$i]["ElementWidth"]) || $aSettings["k".$i]["ElementWidth"] <= 0 ||
                 !is_numeric($aSettings["k".$i]["ElementHeight"]) || $aSettings["k".$i]["ElementHeight"] <= 0) {
         $aSettings["k".$i]["ElementWidth"] = 0;
         $aSettings["k".$i]["ElementHeight"] = 0;
      }
      if (strlen($aSettings["Identifier"]) > 50) {
         $aSettings["Identifier"] = "";
      }
   }
}

echo '        <table cellspacing="0" cellpadding="2" border="0" width="100%">'."\n";
echo '           <tr>'."\n";
echo '              <td class="text">'.mi18n("Primary Category:").'</td>'."\n";
echo '              <td class="text">'.fncBuildCategorySelect("CMS_VAR[5]", $aSettings["Category"], 0, "").'</td>'."\n";
echo '           </tr>'."\n";
echo '           <tr>'."\n";
echo '              <td class="text" style="vertical-align: top;">'.mi18n("Additional Categories:").'</td>'."\n";
echo '              <td class="text">';
    if ($aSettings["CatTypeSel"] == "none") {
        echo '<input type="radio" name="CMS_VAR[10]" value="none" checked="checked" onclick="document.getElementsByName(\'c'.$cnumber.'cbxAddCatSel\')[0].disabled = true;">'.mi18n("None").'&nbsp;';
    } else {
        echo '<input type="radio" name="CMS_VAR[10]" value="none" onclick="document.getElementsByName(\'c'.$cnumber.'cbxAddCatSel\')[0].disabled = true;">'.mi18n("None").'&nbsp;';
    }
    if ($aSettings["CatTypeSel"] == "below") {
        echo '<input type="radio" name="CMS_VAR[10]" value="below" checked="checked" onclick="document.getElementsByName(\'c'.$cnumber.'cbxAddCatSel\')[0].disabled = true;">'.mi18n("All below primary").'&nbsp;';
    } else {
        echo '<input type="radio" name="CMS_VAR[10]" value="below" onclick="document.getElementsByName(\'c'.$cnumber.'cbxAddCatSel\')[0].disabled = true;">'.mi18n("All below primary").'&nbsp;';
    }
    if ($aSettings["CatTypeSel"] == "selected") {
        $sDisabled = "";
        echo '<input type="radio" name="CMS_VAR[10]" value="selected" checked="checked" onclick="document.getElementsByName(\'c'.$cnumber.'cbxAddCatSel\')[0].disabled = false;">'.mi18n("Selected").'<br>';
    } else {
        $sDisabled = "disabled";
        echo '<input type="radio" name="CMS_VAR[10]" value="selected" onclick="document.getElementsByName(\'c'.$cnumber.'cbxAddCatSel\')[0].disabled = false;">'.mi18n("Selected").'<br>';
    }
echo fncAddMultiSelJS().fncBuildCategorySelect("c".$cnumber."cbxAddCatSel", $aSettings["AddCats"], 0, "fncUpdateSel('c".$cnumber."cbxAddCatSel', '"."CMS_VAR[11]"."');", "10", "multiple", false, 0, $sDisabled);
echo '<input type="hidden" name="CMS_VAR[11]" value="'.$aSettings["AddCats"].'"></td>'."\n";
echo '           </tr>'."\n";

echo '           <tr>'."\n";
echo '              <td class="text">'.mi18n("Sort by:").'</td>'."\n";
echo '              <td class="text"><select name="CMS_VAR[2]">'."\n";
    if ($aSettings["SortBy"] == "" || $aSettings["SortBy"] == "CATART.idart") {
    echo '                <option value="CATART.idart" selected>'.mi18n("Article ID").'</option>'."\n";
    } else {
    echo '                <option value="CATART.idart">'.mi18n("Article ID").'</option>'."\n";
    }
    if ($aSettings["SortBy"] == "tblData.value") {
    echo '                <option value="tblData.value" selected>'.mi18n("Headline").'</option>'."\n";
    } else {
    echo '                <option value="tblData.value">'.mi18n("Headline").'</option>'."\n";
    }
    if ($aSettings["SortBy"] == "ARTLANG.created") {
    echo '                <option value="ARTLANG.created" selected>'.mi18n("Create Date").'</option>'."\n";
    } else {
    echo '                <option value="ARTLANG.created">'.mi18n("Create Date").'</option>'."\n";
    }
    if ($aSettings["SortBy"] == "ARTLANG.lastmodified") {
    echo '                <option value="ARTLANG.lastmodified" selected>'.mi18n("Last Modified Date").'</option>'."\n";
    } else {
    echo '                <option value="ARTLANG.lastmodified">'.mi18n("Last Modified Date").'</option>'."\n";
    }
    if ($aSettings["SortBy"] == "ARTLANG.published") {
    echo '                <option value="ARTLANG.published" selected>'.mi18n("Published Date").'</option>'."\n";
    } else {
    echo '                <option value="ARTLANG.published">'.mi18n("Published Date").'</option>'."\n";
    }
    if ($aSettings["SortBy"] == "ARTLANG.title") {
    echo '                <option value="ARTLANG.title" selected>'.mi18n("Page Title (Backend)").'</option>'."\n";
    } else {
    echo '                <option value="ARTLANG.title">'.mi18n("Page Title (Backend)").'</option>'."\n";
    }
    if ($aSettings["SortBy"] == "ARTLANG.pagetitle") {
    echo '                <option value="ARTLANG.pagetitle" selected>'.mi18n("Page Title (Frontend)").'</option>'."\n";
    } else {
    echo '                <option value="ARTLANG.pagetitle">'.mi18n("Page Title (Frontend)").'</option>'."\n";
    }
    if ($aSettings["SortBy"] == "ARTLANG.summary") {
    echo '                <option value="ARTLANG.summary" selected>'.mi18n("Summary (Backend)").'</option>'."\n";
    } else {
    echo '                <option value="ARTLANG.summary">'.mi18n("Summary (Backend)").'</option>'."\n";
    }
    if ($aSettings["SortBy"] == "ARTLANG.artsort") {
    echo '                <option value="ARTLANG.artsort" selected>'.mi18n("Sort No.").'</option>'."\n";
    } else {
    echo '                <option value="ARTLANG.artsort">'.mi18n("Sort No.").'</option>'."\n";
    }
    if ($aSettings["SortBy"] == "RAND()") {
    echo '                <option value="RAND()" selected>'.mi18n("Random").'</option>'."\n";
    } else {
    echo '                <option value="RAND()">'.mi18n("Random").'</option>'."\n";
    }
    echo '              </select>'."\n";
    if ($aSettings["SortDir"] != "DESC") {
    echo '             <input type="radio" name="CMS_VAR[3]" value="ASC" checked>'.mi18n("Ascending").'&nbsp;<input type="radio" name="CMS_VAR[3]" value="DESC">'.mi18n("Descending")."\n";
    } else {
    echo '             <input type="radio" name="CMS_VAR[3]" value="ASC">'.mi18n("Ascending").'&nbsp;<input type="radio" name="CMS_VAR[3]" value="DESC" checked>'.mi18n("Descending")."\n";
    }
echo '           </tr>'."\n";
echo '           <tr>'."\n";
echo '              <td class="text">'.mi18n("Start Article:").'</td>'."\n";
    if ($aSettings["ShowStart"] != "enabled") {
    echo '              <td class="text"><input type="checkbox" name="CMS_VAR[4]" value="enabled">'.mi18n("Show").'</td>'."\n";
    } else {
    echo '              <td class="text"><input type="checkbox" name="CMS_VAR[4]" value="enabled" checked>'.mi18n("Show").'</td>'."\n";
    }
echo '           </tr>'."\n";
/*###########################################*/
echo '<tr><td class="text">Datums-Format</td>
            <td>
            <select name="CMS_VAR[98]" size="1" style="min-width: 250px;">
                    <option value="-1">Keine Datumsangabe anzeigen</option>';

                    if("CMS_VALUE[98]"=="d.m.y")      $s1='selected="selected"';
                    if("CMS_VALUE[98]"=="d.m.Y")      $s2='selected="selected"';
                    if("CMS_VALUE[98]"=="d.m.y H:i")  $s3='selected="selected"';
                    if("CMS_VALUE[98]"=="d.m.Y H:i")  $s4='selected="selected"';

                    if("CMS_VALUE[97]"=="create")     $s5='checked="checked"'; else $s5="";
                    if("CMS_VALUE[97]"=="publish")    $s6='checked="checked"'; else $s6="";

echo'               <option '.$s1.' value="d.m.y">31.12.99</option>
                    <option '.$s2.' value="d.m.Y">31.12.1999</option>
                    <option '.$s3.' value="d.m.y H:i">31.12.99 13:30 Uhr</option>
                    <option '.$s4.' value="d.m.Y H:i">31.12.1999 13:30 Uhr</option>
               </select>
               <input type="radio" name="CMS_VAR[97]" value="create" '.$s5.'>'.mi18n("Create Date").'&nbsp;
               <input type="radio" name="CMS_VAR[97]" value="publish" '.$s6.'>'.mi18n("Published Date").'
            </td></tr>
';
/*###########################################*/
echo '        </table>'."\n";
echo '        <table cellspacing="0" cellpadding="2" border="0" width="100%">'."\n";
echo '           <tr>'."\n";
echo '              <td colspan="2" class="textw_medium" style="background-color: #a9aec2; border: 1px solid #747488;">'.mi18n("Identify elements:").'</td>'."\n";
echo '           </tr>'."\n";
echo '              <td class="text" style="border-left:  1px solid #747488;">'.mi18n("Sample Category:").'</td>'."\n";
echo '              <td class="text" style="border-right: 1px solid #747488;">'.fncBuildCategorySelect("CMS_VAR[12]", $aSettings["SampleCat"], 0, "if (document.forms[0].elements['CMS_VAR[12]'].value != 'CMS_VALUE[12]') { document.forms[0].elements['CMS_VAR[6]'].disabled = true; document.forms[0].elements['CMS_VAR[7]'].disabled = true; document.forms[0].elements['CMS_VAR[8]'].disabled = true; document.forms[0].elements['CMS_VAR[9]'].disabled = true; } else { document.forms[0].elements['CMS_VAR[6]'].disabled = false; document.forms[0].elements['CMS_VAR[7]'].disabled = false; document.forms[0].elements['CMS_VAR[8]'].disabled = false; document.forms[0].elements['CMS_VAR[9]'].disabled = false;}").'&nbsp'.$sSubmitLink.'</td>'."\n";
echo '           </tr>'."\n";
echo '           <tr>'."\n";
echo '              <td class="text" style="border-left:  1px solid #747488;">'.mi18n("Sample Article:").'</td>'."\n";
    if ($aSettings["SampleCat"] == 0) {
    $sDisabled = "disabled";
    } else {
    $sDisabled = "";
    }
echo '              <td class="text" style="border-right: 1px solid #747488;">'.fncBuildArticleSelect("CMS_VAR[6]", $aSettings["SampleCat"], $aSettings["SampleArt"], "if (document.forms[0].elements['CMS_VAR[6]'].value != 'CMS_VALUE[6]') { document.forms[0].elements['CMS_VAR[7]'].disabled = true; document.forms[0].elements['CMS_VAR[8]'].disabled = true; document.forms[0].elements['CMS_VAR[9]'].disabled = true; } else { document.forms[0].elements['CMS_VAR[7]'].disabled = false; document.forms[0].elements['CMS_VAR[8]'].disabled = false; document.forms[0].elements['CMS_VAR[9]'].disabled = false;}", $sDisabled).'&nbsp'.$sSubmitLink.'</td>'."\n";
echo '           </tr>'."\n";
echo '           <tr>'."\n";
echo '              <td class="text" style="border-left:  1px solid #747488;">'.mi18n("Headline Element:").'</td>'."\n";
echo '              <td class="text" style="border-right: 1px solid #747488;">'.fncBuildTypeSelect("CMS_VAR[7]", $aSettings["SampleArt"], $aSettings["HeadlineIdentifier"], "'1','2','3','9','17'").' '.mi18n("Length (max.):").' <input type="text" name="'."CMS_VAR[8]".'" value="'.$aSettings["HeadlineLength"].'" size="3" title="'.mi18n("Set to 0 to show all").'"></td>'."\n";
echo '           </tr>'."\n";

    if ($aSettings["Elements"] == 0) {
    $sBottomStyle = "border-bottom: 1px solid #747488;"; // Paint the table area closing line
    } else {
    $sBottomStyle = "";
    }
echo '           <tr>'."\n";
echo '              <td class="text" style="border-left:  1px solid #747488;'.$sBottomStyle.'">'.mi18n("Additional elements:").'</td>'."\n";
echo '              <td class="text" style="border-right: 1px solid #747488;'.$sBottomStyle.'"><input type="text" name="CMS_VAR[9]" value="'.$aSettings["Elements"].'" size="3" title="'.mi18n("Set to a value above 0 to specify text or images as additional elements").'">&nbsp'.$sSubmitLink.'</td>'."\n";
echo '           </tr>'."\n";

if ($aSettings["Elements"] > 0) {
   for ($i = 0; $i < $aSettings["Elements"]; $i++) {
      $iElementType       = $iDataStart + ($i * 5);
      $iElementIdentifier = $iElementType + 1;
      $iElementWidth      = $iElementType + 2;
      $iElementHeight     = $iElementType + 3;


      echo '           <tr>'."\n";
      echo '              <td class="text" style="border-left:  1px solid #747488;padding-left: 20px;vertical-align: top;">'.sprintf(mi18n("%s. Element:"), $i + 1).'</td>'."\n";
      echo '              <td class="text" style="border-right: 1px solid #747488;">'.mi18n("Type:").'<br />'."\n";
      echo '                <select name="'."CMS_VAR[$iElementType]".'" onchange="if (document.forms[0].elements[\''."CMS_VAR[$iElementType]".'\'].value != \''.$aSettings["k".$i]["ElementType"].'\') { document.forms[0].elements[\''."CMS_VAR[$iElementIdentifier]".'\'].disabled = true; document.forms[0].elements[\''."CMS_VAR[$iElementWidth]".'\'].disabled = true; if (document.forms[0].elements[\''."CMS_VAR[$iElementHeight]".'\']) {document.forms[0].elements[\''."CMS_VAR[$iElementHeight]".'\'].disabled = true;}} else { document.forms[0].elements[\''."CMS_VAR[$iElementIdentifier]".'\'].disabled = false; document.forms[0].elements[\''."CMS_VAR[$iElementWidth]".'\'].disabled = false; if (document.forms[0].elements[\''."CMS_VAR[$iElementHeight]".'\']) {document.forms[0].elements[\''."CMS_VAR[$iElementHeight]".'\'].disabled = false;}}"">'."\n";
      if ($aSettings["k".$i]["ElementType"] == "Text") {
         echo '                 <option value="Text" selected="selected">'.mi18n("Text").'</option>'."\n";
      } else {
         echo '                 <option value="Text">'.mi18n("Text").'</option>'."\n";
      }
      if ($aSettings["k".$i]["ElementType"] == "Image") {
         echo '                 <option value="Image" selected="selected">'.mi18n("Image").'</option>'."\n";
      } else {
         echo '                 <option value="Image">'.mi18n("Image").'</option>'."\n";
      }
      if ($aSettings["k".$i]["ElementType"] == "ExtractedImage") {
         echo '                 <option value="ExtractedImage" selected="selected">'.mi18n("Image from text").'</option>'."\n";
      } else {
         echo '                 <option value="ExtractedImage">'.mi18n("Image from text").'</option>'."\n";
      }
      echo '                 </select>&nbsp'.$sSubmitLink.'&nbsp;'."\n";
      echo '              </td>'."\n";
      echo '           </tr>'."\n";

      if ($i == ($aSettings["Elements"] - 1)) {
         $sBottomStyle = "border-bottom: 1px solid #747488;"; // Paint the table area closing line
      } else {
         $sBottomStyle = "";
      }

      echo '           <tr>'."\n";
if($aSettings["k".$i]["ElementImgAlign"]=="left")$l='checked="checked"';  else $l="";
if($aSettings["k".$i]["ElementImgAlign"]=="right")$r='checked="checked"'; else $r="";

      switch ($aSettings["k".$i]["ElementType"]) {
         case "Image":
            echo '              <td class="text" style="border-left:  1px solid #747488;'.$sBottomStyle.'padding-left: 20px;">&nbsp;</td>'."\n";
            echo '              <td class="text" style="border-right: 1px solid #747488;'.$sBottomStyle.'">'.mi18n("Item:").'<br />'.fncBuildTypeSelect("CMS_VAR[$iElementIdentifier]", $aSettings["SampleArt"], $aSettings["k".$i]["Identifier"], "'4'").'&nbsp;'."\n";
            echo '                 '.mi18n("Width:"). ' <input type="text" name="'."CMS_VAR[$iElementWidth]".'" value="'.$aSettings["k".$i]["ElementWidth"].'" size="4" title="'.mi18n("Set to 0 to disable resize").'">&nbsp;'."\n";
            echo '                 '.mi18n("Height:").' <input type="text" name="'."CMS_VAR[$iElementHeight]".'" value="'.$aSettings["k".$i]["ElementHeight"].'" size="4" title="'.mi18n("Set to 0 to disable resize").'">'."\n";
            echo '                 <br></td>'."\n</td>";
            break;
         case "ExtractedImage":
            echo '              <td class="text" style="border-left:  1px solid #747488;'.$sBottomStyle.'padding-left: 20px;">&nbsp;</td>'."\n";
            echo '              <td class="text" style="border-right: 1px solid #747488;'.$sBottomStyle.'">'.mi18n("Item:").'<br />'.fncBuildTypeSelect("CMS_VAR[$iElementIdentifier]", $aSettings["SampleArt"], $aSettings["k".$i]["Identifier"], "'1','2','3','9','17'").'&nbsp;'."\n";
            echo '                 '.mi18n("Width:"). ' <input type="text" name="'."CMS_VAR[$iElementWidth]".'" value="'.$aSettings["k".$i]["ElementWidth"].'" size="4" title="'.mi18n("Set to 0 to disable resize").'">&nbsp;'."\n";
            echo '                 '.mi18n("Height:").' <input type="text" name="'."CMS_VAR[$iElementHeight]".'" value="'.$aSettings["k".$i]["ElementHeight"].'" size="4" title="'.mi18n("Set to 0 to disable resize").'">'."\n";
            echo '                 <br></td>'."\n</td>";
            break;
         default:
            echo '              <td class="text" style="border-left:  1px solid #747488;'.$sBottomStyle.'padding-left: 20px;">&nbsp;</td>'."\n";
            echo '              <td class="text" style="border-right: 1px solid #747488;'.$sBottomStyle.'">'.mi18n("Item:").'<br />'.fncBuildTypeSelect("CMS_VAR[$iElementIdentifier]", $aSettings["SampleArt"], $aSettings["k".$i]["Identifier"], "'1','2','3','9','17'").'&nbsp;'."\n";
            echo '                 '.mi18n("Length (max.):").' <input type="text" name="'."CMS_VAR[$iElementWidth]".'" value="'.$aSettings["k".$i]["ElementWidth"].'" size="3" title="'.mi18n("Set to 0 to show all").'"></td>'."\n";
      }
      echo '           </tr>'."\n";
   }
}

echo '        </table>'."\n";


///////////////////////////////////////////////////////////////////////////////////////////////////////////////
echo "<table cellspacing=\"0\" cellpadding=\"10\" border=\"0\">";
#Set default values
#Title
echo "  <tr valign=\"top\">
"."    <td>".mi18n("Titel").":</td>
"."    <td><input type=\"text\" maxlength=\"200\" style=\"width:300px;\" name=\"CMS_VAR[104]\" value=\"".$rss_title."\">
"."    </td>
"."  </tr>
";

#Link
echo "  <tr valign=\"top\">
"."    <td>".mi18n("Link").":</td>
"."    <td><input type=\"text\" maxlength=\"200\" style=\"width:300px;\" name=\"CMS_VAR[105]\" value=\"".$rss_link."\">
"."    </td>
"."  </tr>
";

#Description
echo "  <tr valign=\"top\">
"."    <td>".mi18n("Beschreibung").":</td>
"."    <td><input type=\"text\" maxlength=\"200\" style=\"width:300px;\" name=\"CMS_VAR[106]\" value=\"".$rss_description."\">
"."    </td>
"."  </tr>
";

#Language
$arrLanguages['de'] = mi18n("deutsch");
$arrLanguages['en'] = mi18n("englisch");
$arrLanguages['fr'] = mi18n("französisch");
$arrLanguages['it'] = mi18n("italienisch");
$arrLanguages['es'] = mi18n("spanisch");
$arrLanguages['nl'] = mi18n("niederländisch");
$arrLanguages['el'] = mi18n("griechisch");
$arrLanguages['pt'] = mi18n("portugiesisch");

echo "  <tr valign=\"top\">
"."    <td>".mi18n("Sprache").":</td>
"."    <td><select name=\"CMS_VAR[107]\" style=\"width:300px;\">
";
foreach ($arrLanguages as $key => $value) {
    if ($key == $rss_language) {
        echo "<option value=\"$key\" selected=\"selected\">$value
";
    } else {
        echo "<option value=\"$key\">$value
";
    }
}
echo "    </select></td></tr>
";

#Copyright
echo "  <tr valign=\"top\">
"."    <td>".mi18n("Copyright").":</td>
"."    <td><input type=\"text\" maxlength=\"200\" style=\"width:300px;\" name=\"CMS_VAR[108]\" value=\"".$rss_copyright."\">
"."    </td>
"."  </tr>
";

#Image title
echo "  <tr valign=\"top\">
"."    <td>".mi18n("Bildtitel").":</td>
"."    <td><input type=\"text\" maxlength=\"200\" style=\"width:300px;\" name=\"CMS_VAR[109]\" value=\"".$rss_image_title."\">
"."    </td>
"."  </tr>
";

#Image
$sql = "SELECT * FROM ".$cfg['tab']['upl']." WHERE (filetype='jpg') OR (filetype='jpeg') OR (filetype='gif') OR (filetype='png') ORDER BY dirname,filename";
$db->query($sql);
echo '<tr><td>'.mi18n("Bild").':</td><td><select name="CMS_VAR[1010]" size="1" style="width:300px;">';
$selected = false;
$img_display = '';

while ($db->next_record()) {
    $path = $db->f("dirname").$db->f("filename");
    if ($db->f("idupl") == $rss_image_url) {
        echo '<option selected="selected" value="'.$db->f("idupl").'">'.$path.'</option>';
        $img_display = $path;
        $selected = true;
    } else {
        echo '<option value="'.$db->f("idupl").'">'.$path.'</option>';
    }
}

if ($selected) {
    echo '<option value="">'.mi18n("Nichts ausgewählt.").'</option>';
} else {
    echo '<option selected="selected" value="">'.mi18n("Nichts ausgewählt.").'</option>';
}
echo "</select></td></tr>
";

#Image link
echo "  <tr valign=\"top\">
"."    <td>".mi18n("Link (bei Klick auf das Bild)").":</td>
"."    <td><input type=\"text\" maxlength=\"200\" style=\"width:300px;\" name=\"CMS_VAR[1011]\" value=\"".$rss_image_link."\">
"."    </td>
"."  </tr>
";

#Editor
echo "  <tr valign=\"top\">
"."    <td>".mi18n("EMail-Adresse Herausgeber").":</td>
"."    <td><input type=\"text\" maxlength=\"200\" style=\"width:300px;\" name=\"CMS_VAR[1012]\" value=\"".$rss_managingEditor."\">
"."    </td>
"."  </tr>
";

#EMail Webmaster
echo "  <tr valign=\"top\">
"."    <td>".mi18n("EMail-Adresse Webmaster").":</td>
"."    <td><input type=\"text\" maxlength=\"200\" style=\"width:300px;\" name=\"CMS_VAR[1013]\" value=\"".$rss_webMaster."\">
"."    </td>
"."  </tr>
";

#Max. number of articles
echo "  <tr valign=\"top\">
"."    <td>".mi18n("maximale Anzahl Artikel").":</td>
"."    <td><input type=\"text\" maxlength=\"200\" style=\"width:300px;\" name=\"CMS_VAR[1014]\" value=\"".$rss_maxCount."\">
"."    </td>
"."  </tr>
";

#TTL
echo "  <tr valign=\"top\">
"."    <td>".mi18n("TTL (Minuten)").":</td>
"."    <td><input type=\"text\" maxlength=\"200\" style=\"width:300px;\" name=\"CMS_VAR[1015]\" value=\"".$rss_ttl."\">
"."    </td>
"."  </tr>
";

echo "</table>
";
?><?php

djw
Beiträge: 129
Registriert: Di 6. Apr 2004, 21:27
Wohnort: Baden
Kontaktdaten:

OUTPUT

Beitrag von djw » Do 15. Mai 2008, 21:31

OUTPUT:


Code: Alles auswählen

<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname  :      RSS Feed Creator Pics
* Author(s)   :     Markus Grampp Eventspezialeinheit.info
* Created     :     19.04.2008
************************************************/
# Initialization
$bDebug     = false;
$iDataStart = 20;
$lCount     = 0;
unset ($aData);
$aData = array();

# Base settings
unset ($aSettings);
$aSettings = array();
$aSettings["SortBy"]             = "CMS_VALUE[2]";
$aSettings["SortDir"]            = "CMS_VALUE[3]";
$aSettings["ShowStart"]          = "CMS_VALUE[4]";
$aSettings["Category"]           = "CMS_VALUE[5]";
$aSettings["HeadlineIdentifier"] = "CMS_VALUE[7]";
$aSettings["HeadlineLength"]     = "CMS_VALUE[8]";
$aSettings["Elements"]           = "CMS_VALUE[9]";
$aSettings["CatTypeSel"]         = "CMS_VALUE[10]";
$aSettings["AddCats"]            = "CMS_VALUE[11]";
$aSettings["DateType"]           = "CMS_VALUE[97]";
$aSettings["Date"]               = "CMS_VALUE[98]";
$rss_title = "CMS_VALUE[104]";
$rss_link = "CMS_VALUE[105]";
$rss_description = "CMS_VALUE[106]";
$rss_language = "CMS_VALUE[107]";
$rss_copyright = "CMS_VALUE[108]";
$rss_image_title = "CMS_VALUE[109]";
$rss_image_url = "CMS_VALUE[1010]";
$rss_image_link = "CMS_VALUE[1011]";
$rss_managingEditor = "CMS_VALUE[1012]";
$rss_webMaster = "CMS_VALUE[1013]";
$rss_maxCount = "CMS_VALUE[1014]";
$rss_ttl = "CMS_VALUE[1015]";
$author = '';


#Output feed header
//header("Content-type: text/xml");
cInclude('classes', 'class.article.php');
$OutputRSS .= "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";
$OutputRSS .= "<rss version=\"2.0\">";
$OutputRSS .= "<channel>";
#Get feed image
if ($rss_image_link != '') {
    if (substr(strtolower($rss_image_link), 0, 7) != 'http://') {
        $rss_image_link = 'http://'.$rss_image_link;
    }
}

if ($rss_image_url != '') {
    $sql = "SELECT * FROM ".$cfg['tab']['upl']." WHERE idupl = ".$rss_image_url;
    $db->query($sql);
    if ($db->next_record()) {
        $rss_image_url = $cfgClient[$client]['path']['htmlpath'].$cfgClient[$client]['upl']['frontendpath'].$db->f("dirname").$db->f("filename");
        $rss_image_fs = $cfgClient[$client]['path']['frontend'].$cfgClient[$client]['upl']['frontendpath'].$db->f("dirname").$db->f("filename");
    }
}

$OutputRSS .= "<title>".prepareStringForOutput($rss_title)."</title>";
$OutputRSS .= "<copyright>".prepareStringForOutput($rss_copyright)."</copyright>";
$OutputRSS .= "<link>".prepareStringForOutput($rss_link)."</link>";
$OutputRSS .= "<description>".prepareStringForOutput($rss_description)."</description>";
$OutputRSS .= "<language>".prepareStringForOutput($rss_language)."</language>";
$OutputRSS .= "<lastBuildDate>".date('D, d M Y H:i:s T')."</lastBuildDate>";
$OutputRSS .= "<pubDate>".date('D, d M Y H:i:s T')."</pubDate>";
$OutputRSS .= "<generator>Contenido CMS</generator>";
$OutputRSS .= "<managingEditor>".$rss_managingEditor."</managingEditor>";
$OutputRSS .= "<webMaster>".$rss_webMaster."</webMaster>";
$OutputRSS .= "<ttl>".$rss_ttl."</ttl>";
$OutputRSS .= "<image>";
$OutputRSS .= "<title>".prepareStringForOutput($rss_image_title)."</title>";
list ($width, $height, $type, $attr) = getimagesize($rss_image_fs);
$OutputRSS .= "<width>".$width."</width>";
$OutputRSS .= "<height>".$height."</height>";
$OutputRSS .= "<url>".prepareStringForOutput($rss_image_url)."</url>";
$OutputRSS .= "<link>".prepareStringForOutput($rss_image_link)."</link>";
$OutputRSS .= "</image>";

// Daten für RSS
$RSS_OptionArray[Channel][Title] = "[Freiwillige Feuerwehr Rheinau] - Termine";
$RSS_OptionArray[Channel][Link] = "http://www.eventspezialeinheit.info/FFW/Final/FFW_Rheinau/";
$RSS_OptionArray[Channel][DeepLink] = $RSS_OptionArray[Channel][Link]."front_content.php";
$RSS_OptionArray[Channel][Description] = "Freiwillige Feuerwehr Rheinau news";
$RSS_OptionArray[Channel][Language] = "de-de";
$RSS_OptionArray[Channel][Copyright] = "Freiwillige Feuerwehr Rheinau";
$RSS_OptionArray[Channel][Image][URL] = "http://www.eventspezialeinheit.info/FFW/Final/FFW_Rheinau/upload/images/RssHeader.jpg";
$RSS_OptionArray[Channel][Image][Title] = "Freiwillige Feuerwehr Rheinau";
$RSS_OptionArray[Channel][Image][Link] = "http://www.eventspezialeinheit.info/FFW/Final/FFW_Rheinau/";
$RSS_OptionArray[Channel][webMaster] = "webmaster@feuerwehr-rheinau.de";
$RSS_OptionArray[Channel][managingEditor] = "webmaster@feuerwehr-rheinau.de";
$RSS_OptionArray[Channel][category] = "Firefighter";

if (!is_numeric($aSettings["Category"]) || $aSettings["Category"] <= 0) {
   $aSettings["Category"] = 0;
}
if (strlen($aSettings["HeadlineIdentifier"]) > 50) {
   $aSettings["HeadlineIdentifier"] = "";
}
if (!is_numeric($aSettings["HeadlineLength"]) || $aSettings["HeadlineLength"] < 0) {
   $aSettings["HeadlineLength"] = 0;
}
if (!is_numeric($aSettings["Elements"]) || $aSettings["Elements"] < 0) {
   $aSettings["Elements"] = 0;
}
if ($aSettings["CatTypeSel"] == "" || ($aSettings["AddCats"] == "" && $aSettings["CatTypeSel"] == "selected")) {
   $aSettings["CatTypeSel"] = "none";
}

# Detail settings
if ($aSettings["Elements"] > 0) {
   for ($i = 0; $i < $aSettings["Elements"]; $i++) {
      $iElementType       = $iDataStart + ($i * 5);
      $iElementIdentifier = $iElementType + 1;
      $iElementWidth      = $iElementType + 2;
      $iElementHeight     = $iElementType + 3;
      $iElementPadding    = $iElementType + 4;
      $iElementImgAlign   = $iElementType + 5;
      
      $aSettings["k".$i] = array();
      $aSettings["k".$i]["ElementType"]    = "CMS_VALUE[$iElementType]"; // Text, Image, ExtractedImage
      $aSettings["k".$i]["Identifier"]     = "CMS_VALUE[$iElementIdentifier]";
      $aSettings["k".$i]["ElementWidth"]   = "CMS_VALUE[$iElementWidth]"; // Textlength or ImageWidth
      $aSettings["k".$i]["ElementHeight"]  = "CMS_VALUE[$iElementHeight]";
      $aSettings["k".$i]["ElementPadding"] = "CMS_VALUE[$iElementPadding]";
      $aSettings["k".$i]["ElementImgAlign"]= "CMS_VALUE[$iElementImgAlign]";

      # Check detail settings
      if ($aSettings["k".$i]["ElementType"] == "") {
         $aSettings["k".$i]["ElementType"] == "Text";
      }
      if ($aSettings["k".$i]["ElementType"] == "Text") {
         $aSettings["ElementHeight"] = 0;
         if (!is_numeric($aSettings["k".$i]["ElementWidth"]) || $aSettings["k".$i]["ElementWidth"] < 0) {
            $aSettings["k".$i]["ElementWidth"] = 50;
         }
      } else if (!is_numeric($aSettings["k".$i]["ElementWidth"]) || $aSettings["k".$i]["ElementWidth"] <= 0 ||
                 !is_numeric($aSettings["k".$i]["ElementHeight"]) || $aSettings["k".$i]["ElementHeight"] <= 0) {
         $aSettings["k".$i]["ElementWidth"] = 0;
         $aSettings["k".$i]["ElementHeight"] = 0;
      }
      if (strlen($aSettings["Identifier"]) > 50) {
         $aSettings["Identifier"] = "";
      }
   }
}

unset ($iDataStart);
unset ($iElementType);
unset ($iElementIdentifier);
unset ($iElementWidth);
unset ($iElementHeight);

if ($aSettings["Category"] !== "0" && $aSettings["HeadlineIdentifier"] !== "") {
   if (!is_object($db2)) {
      $db2 = new DB_Contenido;
   }
# Nur nicht gesperrte Kategorieen anzeigen
cInclude("frontend", "includes/functions.navigation.php");
   # Specifying search categories
   $sSelCats = "'".$aSettings["Category"]."'";
   # Adding categories "below" primary category
   switch ($aSettings["CatTypeSel"]) {
      case "below":
         $lCatLevel = -1;
         $sql  = "SELECT a.idcat AS idcat, b.level AS level, c.idcatlang AS idcatlang, c.public AS public FROM ".$cfg["tab"]["cat"]." a, ".$cfg["tab"]["cat_tree"]." b, ".$cfg["tab"]["cat_lang"]." c ";
         $sql .= "WHERE a.idcat = b.idcat AND c.idcat = a.idcat AND c.idlang = '".$lang."' ORDER BY b.idtree";

         $db2->query($sql);
         while($db2->next_record()) {
            if ($db2->f("idcat") == $aSettings["Category"]) {
               $lCatLevel = $db2->f("level");
            } else if ($lCatLevel > -1 && $db2->f("level") > $lCatLevel) {
                if (checkCatPermission($db2->f("idcatlang"), $db2->f("public"))) {
                   $sSelCats .= ",'".$db2->f("idcat")."'";
                }
            } else if ($db2->f("level") <= $lCatLevel) {
               break;
            }
         }
         break;
      case "selected":
            $sql  = "SELECT a.idcat AS idcat, b.idcatlang AS idcatlang, b.public AS public FROM ".$cfg["tab"]["cat"]." a, ".$cfg["tab"]["cat_lang"]." b ";
            $sql .= "WHERE a.idcat = b.idcat AND b.idlang = '".$lang."' AND a.idcat IN ('".implode("', '", explode(",",$aSettings["AddCats"]))."')";
            $db2->query($sql);
            while($db2->next_record()) {
                if (checkCatPermission($db2->f("idcatlang"), $db2->f("public"))) {
                   $sSelCats .= ",'".$db2->f("idcat")."'";
                }
            }
         break;
      default:
   }

   $sql  = "SELECT tblData.value AS headline, ARTLANG.pagetitle AS pagetitle, ARTLANG.summary AS summary,ARTLANG.author AS Author, ARTLANG.idart AS id, ARTLANG.lastmodified AS lastmodified, " ;
   $sql .= "ARTLANG.created AS created, ARTLANG.published AS published, CATLANG.name AS category, ";
   $sql .= "ARTLANG.idartlang AS idartlang, CATART.idcat AS idcat, CATART.idcatart AS idcatart FROM ";
   $sql .= $cfg["tab"]["cat_art"]." AS CATART, ";
   $sql .= $cfg["tab"]["art_lang"]." AS ARTLANG, ";
   $sql .= $cfg["tab"]["cat_lang"]." AS CATLANG, ";
   $sql .= $cfg["tab"]["content"]." AS tblData ";

   $sql .= "WHERE CATART.idcat IN (".$sSelCats.") AND ARTLANG.idlang = '".$lang."' ";
   $sql .= "AND tblData.idartlang = ARTLANG.idartlang ";
   $sql .= "AND CATLANG.idlang = ARTLANG.idlang ";
   $sql .= "AND CATLANG.idcat = CATART.idcat ";
   $sql .= "AND ARTLANG.idart = CATART.idart ";

   if ($aSettings["ShowStart"] != "enabled") {
      if ($cfg["is_start_compatible"] == true) {
         $sql .= "AND CATART.is_start = '0' ";
      } else {
         $sql .= "AND tblData.idartlang != CATLANG.startidartlang ";
      }
   }

   $sql .= "AND ARTLANG.online = '1' ";
   $sql .= "AND ".$aSettings["HeadlineIdentifier"]." ";

   // Sort by
   $sql .= "ORDER BY ";
   $sql .= $aSettings["SortBy"]." ".$aSettings["SortDir"]." ";



   // execute query
   $db2->query($sql);
   $lCount = $db2->num_rows();

   if ($lCount > 0) {
      if (!is_object($db3)) {
         $db3 = new DB_Contenido;
      }
      if (!is_object($db4)) {
         $db4 = new DB_Contenido;
      }

         $lStartCount = 0;
         $lEndCount   = $lCount;
      $lRow = 0;
      $i    = 0;
      while ($db2->next_record()) {
         if ( $aSettings["ShowStart"] == "enabled" ||
             ($aSettings["ShowStart"] != "enabled" && $db2->f("idartlang") != $lStartIDArtLang)) {
            if ($lRow >= $lStartCount && $lRow < $lEndCount) {
               $aData[$i]                        = array();
               $aData[$i]["Category"]            = urldecode($db2->f("category"));
               $aData[$i]["idart"]           = $db2->f("id");
               $aData[$i]["idcat"]           = $db2->f("idcat");
               $aData[$i]["Link"]                = $sess->url("front_content.php?idart=".$db2->f("id"));
               $aData[$i]["LastModified"]        = $db2->f("lastmodified");
               $aData[$i]["Created"]             = $db2->f("created");
               $aData[$i]["Published"]           = $db2->f("published");
               $aData[$i]["Author"]           = $db2->f("Author");               
               # nachstehende Daten   Summary   eingefügt
               $aData[$i]["Summary"]           = $db2->f("summary");

               # nachstehende Daten   pagetitle  eingefügt
               $aData[$i]["Pagetitle"]           = $db2->f("pagetitle");
               $sTmpValue = html_entity_decode(strip_tags(urldecode($db2->f('headline'))));
               if ($aSettings["HeadlineLength"] > 0 && strlen($sTmpValue) > $aSettings["HeadlineLength"]) {
                  # Cutting text but preserving words and entities
                  $sTmpValue = htmlentities(capiStrTrimAfterWord($sTmpValue, $aSettings["HeadlineLength"])."...");
               }
               $aData[$i]["Headline"] = $sTmpValue;

               if ($aSettings["Elements"] > 0) {
                  for ($k = 0; $k < $aSettings["Elements"]; $k++) {
                     $aData[$i]["i".$k]               = array();
                     $aData[$i]["i".$k]["Value"]      = "";
                     $aData[$i]["i".$k]["ServerPath"] = "";
                     $aData[$i]["i".$k]["WebPath"]    = "";
                     $aData[$i]["i".$k]["Width"]      = 0;
                     $aData[$i]["i".$k]["Height"]     = 0;
                  }
               
                  $sql =  "SELECT tblData.value AS value, tblData.idtype AS idtype, tblData.typeid AS typeid FROM ";
                  $sql .= $cfg["tab"]["cat_art"]." AS tblCatArt, ";
                  $sql .= $cfg["tab"]["art_lang"]." AS tblArtLang, ";
                  $sql .= $cfg["tab"]["content"]." AS tblData ";
                  $sql .= "WHERE tblData.idartlang = tblArtLang.idartlang AND ";
                  $sql .= "tblArtLang.idlang = '".$lang."' AND ";
                  $sql .= "tblArtLang.idart = tblCatArt.idart AND ";
                  $sql .= "tblCatArt.idcatart = '".$db2->f("idcatart")."' AND (";
               
                  $sql_items = "";
                  for ($k = 0; $k < $aSettings["Elements"]; $k++) {
                     if ($aSettings["k".$k]["Identifier"] != "") {
                        if ($sql_items != "") {
                           $sql_items .= " OR (".$aSettings["k".$k]["Identifier"].")";
                        } else {
                           $sql_items = "(".$aSettings["k".$k]["Identifier"].")";
                        }
                     }
                  }
                  $sql .= $sql_items.")";
                 
                  if ($bDebug) {
                     echo "<pre>".$sql."</pre>", chr(10);
                  }

                  // execute query
                  $db3->query($sql);
                 
                  while ($db3->next_record()) {
                     $sTypeIdentifier = "tblData.idtype = '".$db3->f('idtype')."' AND tblData.typeid = '".$db3->f('typeid')."'";
                     
                     # Note: The TypeIdentifier for one item may be the same as for another item.
                     #       Therefore, we are storing the content everywhere as needed
                     for ($k = 0; $k < $aSettings["Elements"]; $k++) {
                        if ($sTypeIdentifier == $aSettings["k".$k]["Identifier"]) {
                           switch (TRUE) {
                              case ($aSettings["k".$k]["ElementType"] == "Image" || $aSettings["k".$k]["ElementType"] == "ExtractedImage"):
                                 $sql = "";
                                 if ($aSettings["k".$k]["ElementType"] == "Image") {
                                    $sql =  "SELECT dirname, filename FROM ".$cfg["tab"]["upl"]." ";
                                    $sql .= "WHERE idupl = '".$db3->f('value')."'";
                                 } else {
                                    $sTmpValue = urldecode($db3->f('value'));
   
                                    $regEx = "/<img[^>]*?>.*?/i";
                                    $match = array ();
                                    preg_match($regEx, $sTmpValue, $match);
     
                                    $regEx = "/(src)(=)(['\"]?)([^\"']*)(['\"]?)/i";
                                    $img = array ();
                                    preg_match($regEx, $match[0], $img);
                                    $img_src = preg_split("/\//", $img[0]);
                                   
                                    $img_name = $img_src[count($img_src) - 1];
                                    $img_name = preg_replace("/\"/", "", $img_name);
                                    #Don't know what is happening here, exactly...
                                    # $img_split = preg_split("/\./", $img_name);
                                    # $img_type = $img_split[count($img_split) - 1];
                                    # $img_split2 = preg_split("/_/", $img_split[0]);

                                    $name = strtolower($img_name);

                                    #Don't know what is happening here, exactly...
                                    #if (count($img_split2) > 1) {
                                    #   $img_x = $img_split2[count($img_split2) - 1];
                                    #   $img_y = $img_split2[count($img_split2) - 2];
   
                                    #   if (is_numeric($img_x) AND is_numeric($img_y)) {
                                    #      $suffix = "_".$img_x."_".$img_y.".".$img_type;
                                    #      $name = preg_replace("/$suffix/", "", $img_name);
                                    #      $name = $name.".[a-zA-Z]{3}";
                                    #   }
                                    #}
   
                                    if (strlen($name) > 0) {
                                       $sql =  "SELECT dirname, filename FROM ".$cfg["tab"]["upl"]." ";
                                       $sql .= "WHERE LOWER(filename) = '$name'";
                                       // $sql .= "WHERE filename REGEXP '$name'"; // Old: for 'banner.jpg' 'merlin_banner.jpg' is also returned
                                    }
                                 }
                             
                                 if ($bDebug) {
                                    echo "<pre>".$sql."</pre>";
                                 }
                             
                                 // execute query
                                 if ($sql != "") {
                                    $db4->query($sql);
                                 
                                    if ($db4->next_record()) {
                                       $aData[$i]["i".$k]["ServerPath"] = $cfgClient[$client]["upl"]["path"].$db4->f('dirname').$db4->f('filename');
                                       $aData[$i]["i".$k]["WebPath"]    = $cfgClient[$client]["upl"]["htmlpath"].$db4->f('dirname').$db4->f('filename');
###
                                       list ($width, $height, $type, $attr) = getimagesize($aData[$i]["i".$k]["ServerPath"]);
                                       $aData[$i]["i".$k]["Width"]      = $width;
                                       $aData[$i]["i".$k]["Height"]     = $height;
                                    }
                                 }
                                 break;
                              default:
                                 $sTmpValue = html_entity_decode(strip_tags(urldecode($db3->f('value'))));
                                 if ($aSettings["k".$k]["ElementWidth"] > 0 && strlen($sTmpValue) > $aSettings["k".$k]["ElementWidth"]) {
                                    # Cutting text but preserving words and entities
                                    $sTmpValue = htmlentities(capiStrTrimAfterWord($sTmpValue, $aSettings["k".$k]["ElementWidth"])."...");
                                 }
                                 $aData[$i]["i".$k]["Value"] = $sTmpValue;
                           }
                        }
                     }
                  }
               }
               $i++;
            } else if ($lRow == $lEndCount) {
               break;
            }
            $lRow++;
         }
      }
      # Clearing memory
      unset ($db2);
      unset ($db3);
      unset ($db4);
      unset ($sql);
      unset ($lStartIDArtLang);
      unset ($lStartCount);
      unset ($lEndCount);

      # Output data
      # Every output manipulation should be done here...
      #
      # Base information:
      # $aSettings["Elements"]:       Number of expected, additional elements from each article
      # $aSettings["ArticlePerPage"]: Number of articles per page (0: show all)
      # $aSettings["k".$i]["ElementType"]:   Per Element: Type of Element: Text, Image or ExtractedImage
      # $aSettings["k".$i]["ElementWidth"]:  Per Element: Text length or image width (-> recycling ...)
      # $aSettings["k".$i]["ElementHeight"]: Per Element: Image width
      #
      # Per article:
      # $aValue["Headline"]:          Content of article element specified as containing the headline information
      # $aValue["Link"]:              Relative link to get to the listed article
      # $aValue["LastModified"]:      Last modified date of the article
      # $aValue["Created"]:           Created date of the article
      # $aValue["Published"]:         Published date of the article
      # $aValue["Category"]:          Category name
      # $aValue["Summary"]:          summary Zusammenfassung
      # $aValue["Pagetitle"]:          Seitentitel pagetitle
      #
      # Per article additional element:
      # $aValue["i".$i]["Value"]:      Text (only for text elements, otherwise "")
      # $aValue["i".$i]["WebPath"]:    HTTP... path to image
      # $aValue["i".$i]["ServerPath"]: /server/... path to image
      # $aValue["i".$i]["Width"]:      >Original< image width
      # $aValue["i".$i]["Height"]:     >Original< image height



/* Init Template
*/
if ($i >= 1) {
          foreach ($aData as $aValue) {
             $artlist_headline = '<a href="'.$aValue["Link"].'">'.$aValue["Headline"].'</a>';
             $artlist_pagetitel = $aValue["Pagetitle"];
             $artlist_summary = $aValue["Summary"];
             if ($aSettings["Elements"] > 0) {
                for ($i = 0; $i < $aSettings["Elements"]; $i++) {
                   switch (TRUE) {
                      case ($aSettings["k".$i]["ElementType"] == "Image" || $aSettings["k".$i]["ElementType"] == "ExtractedImage"):
                         $image = $aValue["i".$i]["WebPath"];
                         
                         $width  = $aValue["i".$i]["Width"];
                         $height = $aValue["i".$i]["Height"];
                         if ($aSettings["k".$i]["ElementWidth"] > 0 && $aSettings["k".$i]["ElementHeight"] > 0) {
                            # Check, if resize necessary
                            if ($aValue["i".$i]["ServerPath"] != "" && file_exists($aValue["i".$i]["ServerPath"]) &&
                                ($aValue["i".$i]["Width"] > $aSettings["k".$i]["ElementWidth"] ||
                                 $aValue["i".$i]["Height"] > $aSettings["k".$i]["ElementHeight"])) {
                               # Scale image
                               $image = capiImgScale($aValue["i".$i]["ServerPath"], $aSettings["k".$i]["ElementWidth"], $aSettings["k".$i]["ElementHeight"], false, false, 10, false);

    ###                           #Get dimensions of the image
                               list ($width, $height, $type, $attr) = getimagesize(str_replace($cfgClient[$client]["path"]["htmlpath"], $cfgClient[$client]["path"]["frontend"], $image));
                            } else {
                               $image = $aValue["i".$i]["WebPath"];
                               $width  = $aValue["i".$i]["Width"];
                               $height = $aValue["i".$i]["Height"];
                            }
                         }
                         if ($image != "") {
    #####
             $artlist_image[URL] = trim($image); 
             $artlist_image[width] = $width;
             $artlist_image[height] = $height;
    #####
                         }else $artlist_image ="";
                         
                         break;
                      default: // Everything else is treated as "Text"
                            if ($artlist_summary == "") {
                                    $artlist_text =  $aValue["i".$i]["Value"];
                            } else {
                                    $artlist_text = $artlist_summary;
                            }
                   }
                }
             }
            $artlist_more = '<a href="'.$aValue["Link"].'">'.mi18n("More...").'</a>';


    if("CMS_VALUE[97]"=="create") {
        $tmp_artlist_Date = strtotime($aValue["Created"]);
    } else {
        $tmp_artlist_Date = strtotime($aValue["Published"]);
    }

        if("CMS_VALUE[98]"!="-1") {
            $artlist_lastmod = date('CMS_VALUE[98]', $tmp_artlist_Date);
            if(strlen($artlist_lastmod)>12)$artlist_lastmod=$artlist_lastmod." Uhr";
        } else {
               $artlist_lastmod = "";
        }
                    $OutputRSS .= "<item>";
                    $OutputRSS .= "<title>".prepareStringForOutput($aValue["Headline"])."</title>";

                   if ($artlist_image[URL] =="") {
                          $OutputRSS .='<description>'.prepareStringForOutput($artlist_text).'</description>';
                   } else {
                          $OutputRSS .= '<description><img src="'.$artlist_image[URL].'",templateId=renderScaled,property=Bild,width='.$artlist_image[width].'.jpg" alt="" align="left" style="padding-right:5px;" /> <br />'.prepareStringForOutput($artlist_text).'<br</description>';
                   }
                    $OutputRSS .= "<link>".$aValue["Link"]."</link>";
                    //$OutputRSS .= "<pubDate>".date('D, d M Y H:i:s T')."</pubDate>";
                    $OutputRSS .= "<pubDate>".$artlist_lastmod."</pubDate>";
                    $idart = $aValue["idart"];
                    $t1 = $cfg["tab"]["art_lang"];
                    $t2 = $cfg["tab"]["phplib_auth_user_md5"];
                    $sql = "SELECT ".$t2.".realname FROM ".$t1." INNER JOIN ".$t2." ON ".$t1.".author = ".$t2.".username WHERE (".$t1.".idart=$idart) AND (".$t1.".idlang=$lang)";
                    $db->query($sql);
                    if ($db->next_record()) {
                        $author = prepareStringForOutput($db->f("realname"));
                    } 
                    $OutputRSS .= "<author>".$author."</author>";
                    $OutputRSS .= "</item>";
          }
       }
    }
}
$OutputRSS .= "</channel>";
$OutputRSS .= "</rss>";
echo $OutputRSS;
# Clearing memory
unset ($aData);
unset ($aSettings);
unset ($i);
unset ($lCount);
unset ($bDebug);
function prepareStringForOutput($sIn) {

    $sIn = str_replace('&nbsp;',' ',$sIn);
    $sIn = str_replace('&nbsp;',' ',$sIn);
    return str_replace('&','&',htmlnumericalentities($sIn));
}

function htmlnumericalentities($str) {

    return preg_replace('/[^!-%\x27-;=?-~ ]/e', '"&#".ord("$0").chr(59)', $str);
}
?>

malsdgtac
Beiträge: 717
Registriert: Fr 12. Mär 2004, 15:50
Kontaktdaten:

Beitrag von malsdgtac » Do 15. Mai 2008, 22:03

Super und Danke!

Echt cool das Teil!

milez
Beiträge: 29
Registriert: Fr 8. Dez 2006, 13:35
Kontaktdaten:

Cool, aber mr?

Beitrag von milez » Do 3. Jul 2008, 08:51

Cool, ich würde dieses Modul gerne mit der mod_rewrite Version nutzen.

Dazu müßte ich die Stelle in deinem Skript finden, die den Link generiert.

Das habe ich aus einem anderen Modul:

Code: Alles auswählen

$link = 'http://' . $_SERVER['HTTP_HOST'] . ModRewrite::build_new_url("client=" . $client . "&lang=" . $lang . "&idcat=" . $selcat . "&idart=" . $linkID[$key] ); 
Vielleicht kannst du das nochmal so erwiteren, dass es auch mit mod_rewrite funzt?

z.b.

Code: Alles auswählen

if ($cfg['mod_rewrite']['use'] == 1) { 
}
else {
}
Grüße
Jan

wheelz
Beiträge: 13
Registriert: Mi 15. Feb 2006, 13:17
Wohnort: Hamburg
Kontaktdaten:

Beitrag von wheelz » Sa 19. Jul 2008, 15:37

Tausend Dank für dieses super Modul. Auf sowas habe ich lange gewartet.

Gibt es eine Möglichkeit, die relativen Links durch absolute zu ersetzen? Was müsste ich dafür ändern? Denn beim Einbinden des Feed auf anderen Seiten funktionieren die relativen Links natürlich nicht und führen zu Fehlermeldungen.

Nochmals besten Dank für dieses Modul!

Edit:
Lasse den Feed jetzt über Feedburner laufen - der bekommt es irgendwie hin, die relativen Links korrekt weiterzuleiten.

Jamest
Beiträge: 137
Registriert: Mi 2. Aug 2006, 09:29
Kontaktdaten:

Beitrag von Jamest » Mo 11. Aug 2008, 12:48

Bei mir gibt das Modul nur unformatierten TExt aus, was fehlt?

Grüße

Jamest

Gesperrt