Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 02-06-2004, 01:01 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the subforum would be modification hints and tips

as for your problem: hmm, wierd, it seems like you are calling the function files out of the wrong directory.

isn't your script located within the forum directory?

you may want to add a chdir('..'); before the first require once of your script above.
Reply With Quote
  #12  
Old 02-06-2004, 07:53 PM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, the test file was outside the directory. Moving it inside did get rid of that, but more have come

Fatal error: Call to a member function on a non-object in ...forums/includes/functions.php on line 259

That line is within the function fetch_phrase, which is used in function verify_post_errors, which is used in this snippet within functions_new_post.
PHP Code:
    if ($_REQUEST['fromquickreply'] AND $post['preview'])
    {
        
$errors = array();
    }
    else
    {
        
verify_post_errors($type$post$errors);
    } 
Tracing code use is fun kids! lol
Ok, so $post['preview'] has already been set to 0 in the code I listed in the test file a couple of posts back. Not real sure how to set $_REQUEST['fromquickreply'] to the correct value though. Tracing it back, I think that's a default setting. I'm starting to get the feeling that a manual INSERT might work better, but I'm not giving up yet!
Reply With Quote
  #13  
Old 02-06-2004, 11:19 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wierd, i haven't had any problems, i added the build_newpost to a script of mine myself and it worked flawless (ok not creating a new thread, just post...)

the errormessage you have sounds like you have to add a global $DB_site; at the correct part of your script

or better said, does your script include the global.php so the connection to the DB is set up already?
Reply With Quote
  #14  
Old 02-07-2004, 01:00 AM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

... ... ... nope... LMAO! It was there at one point, must've deleted it accidentally! Added that, then re-ran it, got an odd vB error, refreshed, and it went in! Getting an odd error though:
Code:
Database error in vBulletin 3.0.0 Release Candidate 3:

Invalid SQL: 
SELECT CONCAT(newthreademail ,' ', newpostemail) AS newpostemail
FROM forum WHERE forumid IN ()
		
mysql error: You have an error in your SQL syntax near ') ' at line 4
mysql error number: 1064
Now the data is getting into the thread in the right place. Also just found out that every time that happens, I get a DB error email lol! 2 odd things though, which I'll cover after this code, which is the latest incarnation of the test code:
Code:
require_once('./global.php');
require_once('./includes/functions_newpost.php');
require_once('./includes/functions.php');
require_once('./includes/functions_login.php'); 

$foruminfo['forumid'] = 10;
$threadinfo['open'] = 1;
$threadinfo['visible'] = 1;

$threadinfo['title'] = '3rd';

$post['title'] = 'sdfsdfsdf';
$post['message'] = 'This is the message stuff';

build_new_post('thread', $foruminfo, $threadinfo, 0, $post, $errors);
verify_post_errors($type, $post, $errors);
the threadinfo['title'] doesn't do diddly, even when the post['title'] is commented out. Also, I'd like the post specific title to be nothing, but I can always remove it in the postbit.

I've also found out that it uses the cookie's session to use my username/id, not the one in the test file. I was wondering if there's a way to have it log out the user, log in with the Bot's Username/PW, then after it's done, log out. Would probably be easier for the poster to just log out of their user name and login to the bot's acct.

BTW, I take it back about what I said about their code comments, was looking around the vb.com site, and found the pdf with the ERD for the database... WOAH! I'll wait to see vB3 final to see what code comments they say...
Reply With Quote
  #15  
Old 02-07-2004, 10:35 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

replace the code
PHP Code:
$foruminfo['forumid'] = 10
with that:
PHP Code:
$forumid 10;
$foruminfo fetch_foruminfo($forumid); 
that should avoid the db error i think.

as for your second question.
if you just use the init.php instead of global.php i think it doesn't use your account, but does create the thread as well. (but i don't give guarantee for that )
Reply With Quote
  #16  
Old 02-07-2004, 11:46 PM
version2's Avatar
version2 version2 is offline
 
Join Date: Feb 2003
Location: Philly
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am glad to see this thread because I am working on a hack that will be posting new threads and posts as well. Right now I am looking at your code and upon testing it out for myself I have two problems I can see. First I get a dberror:

PHP Code:
Invalid SQL
            
INSERT INTO post
                
(threadidparentidtitleusernameuseriddatelinepagetextallowsmilie,
                 
showsignatureipaddressiconidvisibleattach)
            
VALUES
                
(0, , '',
                 
'mol'11076204664,
                 
'This is the message stuff'10,
                 
'127.0.0.1'010
Now, the second this I see is that I passed a different username and id than the one that is being used. I assume its going off cookie info! As for using init.php, well...that didnt help much except for getting rid of the dberror. Still no thread being created.
Reply With Quote
  #17  
Old 02-08-2004, 12:11 AM
version2's Avatar
version2 version2 is offline
 
Join Date: Feb 2003
Location: Philly
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok. I have created a thread! Woot. Now, I have to figure out how to go around the cookie problem. It is still posting as a different user than what I have hardcoded into it. The next step is how to post a new post in the thread that was just created.
Reply With Quote
  #18  
Old 02-08-2004, 12:20 AM
version2's Avatar
version2 version2 is offline
 
Join Date: Feb 2003
Location: Philly
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by version2
Ok. I have created a thread! Woot. Now, I have to figure out how to go around the cookie problem. It is still posting as a different user than what I have hardcoded into it. The next step is how to post a new post in the thread that was just created.
Well, ok. I got it. It was $threadinfo['iconid'] giving me fits of all things. I am now creating new threads and follow up posts.

Now, to fix the userid problem.
Reply With Quote
  #19  
Old 02-08-2004, 12:23 AM
version2's Avatar
version2 version2 is offline
 
Join Date: Feb 2003
Location: Philly
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok. Update. When using the init.php and bypassing global in hopes of the bbuserinfo not taking over I am getting an invalid posthash as a result:

PHP Code:
Invalid SQL
            
SELECT COUNT(*) AS count
            FROM attachment
            WHERE posthash 
'invalid posthash'
                
AND userid 
Reply With Quote
  #20  
Old 02-08-2004, 12:34 AM
version2's Avatar
version2 version2 is offline
 
Join Date: Feb 2003
Location: Philly
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by version2
Ok. Update. When using the init.php and bypassing global in hopes of the bbuserinfo not taking over I am getting an invalid posthash as a result:

PHP Code:
Invalid SQL
            
SELECT COUNT(*) AS count
            FROM attachment
            WHERE posthash 
'invalid posthash'
                
AND userid 
All right. I am done talking to myself. Hopefully this will help someone in the future. I got around the cookie problem by declaring the username and then grabbing the bbuserinfo using that username. I am also using init.php and not global.php. Everything seems to be working. All counts are being update, etc.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:04 PM.


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.05061 seconds
  • Memory Usage 2,286KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (6)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete