Neue CMS_x-Variable erstellen
Verfasst: Do 2. Sep 2004, 10:13
Hallo,
ich bin gerade dabei, eine CMS_EMAIL-Variable zu basteln.
Ich habe mir dazu den Code aus der Datei include.CMS_TEXT.php abgewandelt und aus dem Textarea ein Input-Feld gemacht.
In der Datenbank habe ich den neuen Typ in der Tabelle con_type angelegt. Dabei habe ich im Feld code folgendes eingetragen:
Das ganze funktioniert auch sehr gut - die eMail-Adresse wird bisher halt als normaler Text angezeigt.
Wenn ich aber aus dem Text einen Link machen will,
geht gar nichts mehr...
Was muss ich in der Datenbank einfügen, damit aus dem Text ein Mailto-Link gemacht wird?
Greets,
marco
ich bin gerade dabei, eine CMS_EMAIL-Variable zu basteln.
Ich habe mir dazu den Code aus der Datei include.CMS_TEXT.php abgewandelt und aus dem Textarea ein Input-Feld gemacht.
Code: Alles auswählen
<?php
if ($doedit == "1") {
consaveContentEntry($idartlang, "CMS_EMAIL", $typenr, $CMS_EMAIL);
conGenerateCodeForArtInAllCategories($idart);
header("Location:".$sess->url($cfgClient[$client]["path"]["htmlpath"]."front_content.php?area=$tmp_area&idart=$idart&idcat=$idcat&lang=$lang&changeview=edit")."");
}
?>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="<?php print $cfg["path"]["contenido_fullhtml"] . $cfg["path"]["styles"] ?>contenido.css">
</head>
<body>
<table width="100%" border=0 cellspacing="0" cellpadding="0" bgcolor="#ffffff">
<tr>
<td width="10" rowspan="4"><img src="<?php print $cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"] ?>spacer.gif" width="10" height="10"></td>
<td width="100%"><img src="<?php print $cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"] ?>spacer.gif" width="10" height="10"></td>
<td width="10" rowspan="4"><img src="<?php print $cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"] ?>spacer.gif" width="10" height="10"></td>
</tr>
<tr>
<td>
<?php
getAvailableContentTypes($idartlang);
echo " <FORM name=\"editcontent\" method=\"post\" action=\"".$cfg["path"]["contenido_fullhtml"].$cfg["path"]["includes"]."include.backendedit.php\">";
$sess->hidden_session();
echo " <INPUT type=hidden name=lang value=\"$lang\">";
// echo " <INPUT type=hidden name=submit value=\"editcontent\">";
echo " <INPUT type=hidden name=typenr value=\"$typenr\">";
echo " <INPUT type=hidden name=idart value=\"$idart\">";
echo " <INPUT type=hidden name=action value=\"10\">";
echo " <INPUT type=hidden name=type value=\"$type\">";
echo "<INPUT type=hidden name=doedit value=1>";
echo " <INPUT type=hidden name=idcat value=\"$idcat\">";
echo " <INPUT type=hidden name=idartlang value=\"$idartlang\">";
echo "<INPUT type=hidden name=changeview value=\"edit\">";
echo " <TABLE cellpadding=$cellpadding cellspacing=$cellpadding border=0>";
echo " <TR><TD valign=top class=text_medium> ".$typenr.". ".$a_description[$type][$typenr].": </TD><TD class=content>";
echo " <input name=CMS_EMAIL value=\"".urldecode($a_content[$type][$typenr])."\" />";
echo " </TD></TR>";
$tmp_area = "con_editcontent";
echo " <TR valign=top><TD colspan=2><br>
<a href=".$sess->url($cfgClient[$client]["path"]["htmlpath"]."front_content.php?area=$tmp_area&idart=$idart&idcat=$idcat&lang=$lang")."><img src=\"".$cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_cancel.gif\" border=0></a>
<INPUT type=image name=submit value=editcontent src=\"".$cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_ok.gif\" border=0>
</TD></TR>";
echo " </TABLE>
</FORM>";
?>
</td></tr></table>
</body>
</HTML>
Code: Alles auswählen
/**
* CMS_EMAIL
*/
$tmp = $a_content["CMS_EMAIL"][$val];
$tmp = urldecode($tmp);
if ($edit) {$editbutton = "<A HREF=\"".$sess->url("front_content.php?action=10&idcat=$idcat&idart=$idart&idartlang=$idartlang&type=CMS_EMAIL&typenr=$val&lang=$lang")."\"><IMG SRC=\"".$cfg["path"]["contenido_fullhtml"].$cfg["path"]["images"]."but_editemail.gif\" border=0></A>";
$editbutton = AddSlashes(AddSlashes($editbutton));
$tmp = $tmp.$editbutton;}
Wenn ich aber aus dem Text einen Link machen will,
Code: Alles auswählen
...
$tmp = '<a href="mailto:'.$tmp.'">'.$tmp.'</a>';
...

Was muss ich in der Datenbank einfügen, damit aus dem Text ein Mailto-Link gemacht wird?
Greets,
marco