PDA

View Full Version : [HIS] Hack Installer System (Build 3)


Link14716
11-09-2004, 10:00 PM
I decided to release what I thought was a stable build 3 early. For those who actually used build 2 in their hacks (if there are any), delete the build 2 files and replace them with the build 3 files (except the example hack). Build 3 changes the way the HIS file are laid out, so hack_install.php was changed quite a bit. Seriously, upgrade. Your build 1/2 hack files will work with build 3.

Now that I've finished my public service announcement, I must not that a hack creator script, allowing for easy creation of the hack files, is not included in this release. I decided to release build 3 before the creator script is finalized. If you want to create hack files now, you'll have to first make a folder for your hack (replacing spaces with underscores), a folder inside for the build number (1 probably, but you can use another number). Then, move the example index.php over and edit it as necessary. Then, upload the folder and index.php to the hacks folder, select it, check "Generate Files" and continue. It will generate all the files needed except the query and modification files. For those, just follow the example file's syntax.

Now, onto the HIS!

The Hack Installer System (HIS) is an HTL-like hack. However, it suceeds in one major place the HTL failed: vBulletin.org compliance.

The HIS is a hacker tool - it does not need a seperate installation. It only needs one database table, which is created automatically the first time the script is ran. Thus, it can be distributed along with your hack as its installer as long as you follow the terms:

You may NOT modify hack_install.php or hack_install_bx.php (where x is the build number) and leave it named as such. If you modify hack_install_bx.php, rename your modified hack_install_bx.php to something entirely different (probably yourhack_install.php) first. ONLY THE OFFICIAL UNMODIFIED FILES MAY BE NAMED hack_install.php AND hack_install_bx.php. Even if you modify and rename, the original copyright text at the top must remain intact.

Eh, well, I think that is all the terms. Anyways, on to this "hack".

This is based off of the uCash & uShop installer, which was based off of the vBadvanced Homepage 1.01 installer by Tigga (Brian Gunter), used with permission.

Build 3 is attached, screens should be attached in this post and in the following post.

Link14716
11-10-2004, 01:06 AM
More screenshots. Looks like PNG images don't get thumbnails. That sucks, doesn't it?

Link14716
11-10-2004, 01:07 AM
The hack creator file will be released in the near future. This post is a placeholder for even more screenshots, considering I just went through 2 posts and now have room for 1 more screen.

pirrup
11-10-2004, 09:42 AM
any info on install?

Agent Jones
11-10-2004, 12:25 PM
Are there compatibility requirements? I mean, are all vBulletin.org hacks compatible to HIS? If not, is there any compatibility list?

Thanks.

Link14716
11-10-2004, 07:27 PM
Only hacks that have written files for the HIS will work. This is more of just an easy way to have an installer for a hack than an end user modification. Hacks that use the HIS should have the HIS files included and uploaded as if it were a normal installer.

pirrup
11-11-2004, 10:15 AM
doesn't work at all here

Zachery
11-11-2004, 11:53 AM
doesn't work at all here
What doesn't work? This is a developer tool, not a hack to be installed.

pirrup
11-11-2004, 12:14 PM
i had to adjust path's in the files , dunno why

Zachery
11-11-2004, 01:16 PM
i had to adjust path's in the files , dunno why
As i said this is a developer tool, are you developing any hacks?

trafix
01-09-2005, 12:04 PM
Which hacks currently use this installer?

Zachery
01-09-2005, 03:13 PM
Which hacks currently use this installer?
Most anything we release :)
uCash and Shop
The Shoutbox (original platform)
maybe somthing else of ours? O.o

cinq
01-10-2005, 12:52 AM
a hack creator script, allowing for easy creation of the hack files, is not included in this release.

Does that mean this build (3) is still not complete ?

edit: downloaded the zip package.
I don't know what to do next .... , no instructions or anything ? :(

Zachery
01-10-2005, 01:06 AM
Does that mean this build (3) is still not complete ?

edit: downloaded the zip package.
I don't know what to do next .... , no instructions or anything ? :(
He is still working on it, there is not automated process but the script itself works

If you need abit of help drop by irc.devcore.co.uk /#geekydesigns

trafix
01-10-2005, 01:22 AM
I think a readme/instruction file is needed .....

trafix
01-10-2005, 01:29 AM
Helpfull hint ...... download the shoutbox and use the files there as a guide

DrkFusion
01-10-2005, 02:29 AM
I was fooling around with this hack, and optimized it to my needs. I have saved much time in modifying clients bulletin boards. This hack was missing a couple of stuff, but I stuck it in. I will post back with some details that some may take advantage of to fully utilize the whole power of this hack.

Great job Link!

trafix
01-10-2005, 02:32 AM
:) ... keep me up to date drk

trafix
01-10-2005, 06:49 AM
i have errors
i have errors
i have errors
i have errors
i have errors
i have errors
i have errors

on trying to install the jukebox i get this with the settings

Parse error: parse error, unexpected T_STRING in /home/xxxxx/domains/xxxxxx.com/public_html/forums/install/hacks/Jukebox/1/settings.php on line 16

line 16 is

<label for=\"wys0\"><input type=\"radio\" name=\"setting[$settingid]\" id=\"vbjb0\" value=\"0\" tabindex=\"1\""

entire tag is

$setting['jb_audio_setting']['optioncode'] = ' <span class=\"smallfont\" style=\"white-space:nowrap\">
<label for=\"wys0\"><input type=\"radio\" name=\"setting[$settingid]\" id=\"vbjb0\" value=\"0\" tabindex=\"1\"" . iif($setting['value'] == 0, ' checked="checked"') . " /><b>None</b></label><br />
<label for=\"wys1\"><input type=\"radio\" name=\"setting[$settingid]\" id=\"vbjb1\" value=\"1\" tabindex=\"1\"" . iif($setting['value'] == 1, ' checked="checked"') . " /><b>Yes</b> - Most requested song</label><br />
<label for=\"wys2\"><input type=\"radio\" name=\"setting[$settingid]\" id=\"vbjb2\" value=\"2\" tabindex=\"1\"" . iif($setting['value'] == 2, ' checked="checked"') . " /><b>Yes</b> - Defult song below</label>
</span>
';


This builds multipule options for the defult song that is played when the page is first opened.

Marco van Herwaarden
01-12-2005, 09:08 AM
Looking into using HIS for a new hack i am writing, thx for making life a bit easier Link.

Running into 1 problem (well not really problem atm):
If there is a database error during install, the db_mysql.php can't include the './includes/functions_log_error.php' because current directory is different then expected. This will be more a nuisance during testing then when a hack is finished.

trafix
01-13-2005, 11:07 PM
OK ... bug report here!

when i auto generate phrase.php the HIS is NOT including email body phrases :(

I did the install for the members choice and it sends out an email to let the member know that he has been nominated and invites to add an acceptance speech ...

however these phrases are not captured by the his....i can only presume that its because the body phrase are broken into many lines .... i added the phrases manually into the hack phrase.php .... and they dont get installed by the his with the others :(

its not so bad for the members choice as there is only 2 email body phrases ... however the vb trader is different ... there are lots of them ;).

Suggestion....

The vb trader also has a substancial faq section that is added to the forum FAQ's ... is it possible to add another step to the installer/auto generator for FAQ information?

Zachery
01-13-2005, 11:53 PM
OK ... bug report here!

when i auto generate phrase.php the HIS is NOT including email body phrases :(

I did the install for the members choice and it sends out an email to let the member know that he has been nominated and invites to add an acceptance speech ...

however these phrases are not captured by the his....i can only presume that its because the body phrase are broken into many lines .... i added the phrases manually into the hack phrase.php .... and they dont get installed by the his with the others :(

its not so bad for the members choice as there is only 2 email body phrases ... however the vb trader is different ... there are lots of them ;).

Suggestion....

The vb trader also has a substancial faq section that is added to the forum FAQ's ... is it possible to add another step to the installer/auto generator for FAQ information?
FAQ entries are just phrases.

trafix
01-14-2005, 12:05 AM
FAQ entries are just phrases.
yes they are ... but the faq dbtable holds the info for this

Kagen
01-14-2005, 03:54 PM
this hack kinda sucks without a readme dont you think? i mean i want to devolop hacks also

Marco van Herwaarden
01-14-2005, 10:43 PM
Well you're free not to use it.

This is not something that will learn you how to write a hack. It only helps with providing an easy way for a developer to offer an installer for his hack.

So i don't see how a readme could make any differnce for you being able to write a hack or not?

coldpride
01-22-2005, 05:53 PM
I need the readme for this !

Marco van Herwaarden
01-22-2005, 10:03 PM
There is no readme, it is ment to be an aid to coders. A coder can quickly figure it out himself.

This is not a standalone tool for an end-user.

noppid
02-06-2005, 04:10 AM
Looking into using HIS for a new hack i am writing, thx for making life a bit easier Link.

Running into 1 problem (well not really problem atm):
If there is a database error during install, the db_mysql.php can't include the './includes/functions_log_error.php' because current directory is different then expected. This will be more a nuisance during testing then when a hack is finished.

That is not the problem I don't think. I get a similar error, but the problem is a query failing and then the template not found error is caused by vB trying to log it I think.

This query in creator..

// Grab all the phrases for the settinggroups, then unset the unneeded variable.
$teh_settinggroups2 = $DB_site->query("SELECT varname, text FROM ".TABLE_PREFIX."phrase WHERE varname IN ($sg_in) ORDER BY languageid DESC");


this is the error sent back.


Invalid SQL: SELECT varname, text FROM phrase WHERE varname IN () ORDER BY languageid DESC
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY languageid DESC' at line 1


$sg_in seems to be empty...

As best I could tell. I was gonna use it for vBGarage, but for the life of me can't gen the files.

If anyone has a heads up on this, please holler.

Thanks.

Zachery
02-06-2005, 12:25 PM
If you drop into #geekydesigns in devcore matt might be avaible to help

noppid
02-06-2005, 03:31 PM
If you drop into #geekydesigns in devcore matt might be avaible to help


I noticed that and will do. However when I posted it was about 7:00 AM Sunday in the UK. I figured I'd wait for a more active time to drop in. I don't need this fixed today. But it sure seems like something I'd like to implement.

Thanks a bunch for the reply.

sabret00the
02-13-2005, 02:55 PM
is there a FAQ laying around on how to use this at all?

Marco van Herwaarden
02-13-2005, 03:15 PM
is there a FAQ laying around on how to use this at all?
Try reading this thread.

sabret00the
02-13-2005, 05:14 PM
would i be right to assume that none of this stuff (regarding creating the hack is done dynamically, i have to manually code it into the example files)?

sabret00the
02-13-2005, 05:40 PM
seriously, no disrespect to anyone but is their anything THIS hack actually does? or is it just basically a tutorial for creating an installer?

sabret00the
02-14-2005, 12:45 PM
ok now i'm starting to get this thing after more confuz-zed-ness than you shake a stick at.

i must reitterate it should really come with a basic readme/faq. but thank you for your efforts.

i have run into a problem though
Warning: halt(./includes/functions_log_error.php): failed toopenstream: No such file or directoryinK:\Network\xampp\htdocs\forums\includes \db_mysql.php on line 389

Warning: halt(): Failed opening './includes/functions_log_error.php'forinclusion (include_path='.;K:\Network\xampp\php\pear\')inK:\ Network\xampp\htdocs\forums\includes\db_mysql.php on line 389



There seems to have been a slight problem with the EBS:L!VE Forums database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.
Database error in vBulletin 3.0.3:

Invalid SQL: SELECT varname, text FROM phrase WHERE varname IN () ORDER BY languageid DESC
mysql error: You have an error in your SQL syntax. Check the manualthatcorresponds to your MySQL server version for the right syntax tousenear ') ORDER BY languageid DESC' at line 1

mysql error number: 1064

Date: Monday 14th of February 2005 02:41:30 PM
Script: http://localhost/forums/install/hack_install.php
Referer: http://localhost/forums/install/hack_install.php
Username: sabret00the
IP Address: 127.0.0.1
ok it's not as simple as i thought it would be to fix it, the error is here
// Now grab all the phrases for the settings andunset the unneeded variable.
$teh_settings2 = $DB_site->query("SELECT varname,text FROM ".TABLE_PREFIX."phrase WHERE varname IN ($sg_in) ORDER BYlanguageid DESC");
unset($sg_in);
while ($the_settings2 =$DB_site->fetch_array($teh_settings2)) {
// Figure out what's what and putthem in the setting array.
$varname =str_replace("setting_", "", $the_settings2['varname']);
if (strpos($varname, "_desc")) {
$varname =str_replace("_desc", "", $varname);
$pt = "desc";
} else {
$varname =str_replace("_title", "", $varname);
$pt = "title";
}
$hack_settings[$varname][''.$pt.'phrase'] = str_replace("'", "\'",$the_settings2['text']);
// Now unset some crap.
unset($varname);
unset($pt);
}

the $sg_in doesn't seem to be set

noppid
02-14-2005, 01:13 PM
This is a good idea, but does have some issues that could be a problem. Not knowing 100% how things work, I can't call um bugs.

I attempted to use this with the creator and had no success. However I did learn enough to see how to do the create by hand. After getting that far I decided that the proceedures available to the users were not exactly the logic I would have liked. My experience with the shoutbox factored in as well.

Great idea, I hope that it gets turned into a full blown documented tool with some ideas from the community applied to how and what things are done.

Marco van Herwaarden
02-14-2005, 02:23 PM
Any SQL error that you run into, will give the above error, and has been reported before i think in this thread.

noppid
02-14-2005, 04:25 PM
Probably, because the same variable don't work in creator.php.

The MySql IN () is empty.

sabret00the
02-14-2005, 08:51 PM
Probably, because the same variable don't work in creator.php.

The MySql IN () is empty.
yup that's the same conclusion i came too, but i don't know why it's empty or how to fix it. :(

sabret00the
02-14-2005, 08:56 PM
Any SQL error that you run into, will give the above error, and has been reported before i think in this thread.
i know but it never got answered :(

Marco van Herwaarden
02-15-2005, 09:14 AM
i know but it never got answered :(
Try catching me on ICQ today, could be difficult because i seem to be stuck with RL work, and a non-responsive server (and a non-responsive Tech Suppurt :( ) for a server i administer.

Vizionz
02-16-2005, 04:11 PM
edits post wrong topic sorry

Marco van Herwaarden
02-16-2005, 05:09 PM
@link

On an upgrade "settinggroups" are never installed. Have a modified version now here, that i will include with one of my hacks. If you want i can send you, but i guess you will figure it out yourself in 10 seconds.

Pseudomizer
04-07-2005, 11:34 PM
ok now i'm starting to get this thing after more confuz-zed-ness than you shake a stick at.

i must reitterate it should really come with a basic readme/faq. but thank you for your efforts.

i have run into a problem though
Warning: halt(./includes/functions_log_error.php): failed toopenstream: No such file or directoryinK:\Network\xampp\htdocs\forums\includes \db_mysql.php on line 389

Warning: halt(): Failed opening './includes/functions_log_error.php'forinclusion (include_path='.;K:\Network\xampp\php\pear\')inK:\ Network\xampp\htdocs\forums\includes\db_mysql.php on line 389



There seems to have been a slight problem with the EBS:L!VE Forums database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.
Database error in vBulletin 3.0.3:

Invalid SQL: SELECT varname, text FROM phrase WHERE varname IN () ORDER BY languageid DESC
mysql error: You have an error in your SQL syntax. Check the manualthatcorresponds to your MySQL server version for the right syntax tousenear ') ORDER BY languageid DESC' at line 1

mysql error number: 1064

Date: Monday 14th of February 2005 02:41:30 PM
Script: http://localhost/forums/install/hack_install.php
Referer: http://localhost/forums/install/hack_install.php
Username: sabret00the
IP Address: 127.0.0.1
ok it's not as simple as i thought it would be to fix it, the error is here
// Now grab all the phrases for the settings andunset the unneeded variable.
$teh_settings2 = $DB_site->query("SELECT varname,text FROM ".TABLE_PREFIX."phrase WHERE varname IN ($sg_in) ORDER BYlanguageid DESC");
unset($sg_in);
while ($the_settings2 =$DB_site->fetch_array($teh_settings2)) {
// Figure out what's what and putthem in the setting array.
$varname =str_replace("setting_", "", $the_settings2['varname']);
if (strpos($varname, "_desc")) {
$varname =str_replace("_desc", "", $varname);
$pt = "desc";
} else {
$varname =str_replace("_title", "", $varname);
$pt = "title";
}
$hack_settings[$varname][''.$pt.'phrase'] = str_replace("'", "\'",$the_settings2['text']);
// Now unset some crap.
unset($varname);
unset($pt);
}

the $sg_in doesn't seem to be set

I have exactly the same problem and I there is zero documentation about this HIS system.

Cheers,

Pseudomizer

Marco van Herwaarden
04-08-2005, 06:11 AM
@Pseudomizer

One of the current problems with HIS (like mentioned before) is that it can't handle a SQL-error during install properly because of wrong directory.

The reason for the error is probably that you didn't quote and escaped all phrases in phrases.php correctly.

If you need help send me a PM and i will try to help you.

sabret00the
04-08-2005, 10:23 AM
I have exactly the same problem and I there is zero documentation about this HIS system.

Cheers,

Pseudomizer
the $sg_in variable is a bit of a problem but you can actually hardcode it and it should sort your problem :)

Marco van Herwaarden
04-08-2005, 10:45 AM
There is no 'problem' with a $sg_in variable.

sabret00the
04-08-2005, 10:57 AM
there most definately is, i've had a problem with it on every installer i've tried to make.

if it isn't that it appears not to be set, it's that it caches :(

Marco van Herwaarden
04-08-2005, 11:41 AM
The problem is that IF you are using settings.php, you MUST leave the definition of both the $setting and the $settinggroup array in that file. If you are not using either one of them, it still must be defined.

Easiest solution is to keep the following 2 lines in the top of the settings.php file if you use it:
$settinggroup = array();
$setting = array();

You can always leave those 2 lines in the top. No need to change the install program.

Pseudomizer
04-08-2005, 03:50 PM
If you need help send me a PM and i will try to help you.

Done. :nervous:

Cheers,

Pseudomizer

sabret00the
04-27-2005, 04:11 PM
getting this error trying to generate an installer
<?php

// Phrases

Warning: Invalid argument supplied for foreach() in \his_files\hack_creator_b2.php.bak on line 202

?>

// Generate phrases file.
if (isset($hack['phrase_like']) && ($_REQUEST['text'] != 1 || $_REQUEST['type'] == "phrases")) {
// Grab the phrases.
$teh_phrases = $DB_site->query("SELECT varname, text, phrasetypeid FROM ".TABLE_PREFIX."phrase WHERE (varname LIKE '$hack[phrase_like]') && phrasetypeid NOT IN (5000, 6000) ORDER BY languageid DESC");
while ($the_phrases = $DB_site->fetch_array($teh_phrases)) {
// Put the phrases in an array.
$hack_phrases[$the_phrases[varname]]['text'] = str_replace("'", "\'", $the_phrases['text']);
$hack_phrases[$the_phrases[varname]]['phrasetypeid'] = $the_phrases['phrasetypeid'];
}
// Start the phrases.php file.
if ($_REQUEST['text'] != 1) {
echo "phrases.php <a href=\"hack_install.php?$_SERVER[QUERY_STRING]&text=1&type=phrases\">(Save This File)</a><br /><div class=\"smallfont\" style=\"height:250px;width:100%;overflow:auto\"><pre>&lt;?php\n\n// Phrases\n";
} else {
echo "<?php\n\n// Phrases\n\n";
}
// Go through each phrase and spit it out. // #####################################
foreach ($hack_phrases as $varname => $phrase) { // ################## LINE 202
if ($_REQUEST['text'] != 1) { // #####################################
echo '$phrase['."'$varname'".'][\'text\'] = \''.htmlentities($phrase['text']).'\';'."\n";
echo '$phrase['."'$varname'".'][\'phrasetypeid\'] = '."'$phrase[phrasetypeid]';\n\n";
} else {
echo "\$phrase['$varname']['text'] = '$phrase[text]';\n";
echo "\$phrase['$varname']['phrasetypeid'] = '$phrase[phrasetypeid]';\n\n";
}
}
// End the file and continue, or...
// End output buffering and spit out the file.
if ($_REQUEST['text'] != 1) {
echo "\n?&gt;</pre></div><br /><br />";
} else {
echo "\n?>";
header ( "Content-type: text/php" );
header('Content-Disposition: attachment; filename="phrases.php"');
$omgzprint = ob_get_contents();
ob_end_clean();
print $omgzprint;
unset($omgzprint);
}
// Now unset some crap.
unset($teh_phrases);
unset($the_phrases);
unset($hack_phrases);
}
line 202 is marked on the right side of the code, help please :happysad:

Marco van Herwaarden
04-27-2005, 06:45 PM
In your hackfiles/..../1/index.php make sure you not commented out "$hack['phrase_like']".

If you don't have any phrases that match the pattern, you can get this error and just ignore.

Marco van Herwaarden
04-27-2005, 06:46 PM
On second thought, if you don't want to generate phrases, comment out the "$hack['phrase_like']".

sabret00the
04-27-2005, 07:15 PM
thanks marco, that cleared up the problem, was a problem to do with case sensitivity

one more problem though
<?php

// Settings

$settinggroup['threadbot']['phrase'] = 'threadBOT';
$settinggroup['threadbot']['displayorder'] = '6431';

$setting['threadbot_on']['titlephrase'] = '';
$setting['threadbot_on']['descphrase'] = '';
$setting['threadbot_on']['grouptitle'] = 'threadbot';
$setting['threadbot_on']['value'] = '1';
$setting['threadbot_on']['defaultvalue'] = 'yes';
$setting['threadbot_on']['optioncode'] = 'yesno';
$setting['threadbot_on']['displayorder'] = '10';

$setting['threadbot_username']['titlephrase'] = '';
$setting['threadbot_username']['descphrase'] = '';
$setting['threadbot_username']['grouptitle'] = 'threadbot';
$setting['threadbot_username']['value'] = 'jetzxia';
$setting['threadbot_username']['defaultvalue'] = '';
$setting['threadbot_username']['optioncode'] = '';
$setting['threadbot_username']['displayorder'] = '20';

$setting['threadbot_feeders']['titlephrase'] = '';
$setting['threadbot_feeders']['descphrase'] = '';
$setting['threadbot_feeders']['grouptitle'] = 'threadbot';
$setting['threadbot_feeders']['value'] = '18';
$setting['threadbot_feeders']['defaultvalue'] = '';
$setting['threadbot_feeders']['optioncode'] = '';
$setting['threadbot_feeders']['displayorder'] = '30';


?> all of the phrases/text for those settings appear to be missing?

Marco van Herwaarden
04-27-2005, 07:21 PM
Sorry never seen that happen.