![]() |
Is there a way to pass the last thread's id from build_new_post? I currently have this: (just a snippet)
PHP Code:
PHP Code:
|
Bump. Anyone?
|
Just checking into my baby ;)
Been busy for forever, but IF I get a chance, I'll try to delve into the code again. Only way I'll release it as a hack is if I can somehow figure out how to put a module in the admin / mod CP for it, gotta be user friendly and all. |
Thanks guys. I set mine up to combine the Contact Us page with this 'hack' so that users could submit news stories to our News admin forum without giving them access to it. Thanks!
Any function and/or example for sending PMs? |
Quote:
Automating sending PMS to one person or a certain amount? Can't see reasoning behind this ATM though, but I'll put it on the list of things to check into. |
WTF .... 85 posts just to try to explain how to auto generate a new thread.
I have used this often .... it only requires like about 6 lines PS .. i havnt read the thread, there is tooooooooooo much and i dont have that much time |
Then by all means, post your way of doing it. FYI, this thread is a year old. The first 2 pages are mainly myself and some others working it out, the rest are about others using the code.
Also, counted the lines, it's about 8 after trimming non-essential stuff, so your code would probably look similar. |
I just found this Thread. That helps me figuring out how to build a Thread. ;)
Did someone know how to add a Poll to the created Thread? |
Quote:
PHP Code:
PHP Code:
PHP Code:
edit: I should probably start a new thread. |
Ok I had this working, but am now trying to implement on a new machine running a version of 3.0.7 and php5. I am getting an odd error,
Fatal error: Call to undefined method stdClass::query_first() in /usr/local/www/htdocs/bbs/includes/functions.php on line 938 Here is my code. As far as I can tell everything is being included fine, no errors there. PHP Code:
|
What's on line 938 of functions.php?
|
PHP Code:
|
Excellent thread. I hooked the auto-creation up to the CaRP RSS parser and a couple of cron jobs and now have this.
Today's question is how do I create calendar events? I'd be interested in a year at a time; i.e. monthly board meeting schedules. I'm thinking of inserting a text file into vb3_event with PHPMyAdmin but would like something more sophisticated. Thanks. |
Quote:
|
Ok, I figured out my problem. Has anyone got this code to work inside a function? When I run it normally, it works fine. When I put it inside a function, I get all kinds of errors.
|
Quote:
|
PHP Code:
Which returns: Warning: array_keys() [function.array-keys]: The first argument should be an array in /includes/functions.php on line 3089 Warning: Invalid argument supplied for foreach() in /includes/functions.php on line 3089 Fatal error: Call to a member function query() on a non-object in /usr/local/www/htdocs/bbs/includes/functions.php on line 2298 Fatal error: Call to undefined method stdClass::query() in /usr/local/www/htdocs/bbs/includes/functions.php on line 524 I also have the same code outside a function, which works fine: PHP Code:
|
I didn't really go through your code, but try getting the userinfo before the foruminfo.
|
yeah the code is pretty long and convoluted, the bottom line is when i run it just in a normal test script it works perfectly, when I put it in any sort of function construct it fails as soon as it tries to execute any vb code.
|
You may be interested in this hack just released by deathemperor:
Calendar Search and Comments for Events https://vborg.vbsupport.ru/showthread.php?p=626269 |
So i just wrote a custom workaround so I don't have to have this code in a function.. it is ugly but it works.
I know there is a lot of people using this hack since this thread is so big, but has anyone gotten posts to display on another page? Is there an easy way to get vbulletin to display posts in their format or is the easier way to just grab the postdata from the db and display them myself? |
Quote:
Did that end up working? If so, can you post your build_new_post function, as I need a way to get the threadid back out of this... |
You don't have to modify build_new_post().
If you take a close look at its implementation, you will see that $post['threadid'] contains the threadid :) $threadinfo can't contain the threadid, as this paramater is call by value instead of call by reference (like $post or $errors) |
Quote:
|
Hrm, don't think my subscription is working to this thread, ack!
Anyway, just as an FYI, I'd release this as an official hack if I could find an article or something that would tell me the easiest way to make a menu within the admin panel. |
What do you mwan with " make a menu within the admin panel."?
|
sry, i'm a bit sleep deprived atm :)
Basically when you look at some hacks, you see that they have added menus to the adminCP / modCP areas. GUIs to make the hack as easy as possible to use. IMHO, someone should make a tutorial on how to do it for newbie vB hackers anyway. Now that I think of it though, I can't recall WHY I wanted that. IIRC, I had a good reason (someone posted a reason why in this thread), but I'm spacing ATM. One main reason for the function was for server-side bots/programs to auto-post info (e.g. RSS feeds, whatever). My personal reason for it was similar. Would you even classify this as a hack? It's more of a collection of vB functions IMHO. |
Stupid question, but how do I put carriage returns in? \n doesn't work.
|
Never mind. I just discovered the distinction between single and double quotes in PHP.
|
kewlness
Yes, I plan to update this when vB 3.5 comes out if it doesn't work |
Hey guys, I'm having a very fundamental issue getting this to work.
As soon as I do the require global.php line, my varibles don't work... by that i mean the php page below prints only Test: $FORUM_ID is blank even though its decalred... if i remove the require global.php line its fine.... what gives? PHP Code:
|
1. what version of PHP are you running, 4 or 5?
2. is global.php called from the function? |
I guess you got register_globals=on
For the sake of security, vBulletin unsets all global variables created by register_globals=on, and there is no way (well ... except changing some basic internal functions would be necessary) to stop it from doing that :) Best suggestion: Code without relying on register_globals :) |
I need to take this rss feed and use it for auto new threads.
http://news.google.com/news?q=mariju...F-8&output=rss I use vb3.5 rc3. how would i do this? |
Quote:
|
artonex:
Not a clue if this will work in vB 3.5.0. Gotta get into the code more first. mtrac: what vB version? |
3.5.0 (Gold)
|
Quote:
- They're created under the username of the person that pushes the "create" button, rather than the user specified by the script. - The threads automatically go into the moderation queue, rather than appearing on the site for other users to respond to. Thanks. |
blast from the past :)
Could've sworn there's a couple of plugins now that auto-create threads now, could be wrong. If you can't find them, I'll dig into the code (maybe this weekend) and see what I can come up with. As you can see from this thread, I pretty much grabbed some vBulletin functions and slapped them together. I'm guessing these functions have changed, and so this broke. Probably have to re-smush the vBulletin code together :) Yeah, that last thought didn't make much sense to me either. |
OK. In case anyone else needs this code....
This worked for me with vBullentin version 3.5.4 The new thread was created successfully -even when I was not loggin in. <?php require_once('./global.php'); require_once('./includes/functions_newpost.php'); require_once('./includes/class_dm.php'); require_once('./includes/class_dm_threadpost.php'); require_once('./includes/functions_databuild.php'); $forumid = 19; $userid = 1; $title = 'The first autopost!'; $pagetext = 'More details here.'; $threaddm =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost'); $foruminfo = fetch_foruminfo($forumid); $threaddm->set_info('forum', $foruminfo); $threaddm->set('forumid', $forumid); $threaddm->set('userid', $userid); //$threaddm->set('user', 'SGD DESIGNS'); $threaddm->set('title', $title); $threaddm->set('pagetext', $pagetext); $threaddm->set('allowsmilie', 1); $threaddm->set('visible', 1); $threaddm->set('dateline', TIMENOW); $threaddm->save(); ?> |
All times are GMT. The time now is 04:17 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:
|