Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Want to be a Hacker and not a Copy and Paster?
amykhar's Avatar
amykhar
Join Date: Oct 2001
Posts: 4,438

 

PA
Show Printable Version Email this Page Subscription
amykhar amykhar is offline 04-27-2003, 10:00 PM

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
Reply With Quote
  #2  
Old 04-28-2003, 10:35 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hear hear.
Reply With Quote
  #3  
Old 04-28-2003, 11:36 PM
Razor's Avatar
Razor Razor is offline
 
Join Date: Jan 2002
Location: Grand Rapids, MI
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 04-29-2003, 04:17 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice and true amy

every good hacker surely has experienced that hisself
Reply With Quote
  #5  
Old 04-29-2003, 04:27 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 04-29-2003, 05:50 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great read Amy

- miSt
Reply With Quote
  #7  
Old 05-02-2003, 08:38 AM
flup's Avatar
flup flup is offline
 
Join Date: Jan 2002
Location: Maastricht, NL
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 07-18-2003, 04:17 AM
chad chad is offline
 
Join Date: Jun 2003
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah . thats a good thing that hacks are open sourced so we can all learn!
Reply With Quote
  #9  
Old 07-18-2003, 04:52 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 07-18-2003, 08:03 AM
Gavin B. Gavin B. is offline
 
Join Date: Jul 2003
Location: Australia
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep, good advice!


Quote:
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?
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 08:25 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05319 seconds
  • Memory Usage 2,291KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete