CMS_IMG[1] with link or not question

Gesperrt
djavet
Beiträge: 264
Registriert: Do 22. Jan 2004, 11:31
Kontaktdaten:

CMS_IMG[1] with link or not question

Beitrag von djavet » Fr 27. Feb 2004, 18:04

Hello,

I've set a container with the standard image module:

Code: Alles auswählen

<?php

if ("CMS_IMG[1]" != "") {

    $img = '<img src="CMS_IMG[1]" border="0">';

    if ("CMS_LINK[1]" != "http://") {
        $img = sprintf('<a href="%s" target="%s">%s</a>',"CMS_LINK[1]", "CMS_LINKTARGET[1]", $img);

    }

    echo $img;

}

echo "<br>";
echo "CMS_IMGDESCR[1]";
echo "<br>";
echo "CMS_LINKDESCR[1]";
echo "<br>";

?>
If I set a image a link, no problem, but if I set a image with no link, the link send me on the homepage... Is that a but?

I know the code I must remove to have only the image, but I wish to have the possibilty to ass a link if I wish. How can I make this?

Thx for your help.
Regards, Dom

emergence
Beiträge: 10645
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Re: CMS_IMG[1] with link or not question

Beitrag von emergence » Mo 1. Mär 2004, 07:20

djavet hat geschrieben:... but if I set a image with no link, the link send me on the homepage...
which contenido version ?
the links sends you to the homepage ??? no idea what you mean... could you descripe it a little bit better ?

djavet
Beiträge: 264
Registriert: Do 22. Jan 2004, 11:31
Kontaktdaten:

Beitrag von djavet » Di 2. Mär 2004, 12:00

Hello,


YOP, I use Contenido 4.4.3.
Here's 2 exemples where I wish no link on the pix:
-> http://www.younggods.com/cms/front_content.php?idcat=26
-> http://www.younggods.com/cms/front_content.php?idcat=45

Please note that hte site is under devoppement ;o)Thx for yoru help.

Regards, Dom

emergence
Beiträge: 10645
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag von emergence » Di 2. Mär 2004, 12:15

in the source code the link looks this way:
<a href="http://www.younggods.com/cms/" target="">

what stands in the edit link dialog ?

djavet
Beiträge: 264
Registriert: Do 22. Jan 2004, 11:31
Kontaktdaten:

Beitrag von djavet » Di 2. Mär 2004, 15:10

Nothing !
Here's a screenshot:
-> http://www.younggods.com/links_problem.gif

I think it can be solve with the php script, but I'm not used in php code...

Regards, Dom

emergence
Beiträge: 10645
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag von emergence » Di 2. Mär 2004, 15:49

check in your database con_type at value CMS_LINK the value code.
post the code...

another question: have you made an upgrade from an older version of contenido ?

emergence
Beiträge: 10645
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag von emergence » Di 2. Mär 2004, 16:05

i think i have a solution for your problem:

replace in setup/base.sql

Code: Alles auswählen

INSERT INTO !PREFIX!_type VALUES (6, 'CMS_LINK', '/**\r\n * CMS_LINK\r\n */\r\nglobal $cfgClient;\r\nglobal $client;\r\n\r\n$tmp = urldecode($a_content["CMS_LINK"][$val]);\r\n\r\n/* internal link */\r\nif ( is_numeric($tmp) ) {\r\n\r\n   if ($contenido)\r\n   {\r\n      $tmp = $sess->url("front_content.php?idcatart=$tmp");\r\n   } else {\r\n     $tmp = "front_content.php?idcatart=$tmp";\r\n   }\r\n\r\n} else {\r\nif ((substr($tmp,0,6) != "mailto") && (substr($tmp,0,4) != "http"))\r\n{\r\n$tmp = $cfgClient[$client]["path"]["htmlpath"].$tmp;\r\n}\r\n\r\n}', 'Link', 0, '', '2002-05-13 19:04:36', '2002-05-13 19:04:36');
with

Code: Alles auswählen

INSERT INTO !PREFIX!_type VALUES (6, 'CMS_LINK', '/**\r\n* CMS_LINK\r\n*/\r\n\r\n$tmp = urldecode($a_content["CMS_LINK"][$val]);\r\n\r\n/* internal link */\r\nif ( is_numeric($tmp) ) {\r\n   $tmp = "front_content.php?idcatart=". $tmp."&client=".$client."&lang=".$lang;\r\n   if ($edit) $tmp = $sess->url("$tmp");\r\n\r\n} else {\r\n\r\n   if (!preg_match(\'/^(http|https|ftp|telnet|gopher):\\/\\/((?:[a-zA-Z0-9_-]+\\.?)+):?(\\d*)/\', $tmp)) {\r\n      // it\'s a relative link, or an absolute link with unsupported protocol\r\n      if (substr($tmp,0,4) == "www." || $tmp == "") { // only check if it could be a domainname\r\n         $tmp = "http://".$tmp;\r\n      }\r\n   }\r\n\r\n}', 'Link', 0, '', '2002-05-13 19:04:36', '2002-05-13 19:04:36');
and make an upgrade with the setup routine...

should work...

i think this bug was fixed in contenido 4.4.2
--> http://www.contenido.de/forum/viewtopic ... c&start=15

this is a so called regression occuring in version 4.4.3 and version 4.4.4

djavet
Beiträge: 264
Registriert: Do 22. Jan 2004, 11:31
Kontaktdaten:

Beitrag von djavet » Di 2. Mär 2004, 17:03

Yop, that's work!
Very good, i'm happy.
A great thanks for your help.

Suggestion to the developper team:
Add the fix into the next version!
Because I found the bug into 4.4.2 and 4.4.3...


Regards, Dom

Gesperrt