Willkommen auf dem Portal für Mediengestalter
|
|
Autor |
Nachricht |
pagewrbung
Threadersteller
Dabei seit: 11.01.2011
Ort: Bad Oeynhausen
Alter: -
Geschlecht: -
|
Verfasst Di 11.01.2011 17:10
Titel PHP Hilfe bei style="background:url..." code |
|
|
Hallo ich habe ein Problem, was ich irgendwie nicht auf die Reihe bekomme. Und zwar geht es um die Seite test5.pagewerbung.de/wiese
die seite bin ich gerade am entwickeln, doch eine sache stört mich noch. unter der slideshow befindet sich der orange balken, mit vorschaubilder. allerdings sind die gewählten ausschnitte eher ungünstig und nichtssagend. ich poste euch mal den code, es dreht sich, so wie ich den code verstehe um die zeile 172.
das was ich gerne machen würde: die bilder, die in dem ausgewählten ausschnitt angezeigt werden verkleiner o.ä.
danke schonmal für hilfe/vorschläge
Code: | // no direct access
defined('_JEXEC') or die('Restricted access');
$who = strtolower($_SERVER['HTTP_USER_AGENT']);
JHTML::_('behavior.mootools');
require_once (JPATH_SITE.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
require_once('modules/mod_youmania_slider/lib/slike.php');
$get_items = $params->get ('get_items',1);
$nitems = $params->get ('nitems',4);
$chars = $params->get ('chars',40);
$ordering = $params->get ('ordering',3);// 1 = ordering | 2 = popular | 3 = random
$specificitems = $params->get ('specificitems','');
$full_player_width = $params->get ('full_player_width',960);
$player_height = $params->get ('player_height',300);
$intro_width = $params->get ('intro_width',"320px");
$autoSlide = $params->get ('autoSlide',0);
$startElem = $params->get ('startElem',2);
$visibleItems = $params->get ('visibleItems',3);
$type_slider = $params->get('type_slider');
$sorient = $params->get('sorient');
$stime = $params->get('stime');
$sduration = $params->get('sduration');
$showtooltip = $params->get('showtooltip',0);
$showcattitle = $params->get('showcattitle',1);
$showreadmore = $params->get('showreadmore',1);
if($ordering ==1){
$order = 'ordering';
}elseif($ordering == 2){
$order = 'hits';
}elseif ($ordering == 3){
$order = 'RAND()';
}
$document = &JFactory::getDocument();
$document->addStyleSheet(JURI::base() . 'modules/mod_youmania_slider/css/stylesheet.css');
$document->addScript(JURI::base() . 'modules/mod_youmania_slider/script/youmania.js');
if(preg_match("/msie 6/", $who)) {
$document->addStyleSheet(JURI::base() . 'modules/mod_youmania_slider/css/ifie.php');
}
$document->addScriptDeclaration("
window.addEvent('load', function(){
new YJYoumania({
outerContainer : 'YJYoumania_outer',
innerContainer : 'YJYoumania_inner',
elements: '.YJYoumania_slide',
navigation: {
'forward':'YJYoumania_right',
'back':'YJYoumania_left',
container: 'YJYoumania_inner_nav',
elements:'.YJYoumania_navLink',
outer: 'YJYoumania_nav',
visibleItems:$visibleItems
},
navInfo: 'YJYoumania_nav_info',
navLinks: '.YJYoumania_navLink',
slideType: $type_slider,
orientation: $sorient,
slideTime: $stime,
duration: $sduration,
tooltips:$showtooltip,
autoslide:$autoSlide,
startElem:$startElem
});
});
");
echo "<!-- http://www.Youjoomla.com Youjoomla YouMania News Slider for Joomla 1.5 starts here --> ";
?>
<?php
$db =& JFactory::getDBO();
$user =& JFactory::getUser();
$userId = (int) $user->get('id');
$aid = $user->get('aid', 0);
$contentConfig = &JComponentHelper::getParams( 'com_content' );
$access = !$contentConfig->get('shownoauth');
$nullDate = $db->getNullDate();
$date =& JFactory::getDate();
$now = $date->toMySQL(); //date('Y-m-d H:i:s');
$where = 'a.state = 1'
. ' AND ( a.publish_up = '.$db->Quote($nullDate).' OR a.publish_up <= '.$db->Quote($now).' )'
. ' AND ( a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).' )'
;
if(!empty($specificitems)){
$where .= ' AND a.id IN ('.$specificitems.')';
}else{
$where .= ' AND cc.id = '.$get_items.'';
}
$sql = 'SELECT a.*, ' .
' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'.
' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug,'.
'cc.title as cattitle,'.
's.title as sectitle'.
' FROM #__content AS a' .
' INNER JOIN #__categories AS cc ON cc.id = a.catid' .
' INNER JOIN #__sections AS s ON s.id = a.sectionid' .
' WHERE '. $where .'' .
($access ? ' AND a.access <= ' .(int) $aid. ' AND cc.access <= ' .(int) $aid. ' AND s.access <= ' .(int) $aid : '').
' AND s.published = 1' .
' AND cc.published = 1' .
' ORDER BY '.$order .' LIMIT 0,'.$nitems.'';
$db->setQuery( $sql );
$load_items = $db->loadObjectList();
$slidesYoumania = array();
foreach ( $load_items as $row ) {
$slideYoumania = array(
'date' => JHTML::_('date', $row->created, '%d-%m-%Y'),
'intro' => substr(strip_tags($row->introtext,'<a><span>'),0,$chars),
'intro2' => substr(strip_tags($row->introtext),0,15),
'link' => ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid),
'cat_link' => ContentHelperRoute::getCategoryRoute($row->catid, $row->sectionid),
'img_url' => $img_url = youmania_image($row),
'title' => $row->title,
'cat_title' => $row->cattitle,
'img_url' => '',
'img_out' =>"<img src=\"".JURI::base().$img_url."\" border=\"0\" class=\"YJYoumania_link\" title=\"".$row->cattitle." :: ".$row->title."\" alt=\"\"/>",
'img_out2'=>"".JURI::base().$img_url.""
);
$slidesYoumania[] = $slideYoumania;
}
?>
<div style="width:<?php echo $full_player_width ?>px; margin:0px auto 0px; display:block; position:relative;">
<div id="YJYoumania_outer" class="slide" style="width:<?php echo $full_player_width ?>px; height:<?php echo $player_height ?>px;">
<div id="YJYoumania_inner" style="width:<?php echo $full_player_width ?>px;">
<?php $countSlides = 0;?>
<?php foreach ($slidesYoumania as $slideYoumania):?>
<div class="YJYoumania_slide" style="width:<?php echo $full_player_width ?>px; height:<?php echo $player_height ?>px; display:<?php echo $startElem==$countSlides?'block':'none';?>"> <a href="<?php echo $slideYoumania['link'] ?>" title="">
<?php if(isset($img_url) && $img_url != "") echo $slideYoumania['img_out'] ?>
</a>
<div class="YJYoumania_description" style="width:<?php echo $intro_width ?>;"> <div class="title"><?php echo $slideYoumania['title'] ?>
<?php if($showcattitle ==1) { ?>
<div class="slide_cat"><a href="<?php echo $slideYoumania['cat_link'] ?>">More <?php echo $slideYoumania['cat_title'] ?> news</a></div>
<?php } ?>
</div>
<p><?php echo $slideYoumania['intro'] ?></p>
<?php if ($showreadmore == 1 ){ ?>
<a href="<?php echo $slideYoumania['link'] ?>" title="" class="YJYoumania_more">Read more</a>
<?php } ?>
</div>
</div>
<?php $countSlides+=1; ?>
<?php endforeach;?>
</div>
</div>
<div class="navContainer" style="width:<?php echo $full_player_width ?>px;"> <a href="#" title="previous" id="YJYoumania_left"></a> <a href="#" title="next" id="YJYoumania_right"></a>
<div id="YJYoumania_nav" style="width:<?php echo $full_player_width - 120 ?>px;">
<div class="nav_inner" id="YJYoumania_inner_nav">
<?php foreach ($slidesYoumania as $slideYoumania):?>
<a href="#" class="YJYoumania_navLink" title="Weiterleitung zu ::<?php echo $slideYoumania['title'] ?>">
<span class="slider_nav_intro" ><?php echo $slideYoumania['title'] ?> </span>
<span class="slide_img" style="background:url(<?php if(isset($img_url) && $img_url != "") echo $slideYoumania['img_out2'] ?> ) no-repeat left 50% ;"></span>
</a>
<?php endforeach;?>
</div>
</div>
</div>
</div>
|
|
|
|
|
|
zweitaccount
Dabei seit: 25.01.2008
Ort: -
Alter: -
Geschlecht: -
|
Verfasst Di 11.01.2011 18:07
Titel
|
|
|
Hi, du könntest die Bilder hier anstatt als Backgroundimg
Code: | <span class="slide_img" style="background:url(<?php if(isset($img_url) && $img_url != "") echo $slideYoumania['img_out2'] ?> ) no-repeat left 50% ;"></span> |
als 'normales' Image einbauen und auf 170x90 runterskalieren.
(wieso eigentlich isset($img_url) ? Wenn dann doch if (isset($slideYoumania['img_out2'])) ...
aber egal)
Oder Du legst in /images/stories/slider/ jeweils noch ein
manuell erstelltes Thumbnail rein und benamst es als *_thumb.*, z.B.:
TGA_Foto_rdax_358x268_thumb.png.
Dann noch die Thumb-Url in der foreach-Schleife oben mitgeben:
Code: | foreach ( $load_items as $row ) {
$img_url = youmania_image($row);
$tmp = pathinfo($img_url);
$img_thumb_url = $tmp['filename'].'_thumb.'.$tmp['extension'];
$slideYoumania = array(
'date' => JHTML::_('date', $row->created, '%d-%m-%Y'),
'intro' => substr(strip_tags($row->introtext,'<a><span>'),0,$chars),
'intro2' => substr(strip_tags($row->introtext),0,15),
'link' => ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid),
'cat_link' => ContentHelperRoute::getCategoryRoute($row->catid, $row->sectionid),
'img_url' => $img_url,
'title' => $row->title,
'cat_title' => $row->cattitle,
'img_url' => '',
'img_out' => "<img src=\"".JURI::base().$img_url."\" border=\"0\" class=\"YJYoumania_link\" title=\"".$row->cattitle." :: ".$row->title."\" alt=\"\"/>",
'img_out2'=> "".JURI::base().$img_url."",
'img_out3'=> JURI::base().$img_thumb_url
);
$slidesYoumania[] = $slideYoumania;
} |
und unten im 'slide_img' dieses Thumb ($slideYoumania['img_out3']) ausgeben.
Grüße
zweitaccount
|
|
|
|
|
Anzeige
|
|
|
|
|
|
Ähnliche Themen |
HTML element Style ohne Parentelement Style
Tipps für verwaschenen Style bzw. Splash Style
c4d background?
[CSS] Background-image INE
PNG Background in IE 6 - DD_belatedPNG
Webdesign-Background
|
|
|
Du kannst keine Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum nicht antworten. Du kannst an Umfragen in diesem Forum nicht mitmachen.
|
|