Article List Advanced V2.2.2 feat. Bildmodul auf Slimbox

Gesperrt
dosenbrot
Beiträge: 102
Registriert: Fr 27. Aug 2004, 15:37
Kontaktdaten:

Article List Advanced V2.2.2 feat. Bildmodul auf Slimbox

Beitrag von dosenbrot »

Moin zusammen,

ich komme einfach nicht weiter. Ich verwende contenido 4.8.11 mit Mod_rewrite und möchte nun gerne das Modul "Bildmodul auf Slimbox 1.64 Basis" von xtended cooperation zusammen mit der Article List Advanced V4.6.x-V4.8.x V2.2.2 von funomat nutzen, so dass ich eine schöne Listenübersicht aller Bildergalerien mit Headline, angerissenem Artikeltext und Vorschaubild generieren kann.

Wenn ich aber die Artikel mit dem Bildermodul anlege, so dass mehrere Bilder als Galerie unter dem Artikel ausgegeben werden, kann ich nicht das erste Bild als Vorschaubild in der Listenübersicht anzeigen lassen. Grund: Es lässt sich in der Artikelkonfiguration kein Bilderelement auswählen.

Dies geht nur, wenn ich nur ein einziges Bild mit dem Bildermodul anzeigen lasse. Dann habe ich die Möglichkeit, entsprechend das Listenmodul zu konfigurieren und mir das Vorschaubild in der Liste anzeigen zu lassen.

Wer kann mir helfen? :-)

DANKE und Grüße!!!
dosenbrot

---

Hier die Module:

Modul-Input Artikelliste:

Code: Alles auswählen

#Includes
cInclude("frontend", "includes/functions.input.helper2.php");

# Initialization
$bDebug      = false;
$iDataStart  = 30;
$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["ArticleCount"]       = "CMS_VALUE[0]";
$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["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["SampleCat"]          = "CMS_VALUE[12]";
$aSettings["DateType"]           = "CMS_VALUE[13]";
$aSettings["Date"]               = "CMS_VALUE[14]";
$aSettings["Template"]           = "CMS_VALUE[15]";
$aSettings["PageBrowsingType01"] = "CMS_VALUE[16]";
$aSettings["PageBrowsingType02"] = "CMS_VALUE[17]";
$aSettings["PageBrowsingType03"] = "CMS_VALUE[18]";
$aSettings["PageBrowsingType04"] = "CMS_VALUE[19]";
$aSettings["PageBrowsingType05"] = "CMS_VALUE[20]";
$aSettings["UseUTF8"]            = "CMS_VALUE[21]";
$aSettings["ForceSummaryUsage"]  = "CMS_VALUE[22]";

# Checking base settings
if (!is_numeric($aSettings["ArticleCount"]) || $aSettings["ArticleCount"] < 0) {
   $aSettings["ArticleCount"] = 5;
}
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;
}
#echo "####".$aSettings["CatTypeSel"]."######<br/>";
#echo "####".$aSettings["AddCats"]."######<br/>";
if ($aSettings["CatTypeSel"] == "" || ($aSettings["AddCats"] == "" && $aSettings["CatTypeSel"] == "select")) {
   $aSettings["CatTypeSel"] = "none";
}
#echo "####".$aSettings["CatTypeSel"]."######";

# Detail settings
if ($aSettings["Elements"] > 0) {
   for ($i = 0; $i < $aSettings["Elements"]; $i++) {
      $iElementType       = $iDataStart + ($i * 10);
      $iElementIdentifier = $iElementType + 1;
      $iElementWidth      = $iElementType + 2;
      $iElementHeight     = $iElementType + 3;
      $iElementUseSummary = $iElementType + 4;
      #$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]["ElementUseSummary"] = "CMS_VALUE[$iElementUseSummary]";
      #$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"] = "";
      }
   }
}

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"] == "select") {
        $sDisabled = "";
        echo '<input type="radio" name="CMS_VAR[10]" value="select" 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="select" onclick="document.getElementsByName(\'c'.$cnumber.'cbxAddCatSel\')[0].disabled = false;">'.mi18n("Selected").'<br>';
    }

echo fncAddMultiSelJS().fncBuildCategorySelect("c".$cnumber."cbxAddCatSel", $aSettings["AddCats"], 0, "ArtAdv_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("Article:").'</td>'."\n";
echo '              <td class="text">'.mi18n("Count (total):").'&nbsp;<input type="text" name="CMS_VAR[0]" value="'.$aSettings["ArticleCount"].'" size="3" title="'.mi18n("Set to 0 to show all articles").'">&nbsp;'."\n";
echo '                '.mi18n("Per Page:").'&nbsp;<input type="text" name="CMS_VAR[1]" value="'.$aSettings["ArticlePerPage"].'" size="3" title="'.mi18n("Set to 0 to disable page browsing").'"></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("Add Date").'</option>'."\n";
    } else {
    echo '                <option value="ARTLANG.created">'.mi18n("Add 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[14]" size="1" style="min-width: 250px;">
                    <option value="-1">Keine Datumsangabe anzeigen</option>';

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

                    if("CMS_VALUE[13]"=="create")     $s5='checked="checked"'; else $s5="";
                    if("CMS_VALUE[13]"=="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[13]" value="create" '.$s5.'>'.mi18n("Create-Date").'&nbsp;
               <input type="radio" name="CMS_VAR[13]" value="publish" '.$s6.'>'.mi18n("Publish-Date").'
            </td>
           </tr>
           <tr>
            <td class="text">'.mi18n("Choose Template").':</td>
             <td class="text">
                 <select name="CMS_VAR[15]" size="1">
                    <option value="">'.mi18n("Nothing selected").'</option>';

$strPath_fs = $cfgClient[$client]["path"]["frontend"].'templates/';

$optionFields ="";
$handle = opendir($strPath_fs);
$files = array();
while ($entryName = readdir($handle)) 
{
    if (is_file($strPath_fs.$entryName)) 
    {
        $files[]=array($strPath_fs.$entryName,$entryName);
    }
}
closedir($handle);
asort($files);
while (list ($key, $val) = each ($files)) 
{
    if ("CMS_VALUE[15]"==$val[0])
    {
        $optionFields.="\n\t".'<option selected="selected" value="'.$val[0].'">'.$val[1].'</option>';
    } else {
        $optionFields.="\n\t".'<option value="'.$val[0].'">'.$val[1].'</option>';
    }
}
echo $optionFields.'</select></td>
           </tr>';

// Page browsing style 1
echo '           <tr>'."\n";
echo '              <td class="text">'.mi18n("Page browsing type:").'</td>'."\n";
    if ($aSettings["PageBrowsingType01"] != "enabled")
    {
        echo '              <td class="text"><input type="checkbox" name="CMS_VAR[16]" value="enabled"> '.mi18n("Back").' / '.mi18n("Next").'</td>'."\n";
    } else {
        echo '              <td class="text"><input type="checkbox" name="CMS_VAR[16]" value="enabled" checked> '.mi18n("Back").' / '.mi18n("Next").'</td>'."\n";
    }
echo '           </tr>'."\n";

// Page browsing style 2
echo '           <tr>'."\n";
echo '              <td>&nbsp;</td>'."\n";
    if ($aSettings["PageBrowsingType02"] != "enabled")
    {
        echo '              <td class="text"><input type="checkbox" name="CMS_VAR[17]" value="enabled"> 1 2 3 4 5 6 7 ...</td>'."\n";
    } else {
        echo '              <td class="text"><input type="checkbox" name="CMS_VAR[17]" value="enabled" checked> 1 2 3 4 5 6 7 ...</td>'."\n";
    }
echo '           </tr>'."\n";

// Page browsing style 3
echo '           <tr>'."\n";
echo '              <td>&nbsp;</td>'."\n";
    if ($aSettings["PageBrowsingType03"] != "enabled")
    {
        echo '              <td class="text"><input type="checkbox" name="CMS_VAR[18]" value="enabled"> '.mi18n("Page").' x '.mi18n("of").' y</td>'."\n";
    } else {
        echo '              <td class="text"><input type="checkbox" name="CMS_VAR[18]" value="enabled" checked> '.mi18n("Page").' x '.mi18n("of").' y</td>'."\n";
    }
echo '           </tr>'."\n";

// Page browsing style 4
echo '           <tr>'."\n";
echo '              <td>&nbsp;</td>'."\n";
    if ($aSettings["PageBrowsingType04"] != "enabled")
    {
        echo '              <td class="text"><input type="checkbox" name="CMS_VAR[19]" value="enabled"> |< 1 ... 3 4 5 ... 8 >|</td>'."\n";
    } else {
        echo '              <td class="text"><input type="checkbox" name="CMS_VAR[19]" value="enabled" checked> |< 1 ... 3 4 5 ... 8 >|</td>'."\n";
    }
echo '           </tr>'."\n";

// Page browsing style 5
echo '           <tr>'."\n";
echo '              <td>&nbsp;</td>'."\n";
    if ($aSettings["PageBrowsingType05"] != "enabled")
    {
        echo '              <td class="text"><input type="checkbox" name="CMS_VAR[20]" value="enabled"> &laquo; &lsaquo; 1 ... 3 4 5 ... 8 &rsaquo; &raquo;</td>'."\n";
    } else {
        echo '              <td class="text"><input type="checkbox" name="CMS_VAR[20]" value="enabled" checked> &laquo; &lsaquo; 1 ... 3 4 5 ... 8 &rsaquo; &raquo;</td>'."\n";
    }
echo '           </tr>'."\n";

// Enable UTF8 decoding
echo '           <tr>'."\n";
echo '              <td class="text">'.mi18n("Use UTF8 decoding:").'</td>'."\n";
    if ($aSettings["UseUTF8"] != "enabled")
    {
        echo '              <td class="text"><input type="checkbox" name="CMS_VAR[21]" value="enabled"> '.mi18n("Yes").' ('.mi18n("Only required if the client do not use UTF8 coding!").')</td>'."\n";
    } else {
        echo '              <td class="text"><input type="checkbox" name="CMS_VAR[21]" value="enabled" checked> '.mi18n("Yes").' ('.mi18n("Only required if the client do not use UTF8 coding!").')</td>'."\n";
    }
echo '           </tr>'."\n";

echo '<tr><td colspan="2">&nbsp;</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 '           <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 * 10);

echo "<!-- Durchlauf $i -->";

      $iElementIdentifier = $iElementType + 1;
      $iElementWidth      = $iElementType + 2;
      $iElementHeight     = $iElementType + 3;
      $iElementUseSummary = $iElementType + 4;
      /*$iElementPadding    = $iElementType + 4;
      $iElementImgAlign   = $iElementType + 5;*/

      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"]=="Text")$n='checked="checked"';  else $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>'.mi18n("Image-Padding:").'<br> <input type="text" name="'."CMS_VAR[$iElementPadding]".'" value="'.$aSettings["k".$i]["ElementPadding"].'" size="15" title="'.mi18n("CSS conformal image padding (0px 10px 0px 0px)").'">';
            echo '                 <br>'.mi18n("Image-Align:").'<br> <input type="radio" name="'."CMS_VAR[$iElementImgAlign]".'" value="left" '.$l.' title="'.mi18n("Picture adjustment in the text").'">'.mi18n("left").'
                                                                 <input type="radio" name="'."CMS_VAR[$iElementImgAlign]".'" value="right" '.$r.' title="'.mi18n("Picture adjustment in the text").'">'.mi18n("right").'
                                 <input type="radio" name="'."CMS_VAR[$iElementImgAlign]".'" value="none" '.$n.' title="'.mi18n("Picture adjustment in the text").'">'.mi18n("none");*/
            echo '              </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>'.mi18n("Image-Padding:").'<br> <input type="text" name="'."CMS_VAR[$iElementPadding]".'" value="'.$aSettings["k".$i]["ElementPadding"].'" size="15" title="'.mi18n("CSS conformal image padding (0px 10px 0px 0px)").'">';
            echo '                 <br>'.mi18n("Image-Align:").'<br> <input type="radio" name="'."CMS_VAR[$iElementImgAlign]".'" value="left" '.$l.' title="'.mi18n("Picture adjustment in the text").'">'.mi18n("left").'
                                                                 <input type="radio" name="'."CMS_VAR[$iElementImgAlign]".'" value="right" '.$r.' title="'.mi18n("Picture adjustment in the text").'">'.mi18n("right").'
                                 <input type="radio" name="'."CMS_VAR[$iElementImgAlign]".'" value="none" '.$n.' title="'.mi18n("Picture adjustment in the text").'">'.mi18n("none");*/
            echo '              </td>'."\n</td>\n\n\n\n";
            break;
         default:
            if ($aSettings["k".$i]["ElementUseSummary"] == "force")
            {
                $bUseSummary = ' checked="checked"';
            }
            else
            {
                $bUseSummary = '';
            }
            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").'"><br/><input type="checkbox" name="'."CMS_VAR[$iElementUseSummary]".'" value="force"'.$bUseSummary.' />'.mi18n("Force article summary usage").'</td>'."\n";
      }
      echo '           </tr>'."\n";
   }
}

echo '        </table>'."\n";
dosenbrot
Beiträge: 102
Registriert: Fr 27. Aug 2004, 15:37
Kontaktdaten:

Re: Article List Advanced V2.2.2 feat. Bildmodul auf Slimbox

Beitrag von dosenbrot »

Wegen Zeichenbegrenzung folgen hier die weiteren Module:

Modul-Output Artikelliste:

Code: Alles auswählen

<?php
# Initialization
$bDebug     = false;
$iDataStart = 30;
$lCount     = 0;

unset ($aData);
$aData = array();

# Base settings
unset ($aSettings);
$aSettings = array();
$aSettings["ArticleCount"]       = "CMS_VALUE[0]";
$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["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[13]";
$aSettings["Date"]               = "CMS_VALUE[14]";
$aSettings["Template"]           = "CMS_VALUE[15]";
$aSettings["PageBrowsingType01"] = "CMS_VALUE[16]";
$aSettings["PageBrowsingType02"] = "CMS_VALUE[17]";
$aSettings["PageBrowsingType03"] = "CMS_VALUE[18]";
$aSettings["PageBrowsingType04"] = "CMS_VALUE[19]";
$aSettings["PageBrowsingType05"] = "CMS_VALUE[20]";
$aSettings["UseUTF8"]            = "CMS_VALUE[21]";

# Checking base settings
if (!is_numeric($aSettings["ArticleCount"]) || $aSettings["ArticleCount"] < 0)
{
    $aSettings["ArticleCount"] = 5;
}
if (!is_numeric($aSettings["ArticlePerPage"]) || $aSettings["ArticlePerPage"] < 0)
{
    $aSettings["ArticlePerPage"] = 0; // Deactivating page browsing
}
if ($aSettings["ArticlePerPage"] == 0 || !is_numeric($_REQUEST["nextstep"]))
{
    $_REQUEST["nextstep"] = 0;
}
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";
}

if ($aSettings["UseUTF8"] == "enabled")
{
    # Needed functions for UTF8 and PHP4 - Posted by "laurynas.butkus@gmail.com" at http://us2.php.net/manual/de/function.html-entity-decode.php
    ######
    # In PHP4 html_entity_decode() is not working well with UTF-8  spitting: "Warning: cannot yet handle MBCS in html_entity_decode()!".
    # This is working solution combining several workarounds:
    ######
    function html_entity_decode_utf8($string)
    {
        static $trans_tbl;
       
        // replace numeric entities
        $string = preg_replace('~&#x([0-9a-f]+);~ei', 'code2utf(hexdec("\\1"))', $string);
        $string = preg_replace('~&#([0-9]+);~e', 'code2utf(\\1)', $string);
    
        // replace literal entities
        if (!isset($trans_tbl))
        {
            $trans_tbl = array();
           
            foreach (get_html_translation_table(HTML_ENTITIES) as $val=>$key)
                $trans_tbl[$key] = utf8_encode($val);
        }
       
        return strtr($string, $trans_tbl);
    }
    
    // Returns the utf string corresponding to the unicode value (from php.net, courtesy - romans@void.lv)
    function code2utf($num)
    {
        if ($num < 128) return chr($num);
        if ($num < 2048) return chr(($num >> 6) + 192) . chr(($num & 63) + 128);
        if ($num < 65536) return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
        if ($num < 2097152) return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128);
        return '';
    }
}

# Detail settings
if ($aSettings["Elements"] > 0)
{
    for ($i = 0; $i < $aSettings["Elements"]; $i++)
    {
        $iElementType       = $iDataStart   + ($i * 10);
        $iElementIdentifier = $iElementType + 1;
        $iElementWidth      = $iElementType + 2;
        $iElementHeight     = $iElementType + 3;
        $iElementUseSummary = $iElementType + 4;
        /*$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]["ForceSummaryUsage"] = "CMS_VALUE[$iElementUseSummary]";
        /*$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;
            }
        }
        elseif (!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"] = "";
        }
    } // end for
}

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

if ($aSettings["Category"] !== "0" && $aSettings["HeadlineIdentifier"] !== "")
{
    if (!is_object($db2))
    {
        $db2 = new DB_Contenido;
    }

    # 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 FROM " . $cfg["tab"]["cat"] . " a, " . $cfg["tab"]["cat_tree"] . " b ";
            $sql .= "WHERE a.idcat = b.idcat ORDER BY b.idtree";

            $db2->query($sql);
            while($db2->next_record())
            {
                if ($db2->f("idcat") == $aSettings["Category"])
                {
                    $lCatLevel = $db2->f("level");
                }
                elseif ($lCatLevel > -1 && $db2->f("level") > $lCatLevel)
                {
                    $sSelCats .= ",'" . $db2->f("idcat") . "'";
                }
                elseif ($db2->f("level") <= $lCatLevel)
                {
                    break;
                }
            } // end while
            break;
        case "select":
            $aCats = explode(",", $aSettings["AddCats"]);
            foreach ($aCats as $value)
            {
                if (is_numeric($value))
                {
                    $sSelCats .= ",'".$value."'";
                }
            }
            break;
        default:
    } // end switch

    $sql  = "SELECT tblData.value AS headline, ARTLANG.pagetitle AS pagetitle, ARTLANG.summary AS summary, 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"] . " ";

    // LIMIT
    if ($aSettings["ArticleCount"] > 0) {
        $sql .= "LIMIT 0, ".$aSettings["ArticleCount"];
    }

    // 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;
        }
        if ($aSettings["ArticlePerPage"] > 0)
        {
            $lStartCount = $_REQUEST["nextstep"];
            $lEndCount   = $_REQUEST["nextstep"] + $aSettings["ArticlePerPage"];
            if ($lEndCount > $lCount)
            {
                $lEndCount = $lCount;
            }
        }
        else
        {
            $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]["Link"]         = $sess->url("front_content.php?idcat=".$db2->f("idcat")."&idart=".$db2->f("id"));
                    # $aData[$i]["Link"]         = $sess->url("front_content.php?idcat=".$db2->f("idcat")."&idart=".$db2->f("id")."&id=".$db2->f("id"));
                    $aData[$i]["Link2"]        = $sess->url("idart=".$db2->f("id"));
                    $aData[$i]["LastModified"] = $db2->f("lastmodified");
                    $aData[$i]["Created"]      = $db2->f("created");
                    $aData[$i]["Published"]    = $db2->f("published");
                    # 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;
                        } // end for

                        $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"] . ")";
                                }
                            }
                        } // end for
                        $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:
                                            if ($aSettings["UseUTF8"] != "enabled")
                                            {
                                                $sTmpValue = html_entity_decode(strip_tags(urldecode($db3->f('value'))));
                                            }
                                            else
                                            {

                                                $sTmpValue = html_entity_decode_utf8(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 = capiStrTrimAfterWord($sTmpValue, $aSettings["k" . $k]["ElementWidth"]) . "...";
                                            }
                                            $aData[$i]["i".$k]["Value"] = $sTmpValue;
                                    } // end switch
                                }
                            } // end for
                        } // end while
                    }
                    $i++;
                }
                elseif ($lRow == $lEndCount)
                {
                    break;
                }
                $lRow++;
            }
        } // end while

        # 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
        # $aSettings["k".$i]["ForceSummaryUsage"]: Per Element: 
        #
        # 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 (!is_object($tpl)) {
            $tpl = new Template;
        }
        $tpl->reset();
    
        $tpl->set('s', 'TITLE', $newsheadline);
    
        foreach ($aData as $aValue)
        {
            $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 = '<div style="position:relative;left:5px;top:5px;width:0px;height:0px;"><img src="images/icon_imagebig.png"></div><img class="articlelistImage" style="border: #CFCFCF 1px solid;" src="' . $image . '" width="' . $width . '" height="' . $height . '" />'; // align="' . $aSettings["k" . $i]["ElementImgAlign"] . '" style="padding:' . $aSettings["k" . $i]["ElementPadding"] . ';"
                            }
                            else
                            {
                                $artlist_image = '<img src="images/blanko_magazin.png" class="teaser_img" style="border: #CFCFCF 1px solid;" width="160" height="100" />';
                            }
                            $tpl->set('d', 'IMG_'.$i,  $artlist_image);
                            
                            break;
                        default: // Everything else is treated as "Text"
                            if ($artlist_summary != "" && $aSettings["k" . $i]["ForceSummaryUsage"] == "force")
                            {
                                $artlist_text = $artlist_summary;
                                $tpl->set('d', 'TEXT_'.$i,  $artlist_text);
                            }
                            else
                            {
                                $artlist_text = $aValue["i" . $i]["Value"];
                                $tpl->set('d', 'TEXT_'.$i,  $artlist_text);
                            }
                            #echo $artlist_text;
                    } // end switch
                } // end for
            }
            $artlist_more = mi18n("More");
    
            if($aSettings["DateType"] == "create")
            {
                $tmp_artlist_Date = strtotime($aValue["Created"]);
            }
            else
            {
                $tmp_artlist_Date = strtotime($aValue["Published"]);
            }
    
            if($aSettings["Date"] != "-1")
            {
                $artlist_lastmod = date($aSettings["Date"], $tmp_artlist_Date);
                if(strlen($artlist_lastmod) > 12)
                {
                    $artlist_lastmod = $artlist_lastmod . mi18n(" Uhr");
                }
            }
            else
            {
                $artlist_lastmod = "";
            }
            
            $tpl->set('d', 'PAGELINK', $aValue["Link"]);
            $tpl->set('d', 'PAGELINK2', $aValue["Link2"]);
            $tpl->set('d', 'PAGETITEL', $aValue["Pagetitle"]);
            $tpl->set('d', 'HEADLINE', $aValue["Headline"]);
            $tpl->set('d', 'DATE', $artlist_lastmod);
            $tpl->set('d', 'MORE', $artlist_more);
    
            $tpl->next();
    
        } // end foreach
    }

    # Page browsing
    # Hint: Number of max available records: $lCount
    #       Number of pages: round($lCount / $aSettings["ArticlePerPage"])
    #       First page: nextstep=0
    #       Last page:  nextstep=(round($lCount / $aSettings["ArticlePerPage"]) - 1) * $aSettings["ArticlePerPage"];
    #                   (I have to admit that I'm not sure about the last page formula ... ;-) )
    if ($aSettings["ArticlePerPage"] > 0)
    {
        $iPages = intval(ceil($lCount / $aSettings["ArticlePerPage"]));
        
        # Example: Back and Next
        $sPageBrowsingType01 = '';
        if ($aSettings["PageBrowsingType01"] == "enabled")
        {
            if ($_REQUEST["nextstep"] > 0)
            {
                $sPageBrowsingType01 .= '<a class="pagebrowse">';
                $sPageBrowsingType01 .= '<a href="front_content.php?idcat=' . $idcat . '&idart=' . $idart . '&nextstep=' . ($_REQUEST["nextstep"] - $aSettings["ArticlePerPage"]) . '">' . mi18n("Back") . '</a>';
                $sPageBrowsingType01 .= '</a>';
            }
            
            if (($_REQUEST["nextstep"] + $aSettings["ArticlePerPage"]) < $lCount)
            {
                $sPageBrowsingType01 .= '<a class="pagebrowse">';
                $sPageBrowsingType01 .= '<a href="front_content.php?idcat=' . $idcat . '&idart=' . $idart . '&nextstep=' . ($_REQUEST["nextstep"] + $aSettings["ArticlePerPage"]) . '">' . mi18n("Next") . '</a>';
                $sPageBrowsingType01 .= '</a>';
            }
        }

        # Example: 1 2 3 4 5 6 7 ...
        $sPageBrowsingType02 = '';
        if ($aSettings["PageBrowsingType02"] == "enabled")
        {
            for ($i = 1; $i <= $iPages; $i++)
            {
                $lNextStep = ($i - 1) * $aSettings["ArticlePerPage"];
                if ($sPageBrowsingType02 != '')
                {
                    $sPageBrowsingType02 .= '';
                }
                
                if ($_REQUEST["nextstep"] == $lNextStep)
                {
                    $sPageBrowsingType02 .= $i; # I'm on the current page, no link
                }
                else
                {
                    $sPageBrowsingType02 .= '<a class="pagebrowse" href="front_content.php?idcat=' . $idcat . '&idart=' . $idart . '&nextstep=' . $lNextStep . '">' . $i . '</a>';
                }
            }
        }

        # Example: Seite 1 von 7
        $sPageBrowsingType03 = '';
        if ($aSettings["PageBrowsingType03"] == "enabled")
        {
            for ($i = 1; $i <= $iPages; $i++)
            {
                $lNextStep = ($i - 1) * $aSettings["ArticlePerPage"];
                if ($sPageBrowsingType03 != '')
                {
                    $sPageBrowsingType03 .= '';
                }
                
                if ($_REQUEST["nextstep"] == $lNextStep)
                {
                    $sPageBrowsingType03 .= mi18n("Page") . '' . $i . '' . mi18n("of") . '' . $iPages; # I'm on the current page, no link
                }
            }
        }

        # Example: |< 1 ... 3 4 5 ... 8 >|
        $sPageBrowsingType04 = '';
        if ($aSettings["PageBrowsingType04"] == "enabled")
        {
            $sPageBrowsingType04 .= '<a class="pagebrowse" href="front_content.php?idcat=' . $idcat . '&idart=' . $idart . '&nextstep=0">' . mi18n("Begin") . ' |<</a>';
            for ($i = 1; $i <= $iPages; $i++)
            {
                $lNextStep = ($i - 1) * $aSettings["ArticlePerPage"];
                if ($i == 1 || $i == $iPages)
                {
                    if ($sPageBrowsingType04 != '')
                    {
                        $sPageBrowsingType04 .= '';
                    }
                    
                    if ($_REQUEST["nextstep"] == $lNextStep)
                    {
                        $sPageBrowsingType04 .= $i; # I'm on the current page, no link
                    }
                    else
                    {
                        $sPageBrowsingType04 .= '<a class="pagebrowse" href="front_content.php?idcat=' . $idcat . '&idart=' . $idart . '&nextstep=' . $lNextStep . '">' . $i . '</a>';
                    }
                }
                elseif ($_REQUEST["nextstep"] == $lNextStep)
                {
                    $sPageBrowsingType04 .= '' . $i . "\n"; # I'm on the current page, no link
                }
                elseif ($_REQUEST["nextstep"] == ($lNextStep + $aSettings["ArticlePerPage"]))
                {
                    # Front
                    $sPageBrowsingType04 .= '<a class="pagebrowse" href="front_content.php?idcat=' . $idcat . '&idart=' . $idart . '&nextstep=' . $lNextStep . '">' . $i . '</a>';
                }
                elseif ($_REQUEST["nextstep"] == ($lNextStep - $aSettings["ArticlePerPage"]))
                {
                    # Back
                    $sPageBrowsingType04 .= '<a class="pagebrowse" href="front_content.php?idcat=' . $idcat . '&idart=' . $idart . '&nextstep=' . $lNextStep . '">' . $i . '</a>';
                }
                elseif ($_REQUEST["nextstep"] == ($lNextStep - (2 * $aSettings["ArticlePerPage"])) ||
                        $_REQUEST["nextstep"] == ($lNextStep + (2 * $aSettings["ArticlePerPage"])))
                {
                    $sPageBrowsingType04 .= '...';
                }
            }
            $sPageBrowsingType04 .= '<a class="pagebrowse" href="front_content.php?idcat=' . $idcat . '&idart=' . $idart . '&nextstep=' . (round($lCount / $aSettings["ArticlePerPage"]) - 1) * $aSettings["ArticlePerPage"] . '">>| ' . mi18n("End") . '</a>';
        }
        
        # Example: << < 1 ... 3 4 5 ... 8 > >>
        // First Page
        $sPageBrowsingType05 = '';
        if ($aSettings["PageBrowsingType05"] == "enabled")
        {
            if (isset($_GET['nextstep']) && !(($_GET['nextstep']) == 0))
            {
                $sPageBrowsingType05 .= '<a class="pagebrowse" href="magazin/" title="' . mi18n("Begin") . '">&laquo;</a>';
            }
            elseif (isset($_GET['nextstep']) && (($_GET['nextstep']) == 0) || !isset($_GET['nextstep']))
            {
                $sPageBrowsingType05 .= '<a class="pagebrowse">&laquo;</a>';
            }
            
            // Previous Page
            if (isset($_GET['nextstep']) && !(($_GET['nextstep']) == 0))
            {
                $sPageBrowsingType05 .= '<a class="pagebrowse" href="magazin/musicalnews-artikel' . ($_REQUEST["nextstep"] - $aSettings["ArticlePerPage"]) . '.html" title="' . mi18n("Previous") . '">&lsaquo;</a>';
            }
            elseif (isset($_GET['nextstep']) && (($_GET['nextstep']) == 0) || !isset($_GET['nextstep']))
            {
                $sPageBrowsingType05 .= '<a class="pagebrowse">&lsaquo;</a>';
            }
            
            for ($i = 1; $i <= $iPages; $i++) {
                $lNextStep = ($i - 1) * $aSettings["ArticlePerPage"];
                if ($i == 1 || $i == $iPages) {
                    if ($sPageBrowsingType05 != '') {
                        $sPageBrowsingType05 .= '';
                    }
                    if ($_REQUEST["nextstep"] == $lNextStep) {
                        $sPageBrowsingType05 .= '<a class="pagebrowse2">'.$i.'</a>'; # I'm on the current page, no link
                    } else {
                        $sPageBrowsingType05 .= '<a class="pagebrowse" href="magazin/musicalnews-artikel'.$lNextStep.'.html" title="weitere Musicalnews">'.$i.'</a>';
                    }
                } else if ($_REQUEST["nextstep"] == $lNextStep) {
                    $sPageBrowsingType05 .= '<a class="pagebrowse2">'.$i.'</a>'; # I'm on the current page, no link
                } else if ($_REQUEST["nextstep"] == ($lNextStep + $aSettings["ArticlePerPage"])) {
                    # Forward
                    $sPageBrowsingType05 .= '<a class="pagebrowse" href="magazin/musicalnews-artikel'.$lNextStep.'.html" title="weitere Musicalnews">'.$i.'</a>';
                } else if ($_REQUEST["nextstep"] == ($lNextStep - $aSettings["ArticlePerPage"])) {
                    # Back
                    $sPageBrowsingType05 .= '<a class="pagebrowse" href="magazin/musicalnews-artikel'.$lNextStep.'.html" title="weitere Musicalnews">'.$i.'</a>';
                } else if ( $_REQUEST["nextstep"] == ($lNextStep - (2 * $aSettings["ArticlePerPage"])) ||
                            $_REQUEST["nextstep"] == ($lNextStep + (2 * $aSettings["ArticlePerPage"]))) {
                    $sPageBrowsingType05 .= '<a class="pagebrowse">...</a>';
                }
            }
        
            // Next Page
            if (isset($_GET['nextstep']) && !(($_GET['nextstep']) == ((round($lCount / $aSettings["ArticlePerPage"]) - 1) * $aSettings["ArticlePerPage"])))
            {
                $sPageBrowsingType05 .= '<a class="pagebrowse" href="magazin/musicalnews-artikel' . ($_REQUEST["nextstep"] + $aSettings["ArticlePerPage"]) . '.html" title="' . mi18n("Next") . '">&rsaquo;</a>';
            }
            elseif (isset($_GET['nextstep']) && (($_GET['nextstep']) == ((round($lCount / $aSettings["ArticlePerPage"]) - 1) * $aSettings["ArticlePerPage"])))
            {
                $sPageBrowsingType05 .= '<a class="pagebrowse">&rsaquo;</a>';
            }
            else
            {
                $sPageBrowsingType05 .= '<a class="pagebrowse" href="magazin/musicalnews-artikel' . $aSettings["ArticlePerPage"] . '.html" title="' . mi18n("Next") . '">&rsaquo;</a>';
            }
            
            // Last Page
            if (isset($_GET['nextstep']) && !(($_GET['nextstep']) == ((round($lCount / $aSettings["ArticlePerPage"]) - 1) * $aSettings["ArticlePerPage"])) || !isset($_GET['nextstep']))
            {
                $sPageBrowsingType05 .= '<a class="pagebrowse" href="magazin/musicalnews-artikel'.(round($lCount / $aSettings["ArticlePerPage"]) - 1) * $aSettings["ArticlePerPage"].'.html" title="' . mi18n("End") . '">&raquo;</a>';
            }
            elseif (isset($_GET['nextstep']) && (($_GET['nextstep']) == ((round($lCount / $aSettings["ArticlePerPage"]) - 1) * $aSettings["ArticlePerPage"])))
            {
                $sPageBrowsingType05 .= '<a class="pagebrowse">&raquo;</a>';
            }
        }
    }
    $tpl->set('s', 'PAGEBROWSINGTYPE01', $sPageBrowsingType01);
    $tpl->set('s', 'PAGEBROWSINGTYPE02', $sPageBrowsingType02);
    $tpl->set('s', 'PAGEBROWSINGTYPE03', $sPageBrowsingType03);
    $tpl->set('s', 'PAGEBROWSINGTYPE04', $sPageBrowsingType04);
    $tpl->set('s', 'PAGEBROWSINGTYPE05', $sPageBrowsingType05);
    $tpl->generate($aSettings["Template"]);
}
# Clearing memory
unset ($aData);
unset ($aSettings);
unset ($i);
unset ($lCount);
unset ($bDebug);
?>
Modul-Input Bildermodul:

Code: Alles auswählen

?><?php
/***********************************************
* Bildmodul auf Slimbox 1.64 Basis
* 
* Inputbereich
*
* Author      :     Ralf Fleischer
* Copyright   :     xtended cooperation
* Mail        :     info@xtended-coperation.de
* Created     :     14-07-2008
* Version     :     0.0.6
* Modified    :     05-09-2008
************************************************/

$sSubmitLink = '<a href="javascript:if (document.tplcfgform.send) {document.tplcfgform.send.value = 0}; document.tplcfgform.submit();"><img src="images/submit.gif" /></a>';
$sSubmitOnchange='javascript:if (document.tplcfgform.send) {document.tplcfgform.send.value = 0}; document.tplcfgform.submit();';

$xtcSlimPicWidthA = "CMS_VALUE[1]";
$xtcSlimPicHeightA = "CMS_VALUE[2]";
$xtcSlimPicWidthZ = "CMS_VALUE[3]";
$xtcSlimPicHeightZ = "CMS_VALUE[4]";
$xtcSlimPicWidthCrop = "CMS_VALUE[5]";
$xtcSlimPicHeightCrop = "CMS_VALUE[6]";
$xtcSlimPicViewArt="CMS_VALUE[7]";
$xtcSlimPicCols="CMS_VALUE[8]";
$fValue="CMS_VALUE[10]";
?>
<table cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td colspan="2" style="padding-top:10px;padding-bottom:5px;">&nbsp;<?php echo mi18n("Anzeigeart:");?>&nbsp;</td>
    </tr>
    <tr>
        <td style="width:50px;">&nbsp;&nbsp;</td>
        <td>
            <select name="CMS_VAR[7]" onChange="<?php echo $sSubmitOnchange; ?>">
                <option value="img"<?php if(($xtcSlimPicViewArt=="img")OR($xtcSlimPicViewArt=="")){echo ' selected="selected"';}else{echo "";} ?>><?php echo mi18n("Bild einzeln");?></option>
                <option value="set"<?php if($xtcSlimPicViewArt=="set"){echo ' selected="selected"';}else{echo "";} ?>><?php echo mi18n("Bilderset einzeln");?></option>
                <option value="sets"<?php if($xtcSlimPicViewArt=="sets"){echo ' selected="selected"';}else{echo "";} ?>><?php echo mi18n("Bilderset mehrfach");?></option>
                <option value="htmlsets"<?php if($xtcSlimPicViewArt=="htmlsets"){echo ' selected="selected"';}else{echo "";} ?>><?php echo mi18n("Bilderset mehrfach mit HMTL-Bereich");?></option>
            </select>
        </td>
    </tr>
    <?php
    if(($xtcSlimPicViewArt=="sets")OR($xtcSlimPicViewArt=="htmlsets")){
    ?>
    <tr>
        <td colspan="2" style="padding-top:10px;padding-bottom:5px;">&nbsp;<?php echo mi18n("Anzahl der Bildbereiche:");?>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;&nbsp;</td>
        <td>&nbsp;<input style="text-align:right;" type="text" name="CMS_VAR[10]" value="<?php echo $fValue; ?>" size="3" />&nbsp;<?php echo mi18n("Bildbereiche");?>&nbsp;
        <?php echo mi18n("speichern");?>&nbsp;<?php echo $sSubmitLink;?>&nbsp;</td>
    </tr>
    <?php
    }
    if($xtcSlimPicViewArt=="img"){$fValue=0;}
    if($xtcSlimPicViewArt=="set"){$fValue=1;}
    if($fValue>0){
        ?>
    <tr><td colspan="2" style="padding-top:10px;padding-bottom:5px;"><?php echo mi18n("Verzeichnis auswählen").":&nbsp;"; ?></td></tr>
        <?php
        for ($i=1;$i<=$fValue;$i++){
             $fVar=20+$i;
             
              $sql = "SELECT DISTINCT dirname FROM ".$cfg['tab']['upl']." ORDER BY dirname";
              $db->query($sql);
      ?>
      <tr>
        <td>&nbsp;&nbsp;</td>
        <td>
            <select name="<?php echo "CMS_VAR[$fVar]";?>" size="1" style="width: 320px" onChange="<?php echo $sSubmitOnchange; ?>">
                <option value=""><?php echo mi18n("Nichts ausgewählt"); ?></option>
      <?php
                while ($db->next_record()) {
                    if ( stristr($db->f("dirname"),'CVS/') === FALSE ) {
                        if ($db->f("dirname")=="CMS_VALUE[$fVar]") {
                            echo '<option value="'.$db->f("dirname").'" selected="selected">'.$db->f("dirname").'</option>';
                        } else {
                            echo '<option value="'.$db->f("dirname").'">'.$db->f("dirname").'</option>';
                        }
                    }
                }
        ?>
        </select></td></tr>
        <?php
        }
    }
    ?>
    <tr>
        <td colspan="2" style="padding-top:10px;padding-bottom:5px;">&nbsp;<?php echo mi18n("Thumbnailgr&ouml;&szlig;e:");?>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;&nbsp;</td>
        <td>
            <input style="text-align:right;" type="text" name="CMS_VAR[1]" value="<?php echo $xtcSlimPicWidthA; ?>" size="3" />px&nbsp;<?php echo mi18n("max. Breite");?><br />
            <input style="text-align:right;" type="text" name="CMS_VAR[2]" value="<?php echo $xtcSlimPicHeightA; ?>" size="3" />px&nbsp;<?php echo mi18n("max. Höhe");?>&nbsp;
        </td>
    </tr>
    <tr>
        <td colspan="2" style="padding-top:10px;padding-bottom:5px;">
            &nbsp;<?php echo mi18n("Thumbnail beschneiden:");?>&nbsp;<br />
            &nbsp;<?php echo mi18n("(Wenn hier kein Eintrag ist oder 0 steht wird bleibt die Gr&ouml;ße gleich dem Thumbnail.)");?>&nbsp;
        </td>
    </tr>
    <tr>
        <td>&nbsp;&nbsp;</td>
        <td>
            <input style="text-align:right;" type="text" name="CMS_VAR[5]" value="<?php echo $xtcSlimPicWidthCrop; ?>" size="3" />px&nbsp;<?php echo mi18n("Breite");?><br />
            <input style="text-align:right;" type="text" name="CMS_VAR[6]" value="<?php echo $xtcSlimPicHeightCrop; ?>" size="3" />px&nbsp;<?php echo mi18n("Höhe");?>&nbsp;
        </td>
    </tr>
    <tr>
        <td colspan="2" style="padding-top:10px;padding-bottom:5px;">&nbsp;<?php echo mi18n("Zoomgr&ouml;&szlig;e:");?>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;&nbsp;</td>
        <td>
            <input style="text-align:right;" type="text" name="CMS_VAR[3]" value="<?php echo $xtcSlimPicWidthZ; ?>" size="3" />px&nbsp;<?php echo mi18n("max. Breite");?><br />
            <input style="text-align:right;" type="text" name="CMS_VAR[4]" value="<?php echo $xtcSlimPicHeightZ; ?>" size="3" />px&nbsp;<?php echo mi18n("max. Höhe");?>&nbsp;
        </td>
    </tr>
    <?php if(($xtcSlimPicViewArt!="img")AND($xtcSlimPicViewArt!="")){ ?>
    <tr>
        <td colspan="2" style="padding-top:10px;padding-bottom:5px;">&nbsp;<?php echo mi18n("Spaltenanzahl:");?>&nbsp;</td>
    </tr>
    <tr>
        <td>&nbsp;&nbsp;</td>
        <td>
            <input style="text-align:right;" type="text" name="CMS_VAR[8]" value="<?php echo $xtcSlimPicCols; ?>" size="3" />&nbsp;<?php echo mi18n("Spalten");?>&nbsp;
        </td>
    </tr>
    <?php } ?>
</table>
<?php
dosenbrot
Beiträge: 102
Registriert: Fr 27. Aug 2004, 15:37
Kontaktdaten:

Re: Article List Advanced V2.2.2 feat. Bildmodul auf Slimbox

Beitrag von dosenbrot »

sowie das letzte Modul...

Modul-Output Bildermodul:

Code: Alles auswählen

<?php
/***********************************************
* Bildmodul auf Slimbox 1.64 Basis
* 
* Outputbereich
*
* Author      :     Ralf Fleischer
* Copyright   :     xtended cooperation
* Mail        :     info@xtended-coperation.de
* Created     :     14-07-2008
* Version     :     0.0.6
* Modified    :     05-09-2008
************************************************/
//$localEntw="xtcSlimboxPic/";

?>
<script src="<?php echo $localEntw; ?>js/b_mootools.js" type="text/javascript"></script>
<script src="<?php echo $localEntw; ?>js/b_slimbox.js" type="text/javascript"></script>
<link media="screen" type="text/css" href="<?php echo $localEntw; ?>css/b_slimbox.css" rel="stylesheet">
<?php

####################################################
################## Datei Includes ##################
####################################################

cInclude("frontend", "includes/function.b_xtcSlimPic.php");
cInclude("includes", "functions.general.php");
cInclude("includes", "functions.lang.php");
cInclude("classes", "class.htmlelements.php");
cInclude("includes", "functions.api.images.php");

########################################################
################## Variablen zuweisen ##################
########################################################

$xtcSlimPic = "CMS_IMG[1]";
$xtcSlimPicWidthA = "CMS_VALUE[1]";
$xtcSlimPicHeightA = "CMS_VALUE[2]";
$xtcSlimPicWidthZ = "CMS_VALUE[3]";
$xtcSlimPicHeightZ = "CMS_VALUE[4]";
$xtcSlimPicWidthCrop = "CMS_VALUE[5]";
$xtcSlimPicHeightCrop = "CMS_VALUE[6]";
$xtcSlimPicViewArt="CMS_VALUE[7]";
$xtcSlimPicCols="CMS_VALUE[8]";
$fValueOut="CMS_VALUE[10]";
$bRecursive = false;
$aValidExtensions = array("jpg", "jpeg", "gif", "png");

###################################################################################
################## Abfragen falls Variablen nicht definiert sind ##################
###################################################################################

if (($xtcSlimPicWidthA == 0)OR($xtcSlimPicWidthA == "")){$xtcSlimPicWidthA = 150;}
if (($xtcSlimPicHeightA == 0)OR($xtcSlimPicHeightA == "")){$xtcSlimPicHeightA = 150;}
if (($xtcSlimPicWidthZ == 0)OR($xtcSlimPicWidthZ == "")){$xtcSlimPicWidthZ = 700;}
if (($xtcSlimPicHeightZ == 0)OR($xtcSlimPicHeightZ == "")){$xtcSlimPicHeightZ = 700;}
if ($xtcSlimPicWidthCrop == ""){$xtcSlimPicWidthCrop = 0;}
if ($xtcSlimPicHeightCrop == ""){$xtcSlimPicHeightCrop = 0;}

############################################################
################## Bildausgabe Einzelbild ##################
############################################################

if ($xtcSlimPicViewArt=="img"){
    if ($xtcSlimPic != "") {
        echo xtcSlimPicImg($xtcSlimPic,"lightbox");
    }
    if ($edit) {
        echo "CMS_IMGDESCR[1]";
    }
}
if ($xtcSlimPicViewArt!="img"){

#########################################################################           
################## Zusammenbau der CMS_VALUE Variablen ##################
#########################################################################  

    if($xtcSlimPicViewArt=="set"){$fValueOut=1;}

    if(($fValueOut!="")AND($fValueOut>0)){
        for ($y=1;$y<=$fValueOut;$y++){
           
            $fVarTemp=20+$y;
            $fVarTempCMS=200+$y;
            
            if($xtcSlimPicViewArt=="htmlsets"){
                echo "<div id=\"text\">".xtcSlimPicCmsHtml($fVarTempCMS)."</div>";
            }
            
            $sPath = "CMS_VALUE[$fVarTemp]";
            if ($sPath=='') {
                $sPath = $cfgClient[$client]["path"]["frontend"] . $cfgClient[$client]["upl"]["frontendpath"] . "bildergalerie/";
            } else {
                $sPath = $cfgClient[$client]["path"]["frontend"] . $cfgClient[$client]["upl"]["frontendpath"] . "CMS_VALUE[$fVarTemp]";
            }
            
            /* Read all gallery files */
            $aGalleryFiles = scanDirectory($sPath, $bRecursive);
            //array_multisort($aGalleryFiles, $sort, SORT_STRING);
            
            if (is_array($aGalleryFiles)) {
                /* Filter out non-images */
                foreach ($aGalleryFiles as $key => $aGalleryFile) {
                    $sExtension = strtolower(getFileExtension($aGalleryFile));
                    if (!in_array($sExtension, $aValidExtensions)) {
                        unset($aGalleryFiles[$key]);
                    }
                }
                $count=1;
                echo "<div id=\"xtcSlimboxPic\">";
                foreach ($aGalleryFiles as $sImageToDisplay) {
                    echo '<span class="xtcSlimboxPicCell">'.xtcSlimPicImg($sImageToDisplay,"lightboxset").'</span>';
                    if(is_int($count/$xtcSlimPicCols)){echo "<br class=\"clear\" />";}
                    $count++;
                }
                echo "</div>";
            }
           
        }
    }   
}
?>
dosenbrot
Beiträge: 102
Registriert: Fr 27. Aug 2004, 15:37
Kontaktdaten:

Re: Article List Advanced V2.2.2 feat. Bildmodul auf Slimbox

Beitrag von dosenbrot »

Ich hab es jetzt erst einmal so gelöst, dass ich das Bildmodul ein zweites Mal eingebunden habe (kleine Anpassungen an den Variablen) und darüber dann ein Einzelbild für die Liste ansteuere. Das ist zwar dann ein etwas größerer Aufwand beim Anlegen einer Galerie, aber es funktioniert zumindest wie gewünscht.

Falls noch jemand eine Idee haben sollte, wie automatisch das erste Bild aus dem Uploadordner in die Liste übernommen werden kann... ich freue mich über eine Benachrichtigung! :-)

Danke und Grüße
Dodger77
Beiträge: 3626
Registriert: Di 12. Okt 2004, 20:00
Wohnort: Voerde (Niederrhein)
Kontaktdaten:

Re: Article List Advanced V2.2.2 feat. Bildmodul auf Slimbox

Beitrag von Dodger77 »

Für die automatische Übernahme habe ich jetzt direkt auch keinen weiteren Ansatz. Ich denke, du hast das so schon ganz gut und pragmatisch gelöst. yodatortenboxer setzt dies wohl selbst ganz ähnlich um:

http://forum.contenido.org/viewtopic.ph ... 11#p123611
Gesperrt