News:

Wondering if this will always be free?  See why free is better.

Main Menu

8: Undefined index: childLevel

Started by keithdixon, December 21, 2008, 06:45:09 AM

Previous topic - Next topic

keithdixon

i am getting the error "8: Undefined index: childLevel" many times on my forum www. theautopartsshop.net/smf [nofollow]
The forum was a clean install ver:1.1.7
with no mods
error states /home/www/theautopartsshop.net/smf/Sources/Load.php
601

any ideas?

JimM

#1
Please copy lines 567-607 of your Load.php file here, placing it inside the code tags.


ETA:  Changed my line number after looking at a unmodified Load.php. 
Jim "JimM" Moore
Former Support Specialist

Bulakbol

In line 571 of Load.php, make sure that there's "b.childLevel," in it. It should look like this.
Quotemem.realName" . (!empty($topic) ? ", b.ID_BOARD" : '') . ", b.childLevel,
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

keithdixon

Lines 567 to 607 of load.php


$request = db_query("
SELECT
c.ID_CAT, b.name AS bname, b.description, b.numTopics, b.memberGroups,
b.ID_PARENT, c.name AS cname, IFNULL(mem.ID_MEMBER, 0) AS ID_MODERATOR,
b.boardOrder, b.countPosts, b.memberGroups, b.ID_THEME, b.override_theme, b.sort_order, b.sort_method,
b.ID_THEME, b.override_theme, b.permission_mode, b.countPosts
FROM ({$db_prefix}boards AS b" . (!empty($topic) ? ", {$db_prefix}topics AS t" : '') . ")
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
LEFT JOIN {$db_prefix}moderators AS mods ON (mods.ID_BOARD = " . (empty($topic) ? $board : 't.ID_BOARD') . ")
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = mods.ID_MEMBER)
WHERE b.ID_BOARD = " . (empty($topic) ? $board : "t.ID_BOARD
AND t.ID_TOPIC = $topic"), __FILE__, __LINE__);
// If there aren't any, skip.
if (mysql_num_rows($request) > 0)
{
$row = mysql_fetch_assoc($request);

// Set the current board.
if (!empty($row['ID_BOARD']))
$board = $row['ID_BOARD'];

// Basic operating information. (globals... :/)
$board_info = array(
'id' => $board,
'moderators' => array(),
'cat' => array(
'id' => $row['ID_CAT'],
'name' => $row['cname']
),
'name' => $row['bname'],
'description' => $row['description'],
'num_topics' => $row['numTopics'],
'parent_boards' => getBoardParents($row['ID_PARENT']),
'parent' => $row['ID_PARENT'],
'child_level' => $row['childLevel'],
'theme' => $row['ID_THEME'],
'override_theme' => !empty($row['override_theme']),
'use_local_permissions' => !empty($modSettings['permission_enable_by_board']) && $row['permission_mode'] == 1,
'permission_mode' => empty($modSettings['permission_enable_by_board']) ? (empty($row['permission_mode']) ? 'normal' : ($row['permission_mode'] == 2 ? 'no_polls' : ($row['permission_mode'] == 3 ? 'reply_only' : 'read_only'))) : 'normal',
'posts_count' => empty($row['countPosts']),
);

keithdixon

The below is not in my load.php

i searched for "mem.realName" . (!empty" which returned with 0 within the document

rgs

keith dixon

Quote from: Bulakbol on December 21, 2008, 09:05:53 PM
In line 571 of Load.php, make sure that there's "b.childLevel," in it. It should look like this.
Quotemem.realName" . (!empty($topic) ? ", b.ID [nofollow]_BOARD" : '') . ", b.childLevel,

JimM

Something evidently got scrambled in that file when you installed.  Replace lines 571 and 572 with the following:


            mem.realName" . (!empty($topic) ? ", b.ID_BOARD" : '') . ", b.childLevel,
            b.ID_THEME, b.override_theme, b.permission_mode, b.countPosts


Let us know if this takes care if the problem.
Jim "JimM" Moore
Former Support Specialist

keithdixon

#6
i inserted the code and still get the error logs below on the site:-

I have copied the code (Before the change, 571 & 572 are identified with **** are you sure this is where to change the code?
I have very limited programming ability but it seems a very strange place to me

$request = db_query("
SELECT
c.ID_CAT, b.name AS bname, b.description, b.numTopics, b.memberGroups,
b.ID_PARENT, c.name AS cname, IFNULL(mem.ID_MEMBER, 0) AS ID_MODERATOR,
****b.boardOrder, b.countPosts, b.memberGroups, b.ID_THEME, b.override_theme, b.sort_order, b.sort_method,
****b.ID_THEME, b.override_theme, b.permission_mode, b.countPosts
FROM ({$db_prefix}boards AS b" . (!empty($topic) ? ", {$db_prefix}topics AS t" : '') . ")
LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
LEFT JOIN {$db_prefix}moderators AS mods ON (mods.ID_BOARD = " . (empty($topic) ? $board : 't.ID_BOARD') . ")
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = mods.ID_MEMBER)
WHERE b.ID_BOARD = " . (empty($topic) ? $board : "t.ID_BOARD
AND t.ID_TOPIC = $topic"), __FILE__, __LINE__);

  admin   Today at 10:35:42 AM 
81.157.63.19     d7440b0a29f52888c3eeea62f61a7546 
http://theautopartsshop.net/smf/index.php?topic=8.0 [nofollow] 
8: Undefined index: sort_order
/home/www/theautopartsshop.net/smf/Sources/Load.php
610

   admin   Today at 10:35:42 AM 
81.157.63.19     d7440b0a29f52888c3eeea62f61a7546 
http://theautopartsshop.net/smf/index.php?topic=8.0 [nofollow] 
8: Undefined index: sort_method
/home/www/theautopartsshop.net/smf/Sources/Load.php
609


Kermit

If you have no mods installed on your site,just renew your Load.php
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

tatore

Quote from: Duncan85 on December 23, 2008, 06:30:00 AM
If you have no mods installed on your site,just renew your Load.php
That's my thought too.
Checked through Load.php either fresh (see attached file) or with mods, and the query is still the same:
$request = db_query("
            SELECT
                c.ID_CAT, b.name AS bname, b.description, b.numTopics, b.memberGroups,
                b.ID_PARENT, c.name AS cname, IFNULL(mem.ID_MEMBER, 0) AS ID_MODERATOR,
                mem.realName" . (!empty($topic) ? ", b.ID_BOARD" : '') . ", b.childLevel,
                b.ID_THEME, b.override_theme, b.permission_mode, b.countPosts
            FROM ({$db_prefix}boards AS b" . (!empty($topic) ? ", {$db_prefix}topics AS t" : '') . ")
                LEFT JOIN {$db_prefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
                LEFT JOIN {$db_prefix}moderators AS mods ON (mods.ID_BOARD = " . (empty($topic) ? $board : 't.ID_BOARD') . ")
                LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = mods.ID_MEMBER)
            WHERE b.ID_BOARD = " . (empty($topic) ? $board : "t.ID_BOARD
                AND t.ID_TOPIC = $topic"), __FILE__, __LINE__);


Attached, a fresh copy of Load.php.
*Salvo*




Quote from: RumbaarI wont jump to conclusion, but you might be hacked?

keithdixon

fixed,

well that was easy, it must have been a corupt load.php

thanks for the assistance

tatore

Great news  ;)
Please, just mark as solved the topic, when you have a chance
*Salvo*




Quote from: RumbaarI wont jump to conclusion, but you might be hacked?

Advertisement: