View Single Post
  #257  
Old 03-12-2006, 12:52 PM
dkendall dkendall is offline
 
Join Date: Mar 2006
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's another mod I've made to this hack.

In wrestling with getting it working, I needed to blow away my vBulletin threads/posts several times, and re-import everything from USENET. Since some of the postings originated in vBulletin, it was skipping them (which was mucking up the threading).

Locate the whole if (trim($message['user-agent'])... block of code in gateway.php and tweak it as follows:

Code:
	$skip_post = 0;

	if (trim($message['user-agent']) == trim($nntp_settings['useragent'])
		AND $nntp_settings['organization_check'] == 0)
	{
		if ($nntp_settings['full_import_from_usenet'] == 0) {
			logging("Skip, post was sent from our forum.");
			$skip_post = 1;
		}
	}
	else if (trim($message['user-agent']) == trim($nntp_settings['useragent'])
		AND $nntp_settings['organization_check'] == 1
		AND trim($message['organization']) == trim($nntp_settings['organization']))
	{
		//added organization so that we don't skip fellow gateway's posts
		if ($nntp_settings['full_import_from_usenet'] == 0) {
			logging("Skip, post was sent from our forum.");
			$skip_post = 1;
		}
	}
	else if (stristr(trim($message['x-no-archive']), 'yes') AND
		isset($nntp_settings['honor_no-archive']) AND
		$nntp_settings['honor_no-archive'] != 0)
	{
		logging("Skip, X-No-Archive headers is set.");
	}
	elseif ($nntp['grouptype'] == 'mail'
		AND $group['prefix']
		AND stristr($message['subject'], $group['prefix']) == false)
	{
		logging("Skip, not matching prefix: \"" . $group['prefix'] . "\"");
	}

	if(!$skip_post)
	{
	   $kf = killfile_match();
In AdminCP go the to NNTP Gateway Settings, click the Add a New Setting button, and add this:

Code:
	Title: Full import from USENET
	Varname: full_import_from_usenet
	Value: 0
	Description: Override useragent and organization checks to import absolutely everything from USENET.
In order to use this feature, you have to:
  1. Enable it by setting the full_import_from_usenet value to 1.
  2. Delete everything from the thread and post tables in the vBulletin database (selectively, if you want to re-import only certain newsgroups or posts).
  3. In AdminCP go to NNTP Gateway Newsgroups and set the Last message number to zero (or some appropriate value).
  4. Run Update Counters and rebuild the thread and forum information, and Update Post Counts.
  5. Run gateway.php script.
  6. Reset the full_import_from_usenet value to zero.
David
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01331 seconds
  • Memory Usage 1,770KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete