The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Learn to HELP YOURSELF
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= LEARN to HELP YOURSELF =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= I decided to write this after observing the types of questions asked in the General Modification Discussion and PHP/MySQL/JS/HTML forums. If people would know a few simple things, i'm sure the number of questions would be reduced by at least 40-50%. First of all, they need to know that asking on a forum is NOT an efficient way of getting an aswer, and by no means a fast one. It could be days before a member will give you the right solution to your problem. Secondly, you waste BOTH YOUR TIME, and the TIME OF OTHER MEMBERS. With that in mind, the best way to find an answer is to search for it yourself... Golden Rule 1: Use Forum Search - i know this has been said over and over, but i just felt the need to repeat it Golden Rule 2: Use Google 1. EditPlus2 - It's a program. What special about it is the "Find in Files" feature. It will search for a string in multiple files. Use google to find it. I'll give an example of using this later. 2. When you need to find a certain template, keep in mind there's a vBulletin option which will add the names of templates in HTML comments in the HTML source of the page. Turn it on, refresh your vBulletin page, right click on the page > View Source, and then you can just read the name of your template. Also, don't forget there is a search in templates function within vBulletin. 3. If something is wrong in your code, DEBUG, and then post for help. Let's take an example for this. Let's say you have an if statement, which sets a variable to true/false, and based on this you want to allow a user access to a page or not - and it's just not working... PHP Code:
4. If something isn't working, and you just can't figure out why, try using alternate methods of getting the same effect. 5. If you need help with a certain php function, don't ask on the forums. I recommend downloading the php manual in Windows Help Format (chm) from php.net. It's very useful as a function reference. If you don't want to download it - again, use google. 6 If you want to find a function that does something, use the manual. Let's say you want to find a function that converts a string to uppercase. You open the manual, click the Search tab, and search for uppercase. There'll be a few items on the list, but the 4th one is what you're looking for: strtoupper. 7. Similarly, if you need to know what a vBulletin function does, first thing to do is to look at it's name, which will in most cases give a pretty big hint on what the function is supposed to do. Look if there are any comments on that function in the code, and finally, try looking the code and figuring out what it's supposed to do. 8. If you want to find a vbulletin function, EditPlus is your friend. Use Find in Files, and you'll have your function. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= PRACTICAL EXAMPLE OF USING THE ABOVE TIPS =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= What we want As an example of using the above tips, i'll use this thread: How do I: Have Links From a Specific Domain Open in Same Window What we're trying to do is have links (in posts) from certain domains open in the same window. By default, vbulletin opens a new window for all links. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= How We do it First, let's open EditPlus, Search > Find In Files. We'll want to search in our forum folder, for files of type *.*, and the string we'll search for is [url since we know that is the bbcode tag used to generate html links. There's be some results, but you can quickly see which are the important ones. In includes/functions_bbcodeparse.php there'll be some regular expressions to match the [url tag, and some very useful comments ( // [URL] ). Now you know you've found what you were searching for. Go to that page. PHP Code:
Use the find in files function again, to see where that function is... Well, what do you know? It's also in the functions_bbcodeparse file. You won't need to examine the entire function to find what's essential, since it's easy to spot: PHP Code:
Quote:
PHP Code:
So what if we want to do the above for more domains? Here's a demonstration of point 4, alternate methods of doing the same thing... PHP Code:
PHP Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= That's it! It's a lot easier than it seems, believe me. Then again, i'm not that good at explaining things. I hope this helps some of you. Rake. |
#2
|
||||
|
||||
Some great stuff but to test for a needle in a haystack use strpos
|
#3
|
|||
|
|||
Good job.
|
#4
|
|||
|
|||
Nice work rake. Good posts like that take time.
|
#5
|
||||
|
||||
definitelly a good one!
|
#6
|
||||
|
||||
very very useful.
Thanks Rake ! the only thing I've done before time was download all links at http://php.net/manual/en ^^. This helped me make my first modification myself and understand vbulletin things. |
#7
|
||||
|
||||
Thanks, rake. #2 is particularly helpful; I had no idea that was there. :up:
|
#8
|
|||
|
|||
I would also add that a common problem when asking questions is that the explanation/question is often too brief, as if the questioner has less time that the people reading the post.
In general, if I read a question-style post that is a couple of vague sentences, I will just ignore it. I do not think I am alone in this behaviour. If one can not take the 15 or 20 minutes to enter a decent post with as much information as is reasonably possible, then one should not expect a reply. Here are some of the problems with question/request/problem posts: #1 -- Explain what you are trying to do Take the time to start your post with an explanation of what you are trying to do. After you have done that, move on to describing the problem. #2 -- Be as specific as possible Often, it is difficult to tell if one is referring to a PHP script, a template, or some HTTP/browser issue. Be specific about what objects you are working with. #3 -- Attach or enter problem output Now really, what good is it to say "I don't get the right XXX" when I try YYY. Show us the XXX you do get. Attach a screenshot if that is showing the problem. Include the code that is not working if that is applicable. Show the output of the database error. ... you get the idea. #4 -- Hack requests as implementation questions Do not pose a request for a hack as an implementation question. Instead of asking "How can I change the XXX to include the YYY as well.", explain the purpose of the hack. There might be a more proper or elegant solution if you posed the request in terms of what you want to accomplish rather than in terms of what you have tried or what you have in mind as a solution. Cheers, C.C |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|