Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #81  
Old 01-22-2005, 09:39 AM
SnitchSeeker's Avatar
SnitchSeeker SnitchSeeker is offline
 
Join Date: Sep 2004
Posts: 112
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to pass the last thread's id from build_new_post? I currently have this: (just a snippet)
PHP Code:
    build_new_post('thread'$foruminfo, array(), 0$post$errors); 

    
$DB_site->query("
            INSERT INTO fp_news_info
                (threadid, avatar, summary)
            VALUES
                (
$threadinfo[threadid], '$news[avatar]', '$news[summary]')
    "
); 
It's not passing the $threadinfo[threadid] variable. I used to insert it directly into the database, but I want a cleaner version. So I modified build_new_post function and added a new variable. So now it would say:
PHP Code:
function build_new_post($type 'thread'$foruminfo$threadinfo$parentid, &$post, &$errors$news
Then an if news exist check, and my previous sql code. However I'm not very sure if this won't bug current posting? Because previously with build_new_post code it'd post, now it just gives a blank page. I need to add the $news variable or it won't work. Regular posting and topic creating is working as far as I can see, but I want to be sure if this is in fact going to work... (did that make sense? )
Reply With Quote
  #82  
Old 01-23-2005, 11:32 AM
SnitchSeeker's Avatar
SnitchSeeker SnitchSeeker is offline
 
Join Date: Sep 2004
Posts: 112
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump. Anyone?
Reply With Quote
  #83  
Old 02-16-2005, 06:09 AM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #84  
Old 02-16-2005, 06:30 PM
fly fly is offline
 
Join Date: Oct 2003
Posts: 1,215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #85  
Old 02-17-2005, 04:29 AM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by flypaper
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?
Do the submissions go into a moderation queue or just straight in? Got a link?

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.
Reply With Quote
  #86  
Old 02-17-2005, 04:44 AM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #87  
Old 02-17-2005, 06:42 AM
Wired1's Avatar
Wired1 Wired1 is offline
 
Join Date: Nov 2003
Location: Orlando, FL, USA
Posts: 1,361
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #88  
Old 02-17-2005, 01:19 PM
Hoffi's Avatar
Hoffi Hoffi is offline
 
Join Date: Nov 2001
Location: Germany
Posts: 342
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #89  
Old 02-18-2005, 11:14 AM
fly fly is offline
 
Join Date: Oct 2003
Posts: 1,215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by flypaper
The threads go straight into the forum. Link to the hackjob is http://uselessforums.com/submitnews.php

And I was talking in the Ucash/Ushop forum yesterday and someone mentioned PMing a member after they were 'theifed'. I liked the idea and tried to poke around and see if there was a function to send PMs like creating threads, but couldn't find one.
Hmmm. Looks like there isn't a function to do it, but these DB queries do:

PHP Code:
$DB_site->query("INSERT INTO " TABLE_PREFIX "pmtext\n\t(fromuserid, fromusername, title, message, touserarray, iconid, dateline, showsignature, allowsmilie)\nVALUES\n\t($bbuserinfo[userid], '" addslashes($bbuserinfo['username']) . "', '$title', '$message', '" addslashes(serialize($tostring)) . "', $iconid, " TIMENOW ", $signature$disablesmilies)"); 
PHP Code:
$DB_site->query("INSERT INTO " TABLE_PREFIX "pm (pmtextid, userid, folderid, messageread) VALUES ($pmtextid$bbuserinfo[userid], -1, 1)"); 
PHP Code:
$DB_site->shutdown_query("UPDATE " TABLE_PREFIX "user SET pmtotal=pmtotal+1 WHERE userid=$bbuserinfo[userid]"); 
Can anyone explain how I pass whatever is needed in these queries and/or what the queries are exactly doing?

edit: I should probably start a new thread.
Reply With Quote
  #90  
Old 02-23-2005, 06:46 AM
zeropaid's Avatar
zeropaid zeropaid is offline
 
Join Date: Nov 2004
Location: San Diego, CA
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
# Do forum stuff


 chdir('/usr/local/www/htdocs/bbs');

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

if ($_POST[news_user_id] == 0 || !$_POST[news_user_id]) {
        $userid = 1;
} else {
        $userid = 1;
}

//$userid = $_POST[news_user_id]; // The user creating the thread
$forumid = 120; // The forum where the thread should be posted

// Get forum & user info
$foruminfo = fetch_foruminfo($forumid);
$bbuserinfo = fetch_userinfo($userid);

print_r($bbuserinfo);


// Setup the thread
$post[title] = $title;
$post[message] = $article;
$post[poststarttime] = TIMENOW;
$post[posthash] = md5($post[poststarttime] . $bbuserinfo['userid'] . $bbuserinfo['salt']);
$post[emailupdate] = 9999;

// build the thread
build_new_post('thread', $foruminfo, array(), 0, $post, $errors);

// Errors?
if (sizeof($errors) > 0) {
  ?>There have been errors. <?=$errors?><?
  print_r($errors);
  die('errors');
}

$ThreadID = $post['threadid'];
$PostID = $post['postid'];

print ("the threadid is $ThreadID and the postid is $PostID");
Reply With Quote
Reply

Thread Tools
Display Modes

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:57 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04307 seconds
  • Memory Usage 2,279KB
  • 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
  • (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
  • (4)pagenav_pagelink
  • (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