Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #11  
Old 11-20-2002, 08:32 PM
joeschmoe's Avatar
joeschmoe joeschmoe is offline
 
Join Date: May 2002
Location: California
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #12  
Old 11-20-2002, 10:05 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #13  
Old 11-20-2002, 10:37 PM
joeschmoe's Avatar
joeschmoe joeschmoe is offline
 
Join Date: May 2002
Location: California
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #14  
Old 11-20-2002, 10:50 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #15  
Old 11-20-2002, 11:07 PM
joeschmoe's Avatar
joeschmoe joeschmoe is offline
 
Join Date: May 2002
Location: California
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #16  
Old 11-20-2002, 11:10 PM
joeschmoe's Avatar
joeschmoe joeschmoe is offline
 
Join Date: May 2002
Location: California
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<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 
Reply With Quote
  #17  
Old 11-20-2002, 11:19 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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;} 
Reply With Quote
  #18  
Old 11-21-2002, 08:15 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 
Reply With Quote
  #19  
Old 11-22-2002, 02:03 PM
joeschmoe's Avatar
joeschmoe joeschmoe is offline
 
Join Date: May 2002
Location: California
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #20  
Old 11-22-2002, 04:32 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.)
Attached Files
File Type: txt code.txt (2.3 KB, 6 views)
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:46 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.04518 seconds
  • Memory Usage 2,366KB
  • Queries Executed 12 (?)
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
  • (13)bbcode_php
  • (4)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
  • (2)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
  • (1)postbit_attachment
  • (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_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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete