News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Error log full of errors regarding modified BoardIndex.template.php

Started by Yogal, April 10, 2008, 04:23:44 PM

Previous topic - Next topic

Yogal

Hello,

First of all i want to say that i didn't know where to post this message as this error is connected with coding, mods and dilber theme. If its placed wrong, please move it to a proper category.

I have a strage issue with a dilber MC theme.
I recently looked at my SMF Error Log and saw lots of similar errors regarding BoardIndex.template.php file.

There are two errors occuring all the time:
(Plik = File, Linia = Line)
1)
2: Invalid argument supplied for foreach()
Plik: /forum2/Themes/dilbermc/BoardIndex.template.php (main sub template - eval?)
Linia: 511

2)
8: Undefined index: mcl_group
Plik: /forum2/Themes/dilbermc/BoardIndex.template.php (main sub template - eval?)
Linia: 511

So it's all about one line:
foreach($context['mcl_group'] AS $key => $dummy)

I DID a modification to this file - I've installed:  nneonneo's AJAX ShoutBox 1.13(LINK TO THIS MOD) and made it appear on the dilber theme by inserting this  (starting at line 23 in my file):

// YSHOUT HERE
global $boardurl;
echo '
<script src="',$boardurl,'/yshout/js/prototype.js" type="text/javascript"></script>
<script src="',$boardurl,'/yshout/js/moo.ajax.js" type="text/javascript"></script>
<script src="',$boardurl,'/yshout/js/behaviour.js" type="text/javascript"></script>
<script src="',$boardurl,'/yshout/js/domFunction.js" type="text/javascript"></script>
<script type="text/javascript">

var myfunc = new domFunction(function()
{
loadChat();
}, { "yshout":"id"});
var board_url = "'; $boardurlparsed = parse_url($boardurl); echo (isset($boardurlparsed['path'])?$boardurlparsed['path']:""), '";

</script>
<script src="',$boardurl,'/yshout/js/yshout.js?Mar072008" type="text/javascript"></script>
<script type="text/javascript">var shoutFile = "home.txt";</script>
<style type="text/css">
#yshout {
font-size: 10px;
}
#yshout p {
margin: 0 0 0; /* Top Bottom Linespacing */
}
.shout-invalid {
background: #FFFDD1;
}
#yshout fieldset {
border: none;
}
#yshout em {
font-style: normal;
}
#yshout p {
line-height: 1;
margin-top: 0;
}
#yshout {
overflow: hidden;
}
#yshout .shout-timestamp {
font-weight: normal;
color: #000;
}
#yshout .adminlink {
font-size: 6pt;
color: #141414;
}
#forum-name, #shout-text, #shout-button {
font-size: 9px;
margin: 0;
padding: 0;
}
#yshout #forum-name {
color: #666666;
width: 70px;
margin-right: 5px;
}
#yshout #shout-text {
color: #000000;
width: 310px;
margin-right: 5px;
}
#yshout #shout-button {
width: 55px;
}
</style>';
// YSHOUT END


and this at the end:

echo '
<br /><b>Shout Box</b><br /><br />
<div id="yshout">',$txt['yshout_loading'],'<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></div>';


The shoutbox as well as forum itself are working good.
I wonder if its the problem of code i inserted or the file. Would be nice if anyone could help me get rid of this error.

I've attached the file.

My forum version  is SMF 1.1.4
Installed Mods:
1.     Custom Profile Field Mod      3.17      
2.    MCLegendII    1.1    (Not installed - just uploaded)
3.    Colorized Membergroups    1.0    
4.    nneonneo's AJAX ShoutBox    1.13

EDIT:
1)
Some info about the error - I'ts showing up everytime user watches the forum index (2 errors for 1 user each time he visits index) so its making enormous ammount of errors in error log (had 27 pages of just these errors in about 1 day @ 31 users).

2)
When I change (in my profile) the forum theme to default one Im no longer causing the issiue - its only connected with dilber theme and the file I modified.

I hope its just a lame mistake i made changing the file and it will be easy to fix.

Regards,
Yogal

metallica48423

They seem to be related to the membergroup color legend (MCLegendII), as per "8: Undefined index: mcl_group"

Are you sure this template wasn't manually altered for the mod, then when it was uninstalled it still had the code residue?
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Yogal

Thanks for answer.
I tought mcl_group is a core feature of this theme (silly me xD). Now it will be easier to solve it.

I've installed MCLegend II mod but it had trouble modifying the dilber theme (though it's supported). AFAIR I left it not-installed because i had no idea how to fix it (on my local vps it worked all right). I think it might have left some code in the Board.Index file even after failing to install.

I think i can just download this theme again, overwrite the Board.index.php file (inserting JUST the code needed to run Shoutbox) and it will be all right.

I will let You know if this will solve the problem.

EDIT:
It worked! As I said, used fresh BoardIndex.template file with just the code needed for shoutbox - no mcl_group word and no errors whatsoever!
As we say in Poland - Devil lodges in details :)

Thank you for help :)

Advertisement: