vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   newthread.php - Preview or Actually Posting? (https://vborg.vbsupport.ru/showthread.php?t=74131)

Tekton 01-10-2005 11:41 AM

newthread.php - Preview or Actually Posting?
 
Hi. I'm trying to determine whether or not a thread is actually being created, or if it is just doing a preview of it.


Part of the newthread.php:
PHP Code:

else if ($newpost['preview'])
{
// ### PREVIEW POST ###
$postpreview process_post_preview($newpost);
$_REQUEST['do'] = 'newthread';
$newpost['message'] = htmlspecialchars_uni($newpost['message']);


I saw that, but that doesn't really seem like it's anything useful since it builds the post for the new thread before then anyways... or at least that's what it looks like to me.

sabret00the 01-10-2005 11:48 AM

look in the template for the variable i beleive it's $preview and that should provide you with your answer when you cross reference it with the newthread.php

Tekton 01-10-2005 11:57 AM

I think I found what you're refering too:

$postpreview

It's value seems to be the same regardless of whether it is previewing or posting however.

Tekton 01-11-2005 10:14 AM

Has anyone messed around with this type of thing before?

sabret00the 01-11-2005 11:31 AM

from what i can gather, it lets say $_POST[message] into the newthread.php from itself providing a kind of cache, as i've noticed if you edit the existing but click post on the preview it'll post the preview, basically theirs no query used to create the preview (well their shouldn't be unless vB know something i don't, i just can't see the purpose of caching the data in the database.

Tekton 01-11-2005 02:15 PM

Yeah it seems like the preview is just going to the same page again and then placing the $_POST[message] into a box, but I was hoping there would be a way to tell which it is before the post/thread gets added to the database...

sabret00the 01-11-2005 02:22 PM

can i ask why?

Tekton 01-11-2005 02:44 PM

Quote:

Originally Posted by sabret00the
can i ask why?

when a new thread is made in a specific forum, it adds more text onto the thread's post, and does some other things in the database. If they preview the post, it would run the same as posting the thread for real.


All times are GMT. The time now is 01:30 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.01689 seconds
  • Memory Usage 1,724KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete