Soy un nuevo usuario de Joomla, por lo que desconosco sus limitaciones. Resulta que encontre un template gratuito siteground-j15-82 el cual contaba con dos módulos en el header. Dichos módulos estaban indicados en el HTML del template de la siguiente manera:
Código PHP:
<div class="popular<?php if(!$this->countModules('user2') and JRequest::getCmd('layout') != 'form') : ?> only<?php endif; ?>">
<jdoc:include type="modules" style="rounded" name="user2" />
</div>
<div class="latest<?php if(!$this->countModules('user2') and JRequest::getCmd('layout') != 'form') : ?> only<?php endif; ?>">
<jdoc:include type="modules" style="rounded" name="user1" />
</div>
Código PHP:
<div class="popular<?php if(!$this->countModules('user1') and JRequest::getCmd('layout') != 'form') : ?> only<?php endif; ?>">
<div class="module">
<h3>EVENTOS</h3>
<ul class="mostread">
<?php
$ipeve = '******';
$usuarioeve = '******';
$passwordeve = '******';
$db_nameeve = '******';
$conneve = mysql_connect($ipeve,$usuarioeve,$passwordeve) or die();
mysql_select_db($db_nameeve,$conneve) or die();
$sqleve = "select * from eventos ORDER BY mes DESC, dia DESC LIMIT 0, 5";
$reseve = mysql_query($sqleve,$conneve) or die(mysql_error());
while($roweve = mysql_fetch_array($reseve)){
echo ' <li class=mostread>
<a href='.$roweve['link'].' target=blank class=mostread>
'.$roweve['nombre'].'</a>
</li>';
}
mysql_free_result($reseve);
mysql_close($conneve);
?></ul></div>
</div>
<div class="latest<?php if(!$this->countModules('user1') and JRequest::getCmd('layout') != 'form') : ?> only<?php endif; ?>">
<div class="module">
<h3>ÚLTIMOS POSTS</h3>
<ul class="mostread">
<?php
$ipposts = '******';
$usuarioposts = '******';
$passwordposts = '******';
$db_nameposts = '******';
$connposts = mysql_connect($ipposts,$usuarioposts,$passwordposts) or die();
mysql_select_db($db_nameposts,$connposts) or die();
$sqlposts = "SELECT * FROM phpbb_topics WHERE forum_id NOT IN (15, 16, 19) ORDER BY topic_last_post_time DESC LIMIT 0,5";
$resposts = mysql_query($sqlposts,$connposts) or die(mysql_error());
while($row = mysql_fetch_array($resposts)){
if (strlen($row['topic_title']) > 35) {
$row['topic_title'] = substr($row['topic_title'],0,35-3)."...";
}
echo '
<li class=mostread><A HREF="http://foro.auditiontown.net/viewtopic.php?f='.$row['forum_id'].'&t='.$row['topic_id'].'" target=_blank>'.$row['topic_title'].'</font></A></li>';
}
mysql_free_result($resposts);
mysql_close($connposts);
?></ul></div>
Warning: mysql_real_escape_string(): 23 is not a valid MySQL-Link resource in path/Joomla/libraries/joomla/database/database/mysql.php on line 193
Que vendria a ser esto:
Código HTML:
function getEscaped( $text, $extra = false ) { $result = mysql_real_escape_string( $text, $this->_resource ); if ($extra) { $result = addcslashes( $result, '%_' ); } return $result; }