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)

zeropaid 03-18-2005 06:02 PM

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?

fly 06-01-2005 11:18 PM

Quote:

Originally Posted by SnitchSeeker
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? :))


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

Andreas 06-01-2005 11:36 PM

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)

fly 06-02-2005 12:45 PM

Quote:

Originally Posted by KirbyDE
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)

Sweet! Thanks man. That was it!

Wired1 06-02-2005 09:35 PM

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.

Andreas 06-02-2005 09:36 PM

What do you mwan with " make a menu within the admin panel."?

Wired1 06-02-2005 10:55 PM

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.

mtrac 08-23-2005 04:00 AM

Stupid question, but how do I put carriage returns in? \n doesn't work.

mtrac 08-24-2005 12:03 PM

Never mind. I just discovered the distinction between single and double quotes in PHP.

Wired1 09-02-2005 01:33 AM

kewlness

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


All times are GMT. The time now is 03:13 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.01072 seconds
  • Memory Usage 1,745KB
  • 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
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (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