vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Auto-creation of threads? (https://vborg.vbsupport.ru/showthread.php?t=61030)

Rendog 09-16-2005 06:47 PM

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:

<?php

    $FORUM_ID 
60;

     
chdir('/www/data/website/forums');

    
// Load vB-Backend
    
require_once ('./global.php');
    
// require_once ('./includes/functions_newpost.php')


?>

Test: <?php echo $FORUM_ID?>

forum_id ends up blank... if i comment out the global.php, it prints properly... any ideas?

Wired1 09-17-2005 05:00 AM

1. what version of PHP are you running, 4 or 5?

2. is global.php called from the function?

Andreas 09-17-2005 05:03 AM

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 :)

artonex 09-21-2005 10:05 AM

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?

mtrac 10-02-2005 03:43 PM

Quote:

Originally Posted by Wired1
Yes, I plan to update this when vB 3.5 comes out if it doesn't work

It's not working off a cron job any more but does work when called locally. Compared to the other problems I'm having it's not exactly a catastrophe. Any ideas?

Wired1 10-02-2005 06:41 PM

artonex:
Not a clue if this will work in vB 3.5.0. Gotta get into the code more first.

mtrac:
what vB version?

mtrac 10-03-2005 09:22 AM

3.5.0 (Gold)

mickmel 07-31-2007 06:42 PM

Quote:

Originally Posted by Wired1 (Post 766713)
Yes, I plan to update this when vB 3.5 comes out if it doesn't work

I was hoping for an update to this. It still creates threads, but:

- 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.

Wired1 07-31-2007 07:32 PM

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.

norma-aguilera 12-30-2009 02:23 AM

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 11:23 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
  • Page Generation 0.02028 seconds
  • Memory Usage 1,741KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete