The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Additional Options
HI!
My first question here after much googling.. I wanted to know what hook I should use to add a new "additional option" when a user is creating a new thread, editing a post or replying. (basically anytime when you post). I'm creating a method to upload custom cropped icons to a post, but I don't know which hook I should use to have that option show up with the Additional Options. This option can also be outside of the "additional options" box when posting. It doesn't have to reside within the same box. Also, does anyone know which array variable I can access to get post information (i.e. - post ID, post date, etc) and the user info (i.e. - user ID, user sign up date, etc)? Thanks! |
#2
|
|||
|
|||
Quote:
All that just gets the html to show up on the form. To process it, I'd probably use hooks newthread_post_start/newreply_post_start to get the values and put them in the $newpost[] array, then use hook newpost_process to do something with them (they'll be in $post[] at that point), and if you detect an error at that point you just have to put an error message in $errors[] to stop the post from being saved. I know that's a really short explanation of something that's a bit complicated. If you know php I'd recommend searching for fetch_hook('hook_name') (using whatever hook name you're interested in) to see what's going on at that point in the code. Quote:
It depends on what hook location you're using. If you follow what I outlined above and use newpost_process to process your data, then everything about the post is in $post[]. The "current" (logged in) user's info is in $vbulletin->userinfo, but that could be different than the post if, say, an admin is editing someone else's post. I'm not sure if all the fields you mention are available. What I usually do if I'm wondering is I put in a print_r() to print the entire array into a file, then use it as a reference. |
Благодарность от: | ||
Lynne |
#3
|
|||
|
|||
Thanks kh99 for the insight.
I don't want to replace the post icon that shows up when a user posts a message. Rather, allow for a another or new icon that is independent of the VB post icon method. In the "Additional Options" portion of the new, reply or edit post area, I'm trying to add a custom icon loading option. Since a post on my site will have many attachments of images, I want the user to have the freedom to crop their own representative thumbnail of the image. Can I add a custom feature to the "Additional Options" box on the bottom of a posting page? That is where I'm trying to find a hook perhaps to add this custom plugin. Any clues or leads would help! Thanx! |
#4
|
|||
|
|||
That's what I posted about above. But maybe someone else can explain it better.
|
#5
|
|||
|
|||
Awesome! Your tips did lead me to right place.
My only question is where could I possibly get the actual "postid" of a new reply or new thread? I noticed that in the $vbulletin->GPC there is a "postid" but it is of the postid of the previous thread in a reply (and 0 for a new thread). You mentioned that the data will be in $post. I tried to print out the information, but I didn't get anything. Where do I go about getting the final information from the actual post that was just created? I'm assuming that I can obtain the current "postid" information of a post when editing a post using $vbulleting->GPC. Thanks kh99, you've been a great help! |
#6
|
|||
|
|||
The new threadid and postid will be in $post[] in build_new_post(), but not until after $dataman->save() is called. So if you create a plugin using hook newpost_complete you will be able to get the new postid.
You could also use plugins using hooks in newreply.php and newthread.php as long as they are after build_new_post() is called, and the postid will be in $newpost[]. |
#7
|
|||
|
|||
I think $post[userid] or $newpost[userid] (depending on which hook you're using) will have the id of the original author of the post.
ETA: ...but now you've deleted the question for some reason. |
#8
|
|||
|
|||
Thanks kh99 for the vigilance.
I deleted the post because I found which array contains the selected edited post info. *hint*hint* The array is $postinfo[] This contained all the information pertaining to the currently edited post regardless of who is logged in. |
#9
|
|||
|
|||
OK, I guess I probably misunderstood the question.
|
#10
|
|||
|
|||
Man I'm on the home stretch!
I'm stuck on doing the final display of a plugin. Now I'm trying to have it show up on several sections and not others. I found this VB snippet on another post https://vborg.vbsupport.ru/showthrea...+certain+pages Code:
<vb:if condition="in_array(THIS_SCRIPT, array('index', 'vbcms', 'blog'))"> stuff here </vb:if> Is there another array value that I can access to find out what page I'm on? Thanks! UPDATE! I decided on using $vbulletin->script as the page detect method. Or, the replacement for "THIS_SCRIPT". Is there a better value than that, that I can use? |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|