Back to vBulletin 3 Articles

vB Hacking Article v1.5
by Oblivion Knight 08 Sep 2004

Here's something that I wrote when EvB was around, but Kura has since closed it so I thought I'd post it here.. Feel free to leave any suggestions or feedback.

------------------------------------------------------

vB Hacking Article v1.5
By: Oblivion Knight

Article History
v1.5 - FTP AUTO mode hint added, program suggestions for Mac users added (thanks to Jolten), query suggestions updated (thanks to Revan), Notepad "goto line" hint added (thanks to rake).
v1.4 - Contributed to vB.org, vB.nl and Synergy, general updates.
v1.3 - Full Path section added.
v1.2 - FTP section added.
v1.1 - Changes made to recommended programs, and removed Wordpad font hint.
v1.0 - Initial document contributed to EvB.


BEFORE HACKING ANY FILES OR RUNNING ANY DATABASE QUERIES, YOU ARE ADVISED TO MAKE BACKUPS OF BOTH THE FILES YOU ARE EDITING AND THE DATABASE YOU ARE RUNNING QUERIES ON. THIS GIVES YOU SOMETHING TO FALL BACK ON IF THINGS GO WRONG AND THE PROBLEM CAN'T BE FIXED!

What program should I use to download/upload my files?

Well since you've already uploaded vBulletin, you should already have a fairly good idea of what to use. However, if someone uploaded them for you and you're wanting to learn then here we are, a section just for you.!

You'll need an FTP Browser. Many internet browsers can browse FTP sites fine, but lack features such as ASCII mode and CHmod. There are many FTP Browsers out there, and which you use depends on which you feel the most comfortable with. Everyone has their own preferences..

Here's a list of FTP Browsers you may want to try..
WS_FTP, LeechFTP, SmartFTP, CuteFTP, FTP Voyager, FlashFXP

Where can I download these FTP Browsers from?
WS_FTP: http://www.ipswitch.com/Products/WS_FTP/
LeechFTP: http://stud.fh-heilbronn.de/~jdebis/leechftp/
SmartFTP: https://www.smartftp.com/
CuteFTP: http://www.cuteftp.com/cuteftp/
FTP Voyager: http://www.ftpvoyager.com/
FlashFXP: http://www.flashfxp.com/

But... I'm a Mac user!
If you're a Mac user, MacOS 10 can directly connect to a server via FTP. However if you want to use an application, try Transmit from http://www.panic.com/transmit/ or Fetch from http://www.fetch.net/.

How do I CHmod a file?
This depends on which FTP Browser you use. For the majority, all you need to do is right click a file on your host and click Properties or Change File Attributes. Usually there are either 3 numbers there which you can edit, or there are several checkboxes (User, Group and World), or both. This is what we call CHmod or the file's permissions.

With vBulletin, rarely are you asked to change the file's permissions, but sometimes you are required to change the permissions of a directory you have just created. For example with the Arcade hack, you are asked to create a directory called 'games' which must be CHmodded to 755.

How do I switch between ASCII and Binary mode?
Again, this depends on which FTP Browser you use. Key words to look out for on the toolbars for this would be 'A-1 Mode' and 'Transfer Mode'. If you have problems finding this, ask at the support forums of your chosen FTP Browser, or asking at a vBulletin community might be helpful (as long as you're polite!). It is worth noting that the vast majority of FTP Browsers also come with an 'AUTO mode', which saves a lot of time.

AUTO mode?
AUTO mode automatically checks whether or not to upload files in ASCII or Binary mode by checking an internal list. If you use AUTO mode, please make sure to check the list of extensions that will be uploaded in ASCII mode, and make sure that the .php and .php3 extensions are listed.

What program should I use to edit my files?

The most common question asked where vB hacking is concerned is; "What program should I use to edit my files?" The answer is, there is no definitive program to use.. Some work better much better than others however.

Recommended:
Notepad, Developers Pad, EditPlus, UltraEdit

Not Recommended:
Microsoft Word, Wordpad, Macromedia Dreamweaver

Notepad will get you by just fine, but the major features it lacks (syntax highlighting, line numbers and customizable keyboard shortcuts) can be found in the other recommended programs; Developers Pad, EditPlus and UltraEdit. However, not many people know that with Notepad you CAN go straight to a line number of your file by pressing 'Ctrl+G', and entering the line number that you want to go to.

Where can I get these recommended programs from?
Developers Pad: http://www.developerspad.com/devpad/
EditPlus: http://www.editplus.com/
UltraEdit: http://www.ultraedit.com/

But... I'm a Mac user!
If you're a Mac user, it is advised that you DON'T use the Macintosh TextEdit application. Instead, try BBEdit from http://www.barebones.com/.

When I'm asked to enter the "Full Path" to my forums, how do I find this?

Occasionally, you'll come accross a hack that requires you to enter the full path to your forums directory. As it should clearly state, you do NOT enter the URL. The full path can be found by accessing your PHP info, and is listed under 'DOCUMENT_ROOT' of your Environment.

How do I access my PHP Info?
Accessing your PHP Info is easy. In vB2, you are provided with the file phpinfo.php in the extras folder. Upload this to anywhere on your host, and access it with your internet browser. This feature is built in to vB3's Admin Panel, and can be accessed by going to 'Import & Maintenance', and then clicking 'View PHP info'.

I get an Internal Server Error.. Help!

While this rarely occurs when hacking vBulletin, I see it being asked.. The only explanation I have for this is to make sure your includes/config.php file is set up correctly. If you are unsure of this, ask your host. You should also make sure that you have typed the URL correctly to the file that you are trying to launch.

I get this error when uploading my hacked files.. Help!

Any error that you receive is likely to be an error on your side rather than the hack's. The problem can be anything from a range of things, but these are the most common ones..

What program did you use to edit the files?
If you used Macromedia Dreamweaver, it's likely that something else was changed on top of what you asked it to change. The program is funny like that..

Did you follow the instructions correctly?
You'd be amazed how many times people paste code AFTER instead of BEFORE, BEFORE instead of AFTER and REPLACE when they're not even asked to. Other times, the line provided can appear in the file more than once, so make sure you're editing around the correct instance. Ask the hack author if you are unsure of this, and quote the file name or template you are editing.

Did you download/upload the file in ASCII mode?
If you downloaded/uploaded the file in Binary mode, sometimes the file will corrupt itself and give you some kind of error. While this isn't always the case, it's a good habit to get yourself into downloading/uploading PHP files in ASCII mode.

Did you upload the additional files and create the additional templates that came with the hack you're installing?
Often, people make the required changes to the original vBulletin files and templates and forget to upload the additional files and create the additional templates that are required for the hack to work. It's a common mistake to make - even the professionals do it from time to time.!

Are you running a firewall while uploading to your FTP?
Sometimes, firewalls such as ZoneAlarm get in the way of you uploading files to the FTP and these files get "cut". What I mean by this is instead of the whole file being uploaded, some of the file is missing.

Did you run the queries required?
Occasionally, you are asked to run queries on your MySQL database for the hack to work correctly. Not running these can cause errors, and sometimes have very strange effects on your forums.

How do I run queries?

Another question commonly asked; "How do I run queries?" First, access to phpMyAdmin on your host would make your life easier.. To access this, you will need to go into your site's admin panel (NOT your vBulletin admin panel). Find your MySQL management and a link to phpMyAdmin should be found around there.

Not everyone has admin access to their site however, unfortunately for those running vB2, you will have to ask your host to run the database queries for you or alternatively install one of many hacks available that allows you to run database queries through your vB Admin Panel. vB3 however, comes standard with this feature if you list your userid to be able to run database queries in the file includes/config.php .

I get a syntax error when running this query.. Help!
Syntax errors are often enough the result of bad copying and pasting, or depending on what you're using to run database queries the query string may differ.

If you get a syntax error when running code with a ';' at the end of it, remove the ';' and try running it again. This SHOULD solve your problem.

Other things to look out for is poor query structuring by the hack's author. The following is a good example of this:

Correct :laugh:
SQL Query: (how to run queries)
CREATE TABLE `journal` (
  `journalid` int(11) NOT NULL auto_increment,
  `title` text NOT NULL,
  `description` text NOT NULL,
  `imagename` text NOT NULL,
  `entries` int(11) NOT NULL default '0',
  `views` int(11) NOT NULL default '0',
  `enabled` smallint(6) default '0',
  `timestamp` int(11) NOT NULL default '0',
  `userid` int(11) NOT NULL default '0',
  `mood` text NOT NULL,
  `np` text NOT NULL,
  PRIMARY KEY  (`journalid`)
) TYPE=MyISAM;
Incorrect :dead:
SQL Query: (how to run queries)
CREATE TABLE 'journal' (
  'journalid' int(11) NOT NULL auto_increment,
  'title' text NOT NULL,
  'description' text NOT NULL,
  'imagename' text NOT NULL,
  'entries' int(11) NOT NULL default '0',
  'views' int(11) NOT NULL default '0',
  'enabled' smallint(6) default '0',
  'timestamp' int(11) NOT NULL default '0',
  'userid' int(11) NOT NULL default '0',
  'mood' text NOT NULL,
  'np' text NOT NULL,
  PRIMARY KEY  ('journalid')
) TYPE=MyISAM;
Can you see the difference? The correct query uses ` marks around the name area, and the incorrect query uses ' marks around the name area. Sometimes, there will be no marks around the name area at all, but this should also work just fine. It's a subtle difference, but it's one that will make the difference between the query running or not.

Make absolutely sure that you have copied ALL of the query string before running it.. One mistake could mess up your database, and reversing this effect may not be an easy task.!

How do I make a backup of my database?

There are several ways of doing this.. The most effective and quickest way I have found is using Telnet/SSH. However, not everyone has access to this due to security reasons.. Other ways of backing up your database are through phpMyAdmin (this is NOT recommended - many problems have been reported of it timing out on large databases), or making a backup through your vB Admin Panel.

What command do I need to run in Telnet/SSH?
This is the command I run, there are other ways but this seems to be the best for me;
mysqldump -uUSERNAME -pPASSWORD DATABASE_NAME > FILENAME.sql

How do I revert my database to the backup I made?
Again, there are other ways but this is the command I run in Telnet/SSH;
mysql -uUSERNAME -pPASSWORD DATABASE_NAME < FILENAME.sql

Similar Mods

vBa: Show GARS article image on article vBulletin 3.5 Add-ons

vblts.ru supports vBulletin®, 2022-2024