vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Make moderated posts go into private forum instead of queue? (https://vborg.vbsupport.ru/showthread.php?t=45264)

joeschmoe 11-20-2002 08:32 PM

Ah - okay, I was looking in an original copy of the file. :) Forgive me, I'm new to this editing of the core files of the program.

On the replacement of the "X1", "X2", etc. with the forum ID numbers, I will eventually have about 35-50 forums. I am assuming I just continue the
PHP Code:

elseif ($forumid==Z1) {$forumid=Z2;} 

line for as many forums as I have, right?

And also, what do I replace the "W2" in this line with:
PHP Code:

else {$forumid=W2;} 

? Does the "W2" equal the main category/forum?

This is the format I am planning on:

-Main Category
--Forum 1
---Sub-Forum 1.1
----Sub-Forum 1.1 submitted questions
---Sub-Forum 1.2
----Sub-Forum 1.2 submitted questions
---Sub-Forum 1.3
----Sub-Forum 1.3 submitted questions
---etcetera, and so on
--Forum 2
---etcetera, and so on
-Second Category
--Forum 1b
---Sub-Forum 1b.1
----Sub-Forum 1b.1 submitted questions
---etcetera, and so on

You get the idea :) it will be a big forum with many sub-forums. So by my second question I mean in that "else" statement, does the "W2" variable just get replaced with the forum ID of the Main category the forums are in? Because there are two categories...I just don't want to flub this up. For a non-programmer, there's nothing worse than loading up the page and a jumble of code or error message popping up! :)

Thanks again for the help!

Logician 11-20-2002 10:05 PM

Quote:

Originally posted by joeschmoe
On the replacement of the "X1", "X2", etc. with the forum ID numbers, I will eventually have about 35-50 forums. I am assuming I just continue the
PHP Code:

elseif ($forumid==Z1) {$forumid=Z2;} 

line for as many forums as I have, right?

yep just continue like that..

Quote:

And also, what do I replace the "W2" in this line with:
PHP Code:

else {$forumid=W2;} 

? Does the "W2" equal the main category/forum?
If you did everything correct, this line will never needed nor run. It's just your insurance. If you edited some forumid's wrong, this line will save thread to forum W2 so there will not be any weird issues or orphaned threads in your db. even if you didnt apply the hack correctly.

So in other words just use any forumid there. Eg. An admin only forum will be a good start.

joeschmoe 11-20-2002 10:37 PM

Cool - so I've added the lines of code, created two of the "submitted question subforums", edited the "X1", "X2", etc.

Hopefully this is my last question: In this line of code:
PHP Code:

if ($foruminfo['moderatenew']!=0) {$oldforumid=$forumid;$forumid=X;} 

what is "X"?

-----

Also, do I just copy and paste these in, or do I follow the format of the if-then-else statements (two spaces indentation, etc.) elsewhere in the file?

Before uploading this new file I want to make sure it's all okay. :)

Logician 11-20-2002 10:50 PM

Quote:

Originally posted by joeschmoe
Hopefully this is my last question: In this line of code:
PHP Code:

if ($foruminfo['moderatenew']!=0) {$oldforumid=$forumid;$forumid=X;} 

what is "X"?

I guess you mean "what WAS X"? Because we don't use this line anymore. You are supposed to replace this line with the new code I provided.

You'd better post here what you applied to your script and let's see if it's correct.

joeschmoe 11-20-2002 11:07 PM

Okay, here goes:
PHP Code:

      if ($foruminfo['moderatenew']!=0) {$oldforumid=$forumid;$forumid=X;}
      
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($subject))."','".time()."','$forumid','1','0','".addslashes($postusername)."','$bbuserinfo[userid]','".addslashes($postusername)."','".time()."','$iconid','$visible','$attachcount')");
      
$threadid=$DB_site->insert_id();

      
// subscribe to thread
      
if ($email and $bbuserinfo['userid']!=0) {
        if (!
$checkid=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE userid=$bbuserinfo[userid] AND threadid=$threadid")) {
          
$DB_site->query("INSERT INTO subscribethread (subscribethreadid,userid,threadid) VALUES (NULL,$bbuserinfo[userid],$threadid)");
        }
      }

      
/*if ($bbuserinfo[userid]==0) {
        $postusername=$bbuserinfo[username];
      } else {
        $postusername="";
      }*/
      // create first post
      
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($subject))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','1')");
      
$postid=$DB_site->insert_id();

      
indexpost($postid,1);
      if (
$foruminfo['moderatenew']!=0) { 
        
$oldforumid=$forumid
          
// *****************  start of moderation forum queue hack
          
if ($forumid==48) {$forumid=53;} // Nitro TC - chassis & handling
            
elseif ($forumid==49) {$forumid=54;} // Nitro TC - engines & speed
            
elseif ($forumid==Z1) {$forumid=Z2;} 
            elseif (
$forumid==Y1) {$forumid=Y2;} 
            elseif (
$forumid==Z1) {$forumid=Z2;} 
            else {
$forumid=55;} // this is the error forum - if posts do not go into the right forum they will go into this forum
          
}
      
// update forum stuff 

The line with the variable "X" in it was from your first reply, I thought I was supposed to use that line still.

joeschmoe 11-20-2002 11:10 PM

<I'm not sure what's happening, I've tried replying a couple of times and my posts keep coming up in the wrong order...I think the moderators changed the time on the server, which is throwing off the posting queue>

Yah, okay, I forgot to change the Z1, Z2, etc., variables, I should have commented those out before pasting them in my post. :)

I've been trying to follow the directions but it's a little hard for me I guess since I'm not familiar with the coding - is this right, then?
PHP Code:

// *****************  start of moderation forum queue hack
if ($foruminfo['moderatenew']!=0

$oldforumid=$forumid
                   if (
$forumid==48) {$forumid=53;} // Nitro TC - chassis & handling
            
elseif ($forumid==49) {$forumid=54;} // Nitro TC - engines & speed
            //elseif ($forumid==Z1) {$forumid=Z2;} 
            //elseif ($forumid==Y1) {$forumid=Y2;} 
            //elseif ($forumid==Z1) {$forumid=Z2;} 
            
else {$forumid=55;} // this is the error forum - if posts do not go into the right forum they will go into this forum
          
}
      
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($subject))."','".time()."','$forumid','1','0','".addslashes($postusername)."','$bbuserinfo[userid]','".addslashes($postusername)."','".time()."','$iconid','$visible','$attachcount')");
      
$threadid=$DB_site->insert_id();

      
// subscribe to thread
      
if ($email and $bbuserinfo['userid']!=0) {
        if (!
$checkid=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE userid=$bbuserinfo[userid] AND threadid=$threadid")) {
          
$DB_site->query("INSERT INTO subscribethread (subscribethreadid,userid,threadid) VALUES (NULL,$bbuserinfo[userid],$threadid)");
        }
      }

      
/*if ($bbuserinfo[userid]==0) {
        $postusername=$bbuserinfo[username];
      } else {
        $postusername="";
      }*/
      // create first post
      
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($subject))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','1')");
      
$postid=$DB_site->insert_id();

      
indexpost($postid,1);
if (
$foruminfo['moderatenew']!=0) {$forumid=$oldforumid;}
      
// update forum stuff 


Logician 11-20-2002 11:19 PM

no your code is wrong. Please read the instructions carefully. You are supposed to replace the line:

PHP Code:

if ($foruminfo['moderatenew']!=0) {$oldforumid=$forumid;$forumid=X;} 

with the new code.

Also u should NOT touch that part:
Quote:

if ($foruminfo['moderatenew']!=0) {$forumid=$oldforumid;}
Besides you have to enter all ids one by one, it seems that you forget to edit z1, y1, z2 y2 parts in :

PHP Code:

if ($forumid==48) {$forumid=53;} // Nitro TC - chassis & handling
            
elseif ($forumid==49) {$forumid=54;} // Nitro TC - engines & speed
            
elseif ($forumid==Z1) {$forumid=Z2;} 
            elseif (
$forumid==Y1) {$forumid=Y2;} 
            elseif (
$forumid==Z1) {$forumid=Z2;} 


Logician 11-21-2002 08:15 AM

This code should work:

PHP Code:

// *****************  start of moderation forum queue hack
if ($foruminfo['moderatenew']!=0

$oldforumid=$forumid
                   if (
$forumid==48) {$forumid=53;} // Nitro TC - chassis & handling
            
elseif ($forumid==49) {$forumid=54;} // Nitro TC - engines & speed
            //elseif ($forumid==Z1) {$forumid=Z2;} 
            //elseif ($forumid==Y1) {$forumid=Y2;} 
            //elseif ($forumid==Z1) {$forumid=Z2;} 
            
else {$forumid=55;} // this is the error forum - if posts do not go into the right forum they will go into this forum
          
}
      
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($subject))."','".time()."','$forumid','1','0','".addslashes($postusername)."','$bbuserinfo[userid]','".addslashes($postusername)."','".time()."','$iconid','$visible','$attachcount')");
      
$threadid=$DB_site->insert_id();

      
// subscribe to thread
      
if ($email and $bbuserinfo['userid']!=0) {
        if (!
$checkid=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE userid=$bbuserinfo[userid] AND threadid=$threadid")) {
          
$DB_site->query("INSERT INTO subscribethread (subscribethreadid,userid,threadid) VALUES (NULL,$bbuserinfo[userid],$threadid)");
        }
      }

      
/*if ($bbuserinfo[userid]==0) {
        $postusername=$bbuserinfo[username];
      } else {
        $postusername="";
      }*/
      // create first post
      
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($subject))."','".addslashes($postusername)."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','1')");
      
$postid=$DB_site->insert_id();

      
indexpost($postid,1);
if (
$foruminfo['moderatenew']!=0) {$forumid=$oldforumid;}
      
// update forum stuff 


joeschmoe 11-22-2002 02:03 PM

Thanks Logician,

I copied and pasted your code above in my newthread.php using Notepad (to keep the formatting correct, Wordpad messed it up), then tried posting as a guest in my forum and got "Parse error: parse error on line 449"

I've attached the newthread.php file, could you look at it and see what may be messed up? I'm pretty sure I pasted it in correctly.

<file deleted per post below>

Logician 11-22-2002 04:32 PM

1 Attachment(s)
This is because you inserted the hack code into the wrong section in the first place. Now follow me and please proceed carefully:
1- Revert back to your original newthread.php
2- find:
PHP Code:

  if ($postpoll) {
         
$visible 0;
      } 

3- Delete the section starting from there until :
PHP Code:

 // update forum stuff 

4- Now insert this code into the part you deleted

(Btw. please remove your file from the post above. Site rules do not allow posting of entire vb files here.)


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