Seite 1 von 1

Thumbnail Probleme

Verfasst: So 5. Feb 2006, 15:54
von renasco
Hallo alle zusammen,

ich hab seit gestern ein Problem den ich nicht lösen kann. Ich kriegs nicht hin in mein Artikelliste ein thumb anzuzeigen. Ich habe im Forum ein Beitrag gefunden. dort war dieses Code dabei:

Code: Alles auswählen

<?php 
/*********************************************** 
* CONTENIDO MODUL - OUTPUT 
* 
* Modulname  :      News 
* Author(s)   :     Andreas Lindner, 4fb 
* Copyright   :     Contenido - four for business, Andreas Lindner 
* Created     :     12.08.2005 
* Modified    :     27.01.2006 
************************************************/ 

cInclude('classes', 'class.article.php'); 
cInclude('includes', 'functions.api.string.php'); 
cInclude('includes', 'functions.api.images.php'); 

if (!is_object($tpl)) { 
   $tpl = new Template; 
} 

$tpl->reset(); 

$sql = "SELECT 
            htmlpath, frontendpath 
        FROM 
            ".$cfg["tab"]["clients"]." 
        WHERE 
            idclient = ".$client." "; 

$db->query($sql); 

if ($db->next_record()) { 
   $htmlpath = $db->f('htmlpath'); 
   $frontendpath = $db->f('frontendpath'); 
} 

// selected category 
$selcat = "CMS_VALUE[1]"; 
//echo "sel $selcat<br>"; 
$template = "teaser-standard.html"; 
//echo "tpl $template<br>"; 
// anzahl der zeichen text 
$mxtext = 200; 

$limit = "CMS_VALUE[15]"; 

$cms_sort_direction = "CMS_VALUE[16]"; 
if ($cms_sort_direction == '') { 
   $cms_sort_direction = 'desc'; 
} 

if ("CMS_VALUE[3]" == "sortdate") { 
   $order = 'lastmodified'; 
} else { 
   $order = 'artsort'; 
} 

$newsheadline = "CMS_VALUE[4]"; 

$tpl->set('s', 'TITLE', $newsheadline); 

if (strlen($selcat) > 0 AND $selcat != '0') { 
   $options = array ('idcat' => $selcat, "start" => false, "order" => $order, "direction" => $cms_sort_direction); 

   $list = new ArticleCollection($options); 

   $count = $list->count; 

   if ($count > 0) { 
      if (is_numeric($limit) AND strlen($limit) > 0) { 
         if ($limit < $list->count) { 
            $limit_art = $limit; 
         } else { 
            $limit_art = $list->count; 
         } 
      } else { 
         $limit_art = $list->count; 
      } 

      for ($i = 0; $i < $limit_art; $i ++) { 

         $article = $list->nextArticle(); 

         $article_id = $article->getField('idart'); 

         $teaser_img = ''; 
         if ($noimg != 'true') {//Wenn Bild ja 
             
            $br_img = $article->getContent('IMG', 1); 

            $img_teaser = ''; 

             
               $sql = "SELECT 
                                       * 
                                    FROM 
                                       ".$cfg["tab"]["upl"]." 
                                    WHERE 
                                       idupl=$br_img "; 

               //echo "<pre>"; print_r($sql); echo "</pre>"; 

               $db->query($sql); 

               if ($db->next_record()) { 
                   
                  $filename = $db->f('filename'); 
                  $dirname = $db->f('dirname'); 
                  //echo $dirname.$filename; 
               } 

               $img_path = $cfgClient[$client]["upl"]["path"].$dirname.$filename; 

               $img_size = "CMS_VALUE[14]"; 

               $img_teaser = capiImgScale($img_path, $img_size, $img_size, $crop = false, $expand = false, $cacheTime = 1000, $wantHQ = false); 
            $teaser_img = '<img src="'.$img_teaser.'" class="teaser_img">'; 

             

         } // end if noimg        

         $headline = strip_tags($article->getContent('CMS_HTMLHEAD', 1)); 
         $headline = str_replace($replace, " ", $headline); 

         /*         $subheadline = strip_tags($article->getContent('CMS_HTMLHEAD', 2)); 
                  $subheadline = str_replace($replace, " ", $subheadline);*/ 

         $teaserheadline = /*$subheadline."&nbsp;-&nbsp;".*/ 
         $headline; 
         $href = $sess->url("front_content.php?idcat=$selcat&idart=$article_id"); 
         $teasertext = $article->getField('summary'); 

         if (strlen(trim($teasertext)) == 0) { 
            $teasertext = strip_tags($article->getContent('CMS_HTML', 1)); 
            $teasertext2 = $teasertext; 
            $teasertext = capiStrTrimAfterWord($teasertext, $mxtext); 
            if ($teasertext!=$teasertext2) { 
               $teasertext.= '...'; 
            } 
             
         } // end if             

         $teasertext = $teasertext."&nbsp;"; 

         $tpl->set('d', 'HEADLINE', $teaserheadline); 
         $tpl->set('d', 'TEXT', $teasertext); 
         $tpl->set('d', 'HREF', $href); 
         $tpl->set('d', 'IMG', $teaser_img); 
         $tpl->set('d', 'MORE', mi18n("mehr")); 

         $tpl->next(); 

      } // end for 

      $tpl->generate('templates/'.$template); 

   } 
} 

?> 
Dieses Code hab ich, dann auch benutzt, dann hab ich als Beispiel 6 Artikel erstellt. Bei den neuesten Artikel hab ein Bild in das Bildmodul (CMS_IMG[1]) eingefügt, jetzt wird das Bild bei jeden Artikel erstellt. Überall wo ich {IMG} habe wird das selbe Bild angezeigt. BITTE HILFT MIR!!!!

Danke im Vorraus.

Verfasst: So 5. Feb 2006, 16:00
von rezeptionist
soweit ich das sehe ist das das Original News modul da ist es so das die Newsliste nur bilder darstellt die in dem Artikel in das Texthtml feld eingebaut sind

es gibt aber wenn du suchst nen Umbau mit der du auch das Bild aus dem Bildmodul Darstellen kannst

http://contenido.org/forum/viewtopic.ph ... =newsliste

ansonsten schau mal bei Module nach HerrB Artikelliste Advanced

http://contenido.org/forum/viewtopic.php?t=10957

Verfasst: So 5. Feb 2006, 16:19
von renasco
Das ist mir schon klar genau das hab ich auch benutzt. jetzt wird CMS_IMG[1] in der Liste angezeigt. Doch bei jeden Artikel auch wenn ich in ein Artikel kein Bild hab wird dort das selbe Bild angezeigt.
Hier ein Bild davon:
Bild

Ich hab nur beim ersten Artikel ein Bild eingefügt und zwar ins Bildmodul nicht ins Text. Ich hab schon alles versucht Auch das von HerrB mir angeckuckt wie er das gemacht hat versucht nach zu machen hab ich auch nicht hingekrigt.

Verfasst: So 5. Feb 2006, 16:38
von rezeptionist
Sorry leider Ist meine Hellsehkugel kaputt :wink: Steht ja auch im Modulhead das das Modul geändert ist !

so zu deinem Prob

komisch kommt mir vor

Code: Alles auswählen

$br_img = $article->getContent('IMG', 1);
versuche mal

Code: Alles auswählen

$br_img = $article->getContent('CMS_IMG', 1);
ungetestet

Verfasst: So 5. Feb 2006, 16:56
von renasco
Danke für die schnelle Antwort.
Aber das klappt auch nicht das ist genau so wie vorher

Verfasst: So 5. Feb 2006, 20:12
von renasco
Hey Leute ich bitte euch darum mir zu helfen.
Ich komme einfach nicht weiter.

Verfasst: So 5. Feb 2006, 20:19
von rezeptionist
Warum hälst du an diesem Modul fest das in der ursprünglichen version nur das bild aus dem HTML gezogen hat.

Das Modul von HerrB erfüllt deine wünsche Perfekt und ist dazu noch easy zu installieren ich denke mal in 2 Minuten ist der Fisch geputzt. Ich würde es mal so beschreiben du versuchst einen VW zu einem Ferrari umzubauen obwohl der Ferrari schon auf dem Hof steht .

http://contenido.org/forum/viewtopic.php?t=10957

Verfasst: So 5. Feb 2006, 20:34
von rezeptionist
So jetzt hab ich das modul mal wie gepostet getestet und wer sagt es es geht sprich da muss irfendetwas anderes nicht stimmen setzte mal in deine anderen Artikel andere Bilder ein bzw überprüfe mal dein Template etc. bzw überprüfe mal deine Konfigartion Templates Kategorie etc.
Hast du etwas an den Templates verändert zb die

Code: Alles auswählen

<!-- BEGIN:BLOCK --><!-- END:BLOCK --> 
entfernt etc

Verfasst: So 5. Feb 2006, 21:06
von renasco
So sieht das bei mir aus: Hab ich da was falsch gemacht????

Code: Alles auswählen

<!-- BEGIN:BLOCK -->
<table border="0" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" bgcolor="#F0F2F4">
      <tr>
        <td width="100%" height="3"></td>
      </tr>
      <tr>
        <td width="100%">
        {IMG}<a href="{HREF}" class="mainhead2">{HEADLINE}</a><br>
        <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
          <tr>
            <td width="50%">
        <p class="mainautor2">{AUTOR}</p>
            </td>
            <td width="50%">
        <p class="mainquelle2">{QUELLE} {TIME}</p>
            </td>
          </tr>
        </table>
        <font class="maintext2">{TEXT}&nbsp;<b><a href="{HREF}" ><font color="#000066">{MORE}</font></a></b>&nbsp;<a href="{HREF}"><img src="images/navi_pfeil_rechts.gif" border="0" alt="{MORE}" title="{MORE}" /></a></font>
        </td>
      </tr>
      <tr>
      <td>
      <hr color="#1D66C0" size="1">
      </td>
      </tr>
    </table>
<!-- END:BLOCK -->

Verfasst: So 5. Feb 2006, 21:09
von rezeptionist
Also daran liegt es definitiv nicht hast du die Seite online ?? wenn Ja schick mal deine Daten per PM

Verfasst: So 5. Feb 2006, 21:24
von renasco
JUHUUUUUUUUUUUU,
ich hab es geschafft und das ganz alleine ;)

ich hab das nur damit erweitert.

Code: Alles auswählen

if($br_img!='')
         {
               $teaser_img = '<img src="'.$img_teaser.'" class="teaser_img">'; 
         }
Ist aber eine Coole Lösung jetzt hab ich mein Ferrarie ;)

Code: Alles auswählen

<?php 
/*********************************************** 
* CONTENIDO MODUL - OUTPUT 
* 
* Modulname  :      News 
* Author(s)   :     Andreas Lindner, 4fb 
* Copyright   :     Contenido - four for business, Andreas Lindner 
* Created     :     12.08.2005 
* Modified    :     27.01.2006 
************************************************/ 

cInclude('classes', 'class.article.php'); 
cInclude('includes', 'functions.api.string.php'); 
cInclude('includes', 'functions.api.images.php'); 

if (!is_object($tpl)) { 
   $tpl = new Template; 
} 

$tpl->reset(); 

$sql = "SELECT 
            htmlpath, frontendpath 
        FROM 
            ".$cfg["tab"]["clients"]." 
        WHERE 
            idclient = ".$client." "; 

$db->query($sql); 

if ($db->next_record()) { 
   $htmlpath = $db->f('htmlpath'); 
   $frontendpath = $db->f('frontendpath'); 
} 

// selected category 
$selcat = "CMS_VALUE[1]"; 
//echo "sel $selcat<br>"; 
$template = "teaser_efrin3.html"; 
//echo "tpl $template<br>"; 
// anzahl der zeichen text 
$mxtext = 200; 

$limit = "CMS_VALUE[15]"; 

$cms_sort_direction = "CMS_VALUE[16]"; 
if ($cms_sort_direction == '') { 
   $cms_sort_direction = 'desc'; 
} 

if ("CMS_VALUE[3]" == "sortdate") { 
   $order = 'lastmodified'; 
} else { 
   $order = 'artsort'; 
} 

$newsheadline = "CMS_VALUE[4]"; 

$tpl->set('s', 'TITLE', $newsheadline); 

if (strlen($selcat) > 0 AND $selcat != '0') { 
   $options = array ('idcat' => $selcat, "start" => false, "order" => $order, "direction" => $cms_sort_direction); 

   $list = new ArticleCollection($options); 

   $count = $list->count; 

   if ($count > 0) { 
      if (is_numeric($limit) AND strlen($limit) > 0) { 
         if ($limit < $list->count) { 
            $limit_art = $limit; 
         } else { 
            $limit_art = $list->count; 
         } 
      } else { 
         $limit_art = $list->count; 
      } 

      for ($i = 0; $i < $limit_art; $i ++) { 

         $article = $list->nextArticle(); 

         $article_id = $article->getField('idart'); 

         $teaser_img = ''; 
         if ($noimg != 'true') {//Wenn Bild ja 
             
            $br_img = $article->getContent('CMS_IMG', 1); 

            $img_teaser = ''; 

             
               $sql = "SELECT 
                                       * 
                                    FROM 
                                       ".$cfg["tab"]["upl"]." 
                                    WHERE 
                                       idupl=$br_img "; 

               //echo "<pre>"; print_r($sql); echo "</pre>"; 

               $db->query($sql); 

               if ($db->next_record()) { 
                   
                  $filename = $db->f('filename'); 
                  $dirname = $db->f('dirname'); 
                  //echo $dirname.$filename; 
               } 

               $img_path = $cfgClient[$client]["upl"]["path"].$dirname.$filename; 

               $img_size = "CMS_VALUE[14]"; 

               $img_teaser = capiImgScale($img_path, $img_size, $img_size, $crop = false, $expand = false, $cacheTime = 1000, $wantHQ = false); 
               if($br_img!=''){
 			      $teaser_img = '<img src="'.$img_teaser.'" class="teaser_img">'; 
		       }
         } // end if noimg        
			$headline = strip_tags($article->getContent('CMS_HTMLHEAD', 1));
			$headline = str_replace($replace, " ", $headline);
			$teaserheadline = /*$subheadline."&nbsp;-&nbsp;".*/ $headline;
			
			$autor = strip_tags($article->getContent('CMS_HTML', 3));
			$autor = str_replace($replace, " ", $autor);
			$teaserautor = /*$subheadline."&nbsp;-&nbsp;".*/ $autor;
			
			$quelle = strip_tags($article->getContent('CMS_HTML', 4));
			$quelle = str_replace($replace, " ", $quelle);
			$teaserquelle = /*$subheadline."&nbsp;-&nbsp;".*/ $quelle;

			/*			$subheadline = strip_tags($article->getContent('CMS_HTMLHEAD', 2));
						$subheadline = str_replace($replace, " ", $subheadline);*/

			$teaserheadline = /*$subheadline."&nbsp;-&nbsp;".*/ $headline;
			$href = $sess->url("front_content.php?idcat=$selcat&idart=$article_id");
			$teasertext = $article->getField('summary');

			if (strlen(trim($teasertext)) == 0) {
				$teasertext = strip_tags($article->getContent('CMS_HTML', 1));
				$teasertext2 = $teasertext;
				$teasertext = capiStrTrimAfterWord($teasertext, $mxtext);
				if ($teasertext!=$teasertext2) {
					$teasertext.= '...';
				}
				
			} // end if   
						
			$sql = "SELECT DATE_FORMAT(created, '%d.%m.%Y') AS Changedatum FROM con__art_lang WHERE idart = " .$article_id; 
            $db->query($sql); 
            if ($db->next_record()) 
            { 
               $time = $db->f('Changedatum'); 
            } 
			
			$teasertext = $teasertext."&nbsp;";

			$tpl->set('d', 'HEADLINE', $teaserheadline);
			$tpl->set('d', 'TEXT', $teasertext);
			$tpl->set('d', 'HREF', $href);
		    $tpl->set('d', 'QUELLE', $teaserquelle);
		    $tpl->set('d', 'AUTOR', $teaserautor);
		    $tpl->set('d', 'TIME', $time);
			$tpl->set('d', 'IMG', $teaser_img);
			$tpl->set('d', 'MORE', mi18n("mehr"));

			$tpl->next();

      } // end for 

      $tpl->generate('templates/'.$template); 

   } 
} 

?> 

Verfasst: So 5. Feb 2006, 21:32
von rezeptionist
Schön wie gesagt bei mir ging es auch ohne deine erweiterung
renasco hat geschrieben:Ist aber eine Coole Lösung jetzt hab ich mein Ferrarie
Aber eben nur einen Ferrari mit ie :wink: der dich sehr viel Zeit gekostet hat aber nichts destotrotz viel Spaß

Verfasst: So 5. Feb 2006, 21:36
von renasco
Ja stimmt schon. Aber ich finde, dass von HerrB ist mit viel schnick schnack (Für mich). Daher ich hab auch schon sehr viel daran geändert. Ich kann jetzt nicht einfach ein anderes nehmen.

Aber trotzdem Danke für die Hilfe :)