vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   FORM to THREAD/ FORUM/ POLL/ PM/ EMAIL - CUSTOMIZABLE FORMS - Mod Apps, Orders, News. (https://vborg.vbsupport.ru/showthread.php?t=66082)

Erwin 07-09-2004 09:50 PM

Quote:

Originally Posted by Jolten
Wonderful hack!

After some modifying I'm getting a query for an uncached template. All I pretty much did was delete some radio buttons and the check for them and changed the two template names to two new custom templates. I'm having a real hard time finding what other template the script may be using other than STANDARD_ERROR.

Either way.. freakin' great hack Erwin. Thanks.

This file only uses the standard_error template.

Jolten 07-09-2004 09:56 PM

that's what I thought. hmmm.. Thanks Erwin.

Jolten 07-09-2004 10:18 PM

Okay help please... I've changed the three template names. The form works wonderfully.. but there's a query for an uncashed template.

PHP Code:

if ($action=="submit") {

if (
$answerall == "1") {
    if (
$answer1 == '' OR $answer2 == '' OR $longanswer1 == '')
    {
    
$errormessage "You need to answer every question, $bbuserinfo[username]!";
    eval(
'print_output("' fetch_template('flag_error') . '");');
    exit();
    }
}

    eval(
'$formsend = "' fetch_template('flag_answers') . '";');

    if (
$formforum == "1") {

                    
$DB_site->query("
                                INSERT INTO " 
TABLE_PREFIX "thread(title, lastpost, forumid, open, replycount,
                                postusername, postuserid, lastposter, dateline, iconid, visible, attach)
                                VALUES
                                        ('"
.addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle', " TIMENOW ", $formforumid,
                                         1, 0, '" 
addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid],
                                         '" 
addslashes($bbuserinfo['username']) . "', " TIMENOW ", 0, 1,
                                         0)
                        "
);
                
$thread['threadid'] = $DB_site->insert_id();
                
$DB_site->query("
                        INSERT INTO " 
TABLE_PREFIX "post
                                (threadid, title, username, userid, dateline, pagetext, allowsmilie,
                                 showsignature, iconid, visible)
                        VALUES
                                (
$thread[threadid], '".addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle',
                                 '" 
addslashes($bbuserinfo['username']) . "', $bbuserinfo[userid], " TIMENOW ",
                                 '" 
addslashes($formsend) . "', 1, 1,
                                 0, 1)
                "
);
                
$post['postid'] = $DB_site->insert_id();
                
$DB_site->query("
                                UPDATE " 
TABLE_PREFIX "thread
                                SET firstpostid = 
$post[postid]
                                WHERE threadid = 
$thread[threadid]
                        "
);
                
$DB_site->query("
                                UPDATE " 
TABLE_PREFIX "forum
                                SET replycount = replycount +  1,
                                " 
iif($type == 'thread''threadcount = threadcount + 1,') . "
                                lastpost = " 
TIMENOW ",
                                lastposter = '" 
addslashes($bbuserinfo['username']) . "',
                                lastthread = '"
.addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle',
                                lastthreadid = 
$thread[threadid]
                                WHERE forumid = 
$formforumid
                        "
);

    }


    if (
$formemail == "1") {
    
vbmail($formemailaddress$formtitle$formsend);
    }

    
$errormessage "The image has been flagged.";
    eval(
'print_output("' fetch_template('flag_error') . '");');
   exit();
}

eval(
'print_output("' fetch_template('flag') . '");');
?> 


mtha 07-10-2004 03:55 AM

Quote:

Originally Posted by Erwin
2. Posted as a reply in an existing thread of your choice

When reply to an existing thread, should thread counter and last poster be updated?


Look for
PHP Code:

    if ($formreply == "1") {
      
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$formreplythreadid','".addslashes(htmlspecialchars($bbuserinfo[username])).$formtitle','".addslashes($bbuserinfo[username])."','$bbuserinfo[userid]','".time()."','" addslashes($formsend) . "','$allowsmilie','$signature','$ipaddress','$iconid','1')"); 

Add after

PHP Code:

        $DB_site->query("UPDATE thread SET replycount = replycount + 1, lastpost = " TIMENOW ", lastposter = '".addslashes($bbuserinfo[username])."' WHERE threadid = $formreplythreadid"); 


Erwin 07-10-2004 07:10 AM

Thanks mtha - forgot to add that.

Update Version 1.2

Thread count and lastposter information now updated if form is sent to existing thread.

Zip file is updated.

To upgrade, just apply the changes in the post above.

Merjawy 07-10-2004 08:05 AM

Great hack Erwin.. will install soon I get my issues out of the way and upgrade

mtha 07-10-2004 06:20 PM

Quote:

Originally Posted by Erwin
Thanks mtha - forgot to add that.

Update Version 1.2

Thread count and lastposter information now updated if form is sent to existing thread.

Zip file is updated.

To upgrade, just apply the changes in the post above.

:)

this one is not important, but if you want, you can fix.

when sending a PM to user, and that user has option to display a pop-up for new PM, the pop-up isnt displayed.

T2DMan 07-13-2004 12:25 PM

Cool - this is going to be fun

Objective - each thread is a restaurant, users submit review, and review gets posted into that thread, with the data stored. Each thread shows survey to date, new survey form, and submitted reviews.

I'll report back when its all working.

Erwin 07-13-2004 12:32 PM

Quote:

Originally Posted by mtha
:)

this one is not important, but if you want, you can fix.

when sending a PM to user, and that user has option to display a pop-up for new PM, the pop-up isnt displayed.

Really? It does for me.

WAR 07-14-2004 07:44 PM

Quote:

Originally Posted by Erwin
Really? It does for me.

It doesn't pop the window up for me either but i wasn't worried about it.

Thanks again for this hack erwin, it has been invaluable for me as I've been building the site I am working on.


All times are GMT. The time now is 11:13 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.01587 seconds
  • Memory Usage 1,792KB
  • 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
  • (3)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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