Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles

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

Quote:
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
  #13  
Old 07-18-2003, 01:00 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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
  #15  
Old 07-18-2003, 01:11 PM
corsacrazy's Avatar
corsacrazy corsacrazy is offline
 
Join Date: May 2002
Location: london
Posts: 854
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
  #16  
Old 04-02-2006, 07:09 PM
GrCh_Jeff's Avatar
GrCh_Jeff GrCh_Jeff is offline
 
Join Date: Dec 2005
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #17  
Old 04-03-2006, 02:52 AM
Daniel's Avatar
Daniel Daniel is offline
 
Join Date: Jul 2005
Location: USA
Posts: 707
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[high]* Daniel states the obvious: This post is three years old. [/high]
Reply With Quote
  #18  
Old 04-03-2006, 04:48 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow... this thread is about porting hacks from vB2 to vB3... a while ago now!
Reply With Quote
  #19  
Old 04-03-2006, 11:30 AM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

doesn't make the first post any less relevant .
Reply With Quote
  #20  
Old 04-04-2006, 03:44 AM
Freesteyelz's Avatar
Freesteyelz Freesteyelz is offline
 
Join Date: Jan 2006
Posts: 1,552
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #21  
Old 04-05-2006, 03:41 AM
GrCh_Jeff's Avatar
GrCh_Jeff GrCh_Jeff is offline
 
Join Date: Dec 2005
Posts: 68
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Freesteyelz
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 !
Reply With Quote
Reply

Thread Tools

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:04 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.05949 seconds
  • Memory Usage 2,297KB
  • 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
  • (3)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
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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