Every page works but 1, undefined index - parse_url?

Joomla version 1.0 is end-of-life and are no longer supported. Please use Joomla 3.x instead.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
myk7
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Jan 03, 2008 2:48 am

Every page works but 1, undefined index - parse_url?

Post by myk7 » Fri Jun 20, 2008 8:28 pm

here is a site im working on - http://www.reosonoma.com

everything works great with the template, but when i click on VIEW ALL LISTINGS or view search results, i get a php error.

Notice: Undefined index: path on line 210

The code for that line in my php for the template is

function getLiveSiteURL() {
global $mosConfig_live_site;
$url = parse_url($mosConfig_live_site);
LINE 210 - $livesite = $url['scheme'].'://'.$_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT']==80?'':':').($url['path']?$url['path']:'');
return $livesite;

the parse link is -

$urls = parse_url($mmenu->link);
$querystring = $urls['query'];
$output = null;
parse_str ($querystring,$output);
$sectionid = 0;
if(isset($output['option']) && $output['option'] == 'com_content') {
if(isset($output['task']) && $output['task']=='blogsection'){
$sectionid = $output['id'];
}
else if(isset($output['task']) && $output['task']=='blogcategory'){
$catid = $output['id'];
$sectionid = $this->getSectionId($catid);
}
}

if($sectionid) {
if(!$sectionid) return '';
$query = "select params from #__modules where `module`='mod_janews'";
$database->setQuery($query);
$params = new mosParameters($database->loadResult());
$catids = $params->get('catid');
if ($catids) {
$catids = preg_split('/[\n,]|<br \/>/', $catids);
}else {
return '';
}
for ($i = 0; $i < count($catids); $i++) {
$temp = split(':',$catids[$i]);
if(isset($temp[0])) $catid = $temp[0];
if($catid==$sectionid) {
return isset($temp[1])? '-'.trim($temp[1]):'';
}
}
}
return '';
}
}
?>


joomlart template obviously... thanks!

User avatar
k4lch
Joomla! Hero
Joomla! Hero
Posts: 2796
Joined: Sat Dec 31, 2005 1:58 am
Contact:

Re: Every page works but 1, undefined index - parse_url?

Post by k4lch » Tue Jun 24, 2008 9:49 pm

just visited the site no errors whrn clicking the link looks good.
Loyd Headrick

ahldo
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Jul 27, 2009 4:25 pm

Re: Every page works but 1, undefined index - parse_url?

Post by ahldo » Mon Jul 27, 2009 4:37 pm

the Notice: Undefined index: path on line XXX message can be corrected by modifying the getLiveSiteURL() function:

you need to change

Code: Select all

$livesite = $url['scheme'].'://'.$_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT']==80?'':':').($url['path']?$url['path']:'');
to

Code: Select all

$livesite = $url['scheme'].'://'.$_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT']==80?'':':').(isset($url['path'])?$url['path']:'');
in the latest versions of php, the function parse_url() doesn't set the 'path' index in the array if it doesn't find one so you have to check it first.

SpiceVita
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Thu Oct 28, 2010 1:01 pm

Re: Every page works but 1, undefined index - parse_url?

Post by SpiceVita » Thu Oct 28, 2010 1:21 pm

Hello

I see that you still have a PHP error, not the one you said above but this one now:
Notice: Use of undefined constant action - assumed 'action' in /home/mstevens/public_html/r/include/class/template/core.inc.php on line 487
PM me if you want me to look at your source code.
Professional PHP/C++ Programmer: If you need help, PM me.
http://vitavee.com/forums/
http://www.euserreviews.com/


Locked

Return to “Installation - 1.0.x”