The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Aug 07, 2012 5:08 am 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Wed Jul 08, 2009 12:40 pm
Posts: 248
I had installed a site on server,but when i run the site, its showing blank page, but its backend is working fine.

when i got to template manager, i am getting the following error

JFolder::folder: Path is not a folder
Warning: Invalid argument supplied for foreach() in /home/u362737786/public_html/administrator/components/com_templates/helpers/template.php on line 62

Here is the code written at template.php

Quote:
<?php
/**
* @version $Id: template.php 10381 2008-06-01 03:35:53Z pasamio $
* @package Joomla
* @subpackage Templates
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant to the
* GNU General Public License, and as distributed it includes or is derivative
* of works licensed under the GNU General Public License or other free or open
* source software licenses. See COPYRIGHT.php for copyright notices and
* details.
*/

// no direct access
defined('_JEXEC') or die('Restricted access');

/**
* @package Joomla
* @subpackage Templates
*/
class TemplatesHelper
{
function isTemplateDefault($template, $clientId)
{
$db =& JFactory::getDBO();

// Get the current default template
$query = ' SELECT template '
.' FROM #__templates_menu '
.' WHERE client_id = ' . (int) $clientId
.' AND menuid = 0 ';
$db->setQuery($query);
$defaultemplate = $db->loadResult();

return $defaultemplate == $template ? 1 : 0;
}

function isTemplateAssigned($template)
{
$db =& JFactory::getDBO();

// check if template is assigned
$query = 'SELECT COUNT(*)' .
' FROM #__templates_menu' .
' WHERE client_id = 0' .
' AND template = '.$db->Quote($template) .
' AND menuid <> 0';
$db->setQuery($query);
return $db->loadResult() ? 1 : 0;
}

function parseXMLTemplateFiles($templateBaseDir)
{
// Read the template folder to find templates
jimport('joomla.filesystem.folder');
$templateDirs = JFolder::folders($templateBaseDir);

$rows = array();

// Check that the directory contains an xml file
foreach ($templateDirs as $templateDir)
{
if(!$data = TemplatesHelper::parseXMLTemplateFile($templateBaseDir, $templateDir)){
continue;
} else {
$rows[] = $data;
}
}

return $rows;
}

function parseXMLTemplateFile($templateBaseDir, $templateDir)
{
// Check of the xml file exists
if(!is_file($templateBaseDir.DS.$templateDir.DS.'templateDetails.xml')) {
return false;
}

$xml = JApplicationHelper::parseXMLInstallFile($templateBaseDir.DS.$templateDir.DS.'templateDetails.xml');

if ($xml['type'] != 'template') {
return false;
}

$data = new StdClass();
$data->directory = $templateDir;

foreach($xml as $key => $value) {
$data->$key = $value;
}

$data->checked_out = 0;
$data->mosname = JString::strtolower(str_replace(' ', '_', $data->name));

return $data;
}

function createMenuList($template)
{
$db =& JFactory::getDBO();

// get selected pages for $menulist
$query = 'SELECT menuid AS value' .
' FROM #__templates_menu' .
' WHERE client_id = 0' .
' AND template = '.$db->Quote($template);
$db->setQuery($query);
$lookup = $db->loadObjectList();
if (empty( $lookup )) {
$lookup = array( JHTML::_('select.option', '-1' ) );
}

// build the html select list
$options = JHTML::_('menu.linkoptions');
$result = JHTML::_('select.genericlist', $options, 'selections[]', 'class="inputbox" size="15" multiple="multiple"', 'value', 'text', $lookup, 'selections' );
return $result;
}
}


Top
 Profile  
 
PostPosted: Tue Aug 07, 2012 11:51 am 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Wed Jul 08, 2009 12:40 pm
Posts: 248
Resolved, the problem is with folder name, it should be start with small t (template) not (Template)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 



Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group