Seite 1 von 1

Modul auf Seite in Suche auslesen

Verfasst: Fr 15. Aug 2008, 09:26
von hmmh
Hallo;

ich habe ein Modul gebaut (Teaser mit Verzeichnisslisting etc. ). Wenn ich nun eine Suche auslöse soll das Bild (was in CMS_VAR[1] gesperichert wird) als Vorschau angezeigt werden.

Mir ist dies bislang leider nicht möglich.
gibt es eine Möglichkeit in der Suche den Modul Inhalt auszulesen?

Verfasst: Fr 15. Aug 2008, 13:39
von hmmh

Code: Alles auswählen

?>
<script type="text/javascript">
    changeImage = function() {
		img = document.getElementById("teaser").value;
		a = new Image();
		a.src = "../../contenido/cms/teaser/"+img;
		document.getElementById("backendTeaserPreview").src = a.src;
    }
</script>
<select name="CMS_VAR[1]" onchange="changeImage()" id="teaser">
<?php
	$act = "CMS_VALUE[1]";
	$pfad="../../contenido/cms/teaser/";
    $verz=opendir ($pfad);
    while ($file=readdir($verz)) {
        if (filetype($pfad.$file)!="dir") {
            echo "<option value='$file' "; 
                if($file == $act) echo " selected "; 
            
            echo ">$file</option>";
        }
    }
    closedir($verz);    
?>
</select>
<img id="backendTeaserPreview" src="../../contenido/cms/teaser/<?php echo "CMS_VALUE[1]"; ?>"  />
<?php


das möchte ich gerne bei meinem newstool auslesen, als den wert von CMS_VAR[1]

Code: Alles auswählen

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

            $article = $list->nextArticle();

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

            $teaser_img = '';
            if ($noimg != 'true') {
				
                $text_html = $article->getContent('CMS_HTML', 1);
				
                $regEx = "/<img[^>]*?>.*?/i";
                $match = array ();
				
                if ( preg_match($regEx, $text_html, $match) ) {

					$img = $match[0];
					$img = split("\"",$img);
					#echo "<textarea>";
					#	print_r($img);
					#echo "</textarea>";
					
					$img = $img[1];
					
				}
				else{
					$img = "images/defaultNewsTeaser.jpg";
				}
				$teaser_img = '<img src="'.$img.'" class="teaserImage">';
				
            } // 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;";
			$teaserheadline = $article->getField('title');
            $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


soll halt nicht das erste bild im artikel sondenr das aus dem Teaser-Modul sein.

jemand eine Idee , Quellcode oder Anregungen?

Verfasst: Fr 15. Aug 2008, 15:03
von hmmh
niemand eine idee? =/

Verfasst: Fr 15. Aug 2008, 16:42
von hmmh

Verfasst: Mo 18. Aug 2008, 07:40
von hmmh
ich komme nicht weiter =/