pragmaMx Support Forum

pragmaMx => Allgemeines => Thema gestartet von: Banto am 26 März 2007, 18:04:30

Titel: Bild im Block block-Modules_one.php einfügen
Beitrag von: Banto am 26 März 2007, 18:04:30
Hallo zusammen
ich versuch nach dem letzten Menüpunkt ein Bild einzufügen. Zentriert mit oben zum Menüpunkt und Rand unten bisschen Abstand.

Text müsste doch etwa so heissen:
$content .= "<img src='images/logo_small_120.gif' width='120' height='1203' alt='text'>"; 

Ich hab das Bild ausserhalb vom Portal-Ordner auf dem Server. Der Ordner ist im Main-Verzeichnis und heisst "images". Wie kann ich das und vorallem wo einbinden?

die Seite heisst: www.ehc-seuzach.ch
Der Block ist der erste links. Da nach dem letzten Menüpunkt "Vergangenes" müsste ein Logo zentriert hin.

Block: block-Modules_one.php


<?php
/************************************
pragmaMx  Content Management System
Copyright (c) 2005 pragmaMx Dev Team - http://pragmaMx.org
***********************************
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
***********************************
$Source: /cvsroot/pragmamx/stable/blocks/block-Modules_one.php,v $
$Revision: 1.2 $
$Author: tora60 $
$Date: 2005/06/19 20:27:57 $
************************************/

if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");

//-------------MODIFY HERE TO CUSTOMIZE THE MENU------>
$homelink = 'index.php';                /* link to homepage (alternate: ./ )
$showadminlink = 1;                         /* Show link to adminmenue */
$mouseOver = "#e8e8e8";                    /* Sets mouseover color */
$image1 = "images/menu/rarrow.gif";     /* image path relative to public root*/
#$image2 = "images/menu/barrow.gif";    /* image path relative to public root*/
$image3 = "images/menu/oarrow.gif";     /* image path relative to public root*/
$maxwordlen      = 18;                  /* max. Number of charakters in Moduleslist */
$listheigth1      = 0;                  /* Heigth of the scrolling Layer for Moduleslist */
$mxblockcache = FALSE;                  /* allow to cache this Block */
//---------END-MODIFY HERE TO CUSTOMIZE THE MENU------>

global $prefix, $name, $home;
$main_module = mxGetMainModuleName();
$mouseOut = "transparent";                /* Sets mouseout color - leave blank for background*/
$actionMenu = "style=\"background: transparent;\" onMouseOver=\"this.style.background='$mouseOver'\" onMouseOut=\"this.style.background='$mouseOut'\"";
$thisfile = basename(__file__);
$thismodulblock = ereg_replace("block-","",$thisfile);
$thismodulblock = ereg_replace(".php","",$thismodulblock);

$size = @getimagesize($image1);
$size = (empty($size[3])) ? "" : $size[3];
$img1 = "<img src=\"".$image1."\" border=\"0\" ".$size.">";

#$size = @getimagesize($image2);
#$size = (empty($size[3])) ? "" : $size[3];
#$img2 = "<img src=\"".$image2."\" border=\"0\" ".$size.">";

$size = @getimagesize($image3);
$size = (empty($size[3])) ? "" : $size[3];
$img3 = "<img src=\"".$image3."\" border=\"0\" ".$size.">";

$content .= "<img src='images/logo_small_120.gif' width='120' height='1203' alt='text'>";

$curname = (empty($name)) ? $main_module : $name;
$where = "WHERE  active=1 AND main_id='".$thismodulblock."'";
$result = sql_query("select mid, title, custom_title, active, main_id from ${prefix}_modules $where");
while(list($mid, $m_title, $custom_title, $active, $main_id) = sql_fetch_row($result)) {
   if ($m_title == $main_module) {
      if ($main_id == $thismodulblock) $homefound = TRUE;
      continue;
      }
   $m_title2 = (empty($custom_title)) ? str_replace("_", " ", $m_title) : str_replace("_", " ", $custom_title);
   $m_title3 = mxCutString($m_title2, $maxwordlen, "..", "");
   $img = ($m_title == $curname) ? $img3 : $img1;
   if (mxModuleAllowed($m_title)) {
      $opt_u[strtolower($m_title2)] = "<tr $actionMenu\"><td title=\"".$m_title2."\"><span class=\"boxcontent\">".$img." <a href=\"modules.php?name=".urlencode($m_title)."\">".$m_title3."</a></span></td></tr>\n";
      }
   }

if (!empty($opt_u) || isset($homefound)) {
   if (!empty($opt_u)) ksort($opt_u, SORT_STRING);
   $options = "";
   if (isset($homefound)) {
      $options = "<tr $actionMenu\"><td><span class=\"boxcontent\">".$img3." <a href=\"".$homelink."\">"._HOME."</a></span></td></tr>\n";
      }
   if (!empty($opt_u)) $options .= implode("",$opt_u);
   if ($options) {
      $content  = ($listheigth1) ? "<div style=\"height: ".$listheigth1."px; overflow : auto;\">" : "<div>";
      $content .= "<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\" width=\"100%\">";
      $content .= $options;
      $content .= "</table></div>\n";
      }
   }

?>