MULTILINK für "DER ARTIKEL"

Gesperrt
JSIT
Beiträge: 15
Registriert: Di 4. Feb 2003, 16:14
Wohnort: Pfinztal
Kontaktdaten:

MULTILINK für "DER ARTIKEL"

Beitrag von JSIT » Mi 26. Feb 2003, 21:18

Hallo!

Ich bin auch der Sucht des Contenido verfallen und habe einige Anpassungen am System durchgeführt.
Wer mag, der kann folgende Änderungen übernehmen.

"Der Artikel" ist ein extrem starkes Modul, das in der Regel für eine ganze Seite aussreicht und um das Modul noch etwas flexibler zu machen, haben wir (kunde und ich) einige Änderungen im LINK durchgeführt.
Es war nicht möglich einen LINK auf ein BILD zu legen unter einem TEXT!

nun geht es:-)
Bild

IN der DB muss allerdings ein kleine Änderung rein:
die VAR CMS_LINK , der code muss etwas angepasst werden.
hier der MYSQL UPDATECODE:

Code: Alles auswählen

# Connection: localhost
# Host: localhost
# Saved: 2003-02-26 20:11:06
# 
UPDATE con_type SET code= '$tmp = $a_content["CMS_LINK"][$val];\r\nif (is_numeric($tmp)) {$tmp="\\".\\$sess->url(\\"front_content.php?lang=$lang&idcatside=".$tmp."\\").\\"";}\r\nelseif (stristr($tmp,":")) {$temp;} else {$tmp=$cfgClient[$client]["path"]["htmlpath"].$tmp;}\r\n/*\r\nelseif (substr($tmp,0,6)=="mailto") {}\r\nelseif (substr($tmp,0,6)!="mailto") {if (substr($tmp,0,7)=="http://") {}\r\nelseif (substr($tmp,0,7)!="http://") {$tmp = "".$tmp;}}\r\n*/'
WHERE type='CMS_LINK';
 
Hier der Code der "tplInputField_CMS_LINK.inc.php" DATEI:

Code: Alles auswählen


<?
//geändert: j.Schaaf www.JSIT.de 23-02-03
//geändert: 05.03.03 j.Schaaf www.JSIT.de
//
//
//

if ($submit == "editcontent") {
	consaveContentEntry($idsidelang, "CMS_LINK", $typenr, $CMS_LINK);
	consaveContentEntry($idsidelang, "CMS_LINKDESCR", $typenr, $CMS_LINKDESCR);
	consaveContentEntry($idsidelang, "CMS_LINKTARGET", $typenr, $CMS_LINKTARGET);
	conGenerateCodeForSideInAllCategories($idside);
	Header("Location:".$sess->url("front_content_edit.inc.php?area=$tmp_area&idside=$idside&idcat=$idcat&lang=$lang")."");
}
?>
<html>
<head>
<title>contenido</title>
<link rel="stylesheet" type="text/css" href="<? print $ContenidoPath ?>content.css">
</HEAD>
<BODY MARGINHEIGHT=0 MARGINWIDTH=0 LEFTMARGIN=0 TOPMARGIN=0>
<table width="100%"  border=0 cellspacing="0" cellpadding="0" bgcolor=<? echo "$bg"; ?> >
  <tr>
    <td width="10" rowspan="4"><img src="<? print $ContenidoPath.$cfgPathImg ?>space.gif" width="10" height="10"></td>
    <td width="100%"><img src="<? print $ContenidoPath.$cfgPathImg ?>space.gif" width="10" height="10"></td>
    <td width="10" rowspan="4"><img src="<? print $ContenidoPath.$cfgPathImg ?>space.gif" width="10" height="10"></td>
  </tr>
  <tr>
    <td>

<?

	$sql = "SELECT * FROM $cfgTab_content AS A, $cfgTab_side_lang AS B, $cfgTab_type AS C WHERE A.idtype=C.idtype AND A.idsidelang=B.idsidelang AND B.idsidelang='$idsidelang'";
	$db->query($sql);
	while ($db->next_record()) {
		$a_content[$db->f("type")][$db->f("typeid")] = $db->f("value");
                 $a_description[$db->f("type")][$db->f("typeid")] = $db->f("description");
 	}
	echo "\n  <FORM name=\"editcontent\" method=\"post\" action=\"".$sess->url("front_content_edit.inc.php")."\">";
	$sess->hidden_session();
	echo "\n  <INPUT type=hidden name=lang value=\"$lang\">";
	echo "\n  <INPUT type=hidden name=submit value=\"editcontent\">";
	echo "\n  <INPUT type=hidden name=typenr value=\"$typenr\">";
	echo "\n  <INPUT type=hidden name=idside value=\"$idside\">";
	echo "\n  <INPUT type=hidden name=idcat value=\"$idcat\">";
	echo "\n  <INPUT type=hidden name=idsidelang value=\"$idsidelang\">";
	echo "\n  <INPUT type=hidden name=action value=\"10\">";
	echo "\n  <INPUT type=hidden name=type value=\"$type\">";

	echo "\n  <TABLE cellpadding=$cellpadding cellspacing=$cellpadding border=0>";

	echo "\n  <TR><TD valign=\"top\" class=head nowrap>&nbsp;".$a_description["CMS_LINK"][$typenr].":&nbsp;</TD><TD class=content>";
	echo "\n<INPUT type=hidden name=CMS_LINK VALUE=\"".$a_content["CMS_LINK"][$typenr]."\">";
	//echo $a_content["CMS_LINK"][$typenr];
		if (is_numeric($a_content["CMS_LINK"][$typenr])) {
			$a_link_intern_value = $a_content["CMS_LINK"][$typenr];
			$a_link_extern_value = "";
			$a_link_image_value = 0; //JSIT 23-02-03 				//jsit-05.03.03
		} else {
			$a_link_intern_value = "0";

			//START - JSIT 23-02-03
			if (stristr($a_content["CMS_LINK"][$typenr],":")){
			$a_link_image_value = 0;
			$a_link_extern_value = $a_content["CMS_LINK"][$typenr]; 	//jsit-05.03.03
			} else {
			$a_link_extern_value = ""; 						//jsit-05.03.03
			$a_link_image_value = $a_content["CMS_LINK"][$typenr];
			}
			//ENDE - JSIT 23-02-03

		}
		echo "<table border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\"><tr>";

		echo "<td valign=top>Externer Link</td><td>\n";
		echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr>";
		echo "\n<td><input type=\"radio\" value=\"\" name=\"link\" onclick=\"editcontent.CMS_LINKextern.value=this.value;\" checked>datei</td>";
		echo "\n<td><input type=\"radio\" value=\"http://\" name=\"link\" onclick=\"editcontent.CMS_LINKextern.value=this.value;\">http</td>";
		echo "\n<td><input type=\"radio\" value=\"https://\" name=\"link\" onclick=\"editcontent.CMS_LINKextern.value=this.value;\">https</td>";
		echo "\n<td><input type=\"radio\" value=\"ftp://\" name=\"link\" onclick=\"editcontent.CMS_LINKextern.value=this.value;\">ftp</td>";
		echo "\n<td><input type=\"radio\" value=\"mailto:\" name=\"link\" onclick=\"editcontent.CMS_LINKextern.value=this.value;\">mailto</td>";
		echo "\n</tr><tr>";
		echo "\n<td><input type=\"radio\" value=\"news://\" name=\"link\" onclick=\"editcontent.CMS_LINKextern.value=this.value;\">news</td>";
		echo "\n<td><input type=\"radio\" value=\"gropher://\" name=\"link\" onclick=\"editcontent.CMS_LINKextern.value=this.value;\">gropher</td>";
		echo "\n<td><input type=\"radio\" value=\"telnet://\" name=\"link\" onclick=\"editcontent.CMS_LINKextern.value=this.value;\">telnet</td>";
		echo "\n<td><input type=\"radio\" value=\"wais://\" name=\"link\" onclick=\"editcontent.CMS_LINKextern.value=this.value;\">wais</td>";
		echo "<td>&nbsp;</td><td>";
		echo "</tr></table>";
		echo "\n<INPUT type=text name=CMS_LINKextern VALUE=\"".$a_link_extern_value."\" SIZE=45 style=\"width:300; width=300;\" onchange=\"editcontent.CMS_LINK.value=this.value; editcontent.CMS_LINKintern.value=0; editcontent.CMS_IMGintern.value=0;\"></td>";

		echo "</tr><td>Interner Link</td><td>\n";
		$sql = "SELECT * FROM $cfgTab_cat_tree AS TREE, $cfgTab_cat_side AS CATSIDE, $cfgTab_cat AS CAT, $cfgTab_cat_lang AS CATLANG, $cfgTab_side_lang AS SIDELANG WHERE TREE.idcat=CATSIDE.idcat AND CATSIDE.idcat=CATLANG.idcat AND CATLANG.idlang='$lang' AND CATSIDE.idside=SIDELANG.idside AND SIDELANG.idlang='$lang' AND CAT.idcat=TREE.idcat AND CAT.idclient='$client' ORDER BY TREE.idtree";
		$db->query($sql);
		echo "\n<SELECT name=CMS_LINKintern SIZE=1 style=\"width:300; width=300;\" onChange=\"editcontent.CMS_LINK.value=this.value; editcontent.CMS_LINKextern.value='';editcontent.CMS_IMGintern.value=0;\">";
		        if ($a_link_intern_value != 0) {
		        	echo "\n<option value=0>".$lngForm["nothing"]."</option>";
		        } else {
		        	echo "\n<option value=0 selected>".$lngForm["nothing"]."</option>";
		        }
		        while ($db->next_record()) {
		        	$spaces = "";
		                for ($i=0; $i<$db->f("level"); $i++) {
		                	$spaces = $spaces . "    ";

		                }
		                if ( $db->f("idcatside") != $a_link_intern_value ) {
		                	echo "\n<option value=\"".$db->f("idcatside")."\">$spaces ".$db->f("name")."---".$db->f("title")."</option>";
		                } else {
		                        echo "\n<option value=\"".$db->f("idcatside")."\" selected>$spaces ".$db->f("name")."---".$db->f("title")."</option>";
		                }
		        }
		echo "\n</SELECT></td>";
		//START - JSIT 23-02-03
		echo "</tr><td>Interne Bilder</td><td>";
		echo "\n<SELECT name=CMS_IMGintern SIZE=1 style=\"width:300; width=300;\" onChange=\"editcontent.CMS_LINK.value=this.value; editcontent.CMS_LINKextern.value='';editcontent.CMS_LINKintern.value=0;\">";
		        if ($a_link_image_value != "") {
		        	echo "\n<option value=0>".$lngForm["nothing"]."</option>";
		        } else {
		        	echo "\n<option value=0 selected>".$lngForm["nothing"]."</option>";
		        }
		$sql = "SELECT * FROM $cfgTab_upl WHERE idclient='$client' ORDER BY dirname,filename";
        	$db->query($sql);
        	while ($db->next_record()) {
	               	$_link= "pics:".$db->f("dirname")."/".$db->f("filename"); 	//- JSIT 26-02-03
	               	$_link1="img:".$db->f("dirname")."/".$db->f("filename"); 	//- JSIT 26-02-03
	               	$_link3= $db->f("dirname")."/".$db->f("filename"); 		//- JSIT 26-02-03

				//if ($db->f("idupl") != $a_content["CMS_LINK"][$typenr]) {
				// JSIT 26-02-03
				if ($_link != $a_content["CMS_LINK"][$typenr] && $_link1 != $a_content["CMS_LINK"][$typenr] && $_link3 != $a_content["CMS_LINK"][$typenr]) {

				echo "\n<option value=\"".$db->f("dirname")."/".$db->f("filename")."\">".$db->f("dirname")."/".$db->f("filename")." [".$db->f("description")."]</option>";
                	} else {
	                  echo "\n<option value=\"".$a_content["CMS_LINK"][$typenr]."\" selected>".$db->f("dirname")."/".$db->f("filename")." [".$db->f("description")."]</option>";
				if ($db->f("dirname")=="img" ||$db->f("dirname")=="pics") $isimg=$db->f("dirname")."/".$db->f("filename"); // jsit 05.03.03
                	}
	        }
		echo "\n</SELECT>\n";
		if(isset($isimg))	echo "\n<br><b>Vorschau 100x100:</b><br><img src=\"".$cfgClient[$client]["path"]["htmlpath"].$isimg."\" width=\"100\" height=\"100\">\n";

		echo "\n</td></tr></table>\n";
		//ENDE - JSIT 23-02-03

	echo "  </TD></TR>";
	echo "  <TR><TD valign=top class=head nowrap>&nbsp;".$a_description["CMS_LINKDESCR"][$typenr].":&nbsp;</TD><TD class=content>";
	echo "  <TEXTAREA name=CMS_LINKDESCR ROWS=1 COLS=60 style=\"width:300; width=300;\">".$a_content["CMS_LINKDESCR"][$typenr]."</TEXTAREA>";
	echo "  </TD></TR>";
	echo "  <TR><TD valign=top class=head nowrap>&nbsp;".$a_description["CMS_LINKTARGET"][$typenr].":&nbsp;</TD><TD class=content>";
	echo "  <INPUT type=text name=CMS_LINKTARGET VALUE=\"".$a_content["CMS_LINKTARGET"][$typenr]."\" SIZE=60 onChange=\"setlinktargettosomething();\">";
	
	echo "  <INPUT TYPE=checkbox name=checkboxlinktarget value=\"1\" onClick=\"setlinktargettoblank();\" ";if ($a_content["CMS_LINKTARGET"][$typenr]=="_blank") echo " checked"; echo ">Link in neuem Fenster öffnen.</INPUT>
	    	<!---------JavaScript-------------------->
   			<script language=\"JavaScript\">
		<!--
		function setlinktargettosomething() {
			document.editcontent.checkboxlinktarget.value = 1;
			document.editcontent.checkboxlinktarget.checked = false;
		}
			function setlinktargettoblank() {
			if (document.editcontent.checkboxlinktarget.value == 1) {
				document.editcontent.CMS_LINKTARGET.value       = \"_blank\";
				document.editcontent.checkboxlinktarget.value = 0;
			} else {
				document.editcontent.CMS_LINKTARGET.value       = \"\";
				document.editcontent.checkboxlinktarget.value = 1;
			}
		}
		//-->
		</SCRIPT>
		";
	echo "  </TD></TR>";
	$tmp_area = "con_editcontent";
	echo "  <TR valign=top><TD colspan=2><br>
      		<a href=".$sess->url("front_content_edit.inc.php?area=$tmp_area&idside=$idside&idcat=$idcat&lang=$lang")."><img src=\"".$ContenidoPath.$cfgPathImg."but_cancel.gif\" border=0></a>
      		<INPUT type=image name=submit value=editcontent src=\"".$ContenidoPath.$cfgPathImg."but_ok.gif\">
      		</TD></TR>";

	echo "  </TABLE>
      		</FORM>";

?>
</td></tr></table>
</body>
</HTML>
Für Fragen bin ich immer da. :-=

Jörg
Zuletzt geändert von JSIT am Mi 5. Mär 2003, 12:45, insgesamt 2-mal geändert.
###############
www.jsit.de
www.phpnet.de
www.MailReader.de
################

chrila
Beiträge: 49
Registriert: Di 17. Sep 2002, 16:31
Wohnort: Essen
Kontaktdaten:

Beitrag von chrila » Do 27. Feb 2003, 11:21

Ich muss sagen, eine super Erweiterung des Moduls "DER ARTIKEL". Leider habe offenbar Probleme mit den Pfaden. Die Vorschau des Bilds (100x100) verweist auf: http://www.funsport-essen.de/contenido/ ... mg/xxx.jpg
Es ist ein front_single zu viel. Weiterhin greift die Erweiterung nicht auf die richtige css-Datei bzw. erreicht sie nicht. Ansonsten läuft meine Contendio-Installation ohne Probleme. Könnt ihr mir einen Tipp geben?

Danke für die Hilfe.

Gruß
Christian

JSIT
Beiträge: 15
Registriert: Di 4. Feb 2003, 16:14
Wohnort: Pfinztal
Kontaktdaten:

Beitrag von JSIT » Fr 28. Feb 2003, 13:20

Hallo!

Ja sorry, bei mir heist die CSS nicht contenido.css, sondern content.css, also im Code oben habe ich es geändert! Schreibe einfach statt content.css contenido.css.

Warum er den Pfad doppelt hat, weis ich z.Z nicht.

Schaut Euch mal bitte die Einträge im SourceCode an, was für ein Pfad erzeugt wird. Bei liegt das Fronatend im Root und nicht unter /single_site.

Ich erstelle einen Pfad zum ImG in dem ich aus der con_upl die DIRNAME und den NAME zusammen setze. Also wenn in der con_content im als value=img/bild.gif steht, ist das ok, steht aber single_site/img/bild.gif, dann wird im code von con_type CMS_LINK nochmal der Pfad dazu gelegt :-)

Ist das so? ändert den Code von CMS_LINK ab.

so:

Code: Alles auswählen

$tmp = $a_content["CMS_LINK"][$val];
if (is_numeric($tmp)) {$tmp="\".\$sess->url(\"front_content.php?lang=$lang&idcatside=".$tmp."\").\"";}
elseif (stristr($tmp,":")) {$temp;} 
else {
//$tmp=$cfgClient[$client]["path"]["htmlpath"].$tmp;
$tmp="./".$tmp; // vom aktuellen Root
}
ALSO nun wird vom aktuellen Root gelesen, das "./" macht das, wenn nun der Pfad mit abgespeichert wird ist es nun egal. Ich schreibe nun nicht mehr den Pfad $cfgClient[$client]["path"]["htmlpath"] mit rein.

Viel Spass Jörg

PS: löscht die IF (_DEBUG) raus, oder legt so wie ich eine VAr in der config.php an !

Code: Alles auswählen

//---------------------------------------------------------
// DEBUG MODUS einschalten 1=ein; 0=aus
//---------------------------------------------------------
define ("_DEBUG",1);
HIER die DEBUG Datei die ich nutze, gibt viele interessante INFOS für Entwickler.

Code: Alles auswählen

<?php
// Debug-info only!

// To see all available variables insert the line 
//    include ("inc/debug_info.php3");
// in the .php3 file where you want to see this infos

function ShowHTTPVars ($array)
{  if (count($array))
   {	while (list($key, $val) = each($array)) 
   	{  echo "<tr><td valign=\"top\">" . gettype($val) . "</td>";
   		if (is_array($val))
   		{	echo "<td>";
            while (list($key2, $val2) = each($val)) 
               echo "$key [$key2] = $val2<br>\n";
   			echo "</td>";
   		}
   		else
   			echo "<td>$key = $val</td>\n";
   		echo "</tr>";
   	}
   }
}
?>
<hr noshade>
<br>
<table border="1" cellspacing="0" cellpadding="2">
   <tr>
      <td align="left" valign="top" width="50%">
         <table border="1" cellspacing="0" cellpadding="2" width="100%">   
            <tr><th colspan=2>Values submitted via POST method:</th></tr>
            <tr><th>Type</th><th align="left">Variable = Value</th></tr>
            <?php ShowHTTPVars ($HTTP_POST_VARS) ?>
         </table>
      </td>
      <td align="left" valign="top" width="50%">
         <table border="1" cellspacing="0" cellpadding="2" width="100%">   
            <tr><th colspan=2>Values submitted via GET method:</th></tr>
            <tr><th>Type</th><th align="left">Variable = Value</th></tr>
            <?php ShowHTTPVars ($HTTP_GET_VARS) ?>
         </table>
      </td>
   </tr>
   <tr>
      <td align="left" valign="top" colspan="2">
         <table border="1" cellspacing="0" cellpadding="2">   
            <tr><th colspan=2>Real available vars on this page now:</th></tr>
            <tr><th>Type</th><th align="left">Variable = Value</th></tr>
            <?php // ShowHTTPVars ($GLOBALS) funzt nicht!
            while (list($key, $val) = each($GLOBALS)) 
         	{  echo "<tr><td valign=\"top\">" . gettype($val) . "</td>";
         		if (is_array($val))
         		{	echo "<td>";
                  while (list($key2, $val2) = each($val)) 
                       	if (is_array($val2))
	         		{	
				echo "$key [$key2]="; print_r($val2); echo "<br>\n";
				} else {
				echo "$key [$key2] = $val2<br>\n";
				}
         			echo "</td>";
         		}
         		else
         			echo "<td>$key = $val</td>\n";
         		echo "</tr>";
         	}
            ?>
         </table>
      </td>
   </tr>
</table>
ich nutze diese auch in den anderen Dateien, z.B. \tpl\footer.php,
so "scanne "ich alles mit.

Viel Spass Jörg[/code]
###############
www.jsit.de
www.phpnet.de
www.MailReader.de
################

chrila
Beiträge: 49
Registriert: Di 17. Sep 2002, 16:31
Wohnort: Essen
Kontaktdaten:

Beitrag von chrila » Fr 28. Feb 2003, 17:01

Hallo Jörg,

danke für die Hilfe. Jetzt habe auch die richtige css-Datei. Ich habe den Unterschied garnicht erkannt :shock:

Ich habe im Update-Code und in der tpl-Datei den Eintrag [$client] gelöscht und so klappt es jetzt bei mir mit der Erweiterung. Welche Konsequenzen das auf andere Module hat, kann ich nicht sagen. :?:

Ich gehe jetzt erstmal 1 Woche Skifahren.

Gruß
Christian

Gesperrt