PDA

View Full Version : Want to be a Hacker and not a Copy and Paster?


amykhar
28 Apr 2003, 19:03
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/phptutorial/main/event=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/01/48/index2a_page9.html?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

Erwin
28 Apr 2003, 23:35
Hear hear. :)

Razor
29 Apr 2003, 00:36
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.

Xenon
29 Apr 2003, 17:17
nice and true amy :)

every good hacker surely has experienced that hisself :)

amykhar
29 Apr 2003, 17:27
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 :D

Amy

Dean C
29 Apr 2003, 18:50
Great read Amy :)

- miSt

flup
02 May 2003, 09:38
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)

chad
18 Jul 2003, 05:17
yeah . thats a good thing that hacks are open sourced so we can all learn!

Erwin
18 Jul 2003, 05:52
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!

Gavin B.
18 Jul 2003, 09:03
Yep, good advice! :)


Today at 06:52 AM Erwin said this in Post #9 (http://www.vbulletin.org/forum/showthread.php?postid=418637#post418637)
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? :)

Erwin
18 Jul 2003, 13:43
Today at 07:03 PM Gavin B. said this in Post #10 (http://www.vbulletin.org/forum/showthread.php?postid=418657#post418657)
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.

NTLDR
18 Jul 2003, 14:00
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 ;)

Erwin
18 Jul 2003, 14:01
Same here. :)

I managed to make myself some static URLs as well. ;) Much easier in vB3 because of the way sessionhash is coded.

corsacrazy
18 Jul 2003, 14:11
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 ;)

GrCh_Jeff
02 Apr 2006, 20:09
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". :up:

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.

Daniel
03 Apr 2006, 03:52
/me states the obvious: This post is three years old. :rolleyes:

Erwin
03 Apr 2006, 05:48
Wow... this thread is about porting hacks from vB2 to vB3... a while ago now! :)

amykhar
03 Apr 2006, 12:30
doesn't make the first post any less relevant :D .

Freesteyelz
04 Apr 2006, 04:44
I can relate to it just like, GrCh_Jeff. I'm far from a computer person.

Since I'm not a coder - not an excuse by any means - often I'll need some level of guidance to get me jump started. By looking at script routines, even if they are not exactly what I need, I try to manipulate it to serve my needs. By learning how codes work sometimes I'm able to craft something up myself. For just being with vB about 2 months I think I'm coming along nicely.

Every now and then I'll ask questions, though, I don't like to depend nor become a burden. My best way to send a thank you is by extending what answers I've been given and evolve from there. With the things I've learned from others I try to give back.

I'm glad I came across this thread as it holds true today. Very well written, amykhar. :)

GrCh_Jeff
05 Apr 2006, 04:41
My best way to send a thank you is by extending what answers I've been given and evolve from there. With the things I've learned from others I try to give back.

I'm glad I came across this thread as it holds true today. Very well written, amykhar. :)


Right on !;)