I'm looking for a solution to pass some "Alt" text to this one:
Code: Select all
[ID home]{IMAGE:img/house.gif}[/ID]Passing along something like
Code: Select all
[ID home]{IMAGE:img/house.gif|nach hause telefonieren}[/ID]Code: Select all
[ID home]{IMAGE:img/house.gif}[/ID]Code: Select all
[ID home]{IMAGE:img/house.gif|nach hause telefonieren}[/ID]Code: Select all
<?php
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
$content["all"] = preg_replace('/\{A_IMAGE:(.*?):(.*?):(.*?)\}/ie', 'liste26("$1","$2","$3")', $content["all"]);
function liste26($bild,$alt,$ID) {
if (is_numeric($ID)) {
$lista='<a href="index.php?aid='.$ID.'" class="phpwcmsIntLink">';
}
else {
$lista='<a href="index.php?'.$ID.'" class="phpwcmsIntLink">';
}
$lista =$lista. '<img src="picture/'.$bild.'" alt ="'.$alt.'" title="'.$alt.'"> </a>';
return($lista);
}
?>this is only why I am to stupid to change the code that it likely draws some nice pictures if there is no materialclaus wrote:If the img cannot be found it still shows the title/alt text as a link.
Code: Select all
// internal Link to article ID
$search[1] = '/\[ID (\d+)\](.*?)\[\/ID\]/';
$replace[1] = '<a href="index.php?aid=$1" class="phpwcmsIntLink" title="$2">$2</a>';Code: Select all
<?php
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
// call it like so: {A_IMAGE:pic_name:alt-and-titleText:id-or-alias}
// example: {A_IMAGE:house.gif:home:home}
//the script is now accessing the picture/img folder, so you have to change it accordingly to the correct path
$content["all"] = preg_replace('/\{A_IMAGE:(.*?):(.*?):(.*?)\}/ie', 'liste26("$1","$2","$3")', $content["all"]);
function liste26($bild,$alt,$ID) {
if (is_numeric($ID)) {
$lista='<a href="index.php?aid='.$ID.'" class="phpwcmsIntLink">';
}
else {
$lista='<a href="index.php?'.$ID.'" class="phpwcmsIntLink">';
}
$lista =$lista. '<img src="picture/img/'.$bild.'" alt="'.$alt.'" title="'.$alt.'" /></a>';
return($lista);
}
?>Code: Select all
$replace[1] = '<a href="index.php?aid=$1" class="phpwcmsIntLink" title="$1">$2</a>';