Uutiset:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu
Advertisement:

I prefer to hard code Mods but...

Aloittaja gemigene, joulukuu 27, 2007, 11:26:08 IP

« edellinen - seuraava »

gemigene

After installing a few Mods using the installer, I added another which really fouled up my board because it replaced code modified by another Mod and I ended-up with a fatal error.

Being used to modding and hard coding the heck out of phpBB 2.0.22, I corrected the errors and removed the mod.

From now on, I want to do all my Modding by hand using the Package Parser but I noticed that the parser only recognizes 2 file types and will often give errors such as:

LainaaERROR: The package-info.xml file is invalid!

Debugging Information
Error message: String could not be parsed as XML
Source: /home/sleepy1/public_html/PackageParser/index.php:133
Errors encountered while parsing XML file:

Stack Trace:
#0 /home/sleepy1/public_html/PackageParser/index.php(133): SimpleXMLElement->__construct('')
#1 /home/sleepy1/public_html/PackageParser/index.php(94): parsePackageInfoXML('/home/sleepy1/p...', 'install', 'all')
#2 /home/sleepy1/public_html/PackageParser/index.php(757): parseArchive('/tmp/phpPrOCbJ', 'install', 'all')
#3 {main}

XML File:

or (often):

LainaaparseArchive(): No package-info.xml in this mod! Is it corrupted?

So, is there another easy way to read those XML files when the Parser fails?

Also, if a Mod's XML is corrupted or gives any kind of errors, can the Mod be trusted?

Thanks,
Gene
"Religion is metaphysical statism. I will be ruled by no man on earth, nor by any god in heaven"

vbgamer45

If there is an error with a mod that has invalid xml in the the mod files let us know.

Also contact Daniel15 since he created the package parser.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

karlbenson

Yeah what mod is it?

I know some mods which use the old-style .mod format won't work with the package parser.


gemigene

#3
OK, here's a recent one who gave me these errors using the Parser:
LainaaERROR: The package-info.xml file is invalid!

Debugging Information
Error message: String could not be parsed as XML
Source: /home/sleepy1/public_html/PackageParser/index.php:133
Errors encountered while parsing XML file:

Stack Trace:
#0 /home/sleepy1/public_html/PackageParser/index.php(133): SimpleXMLElement->__construct('')
#1 /home/sleepy1/public_html/PackageParser/index.php(94): parsePackageInfoXML('/home/sleepy1/p...', 'install', 'all')
#2 /home/sleepy1/public_html/PackageParser/index.php(757): parseArchive('/tmp/phpskx2Lx', 'install', 'all')
#3 {main}

The Mod is Admin Lock Thread

Before we go any further, I'd like to know how the package installer works as far as searching for code, let's assume that it searches for (from the MoveOldTopics Mod):

var rotSwap = false;
function swapRot()
{
rotSwap = !rotSwap;

document.getElementById("rotIcon").src = smf_images_url + (rotSwap ? "/collapse.gif" : "/expand.gif");
setInnerHTML(document.getElementById("rotText"), rotSwap ? "', $txt['maintain_old_choose'], '" : "', $txt['maintain_old_all'], '");
document.getElementById("rotPanel").style.display = (rotSwap ? "block" : "none");

for (var i = 0; i < document.forms.rotForm.length; i++)
{
if (document.forms.rotForm.elements[i].type.toLowerCase() == "checkbox" && document.forms.rotForm.elements[i].id != "delete_old_not_sticky")
document.forms.rotForm.elements[i].checked = !rotSwap;
}
}


Does the search algorithm look for every character in the code or only certain keywords?

And as far as the old .MOD files go, if they were the same as version 2 phpBB Mods, the code instructions are easy to apply (manually) and almost fool-roof.

According to what I read on the forum, seems that the installer (or the way Mods are packaged) can create a lot of chaos, "screwing-up" other installed Mods (I get a kick out of "tested on a fresh SMF installation", knowing darn well that quite a few people will add other mods).

One such Mod (TrimURL) fouled-up my board so bad that I ended up with a fatal error.

Please don't take this as criticism, I'm trying SMF along with MyBB to replace 3 phpBB 2.0.22 forums which I found easy to apply Mods (one of them has over 45 Mods and none are conflicting with each other thanks to concise manual instructions).

Also, wouldn't it be a good idea to clean-up the Mod database in order to eliminate the "archaic" files? Didn't most users upgrade to either 1.1.14 or 2.1 Beta?

Cheers,
Gene
"Religion is metaphysical statism. I will be ruled by no man on earth, nor by any god in heaven"

gemigene

Off-topic but I forgot to mention in my previous post that I also am very fond of UseBB for light forums, it may not have all the bells and whistles that the "big boys" have but is easy to setup, configure and have it up and running without any fuss. Also, the Mods are easy to apply... Great for small, quick and dirty community forums.

The developer is very forward thinking and now working on version 2:

UseBB 2.0 (PHP 5)

The goal of the UseBB 2 project is to replace the current old codebase with a new one written in object oriented PHP 5. It also includes a new development model, website and shift from CVS to Subversion. In short, 2.0 is the first big renovation of the UseBB project in over three years.

Development of the 2.0 codebase started in the summer of 2006 and restarted in September 2007 after analysis and planning changes. A few highlights include (this list is not definitive, changes may occur):

    * >95% object oriented PHP 5.2
    * PDO based database layer, with initial support for MySQL, possibly also SQLite
    * Template parser abstraction (PHP based templates by default)
    * Database powered session system, supporting IPv6
    * Flexible subforums instead of categories/forums
    * Cron (scheduling) system
    * Extended I18N possibilities: UTF-8, auto-detection, plural forms, RTL support
    * Plug-in/modules system
    * Threaded topics
    * etc.

Should be interesting...
Gene

"Religion is metaphysical statism. I will be ruled by no man on earth, nor by any god in heaven"

karlbenson

It appears that the Admin Lock thread mod won't go through the package parser as it is.
Although I extracted the files and put them in a zip, and it managed to go through the package parser.
Maybe accidentally there is some extra compression used on the package which is preventing it being extracted.

I've got over 100 mods installed on my forum.
Although some had to be manually installed due to conflicts.

Installing mods via package manager is the easiest among forum software I've tried.

It searches for an EXACT match to some code specifies, and then replaces it, puts it before or after. (remember in the .xml format, after means it places the new code before, and before means it places the new code after).

it is possible when creating the mod to have it ignore whitespace.
You can view the specification (if it doesnt give you a headache)
http://www.simplemachines.org/xml/modification

Basically the challenge is to find some unique code in that file to search for, but only enough that makes it unique, not a whole chunk.
In future it will be even easier as in SMF 2.0 it will try to install mods on ALL themes.

As for the mod center.
You can search by mods for certain versions.  But most mods for 1.1.1-1.1.3 will work for 1.1.4. (since they are bug-fix releases rather than updates).
Some other mods may work or not for 1.1.4.

I've never heard of UseBB.  Most of that is already part of 1.1.x series, if not it will be for 2.0.

SleePy

That error is usually generated when a mod is made like this:
LainaaMyFile.zip
--MyFolder
----package-info.xml
----install.xml

When it should be
LainaaMyFile.zip
--package-info.xml
--install.xml

The simple solution is to repack the mod the correct way by only putting the files in the zip instead of another folder.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

karlbenson

One tip.

read the comments about the mod. It will be invaluable to let you know

a) if the mod works without any issues
b) are there any updates/developments on the mod at work
c) general notes you may want to know

gemigene

Thanks for all the input.

I just installed Reg Bar Warning (a simple Mod) but the warning shield doesn't appear, I emptied the cache, re-uploaded the graphic but to no avail. I checked the support thread and I'm not the only one with this problem so I uninstalled it. I then hard coded it and ended-up with the same results.

The only mods I have are:
Email Flash
Add Domaintools to TrackIP
New Topic Button

Cheers,
Gene
"Religion is metaphysical statism. I will be ruled by no man on earth, nor by any god in heaven"

karlbenson


gemigene

#10
Lainaus käyttäjältä: karlbenson - joulukuu 28, 2007, 04:16:13 IP
Are you using the default theme?

Yes, the default theme with only a few small modifications in the CSS file (changed the hover color and increased the font size to 10px on the main menu and the forum width to a fixed value).

Gene
"Religion is metaphysical statism. I will be ruled by no man on earth, nor by any god in heaven"

Advertisement: