Новости Joomla

Совет по Joomla: $db->getQuery(true) стал устаревшим

Совет по Joomla: $db->getQuery(true) стал устаревшим

👩‍💻 Совет по Joomla: $db->getQuery(true) стал устаревшим.Раньше при создании запросов в базу данных мы всегда получали объект запроса с помощью метода

getQuery(). Если передавался параметр
$new =
true, то получали новый запрос. Если без - последний.

use Joomla\CMS\Factory;$db = Factory::getContainer()->get('DatabaseDriver');$query = $db->getQuery(new: true);// и строим запрос
Под капот Joomla 4 вошёл Joomla Framework (PHP фреймворк а-ля Laravel, Yii и т.д.), а для Joomla 5 он обновился - версия 3.4.1 вышла 6 октября 2023г. В методе фреймворка есть примечание о том, что параметр
$new, который передавался в метод
getQuery() помечен как устаревший и будет удалён в версии фреймворка 4.0.
The parameter $new is deprecated and will be removed in 4.0, use %s::createQuery() instead.В Joomla 4 версия Joomla Framework была 2.x., в Joomla 5 - 3.x. Поэтому есть предположение, что с выходом Joomla 6 обновится и версия фреймворка - станет 4.0. Поэтому для получения объекта для новых запросов следует использовать метод
createQuery(). Он уже представлен в ядре и широко используется. При этом метод
getQuery() останется, но, скорее всего, будет выполнять функцию только геттера - получения текущего запроса.
@joomlafeed#joomla #php #разработка

0 Пользователей и 1 Гость просматривают эту тему.
  • 35 Ответов
  • 65036 Просмотров
*

noni

  • Новичок
  • 5
  • 0 / 0
Re: Создаем индикатор загрузки сайта
« Ответ #30 : 08.06.2010, 13:01:28 »
Я не слишком силен в этом... Помогите люди добрые и знающие. Какой код надо добавить, чтобы индикатор появлялся только на странице www.domen.ru/page  ? Выручайте  :(
*

mosgaz

  • Захожу иногда
  • 65
  • 12 / 0
Re: Создаем индикатор загрузки сайта
« Ответ #31 : 09.06.2010, 15:14:09 »
Я не слишком силен в этом... Помогите люди добрые и знающие. Какой код надо добавить, чтобы индикатор появлялся только на странице www.domen.ru/page  ? Выручайте  :(

www.domen.ru/page. Нужно делать проверку по Itemid или id или option, по любому другому параметру адреса вашей страницы, делающего его уникальным. Если условие выполняется, тогда выполнять код.

Код проверки условия, указанный мною выше, нужно разместить в файле index.php (вашего шаблона):

templates/(имя вашего шаблона)/index.php


Попробуйте разобраться. Если не разберетесь сами, выложите код вашего index.php и адрес страницы для отображения индикатора.
« Последнее редактирование: 09.06.2010, 15:23:10 от mosgaz »
ACER == мусор.
*

noni

  • Новичок
  • 5
  • 0 / 0
Re: Создаем индикатор загрузки сайта
« Ответ #32 : 09.06.2010, 17:31:08 »
Спасибо за отзывчивость! Мои эксперименты со вставкой кода привели только к тому что надпись загрузка ждите не исчезала даже после загрузки страницы  ^-^
ID страницы 91  вот код. Заранее спасибо.
Код
<head>
<jdoc:include type="head" />

<script type="text/javascript">

function hideLoading() {
document.getElementById('pageIsLoading').style.display = 'none';
}
</script>

<!--Rating@Mail.ru counter-->
<script language="javascript"><!--
d=document;var a='';a+=';r='+escape(d.referrer);js=10;//--></script>
<script language="javascript1.1"><!--
a+=';j='+navigator.javaEnabled();js=11;//--></script>
<script language="javascript1.2"><!--
s=screen;a+=';s='+s.width+'*'+s.height;
a+=';d='+(s.colorDepth?s.colorDepth:s.pixelDepth);js=12;//--></script>
<script language="javascript1.3"><!--
js=13;//--></script><script language="javascript" type="text/javascript"><!--
d.write('<img src="http://d8.c2.bc.a1.top.mail.ru/counter'+'?id=1845352;js='+js+
a+';rand='+Math.random()+'" height="1" width="1" alt="top.mail.ru" border="0">');
if(11<js)d.write('<'+'!-- ')//--></script>
<noscript><img src="http://d8.c2.bc.a1.top.mail.ru/counter?js=na;id=1845352"
height="1" width="1" alt="top.mail.ru" border="0"></noscript>
<script language="javascript" type="text/javascript"><!--
if(11<js)d.write('--'+'>');//--></script>
<!--// Rating@Mail.ru counter-->


<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta content="Merkury-ice"  name="copyright">
<link href="templates/businesslook/css/template_css.css" rel="stylesheet" type="text/css" media="screen" />
<link href="templates/businesslook/css/lytebox.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />
<?php if ($s5_menu  == "1") { ?>
<link href="templates/businesslook/css/nomoo_suckerfish.css" rel="stylesheet" type="text/css" media="screen" />
<?php } ?>
<?php if ($s5_menu  == "2") { ?>
<link href="templates/businesslook/css/suckerfish.css" rel="stylesheet" type="text/css" media="screen" />
<?php } ?>
<script type="text/javascript" src="templates/businesslook/js/s5_effects.js"></script>
<?php if (($s5_menu  == "1") || ($s5_menu  == "2")) { ?>
<script type="text/javascript" src="templates/businesslook/js/IEsuckerfish.js"></script>
<?php } ?>

<?php
// Disable lytebox when VM is loaded
if (JRequest::getVar('option') == 'com_virtuemart' ) {
 } else { ?>
<script type="text/javascript" src="templates/businesslook/js/lytebox.js"></script>
<?php } ?>

<?php
$br = strtolower($_SERVER['HTTP_USER_AGENT']); // what browser.
if(ereg("msie 6", $br)) {
$is_ie6 = "yes";
}
else {
$is_ie6 = "no";
}
?>


<?php
$br = strtolower($_SERVER['HTTP_USER_AGENT']); // what browser.
if(ereg("msie 7", $br)) {
$is_ie7 = "yes";
}
else {
$is_ie7 = "no";
}

$br = strtolower($_SERVER['HTTP_USER_AGENT']); // what browser.
if(ereg("msie 8", $br)) {
$is_ie8 = "yes";
}
else {
$is_ie8 = "no";
}
?>
<style type="text/css">
body  {
background:<?php echo $s5_backcolor;?> url(<?php echo $s5_backimage;?>) no-repeat top; }

#s5_bottomwrap {
color:<?php echo $s5_bottomcolor;?>;}
</style>
<?php if ($is_ie6 == "yes") { ?>
<style type="text/css">
* HTML #s5_logo {
background:none;
height: 100px;
width:352px;
margin-top: 0px;
filter:
progid:dximagetransform.microsoft.alphaimageloader(src='templates/businesslook/images/logo.png', sizingmethod='scale');}


* HTML #s5_menubarwrap {
background:none;
height:110px;
width:916px;
margin-top: 0px;
filter:
progid:dximagetransform.microsoft.alphaimageloader(src='templates/businesslook/images/menu_bar.png', sizingmethod='scale');}


* HTML #s5_mainbottomback {
background:none;
height:53px;
width:912px;
margin-top: 0px;
filter:
progid:dximagetransform.microsoft.alphaimageloader(src='templates/businesslook/images/bottomback.png', sizingmethod='crop');}


* HTML #s5_bottombottom {
background:none;
clear:both;
height:73px;
width:912px;
margin-top: 0px;
filter:
progid:dximagetransform.microsoft.alphaimageloader(src='templates/businesslook/images/bottombottom.png', sizingmethod='scale');}

* HTML #s5_footer {
background:none;
height:75px;
width:900px;
bottom:0pt;
position:relative;
margin-left:auto;
margin-right:auto; }

* HTML #s5_mainbacktop {
background:transparent url(templates/businesslook/images/topback.gif) no-repeat scroll 0%;
height:9px;
width:912px; }

#s5_bottomtop {
height:33px;
width:912px;
background:transparent url(templates/businesslook/images/bottomtop.gif) no-repeat top;}

#s5_mainbuttons {
margin-bottom:-6px; }

#s5_mainbackmiddle {
padding-right:10px;
padding-left:10px;
<?php if ($this->countModules("left") && $this->countModules("right")) { ?>
width:888px;
 <?php } else {?>
 width:892px;
  <?php } ?> }

.inputbox-login {
margin-top:-5px;
padding-top:1px;
line-height: 20px;
background:transparent url(templates/businesslook/images/IEback.gif) no-repeat scroll 0%;}

.button-login {
cursor:pointer;
border:none;
width:73px;
padding-right:21px;
height:31px;
margin-top:0px;
padding-bottom:-12px;
background: transparent url(templates/businesslook/images/login/IElogin.gif) no-repeat;}

#s5_boxbuttonright {
background: url(templates/businesslook/images/right_box.gif) no-repeat; }

#s5_boxbuttonleft {
background: url(templates/businesslook/images/left_box.gif) no-repeat; }

* HTML #s5_bottommiddle {
background-image: none;                             
    background-color: #ffffff;                         
    filter:alpha(opacity=20);   
color:#ffffff;
margin-top:-4px;}

</style>
<?php } ?>

</head>
<body>

<div id="pageIsLoading"
style="
position:          absolute;
display:            block;
padding-left:    44px;
padding-right:  12px;
width:             auto;
height:            46px;
line-height:      46px;
border:            1px solid #890000;
color:              #000000;
font-weight:    bold;
background-color: #e5e5e5;
background-image: url(http://merkury-ice.ru/images/loading.gif);
background-position: 6px center;
background-repeat: no-repeat;">

<script type="text/javascript">
if (typeof window_width == 'undefined' || typeof window_height == 'undefined') {
var window_width;
var window_height;
if( typeof( window.innerWidth ) == 'number' ) {
  window_width = window.innerWidth;
  window_height = window.innerHeight;
} else if( document.documentElement &&
    ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
  window_width = document.documentElement.clientWidth;
  window_height = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
  window_width = document.body.clientWidth;
  window_height = document.body.clientHeight;
}
}
var left = Math.round((window_width - 200) / 2);
var top = Math.round(((window_height - 46) / 3) + 46);
document.getElementById('pageIsLoading').style.left = left+'px';
document.getElementById('pageIsLoading').style.top = top+'px';
</script>
Загружается... Ждите...
</div>

<div id="s5_background">
<div id="s5_wrapper">
<div id="s5_logo" style="cursor:pointer;" onclick="window.document.location.href='index.php'">
</div>
  <?php if (($s5_menu  == "1") || ($s5_menu  == "2")) { ?>
<div id="s5_menubarwrap">
<div id="s5_menu">
  <?php if ($s5_menu  == "1") { ?>
<div id='navv'>
<?php mosShowListMenu($menu_name); ?>
<script type="text/javascript" src="templates/businesslook/js/s5_no_moo_menu.js"></script>
</div>
  <?php } ?>
 
  <?php if ($s5_menu  == "2") { ?>
<div id='navv'>
<?php mosShowListMenu($menu_name); ?>
</div>
  <?php } ?>
</div>
<?php if($this->countModules('top')) { ?>
<div id="s5_search">
<jdoc:include type="modules" name="top" style="xhtml" />
</div>
<?php } ?>
</div>

<?php } ?>
<?php if($this->countModules('header')) { ?>
<div id="s5_header">
<jdoc:include type="modules" name="header" style="xhtml" />
</div>
<?php } ?>

               

<div id="s5_mainback">
<div id="s5_mainbuttons">
<?php if($this->countModules('toolbar')) { ?>
<div id="s5_boxbutton">
<div id="s5_boxbuttonleft"></div>
<div id="s5_boxbuttonmiddle" onclick="<?php if ($is_ie6 == "yes") { ?>ie_popup_fix();<?php } ?>shiftOpacity3('popup_div');shiftOpacity2('popup_outer');show_popup()">
<?php echo $s5_boxtext;?>
</div>
<div id="s5_boxbuttonright"></div>
</div>
<?php } ?>
<?php if ($s5_rss  == "1") { ?>
<div id="s5_rss">
<a style="text-decoration:none" href="index.php?option=com_content&view=frontpage&format=feed&Itemid=1&type=rss" target="_blank">

<img src="templates/businesslook/images/rss.<?php if ($is_ie6 == "yes") { ?>gif<?php } ?><?php if ($is_ie6 == "no") { ?>png<?php } ?>" alt="Home" />
</a>
</div>
<?php } ?>
</div>


<div id="s5_mainbacktop"></div>
<div id="s5_mainbackmiddle">
<?php if ($this->getBuffer('message')) : ?>
<jdoc:include type="message" />
<?php endif; ?>
<?php if($this->countModules('left')) { ?>
<div id="s5_leftcolumn" style="width:<?php echo $s5_left_width;?>px;">
<jdoc:include type="modules" name="left" style="rounded" />
</div>
<?php } ?>
<?php if($this->countModules('right')) { ?>
<div id="s5_rightcolumn" style="width:<?php echo $s5_right_width;?>px;">
<jdoc:include type="modules" name="right" style="rounded" />
</div>
<?php } ?>

<div style="
<?php if ($this->countModules("left") && !$this->countModules("right")) { ?>margin-left:<?php echo $left_margin; ?>px;"><?php } ?>

<?php if (!$this->countModules("left") && $this->countModules("right")) { ?>margin-right:<?php echo $right_margin; ?>px;"><?php } ?>

<?php if ($this->countModules("left") && $this->countModules("right")) { ?>margin-right:<?php echo $right_margin; ?>px;margin-left:<?php echo $left_margin; ?>px;"><?php } ?>
<div id="s5_maincolumn" style="width:<?php echo $s5_mainbody_width; ?>px;float:left;">


<?php if($this->countModules('user1') || $this->countModules('user2')) { ?>
<div id="s5_positions">
<?php if($this->countModules('user1')) { ?>
<div id="s5_user1_<?php echo $user23; ?>">
<jdoc:include type="modules" name="user1" style="rounded" />
</div>
<?php } ?>
<?php if($this->countModules('user2')) { ?>
<div id="s5_user2_<?php echo $user23; ?>">
<jdoc:include type="modules" name="user2" style="rounded" />
</div>
<?php } ?>

</div>
<div style="clear:both;"></div>
<?php } ?>
<?php if($this->countModules('pathway')) { ?>
<div id="s5_breadcrumbs">
<jdoc:include type="modules" name="pathway" style="rounded" />
</div>
<?php } ?>

<div id="s5_mainbody">
<jdoc:include type="component" />
</div>
</div>
<?php if($this->countModules('banner')) { ?>
<div id="s5_mainbodybanner">
<jdoc:include type="modules" name="banner" style="rounded" />
</div>
<?php } ?>

<?php if($this->countModules('right') || $this->countModules('left')) { ?>
</div>
<?php } ?>

<?php if($this->countModules('user3') || $this->countModules('user4') || $this->countModules('user5') || $this->countModules('user6')) { ?>
<div id="s5_mainbodybottom">
<?php if($this->countModules('user3')) { ?>
<div id="s5_user3_<?php echo $bottom4; ?>">
<jdoc:include type="modules" name="user3" style="rounded" />
</div>
<?php } ?>
<?php if($this->countModules('user4')) { ?>
<div id="s5_user4_<?php echo $bottom4; ?>">
<jdoc:include type="modules" name="user4" style="rounded" />
</div>
<?php } ?>
<?php if($this->countModules('user5')) { ?>
<div id="s5_user5_<?php echo $bottom4; ?>">
<jdoc:include type="modules" name="user5" style="rounded" />
</div>
<?php } ?>
<?php if($this->countModules('user6')) { ?>
<div id="s5_user6_<?php echo $bottom4; ?>">
<jdoc:include type="modules" name="user6" style="rounded" />
</div>
<?php } ?>
</div>
<?php } ?>
<div style="clear:both;"></div>


</div>

<div id="s5_mainbottomback"></div>





<?php if($this->countModules('user7') || $this->countModules('user8') || $this->countModules('user9')) { ?>
<div id="s5_bottomtop">
<div id="s5_bottommiddle">
<div id="s5_bottomwrap">
<?php if($this->countModules('user7')) { ?>
<div id="s5_user7_<?php echo $row1; ?>"  style="position:relative">
<jdoc:include type="modules" name="user7" style="rounded" />
</div>
<?php } ?>
<?php if($this->countModules('user8')) { ?>
<div id="s5_user8_<?php echo $row1; ?>"  style="position:relative">
<jdoc:include type="modules" name="user8" style="rounded" />
</div>
<?php } ?>
<?php if($this->countModules('user9')) { ?>
<div id="s5_user9_<?php echo $row1; ?>"  style="position:relative">
<jdoc:include type="modules" name="user9" style="rounded" />
</div>
<?php } ?>
</div>
<div style="clear:both;"></div>
</div>
<div id="s5_bottombottom"></div>
</div>
<?php } ?>

<div id="s5_footer">
<div id="s5_footer_inner">
<?php if($this->countModules('bottom')) { ?>
<div id="s5_footleft">
<jdoc:include type="modules" name="bottom" style="rounded" />
</div>
<?php } ?>
<div id="s5_footright">
<?php include("templates/businesslook/footer.php"); ?>
</div>
</div>
</div>

</div>
</div>
</div>


<?php if($this->countModules('toolbar')) { ?>

<div onclick="shiftOpacity3('popup_div');shiftOpacity2('popup_outer')" id="popup_outer" style="display:none;background:#000000; opacity:.0; <?php if ($is_ie6 == "yes" || $is_ie7 == "yes" || $is_ie8 == "yes") { ?>filter: alpha(opacity=0); -moz-opacity: 0;<?php } ?> height: 0px; z-index:1;

<?php if ($is_ie6 == "yes") { ?>
position:absolute;
<?php } ?>

<?php if ($is_ie6 == "no") { ?>
position:fixed;
<?php } ?>
width: 100%; margin: 0px; padding: 0px; left: 0px; top:0px"></div>

<div id="popup_div" style="display:none;height:0px; top: 50%; opacity:.0; <?php if ($is_ie6 == "yes" || $is_ie7 == "yes" || $is_ie8 == "yes") { ?>filter: alpha(opacity=0); -moz-opacity: 0;<?php } ?>padding:30px;z-index:2; left: 50%; margin-left:-195px; margin-top:-195px;


<?php if ($is_ie6 == "yes" || $is_ie7 == "yes") { ?>
position:absolute;
<?php } ?>

<?php if ($is_ie6 == "no"  && $is_ie7 == "no") { ?>
position:fixed;
<?php } ?>
overflow: auto;"><div id="close_popup_div" onclick="shiftOpacity3('popup_div');shiftOpacity2('popup_outer')">Закрыть [X]</div><br/><jdoc:include type="modules" name="toolbar" style="xhtml" /> </div>
<?php } ?>

<?php if (($s5_clr_fix  == "enabled")) { ?>
<script type="text/javascript" src="templates/businesslook/js/s5_clr_fix.js"></script>
<?php } ?>

<script type="text/javascript">
if (window.addEventListener) {
window.addEventListener('load', hideLoading, false);
} else if (window.attachEvent) {
var r = window.attachEvent("onload", hideLoading);
} else {
hideLoading();
}
</script>

</body>
</html>
*

demilich

  • Новичок
  • 4
  • 0 / 0
  • Made in Hell
Re: Создаем индикатор загрузки сайта
« Ответ #33 : 08.07.2012, 14:48:23 »
Аффтар жжот! Но хотелось бы узнать, как заставить индикатор раскрываться на ВСЮ страницу (чтоб не было видно, что там, внизу)?
*

Equilibrium07

  • Захожу иногда
  • 205
  • 8 / 1
Re: Создаем индикатор загрузки сайта
« Ответ #34 : 05.12.2012, 15:17:46 »
чтож там за сайт такой? если ену индикатор загрузки нужен? он что весит 5гб?
*

Vanya0765

  • Новичок
  • 1
  • 0 / 0
Re: Создаем индикатор загрузки сайта
« Ответ #35 : 01.05.2017, 06:57:51 »
https://preloaders.net/ - Отличный индикатор загрузки, пользуюсь уже давно, все работает хорошо, претензий нет.  Всем советую!
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Частично слетел шаблон сайта

Автор artist

Ответов: 15
Просмотров: 9283
Последний ответ 18.09.2020, 17:02:14
от Kir
Значок (иконка, favicon) в названии сайта

Автор FxPunter

Ответов: 33
Просмотров: 165397
Последний ответ 04.04.2019, 22:04:51
от 4albon
Как реализована подобная шапка сайта?

Автор NAaTa

Ответов: 8
Просмотров: 10803
Последний ответ 02.08.2018, 12:29:03
от lexxbry
Отображение Вашего сайта в 19+ браузерах

Автор poizon

Ответов: 24
Просмотров: 29928
Последний ответ 18.02.2013, 18:55:24
от poizon
Дивы или таблицы с позиции SEO и скорости загрузки сайта ?

Автор Арчик

Ответов: 7
Просмотров: 6592
Последний ответ 14.08.2008, 20:58:38
от Арчик