Antichat снова доступен.
Форум Antichat (Античат) возвращается и снова открыт для пользователей.
Здесь обсуждаются безопасность, программирование, технологии и многое другое.
Сообщество снова собирается вместе.
Новый адрес: forum.antichat.xyz
Модуль для Joomla, переделка |

09.03.2009, 12:23
|
|
Banned
Регистрация: 07.03.2009
Сообщений: 21
Провел на форуме: 230548
Репутация:
24
|
|
Модуль для Joomla, переделка
Всем привет!
В PHP я новичёк и бла бла... все меня поняли.
собственно для джумли нашёл интересный модуль. Называется вроде mod ja catslwi.
Делает он вот что.
Берёт какуюто картинку и какуюто надпись и делает это красиво Ы
Ну а точнее, берёт фотографии с какогото хранилищя (с какого имеено я не понял). Ресайзит их и с помошбю ЯваСкрипта добавляет маленькую полосочку текста снизу. При наведении она поднимается вверх, а под ней текст.
Собственно в чём проблема.
А проблема в том что плУгин делает таких фоток только полосой по вертикали.
А надо что бы было в два столбика.
ЗЫ пишу ночью посему тупо пишу.
Код:
<?php
/*------------------------------------------------------------------------
# JA Teline II for Joomla 1.5 - Version 1.6 - Licence Owner JA108226
# ------------------------------------------------------------------------
# Copyright (C) 2004-2008 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
# @license - Copyrighted Commercial Software
# Author: J.O.O.M Solutions Co., Ltd
# Websites: http://www.joomlart.com - http://www.joomlancers.com
# This file may not be redistributed in whole or significant part.
-------------------------------------------------------------------------*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
require_once (JPATH_SITE .DS.'modules'.DS.'mod_ja_catslwi'.DS.'helper.php');
JHTML::stylesheet('',modJaSLWI::getFile('ja_catslwi.css','modules/mod_ja_catslwi/mod_ja_catslwi/','templates/'.$mainframe->getTemplate().'/css/'));
$height = intval($params->get('height'));
$catid = $params->get('catid','');
$numelem = $params->get('numelem',3);
$autoresize = intval (trim( $params->get( 'autoresize', 0) ));
$maxchars = intval (trim( $params->get( 'maxchars', 200 ) ));
$iwidth = intval (trim( $params->get( 'iwidth', 100 ) ));
$iheight = intval (trim( $params->get( 'iheight', 100 ) ));
$color = $params->get('textcolor');
if ($color) $color = " color:#$color;";
$bgcolor = $params->get('bgcolor');
if ($bgcolor) $bgcolor = " background-color:#$bgcolor;";
$trans = intval($params->get('transparent'));
$list = modJaSLWI::getList($catid, $numelem);
if (!$trans) $trans = 100;
$xheight = intval($params->get('expandheight'));
global $ja_catslwi_id;
if (!defined( '_MOD_JA_CATSLWI')) {
echo '
<sсriрt type="text/jаvаsсript" src="'.JURI::base().'modules/mod_ja_catslwi/mod_ja_catslwi/mod_ja_catslwi.js"></sсriрt>
<sсriрt type="text/jаvаsсript">
jaSLWI.expandH = '.$xheight.';
</sсriрt>';
define( '_MOD_JA_CATSLWI', 1 );
$ja_catslwi_id = 0;
}
foreach($list as $l){
$l->text = $l->introtext.$l->fulltext;
$link = JRoute::_(ContentHelperRoute::getArticleRoute($l->slug, $l->catslug, $l->sectionid));
$image = modJaSLWI::replaceImage ($l, $autoresize, $maxchars, $iwidth, $iheight );
echo '
<div '.($link ? 'onclick="location.href=\''.$link.'\'"' : '').' class="ja-catslwi" style="height: '.$height.'px;'.$image.' '.($link ? ' cursor: pointer;' : '').'">
<div class="ja-catslwi-container">
<p> </p>
<div class="ja-catslwi-text">
<div id="ja-catslwi-textbg'.(++$ja_catslwi_id).'" class="ja-catslwi-content" style="height:'.$xheight.'px;'.$bgcolor.'">
<sсriрt type="text/jаvаsсript">
textbg = document.getElementById("ja-catslwi-textbg'.($ja_catslwi_id).'");
textbg.style.opacity = '.($trans/100).';
textbg.style.filter = \'alpha(opacity='.$trans.')\';
</sсriрt>
</div>
<div class="ja-catslwi-display" style="height:'.$xheight.'px;'.$color.'"><h3>'.$l->title.'</h3>'.$l->introtext1.'</div>
</div>
</div>
</div>';
}
?>
Как я понял с кода.
Запускается цеклическое нечто (шаблон) куда вставляются даные непонятно откуда (эт не столь важно откуда).
Так вот... как это можно разбить на два столбика?
даж наверно проще.... нужно всего два столбика по 3 в каждом.
Как я понял нужно сделать проверку на переменную $ja_catslwi_id (хотя наверно не на эту). а точнее.. если делится на 3 и ответ 1 то следуюющщее пишит в другой <tr><td> ...
Как то так...
Буду очень презнателен за помощь... хоть какуюту.
Вот еще:
Код:
<?php
/*------------------------------------------------------------------------
# JA Teline II for Joomla 1.5 - Version 1.6 - Licence Owner JA108226
# ------------------------------------------------------------------------
# Copyright (C) 2004-2008 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
# @license - Copyrighted Commercial Software
# Author: J.O.O.M Solutions Co., Ltd
# Websites: http://www.joomlart.com - http://www.joomlancers.com
# This file may not be redistributed in whole or significant part.
-------------------------------------------------------------------------*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
require_once (JPATH_SITE .DS.'modules'.DS.'mod_ja_catslwi'.DS.'helper.php');
JHTML::stylesheet('',modJaSLWI::getFile('ja_catslwi.css','modules/mod_ja_catslwi/mod_ja_catslwi/','templates/'.$mainframe->getTemplate().'/css/'));
$height = intval($params->get('height'));
$catid = $params->get('catid','');
$numelem = $params->get('numelem',3);
$autoresize = intval (trim( $params->get( 'autoresize', 0) ));
$maxchars = intval (trim( $params->get( 'maxchars', 200 ) ));
$iwidth = intval (trim( $params->get( 'iwidth', 100 ) ));
$iheight = intval (trim( $params->get( 'iheight', 100 ) ));
$color = $params->get('textcolor');
if ($color) $color = " color:#$color;";
$bgcolor = $params->get('bgcolor');
if ($bgcolor) $bgcolor = " background-color:#$bgcolor;";
$trans = intval($params->get('transparent'));
$list = modJaSLWI::getList($catid, $numelem);
if (!$trans) $trans = 100;
$xheight = intval($params->get('expandheight'));
global $ja_catslwi_id;
if (!defined( '_MOD_JA_CATSLWI')) {
echo '
<sсriрt type="text/jаvаsсript" src="'.JURI::base().'modules/mod_ja_catslwi/mod_ja_catslwi/mod_ja_catslwi.js"></sсriрt>
<sсriрt type="text/jаvаsсript">
jaSLWI.expandH = '.$xheight.';
</sсriрt>';
define( '_MOD_JA_CATSLWI', 1 );
$ja_catslwi_id = 0;
}
echo '
<div class="Gosti_VG">
';
foreach($list as $l){
$l->text = $l->introtext.$l->fulltext;
$link = JRoute::_(ContentHelperRoute::getArticleRoute($l->slug, $l->catslug, $l->sectionid));
$image = modJaSLWI::replaceImage ($l, $autoresize, $maxchars, $iwidth, $iheight );
if ($ja_catslwi_id / 4 == 1){
echo '</div><div class="Gosti_VG2">';
}
echo '
<div '.($link ? 'onclick="location.href=\''.$link.'\'"' : '').' class="ja-catslwi" style="height: '.$height.'px;'.$image.' '.($link ? ' cursor: pointer;' : '').'">
<div class="ja-catslwi-container">
<p> </p>
<div class="ja-catslwi-text">
<div id="ja-catslwi-textbg'.(++$ja_catslwi_id).'" class="ja-catslwi-content" style="height:'.$xheight.'px;'.$bgcolor.'">
<sсriрt type="text/jаvаsсript">
textbg = document.getElementById("ja-catslwi-textbg'.($ja_catslwi_id).'");
textbg.style.opacity = '.($trans/100).';
textbg.style.filter = \'alpha(opacity='.$trans.')\';
</sсriрt>
</div>
<div class="ja-catslwi-display" style="height:'.$xheight.'px;'.$color.'"><h3>'.$l->title.'</h3>'.$l->introtext1.'</div>
</div>
</div>
</div>';
}
echo '
</div>
';
?>
немножко добавил.
Вроде пашит. А теперь редактирую позиции с помошью CSS.
Кажись работает.
Всем спасибо.
|
|
|
|
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|