SQL error when changing template

Everything to do with Joomla! 1.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Locked
User avatar
psantamaria
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 208
Joined: Tue Aug 26, 2008 8:14 pm
Location: Brisbane, Australia
Contact:

SQL error when changing template

Post by psantamaria » Sat Nov 01, 2008 1:39 pm

Hi, I created my own template, but when I try to use it in my site I get an SQL error in the administration and the site view.

The error is a SQL connection error.

How can be related the template with SQL, what can I do?


The error is
Database Error: Unable to connect to the database:Could not connect to MySQL
Last edited by psantamaria on Wed Nov 05, 2008 1:25 pm, edited 1 time in total.

User avatar
psantamaria
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 208
Joined: Tue Aug 26, 2008 8:14 pm
Location: Brisbane, Australia
Contact:

Re: SQL error when changing template

Post by psantamaria » Sat Nov 01, 2008 1:45 pm

This is the index.php code of my template, maybe something is missing, please help.

Code: Select all

<?php defined('_JEXEC')or die('Restricted access');?>
<?php echo '<?xml version="1.0" encoding="UTF-8"?>';?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>">

<head>
<jdoc:include type="head" />
<link href="templates/<?php echo $this->template ?>/css/template_css.pack.css.php" rel="stylesheet" type="text/css" media="screen" />
<link href="templates/<?php echo $this->template ?>/css/handheld.pack.css.php" rel="stylesheet" type="text/css" media="handheld" />
<?php if($this->countModules('meta_data')){?>
	<jdoc:include type="modules" name="meta_data" style="none" />
<?php }?>
<script type="text/javascript" src="templates/<?php echo $this->template ?>/javascript/all.pack.js.php"></script>
</head>
<?php flush(); ?>
<body>
<?php if($this->countModules('left')){$contentwidth="400";}
elseif($this->countModules('right')){$contentwidth="647";}
else{$contentwidth="974";}
if($this->countModules('specials_left and specials_center and specials_right')==1){$specialstyle='class="content320"';$specialseparator='<div class="separator_7"></div>';}
elseif($this->countModules('specials_left and specials_center')==1 || $this->countModules('specials_center and specials_right')==1 || $this->countModules('specials_left and specials_right')==1){$specialstyle='class="content484"';$specialseparator='<div class="separator_6"></div>';}
else{$specialstyle='';}?>
<div id="wrap"><div id="wrapinside">
	<div class="vertical_separator"></div>
	<div id="very_top_line">
	  <div id="textsize">
		<div class="textoleft">Tama&ntilde;o texto</div>
		<div class="textcontrols" id="largertext">
		  <a href="index.php" title="<?php echo JText::_('Increase size');?>" onclick="changeFontSize(2);return false;">&nbsp;&nbsp;&nbsp;</a>
		</div>
		<div class="textcontrols" id="resettext">
		  <a href="index.php" title="<?php echo JText::_('Revert styles to default');?>" onclick="revertStyles();return false;">&nbsp;&nbsp;&nbsp;</a>
		</div>
		<div class="textcontrols" id="smallertext">
		  <a href="index.php" title="<?php echo JText::_('Decrease size');?>" onclick="changeFontSize(-2);return false;">&nbsp;&nbsp;&nbsp;</a>
		</div>
	  </div>
	  <jdoc:include type="modules" name="very_top_line" style="none" />
	</div>
  <?php if($this->countModules('top_publicity')){?>
	<div id="top_publicity">
	  <jdoc:include type="modules" name="top_publicity" style="none" />
	</div>
  <?php }?>

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

  <div id="lower_top_line">
	<?php if($this->countModules('lower_top_line')){?>
	  <jdoc:include type="modules" name="lower_top_line" style="none" />
	<?php }?>
	<!--Desde aca codigo incluido manualmente -->
	<div id="ja-day">
	  <?php setlocale(LC_ALL,'es_ES.UTF-8');setlocale(LC_TIME,'sp');$fechaamostrar=date('Y-m-d H:i');$fecha=strftime('%A, %d de %B de %Y',strtotime($fechaamostrar));
	  ?><div>Bucaramanga, Colombia - <?php echo ucfirst($fecha);?></div>
	</div>
	<!--Hasta aca codigo incluido manualmente -->
	
  </div>
	

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

  <?php if($this->countModules('specials_left or specials_center or specials_right')==1){?>
	<div id="specials">
	  <?php if($this->countModules('specials_left')){?>
	  	<div <?php echo $specialstyle; ?>>
		  <jdoc:include type="modules" name="specials_left" style="none" />
		</div>
	  <?php }if($this->countModules('specials_center')){?>
		<?php if($this->countModules('specials_left')){echo $specialseparator;}?>
		<div <?php echo $specialstyle;?>>
		  <jdoc:include type="modules" name="specials_center" style="none" />
		</div>
	  <?php }if($this->countModules('specials_right')){?>
		<?php echo $specialseparator;?>
		<div <?php echo $specialstyle;?>>
		  <jdoc:include type="modules" name="specials_right" style="none" />
		</div>
	  <?php }?>
	</div>
	<div class="vertical_separator"></div>
  <?php }?>

  <div id="main_content<?php echo $contentwidth;?>">
	<jdoc:include type="modules" name="middlebefore" />
	<jdoc:include type="component" />
	<jdoc:include type="modules" name="middle" style="xhtml" />
  </div>

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

  <?php if($this->countModules('right') || $this->countModules('user6') || $this->countModules('rightbottom')){?>
  <div class="separator_7"></div>
  <div id="right" class="content320">
	<?php if($this->countModules('right')){?>
	  <jdoc:include type="modules" name="right" style="xhtml"/>
	<?php }?>
	<div id="ja-morecol" class="clearfix">
	  <?php if ($this->countModules('user6')) : ?>
	  <script type="text/javascript" src="templates/<?php echo $this->template ?>/javascript/mootabs1.2.pack.js.php"></script>
	  <script type="text/javascript">
		window.addEvent('load', initmootabs);
		function initmootabs() {
		  myTabs1 = new jamootabs('ja-tabs', {
		  <?php echo $ja_mootabs_options; ?>
	  }); }
	  </script>
	  <div id="ja-tabswrap">
		<div id="ja-tabs" class="clearfix">
		  <div class="ja-tab-panels">
			<jdoc:include type="modules" name="user6" style="xhtml" />
		  </div>
		</div>
	  </div>
	<?php endif; ?>
	</div>
	<?php if($this->countModules('rightbottom')){?>
	  <jdoc:include type="modules" name="rightbottom" style="xhtml"/>
	<?php }?>  
  </div>
  <?php }?>

  <div class="vertical_separator"></div>
  <?php if($this->countModules('down_content_left or down_content_right')==1){?>
    <div id="down_content">
	<?php if($this->countModules('down_content_left and down_content_right')==1){?>
	  <div class="content484">
	    <jdoc:include type="modules" name="down_content_left" style="xhtml" />
	  </div>
	  <div class="separator_6"></div>
	  <div class="content484">
	    <jdoc:include type="modules" name="down_content_right" style="xhtml" />
	  </div>
	<?php }elseif($this->countModules('down_content_left')){?>
	  <jdoc:include type="modules" name="down_content_left" style="xhtml" />
    <?php }else{?>
	  <jdoc:include type="modules" name="down_content_right" style="xhtml" />
    <?php }?>
	</div>
  <?php }?>

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

  <div id="footer" >
    <div class="inside">
	  <jdoc:include type="modules" name="footer" style="none"/>
	</div>
  </div>

</div></div>
</body>
</html>


Locked

Return to “Templates for Joomla! 1.5”