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)
-   -   NNTP Gateway for Usenet ( Newsgroups ), Mailing Lists (https://vborg.vbsupport.ru/showthread.php?t=65152)

krohnathlonman 06-25-2005 07:52 PM

I'm working on the mods to make this work with 3.5 and I've found where the post table has changed a bit so I'm working on getting things working right with that...

All DB queries have changed and the globalize has changed..... so it is a decent amount of work to get this working

mcncyo 06-26-2005 01:27 AM

Quote:

Originally Posted by xnt
For Unix you can set up a cron job and use the 4.3.11 PHP CGI program to run gateway.php.
eg: this will run every 10 mins
1,11,21,31,41,51 * * * * /path-to-php4.3.11/php-4.3.11 -f /path-to-script/gateway.php



it didn't work it just output the html to the display
Quote:


-bash-2.05b# /usr/local/php4-cgi/bin/php -f /home/website/www/forum/gateway.php4

<html dir="" lang="">
<head>
<title>My Christian Network's christian forum</title>


</head>
<body>


<br />
<br />
<br />

<table class="tborder" cellpadding="" cellspacing="" border="0" width="70%" align="center">
<tr>
<td class="tcat"></td>
</tr>
<tr>
<td class="panelsurround" align="center">
<div class="panel">
<div align="">


<!-- main error message -->


<blockquote><p>Unable to add cookies, header already sent.<br />
File: <br />
Line: 0<br /></p></blockquote>


<!-- / main error message -->


</div>
</div>
<!--
<div style="margin-top:px">
<input type="submit" class="button" value="" accesskey="s" onclick="history.back(1); return false" />
</div>
-->
</td>
</tr>
</table>

<br />


<!-- forum jump -->
<table cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<td></td>
</tr>
</table>
<!-- / forum jump -->


<br />



</body>
</html>

krohnathlonman 06-26-2005 08:10 PM

I got parts of the import functioning on 3.5... it appears to grab the text but attatchments and debugging output aren't working and I haven't had the time to do any further testing.

The main thing I need for my new project is the inline mod tools and attatchments... I've decided to stick with 3.0.7 and do the inline mod hack and stay there.

Electronic Punk 06-28-2005 07:17 AM

ah well :(

yellowchaser 06-28-2005 02:43 PM

Is there a way to have the username display as something other than "Guest" to something like "UseNet User" instead when posts are imported in from the newsgroups. Without changing the default guest account on VB. I know this sounds trivial but I have actually had people complain that it makes them look like they posted from the site rather than the usenet group.

Kadence 06-29-2005 03:27 AM

Tremendous mod :)

Only problem is the speed. I seem to be getting only about 3,500 posts/hour, whereas it takes under a minute to download that number through NNTP on a newsreader. But I suppose that's probably because of the vBulletin database functions taking up a lot of time, rather than the download of articles itself...?

Anyway, a very helpful mod, and much appreciated.

I see some people here having problems posting with Giganews; not being able to upload articles to Usenet (error code 440). If you have just signed up with them, this is because of the free trial period?during the free trial period, you can download articles, but you can't post; they say it's because of preventing spam. You have to manually bypass the trial period in order to be able to post right away.

krohnathlonman 06-29-2005 04:01 AM

kadence, the biggest issue you'll have with the speed is how fast your hard drives are. Inserting loads of data will take fast drives housing your MySQL servers. I suggest at least 10k SCSI drives with 15k obviously being faster.

xnt 07-01-2005 04:39 AM

Quote:

Originally Posted by mcncyo
it didn't work it just output the html to the display

I believe you must be using PHP <= 4.3.10. In this case, just take out the -f option and use something like:

1,11,21,31,41,51 * * * * cd $HOME/forum; php gateway.php > $HOME/tmp/null

Kadence 07-06-2005 08:29 AM

After a lot more work than I expected :speechless:, I was able to modify this so that it works with 3.5 Beta 3.

What I did:
  • Replace $DB_site with $db in gateway.php, nntp_groups.php, nntp_settings.php, and functions_nntp.php.
  • In those same files, replace all instances of globalize( with $vbulletin->input->clean_array_gpc( ; and the tricky part: alter $_GET, $_POST, and $_REQUEST parameter inputs within clean_array_gpc to 'g', 'p', and 'r' respectively; and change the variable calls from $variablename to $vbulletin->GPC['variablename'].

Note that altering nntp_groups.php isn't entirely necessary, as the nttp_groups table can be directly modified via phpMyAdmin.

In nntp_settings.php the affected lines (in terms of the original line numbers) are around lines 92, 107, 141, 192, and 223. In nntp_groups.php the lines are around 324, 336, 368, 414, and 451.

Rather than replace all variable instances with $vbulletin->GPC['...'] calls, I just set new variables with the same names as the old ones, using $vBulletin->GPC['...']. e.g., add the line $ngid = $vBulletin->GPC['ngid'] right after the clean_array_gpc call; the variable $ngid can then be used the same as before.

One thing that gave me a bit of trouble was line 241 (in my modified file, line 263) of nntp_groups.php. In this line $group[?forum?] must be changed to ?forum?. Otherwise the form variable name comes up as ?0? on the post form, rather than ?forum?; and thus the table update doesn't work.

Note that I made a change to gateway.php line 71, and I'm not sure if it was complete; this would affect the 'log' and 'debug' variables, but those don't seem to be used anywhere that I could find.

The 4 files that were changed (nntp_groups.php, nntp_settings.php, gateway.php, and functions_nntp.php) are attached in .zip format. Note that I did not test thoroughly, so "Use at your own risk" warnings apply!

To add a menu item in the admin control panel, copy the file "cpnav_nntp_gateway.xml" to the /includes/xml directory.

Kadence 07-06-2005 09:31 PM

Ah, duh?$debug is used when passing ?debug=1 in from the URL ;) Without it the logging() function doesn't work.

So I added the following lines after line 71 in gateway.php:
PHP Code:

$log $vbulletin->GPC['log'];
$debug $vbulletin->GPC['debug']; 

The .zip file in the post above has been updated.


All times are GMT. The time now is 05:48 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.01966 seconds
  • Memory Usage 1,753KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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