To preempt this being marked as a duplicate question, please understand that I have zero experience with PHP coding/syntax and I am struggling to apply a general answer to my specific problem. I think I've figured out where the problem is coming from, but I'm not even 100% about that, so I am seeking the assistance of someone who can help guide me through figuring this out for certain.
We are installing a dice rolling mod to a Simple Machines forum. The first install went smoothly, no problems. We wanted to change some of the mod's formatting, so we uninstalled it, changed the files, and reinstalled it. After reinstallation, posting new topics or make replies resulted in a . When we disabled the mod, we could reply and post new topics as usual.
After some hunting, we found this in our error log;
http://irate-pirate.org/forums/index.php?action=admin;area=packages;get;sa=browse;server=1;relative=posting
8: Undefined offset: 1
File: /home4/iratepir/public_html/forums/Sources/Subs-Package.php
Line: 1503
We found the Subs-Package.php file, and here is the surrounding code:
1501 // Build an array of parts.
1502 $versions[$id] = array(
1503 'major' => (int) $parts[1],
1504 'minor' => !empty($parts[2]) ? (int) $parts[2] : 0,
1505 'patch' => !empty($parts[3]) ? (int) $parts[3] : 0,
1506 'type' => empty($parts[4]) ? 'stable' : $parts[4],
1507 'type_major' => !empty($parts[6]) ? (int) $parts[5] : 0,
1508 'type_minor' => !empty($parts[6]) ? (int) $parts[6] : 0,
1509 'dev' => !empty($parts[7]),
1510 );
1511 }
So, after looking at this post, I think(???) need to add:
//isset()
$value = isset($array['my_index']) ? $array['my_index'] : '';
//array_key_exists()
$value = array_key_exists('my_index', $array) ? $array['my_index'] : '';
to the code I've found in the Subs-Package.php file. I'm guessing that I add this before the line the error was found in.
I'm also guessing some of these variables need to be changed to match the parts from our code, but I don't know which variables.
Any help would be absolutely fantastic, and I hope I've given enough information!