Zum Inhalt springen

Shop-Bild mit Gifbuilder

Erstellt am 21. Juni 2003 · 2 Antworten · letzte Antwort am 23. Juni 2003

Tags: Bilder, Frage

cssoft ·

Wie kann ich auf ein Produktbild einen Gifbuilder-Text draufschreiben?
#paralyzed#
Wenn man auf das Produktbild klickt und das Bild im Pop-up Fenster angezeigt wird soll der Firmenname mit Gifbuilder draufstehn.
Im Vorschaubild muss der Text nicht drauf stehn.

mfg Christian Kurta
christian@kurta.ch

pythen ·

Leider kann ich dir keine schnelle Lösung anbieten.

Ich habe das so gemacht:

In der Datei class.tx_ttproducts.php folgende Änderung machen.

function getItemMarkerArray ($row,$catTitle, $imageNum=0, $imageRenderObj="image")	{
			// Returns a markerArray ready for substitution with information for the tt_producst record, $row
		$markerArray=array();
			// Get image
		$theImgCode="";
		$imgs = explode(",",$row["image"]);
		$val = $imgs[0];
		while(list($c,$val)=each($imgs))	{
			if ($c==$imageNum)	break;
			if ($val)	{
				$this->conf[$imageRenderObj."."]["file"] = "uploads/pics/".$val;
			} else {
				$this->conf[$imageRenderObj."."]["file"] = $this->conf["noImageAvailable"];
			}
		$theImgCode.=$this->cObj->IMAGE($this->conf[$imageRenderObj."."]);
		$pos = substr($theImgCode,strpos ($theImgCode,'typo3temp/')+10,14);
		$theImgCode="<a href="javascript:void(0);" onClick="window.open('http://xxx.xxx.xx/index.php?id=44&test=".$val."','test','toolbar=no,location=no,status=no,menubar=no,resizable=yes')"><img src='typo3temp/".$pos."' border='0'></a>";
		}

Eine Seite in Typo3 anlegen mit folgendem Script

# Default PAGE object:
page = PAGE
page.typeNum = 0
page.bodyTag = <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="fenster();">
includeLibs.test_library = fileadmin/michelverlag/test.php
page.5 = HTML
page.5.value = <script>function fenster(){x=document.images[0].height;y=document.images[0].width;window.resizeTo(y,x);}</script>
page.10 = USER
page.10.userFunc = user_test_library_class->test
page.10.a_content_object = IMAGE
page.10.a_content_object.wrap = <a href="javascript:void(0);" onClick="window.close();">|</a>
page.10.a_content_object.file = GIFBUILDER
page.10.a_content_object.file.format = jpg
page.10.a_content_object.file.quality = 80
page.10.a_content_object.file {
XY = [10.w], [10.h]
10 = IMAGE
10.file = ???
20 = IMAGE
20.offset = [10.w]/2-109,[10.h]/2-112
20.file = fileadmin/michelverlag/wasserz.png
}

und dazu noch eine PHP-Datei in entsprechendes Verzeichniss legen.

<?php
class user_test_library_class {
var $cObj; // reference to the calling object.
function test($content,$conf) {
global $TSFE;
$TSFE->set_no_cache(); // Turning caching off - good while developing.
// Setting the path of files attached for page records, media field
$imagePath = "uploads/pics/";
// exploding the list of files from the page record into this array
$imageFilesArray = explode(",",$this->cObj->data["media"]);
$accum=array(); // Collecting the image code in this array
reset($imageFilesArray);
$dat = t3lib_div::GPvar("test");
while(list(,$theImage)=each($imageFilesArray)) { // traverse the image list
// Setting the file name, overriding ??? from TS:
$conf["a_content_object."]["file."]["10."]["file"] = $imagePath."/".$dat;
// Getting the content object:
$accum[] = $this->cObj->cObjGetSingle(
$conf["a_content_object"], // Contains the name, here "TEXT"
$conf["a_content_object."], // Contains the properties of "TEXT"
"a_content_object" // Basically just information for the TypoScript debugger
);
}
// implode the files produced separated by a horizontal ruler
$outputString = implode("<HR>",$accum);
return $outputString;
}
}
?>

Ist zwar umständlich hat aber funktioniert.

MfG
Pythen