![]() |
PHP make thread
Hi, I've made this today:
http://spawnscape614.co.uk/forums/reportuser.php And I'm looking to taking these inputs and then make a thread based off this information. I'll obviously validate it so that you must be logged in to see to use the form although , via the SEND button which you see what's the most basic method for this? I've seen the function on VB where you can automatically make a thread when a user reports a thread; so I only assume that it would be similar? |
One of my products auto-creates a thread, and here is the code that actually handles creating the thread:
PHP Code:
|
Thanks! Could you help me with configure this. I've pmed you.
|
I failed to mention before that you will need this line before using the data manager:
PHP Code:
|
Hiya
So far: (relevant part) PHP Code:
|
Okay, aside from the file you need to require that I posted in #4, it looks to me that you will need to pass the forum and thread information to your sendReport function. Also, you will need to initialize many of the variables being used. You don't need the if block regarding the thread prefix.
It appears you get a username from the form, so you will have to query the user table to get the corresponding userid. Any data needed by the function will either have to be global or passed as parameters (which I recommend). |
Quote:
|
Okay...who will be the author of the auto-created thread?
|
^^ the user logged into the forums. I'll make it so the user must be logged in.
So what exactly is the function that sends a request to make a thread? |
Well, you can use the datamanager (as I did) or you can write directly to the "thread" table to insert a new row. In either case you still want to update the counters.
|
I tried your script and I got an error.
I tried using this: PHP Code:
|
You need to pass parameters to the function...for starters, try passing $foruminfo to the function...
|
Ok I tried without a function and purely tried on the else statement:
PHP Code:
|
You need the required file for the datamanager, but you should have gotten an explicitly stated error.
|
SOLVED.
|
Perhaps try $vbulletin->userinfo['userid']...:D
|
Quote:
I'm trying to get strings on the same line as a string and it's not working... PHP Code:
|
In PHP you add strings with a period, so use:
PHP Code:
|
Ahh, it's in some ways similar to java so I forget. Thank you.
|
Yeah, that threw me for a loop not that long ago...:D
|
Quote:
PHP Code:
|
What I suggest doing for clarity, is to build all of your strings first and then set the values.
|
Quote:
I've tried using /n and /r but: https://vborg.vbsupport.ru/external/2015/07/23.png |
I misunderstood what you were wanting to do...try something like:
PHP Code:
|
Quote:
|
I'm glad I was able to help you out. :D
|
PHP Code:
What's the method name for parsing the links? |
How do I make the thread automatically parse the links?
I've tried: PHP Code:
|
I think it might be:
PHP Code:
|
Quote:
|
I have this plugin my forum:
https://vborg.vbsupport.ru/showthread.php?t=240772 I have already put the section id into the block from seeing in chatbox section. Altough because it's sending a thread via the php file; it's being displayed in the chatbox. I found this within the XML file: Code:
<plugin active="1" executionorder="5"> |
All times are GMT. The time now is 01:26 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|