PDA

View Full Version : How to port a hack


Coldhands
10-10-2006, 06:30 PM
Forgive me if I was not able to find some sort of sticky thread somewhere that already covers this, but I didn't find any via search.

I would devote my time to port some of the good dead hacks that are out there, but I'm not really sure where to start. Is there a list of syntax changes between versions somewhere? That could be helpful.

What are the steps that one would take to port a hack?

I wanted to port the hack Forced Ignore Hack (https://vborg.vbsupport.ru/showthread.php?t=109543) from 3.5 --> 3.6. It doesn't seem like it should be all that hard since it's just add a

Single Line Text Box
Field Required: No
Field Editable by User: No
Private Field: No
Field searchable on Members List: No
Show on Member List: No
Page that displays this option: Edit Profile

and then you add a plugin attached to global_start:

if ($vbulletin->userinfo['fieldX'])
{
if ($vbulletin->options['globalignore'])
{
$vbulletin->options['globalignore'] = $vbulletin->options['globalignore'] . " " . $vbulletin->userinfo['fieldX'];
}
else
{
$vbulletin->options['globalignore'] = $vbulletin->userinfo['fieldX'];
}
}

$vbulletin->options['globalignore'] and $vbulletin->userinfo['fieldX'] seem to be the only things where syntax could change for the whole hack, so what seems to be the problem with vB 3.6 and this hack being vB 3.5? Seems to be to simple to have a version issue, but it does.

If anyone could point me in the right direction on how to port a hack, I'd gladly port a handful of hacks that aren't available for 3.6, but for now, they remain old, dead and out of date.

amykhar
10-11-2006, 02:53 PM
The first thing you need to do, unless you are just porting a mod for your own use, is to get permission from the original author to port the mod.

Coldhands
11-02-2006, 03:03 PM
I realize this. I wouldn't post it if someone was all huffy about it, but I would like to use a few of them for my own use. As far as the "How To", what are the steps that one would take to port a hack? Is there any documentation on vB.org? If so, where is it?

amykhar
11-02-2006, 03:53 PM
There's no documentation that I know of. The general method is to try to install the old version. Note places that the code has changed or doesn't work and adjust accordingly. Most 3.5 mods work for 3.6 and don't need any porting per-say

Coldhands
11-02-2006, 04:12 PM
That's what I figured :(

Is it usually syntax changes that cause a problem? Has "globalignore" changed syntax, or the way it is used? That seems to be the only thing that could cause the problem, since this little script is so simple.