The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#21
|
||||
|
||||
Quote:
Well... I'm out for the night, but I'll leave you guys with some good reads about vBulletin and how to write your own scripts using it... Tutorial Index: https://vborg.vbsupport.ru/showthread.php?t=99570 Pay special attention to these threads: https://vborg.vbsupport.ru/showthread.php?t=98047 https://vborg.vbsupport.ru/showthread.php?t=98009 |
#22
|
|||
|
|||
Ok I took a break from the coding this morning to add some more style to the script and this is what I discovered..
For the fellow newbies, if you want your script to output a page that looks just like a VB page this is what you want to start and end your script with: Start: PHP Code:
PHP Code:
And now onto Step 5. I'm right now trying to add some functionality to the script, I want it to be able to go and edit the .txt file I have and be able to add data, remove data, or edit data from it. Again for me its the basis, so I'm just trying to get a function call to work only if I hit a button. I can make the button appear and will probably do this by making a form that posts to itself. My question is, is there a way to load a .php file and have it go straight to running a certain function? Is that what the "?" in the filename is for?.. Ie. I see some scripts running like this: "https://vborg.vbsupport.ru/newreply.php?do=newreply&noquote=1&p=993576" Is the newreply.php?do=newreply telling the newreply.php to only run the newreply function ? I tried to do something similar on my own script but that obviously didn't work yet UPDATE I've found the answer to that.. What I did was look at vb's own file and just copied what they did from their login script, this is how I got it working I added this into my main body of the script: PHP Code:
PHP Code:
And of course my button in an above section would labeled name="do" value="start" So all is well so far, steaming right along! Now to get my user.txt data to post itself in a nice form which would let you edit it. I think this will be hard as hell, but here I go...! UPDATE #2 Ok so now i'm writing the section of this program that will find the given user's threads (threads started by him) in a predefinied forum and then close the thread. This is what I have so far: PHP Code:
Also does anyone have a clue how to move from here to tell the DB to close that given thread ? Thanks!! UPDATE #3 Took me a while, but I got the script to close the threads one by one by using this bit of code.. woohoo! PHP Code:
$mrkt is a predefined forumid# since i want this to only effect one of my forums, not the entire place. |
#23
|
||||
|
||||
Did you figure everything out? The "?" and everything after it in the URL, is known as the query string. It can be accessed via the $_GET array. file.php?do=closethread&t=15 will translate into the following $_GET array:
PHP Code:
$_POST is similar, it is populated from form elements where the form action is set to post. These are just as insecure as $_GET values, so be sure to clean them. Also, it might be easier to use a template instead of using echo and basically recreating the standard shell template (GENERIC_SHELL). |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|