Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
Want to be a Hacker and not a Copy and Paster?
amykhar
Join Date: Oct 2001
Posts: 4,438

PA
by amykhar amykhar is offline 28 Apr 2003

One of the very best ways to learn a new coding language is to create a real-world application for yourself and then code it. Tutorials and books have their place, but you will learn more, faster if you try to solve a real problem on your board.

For example, lets say you see a hack that shows the last 10 posts on a different forum page. You like that hack just fine, but you don't want to show 10 posts, only 5. A copy and paster will post a request in the hack's thread to modify the hack for 5 posts instead of 10. A hacker will look at the hack's code and try to figure out HOW the hack gets the 10 posts and change that to 5.

In modifying code, there are a few concepts that are key.

1. If / else clauses: These little conditional clauses allow your code to make choices. Do this if the logged in person is a moderator but do that if they are an admin.

http://www.zorka.com/home/phptutoria...vent=lesson/if

2. OR and AND: Those two little words will allow you to do extraordinary things. I can't tell you how many times I have been asked to modify a hack so that it includes an extra usergroup, user, style, whatever. So many times, it is merely a matter of adding an OR or an AND to a query.

http://hotwired.lycos.com/webmonkey/...tw=programming

3. Queries: You don't have to memorize writing queries. Find similar queries in the vbulletin code and then copy, paste and modify! If you need to find all the users in your forum who have made more than a thousand posts, find another query that is looking for users and copy the code and tweak it. Look in phpmyadmin to see the names of the columns you are interested in and experiement. HINT: When writing code to delete data, test your queries with SELECT first. That way you won't accidentally delete the wrong thing.


You are not going to learn how to customize your board if you don't get in there and get your hands dirty. Figure out what you want to do to your board and then find example code that can get you started. Your code won't be neat. It won't be efficient. But, it will be yours. And, after a bit of practice, your code will improve and you will be releasing your own hacks instead of having to depend on others to do it for you.

Amy
Views: 6115
Reply With Quote
Comments
  #2  
Old 28 Apr 2003, 23:35
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Hear hear.
Reply With Quote
  #3  
Old 29 Apr 2003, 00:36
Razor's Avatar
Razor Razor is offline
 
Join Date: Jan 2002
Real name: Greg
Nice post. I've seen soooo many people around here asking for things that are just a simple change of a few strings of code.
Reply With Quote
  #4  
Old 29 Apr 2003, 17:17
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Real name: Stefan Kaeser
nice and true amy

every good hacker surely has experienced that hisself
Reply With Quote
  #5  
Old 29 Apr 2003, 17:27
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Real name: Amy
When I worked as a software developer, I had a reputation of getting things done fast - even if working in a language that I don't really know or with unfamiliar code. The secret has always been knowing how to take existing code that I find here and there and modify it to do what I want. I still say the best programmers are almost always plagiarists to some extent

Amy
__________________
amykhar.com
----------------------------------------
I do not respond to PM requests for coding assistance.
Reply With Quote
  #6  
Old 29 Apr 2003, 18:50
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Real name: Dean Clatworthy
Great read Amy

- miSt
__________________
Dean Clatworthy - Web Developer/Designer
Reply With Quote
  #7  
Old 02 May 2003, 09:38
flup's Avatar
flup flup is offline
 
Join Date: Jan 2002
Real name: Joshua
I've learned myself php that way......but i'm now still learning from a good dutch page (2 very very good mySQL tutorials, i wil place them here in englisch today)
Reply With Quote
  #8  
Old 18 Jul 2003, 05:17
chad chad is offline
 
Join Date: Jun 2003
Real name: Chad
yeah . thats a good thing that hacks are open sourced so we can all learn!
Reply With Quote
  #9  
Old 18 Jul 2003, 05:52
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
I'm having fun with vB3 now... ported a few hacks over already. Basically it's not hard. It's so much more secure too!!! Especially with the _POST and _REQUEST protection... good!
Reply With Quote
  #10  
Old 18 Jul 2003, 09:03
Gavin B. Gavin B. is offline
 
Join Date: Jul 2003
Yep, good advice!


Today at 06:52 AM Erwin said this in Post #9
I'm having fun with vB3 now... ported a few hacks over already. Basically it's not hard. It's so much more secure too!!! Especially with the _POST and _REQUEST protection... good!
Didn't vb2 have protection on this as well?
__________________
Platinum-Central
Reply With Quote
  #11  
Old 18 Jul 2003, 13:43
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Today at 07:03 PM Gavin B. said this in Post #10
Yep, good advice!

Didn't vb2 have protection on this as well?
Not as good as vB3. Now you cannot send any variables via a URL request, without you allowing it in the PHP file in a REQUEST array. Very nice.
Reply With Quote
  #12  
Old 18 Jul 2003, 14:00
NTLDR's Avatar
NTLDR NTLDR is offline
 
Join Date: Apr 2002
Real name: Lee Botley, BSc (Hons)
Didn't vb2 have protection on this as well? [/B]
vB2 automatically registered globals. With vB3 if register_globals is set too off then you need to use either the globalise function or $_POST['var'] $_GET['var'] or $_REQUEST['var'] too have access to the variable.

PHP is the only programming lanuage I can write anything usefull in, and thats thanks to vB and messing around with hacks.

I've manage to be able to port all the hacks I want from vB2 to vB3 as well as create the new ones I want. Taking time to look at the code and work out what it does is well worth it IMO. You can learn so much from "Playing" with hacks. Before vB I couldn't have even told you what PHP was other than an exenstion I'd seen in some urls
__________________
Lee Botley, BSc (Hons) - vBulletin.org Moderator
http://www.thesistersthree.com/lee/sigs/signature.ts3
The Sisters Three Charmed Discussion Forums

WinterDir .:. vBindex v2.1 for vB2 .:. vBindex v3.0.0 RC5 for vB3
Reply With Quote
  #13  
Old 18 Jul 2003, 14:01
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Same here.

I managed to make myself some static URLs as well. Much easier in vB3 because of the way sessionhash is coded.
Reply With Quote
  #14  
Old 18 Jul 2003, 14:11
corsacrazy's Avatar
corsacrazy corsacrazy is offline
 
Join Date: May 2002
Real name: wayne
the way i do it is by playing around in phpmyadmin ! doing select * statments then grabbing different things from anumber of tables then making a simple query and calling the stuff into a template rather then echo
Reply With Quote
  #15  
Old 02 Apr 2006, 20:09
GrCh_Jeff's Avatar
GrCh_Jeff GrCh_Jeff is offline
 
Join Date: Dec 2005
Wink

I have to see what makes it tick.Lil. Before I ask I'll try to manipulate the situation myself.As Amy said, "get in there and get your hands dirty".

95% of my computer skills are hands on.Been messing with computers for bout 6 years and can do computer repair like I went to school.I am an "X.P." specialist:chinese: .If you saw me you would never guess I was a computer junkie or should I really say vB junkie all tattooed:devious: .I have only been messing with php about 5 months and java script about a year.I LOVE IT!!! It is my goal to have the title "Advanced Coder" under my name.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 16:03.

Layout Options | Width: Wide Color: