new image show system, allowing dynamic preview images
This commit is contained in:
parent
b4e6c2f9bb
commit
dfda07ae1c
8 changed files with 193 additions and 53 deletions
|
|
@ -28,4 +28,4 @@ $GlobalPictureDir = "./pictures";
|
|||
|
||||
$GlobalDecimalPoint="."
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ function LangSpellHtml ( $Sentence )
|
|||
function LangSpell ( $Sentence )
|
||||
{
|
||||
global $GlobalLanguage;
|
||||
|
||||
|
||||
$ReturnValue="";
|
||||
|
||||
|
||||
if (file_exists("./languages/$GlobalLanguage.lng"))
|
||||
$Language = file ("./languages/$GlobalLanguage.lng");
|
||||
else
|
||||
|
|
@ -38,17 +38,17 @@ function LangSpell ( $Sentence )
|
|||
$FileSentence=explode("=",$i,2);
|
||||
if ( trim( $FileSentence[0] ) == $Sentence )
|
||||
{
|
||||
$ReturnValue=trim($FileSentence[1]);
|
||||
$ReturnValue=trim($FileSentence[1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$ReturnValue)
|
||||
{
|
||||
ErrorLog("[$GlobalLanguage.lng] Sentence \"$Sentence\" not found!");
|
||||
$ReturnValue=$Sentence;
|
||||
}
|
||||
|
||||
|
||||
return $ReturnValue;
|
||||
}
|
||||
|
||||
|
|
@ -65,4 +65,4 @@ function LangGetAvailableLanguages ()
|
|||
}
|
||||
return $ReturnValue;
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ function OtherGetIcon ($IconName,$CssClass)
|
|||
$IconDirectory='./templates/'.$GlobalTemplate.'/icons/';
|
||||
$Error = 0;
|
||||
$RetVal = "";
|
||||
|
||||
|
||||
if (file_exists($IconDirectory.$IconName.".png")) $IconFile=$IconName.".png";
|
||||
elseif (file_exists($IconDirectory.$IconName.".jpg")) $IconFile=$IconName.".jpg";
|
||||
elseif (file_exists($IconDirectory.$IconName.".gif")) $IconFile=$IconName.".gif";
|
||||
|
|
@ -120,13 +120,35 @@ function OtherGetIcon ($IconName,$CssClass)
|
|||
//log if template directory is existing - if not, anyone else will report this
|
||||
if (file_exists("./templates/".$GlobalTemplate)) ErrorLog("Icon '$IconName' +[.png|.jpg|.gif] not found!");
|
||||
}
|
||||
|
||||
|
||||
if (!$Error)
|
||||
{
|
||||
$RetVal = "<img src=\"$IconDirectory$IconFile\"".(($CssClass)? " class=\"$CssClass\"":"").">";
|
||||
}
|
||||
|
||||
|
||||
return $RetVal;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
// Returns a html <img> tag
|
||||
function OtherGetPictureImg($part_id, $max_width=0, $max_height=0) {
|
||||
|
||||
// create anchor tag
|
||||
$tag = "<a href=\"part_picture.php?PartId=$part_id\">";
|
||||
|
||||
// create img tag
|
||||
$tag .= "<img src=\"part_picture.php?PartId=$part_id";
|
||||
if ($max_width > 0) $tag .= "&MaxWidth=$max_width";
|
||||
if ($max_height > 0) $tag .= "&MaxHeight=$max_height";
|
||||
$tag .= "\""; // finish src attribute
|
||||
$tag .= " alt=\"picture of part $part_id\"";
|
||||
$tag .= ">"; // finish img tag
|
||||
|
||||
|
||||
// close link
|
||||
$tag .= '</a>';
|
||||
|
||||
return $tag;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue