vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Usenet gateway (https://vborg.vbsupport.ru/showthread.php?t=7100)

george_proost 07-01-2001 01:41 PM

Just downloaded and activated basic setup. Exactly what I need.

HOWEVER... I get a

parse error on usenet.php on line 378

also

Warning: GLOBAL variable declaration meaningless in main() scope in /xx/xx/xx/admin/usenet.php on line 353


trying to do the administration ??

are these known errors. Or probably, have I missed something.


Could it have something to do with needing to insert xtra \\s in some SQL inserts?


Does the newnews.pl need to run first? before I do admin.


:confused:

webhost 07-03-2001 12:59 PM

I am installing some of the options with this hack. I have installed 3 or 4 of them. 2 questions; First
I installed the stat's hack in stats.php, but when I go to the admin control panel and view stat's it does not show usenet stat's I then looked in drop down menu and there was not a selection to choose them. I also installed the hack that separtes the board post from the usenet post. Would this have something to do with them not showing up on the stat's page or to do I have to place a command in one of templates for this?
Second Question.
I want to add the last active thread option, Before I do I would like someone to look at code below and make sure I'm putting it in the right place. Area's I am going to place are in bold and state before this to the side.

8) Populating of last active thread in the forum table. This can then be referenced in templates by using $forum[lastactivethread].
a) admin/functions.php - line 1022

if ($newwords) {
$newwords=trim($newwords);
$insertwords="(NULL,'".str_replace(" ","'),(NULL,'",addslashes($newwords))."')";
$DB_site->query("INSERT IGNORE INTO word (wordid,title) VALUES $insertwords");
$selectwords="title IN('".str_replace(" ","','",addslashes($newwords))."')";
$DB_site->query("INSERT IGNORE INTO searchindex (wordid,postid) SELECT DISTINCT wordid,$postid FROM word WHERE $selectwords");
} ===before this====

if ($newtitlewords) {
$newtitlewords=trim($newtitlewords);
$insertwords="(NULL,'".str_replace(" ","'),(NULL,'",addslashes($newtitlewords))."') ";
$DB_site->query("INSERT IGNORE INTO word (wordid,title) VALUES $insertwords");
$selectwords="title IN('".str_replace(" ","','",addslashes($newtitlewords))."')";
$DB_site->query("REPLACE INTO searchindex (wordid,postid,intitle) SELECT DISTINCT wordid,$postid,1 FROM word WHERE $selectwords");
}
}===before this===

// ###################### Start makeforumjump #######################

b) admin/functions.php - line 1577

$DB_site->query("DELETE FROM thread WHERE threadid='$threadid'");
$DB_site->query("DELETE FROM thread WHERE open=10 AND pollid='$threadid'"); // delete redirects
$DB_site->query("DELETE FROM threadrate WHERE threadid='$threadid'");
$DB_site->query("DELETE FROM subscribethread WHERE threadid='$threadid'");
}
}===before this====
// ###################### Start delete post #######################

c) admin/functions.php - line 1599

$DB_site->query("DELETE FROM searchindex WHERE postid=$postid");
$DB_site->query("DELETE FROM post WHERE postid='$postid'");
}
}===before this===

// ###################### Start make login code #######################

d) admin/functions.php - New function at end of file.

//searches expire after a week:
$DB_site->query("DELETE FROM search WHERE dateline<".(time()-(7*24*60*60)));
}

// bye bye!
}===before this====
?>

This is where I put the hack in stats.php

$from = mktime(12,0,0,$frommonth,$fromday,$fromyear);

//START USENET HACK
if (($type == "post" || $type == "thread") && $showusenetpostsinstats==0) {
$stats = $DB_site->query("SELECT COUNT(*), DATE_FORMAT(FROM_UNIXTIME($field),'$sqlformat') AS timeframe, MAX($field) FROM $table WHERE $field > '$from' AND $field < '$to' AND isusenetpost=0 GROUP BY timeframe ORDER BY $field $sort");
} else { $stats = $DB_site->query("SELECT COUNT(*), DATE_FORMAT(FROM_UNIXTIME($field),'$sqlformat') AS timeframe, MAX($field) FROM $table WHERE $field > '$from' AND $field < '$to' GROUP BY timeframe ORDER BY $field $sort"); }
//END USENET HACK
unset($totals);
unset($dates);
unset($sum);
while ($stat = $DB_site->fetch_array($stats)) {
$totals[] = $stat[0];
if ($stat[0]>$max) {
$max=$stat[0];

v0n 07-03-2001 02:44 PM

Houston, we have a problem...

Just moved my forums to new server, installed perl 5.6, MySQL 3.23.38, all modules required, installed usenet hack and...

- VBB shows thread titles but no posts inside them.
- All usenet posts retrieved from the server in database have threadid=0

Here's what I did so far:

Manualy compiled all the modules once again with versions as posted in this thread
Once again installed Bundle::CPAN and all the required modules matching CPAN version.

Still the same - all posts are inserted to database with threadid=0 and don't appear under threads in VBB...

fastforward 07-03-2001 05:51 PM

Quote:

Originally posted by webhost
I am installing some of the options with this hack. I have installed 3 or 4 of them. 2 questions; First
I installed the stat's hack in stats.php, but when I go to the admin control panel and view stat's it does not show usenet stat's I then looked in drop down menu and there was not a selection to choose them. I also installed the hack that separtes the board post from the usenet post. Would this have something to do with them not showing up on the stat's page or to do I have to place a command in one of templates for this?
Second Question.
I want to add the last active thread option, Before I do I would like someone to look at code below and make sure I'm putting it in the right place. Area's I am going to place are in bold and state before this to the side.

8) Populating of last active thread in the forum table. This can then be referenced in templates by using $forum[lastactivethread].
a) admin/functions.php - line 1022

if ($newwords) {
$newwords=trim($newwords);
$insertwords="(NULL,'".str_replace(" ","'),(NULL,'",addslashes($newwords))."')";
$DB_site->query("INSERT IGNORE INTO word (wordid,title) VALUES $insertwords");
$selectwords="title IN('".str_replace(" ","','",addslashes($newwords))."')";
$DB_site->query("INSERT IGNORE INTO searchindex (wordid,postid) SELECT DISTINCT wordid,$postid FROM word WHERE $selectwords");
} ===before this====

if ($newtitlewords) {
$newtitlewords=trim($newtitlewords);
$insertwords="(NULL,'".str_replace(" ","'),(NULL,'",addslashes($newtitlewords))."') ";
$DB_site->query("INSERT IGNORE INTO word (wordid,title) VALUES $insertwords");
$selectwords="title IN('".str_replace(" ","','",addslashes($newtitlewords))."')";
$DB_site->query("REPLACE INTO searchindex (wordid,postid,intitle) SELECT DISTINCT wordid,$postid,1 FROM word WHERE $selectwords");
}
}===before this===
Correct.
Quote:

// ###################### Start makeforumjump #######################

b) admin/functions.php - line 1577

$DB_site->query("DELETE FROM thread WHERE threadid='$threadid'");
$DB_site->query("DELETE FROM thread WHERE open=10 AND pollid='$threadid'"); // delete redirects
$DB_site->query("DELETE FROM threadrate WHERE threadid='$threadid'");
$DB_site->query("DELETE FROM subscribethread WHERE threadid='$threadid'");
}
}===before this====
Correct.
Quote:

// ###################### Start delete post #######################

c) admin/functions.php - line 1599

$DB_site->query("DELETE FROM searchindex WHERE postid=$postid");
$DB_site->query("DELETE FROM post WHERE postid='$postid'");
}
}===before this===
Correct.
Quote:

// ###################### Start make login code #######################

d) admin/functions.php - New function at end of file.

//searches expire after a week:
$DB_site->query("DELETE FROM search WHERE dateline<".(time()-(7*24*60*60)));
}

// bye bye!
}===before this====
?>
WRONG!
It is a NEW function. Add it after the brace but before the php close
Quote:

This is where I put the hack in stats.php

$from = mktime(12,0,0,$frommonth,$fromday,$fromyear);

//START USENET HACK
if (($type == "post" || $type == "thread") && $showusenetpostsinstats==0) {
$stats = $DB_site->query("SELECT COUNT(*), DATE_FORMAT(FROM_UNIXTIME($field),'$sqlformat') AS timeframe, MAX($field) FROM $table WHERE $field > '$from' AND $field < '$to' AND isusenetpost=0 GROUP BY timeframe ORDER BY $field $sort");
} else { $stats = $DB_site->query("SELECT COUNT(*), DATE_FORMAT(FROM_UNIXTIME($field),'$sqlformat') AS timeframe, MAX($field) FROM $table WHERE $field > '$from' AND $field < '$to' GROUP BY timeframe ORDER BY $field $sort"); }
//END USENET HACK
unset($totals);
unset($dates);
unset($sum);
while ($stat = $DB_site->fetch_array($stats)) {
$totals[] = $stat[0];
if ($stat[0]>$max) {
$max=$stat[0]; [/B]
The stats option doesn't actually add a new option. I think there may be a typo. I believe it actually shows the usenet posts UNLESS you apply this option. The next version will provide more options for stats.

fastforward 07-03-2001 05:55 PM

Quote:

Originally posted by v0n
Houston, we have a problem...

Just moved my forums to new server, installed perl 5.6, MySQL 3.23.38, all modules required, installed usenet hack and...

- VBB shows thread titles but no posts inside them.
- All usenet posts retrieved from the server in database have threadid=0

Here's what I did so far:

Manualy compiled all the modules once again with versions as posted in this thread
Once again installed Bundle::CPAN and all the required modules matching CPAN version.

Still the same - all posts are inserted to database with threadid=0 and don't appear under threads in VBB...

Looks like you're having the same problem as chrome. As you know, a couple of people have seen this problem but have fixed it by upgrading their modules. See if you can get in touch with chrome and see if he's found the problem.

webhost 07-03-2001 08:11 PM

fastforward:
ok I got all the code in place for the lastactivethread and I placed on the following location in the forumdisplaybit template but it still not showup on the opening page in my forums. Can you direct me on where I am going wrong below is the script. I have tried $forum, $forum2, and $thread in front of [lastactivethread] but none work.

<tr align="center">
<td bgcolor="#DFDFDF"><img src="images/$thread[newoldhot].gif" border="0" alt=""></td>
<td bgcolor="#DFDFDF">$thread[icon]</td>
<td bgcolor="#F1F1F1" align="left" width="100%"><normalfont>$thread[gotonew] $paperclip$thread[movedprefix]$thread[typeprefix]<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]">$thread[title]</a></normalfont> <smallfont>$thread[pagenav]</smallfont></td>
<td align="right"bgcolor="#DFDFDF" nowrap><smallfont>

$forum[lastactivethread]

$thread[firstpostdate] $thread[firstposttime]<br>by <b>$thread[postedby]</b></smallfont></td>
<td bgcolor="#F1F1F1"><normalfont>
<a href="javascript:who($thread[threadid])">$thread[replycount]</a>
</normalfont></td>
<td bgcolor="#DFDFDF"><normalfont>$thread[views]</normalfont></td>
$threadrating
<td bgcolor="$backcolor">
<table cellpadding="0" cellspacing="0" border="0"><tr>
<td rowspan="2" nowrap><a href="showthread.php?s=$session[sessionhash]&goto=lastpost&threadid=$thread[threadid]"><img src="images/lastpost.gif" border="0" alt="Go to last post"></a>&nbsp;</td>
<td nowrap><smallfont>$thread[lastreplydate] <smallfont color="#666686">$thread[lastreplytime]</smallfont></smallfont></td>
</tr><tr>
<td nowrap><smallfont>by <a href="member.php?action=getinfo&find=lastposter&th readid=$thread[threadid]"><b>$thread[lastposter]</b></a></smallfont></td>
</tr></table>
</td>
</tr>

george_proost 07-03-2001 08:18 PM

An excellent hack, but as per my previous post. I don't understand where it goes wrong. The admin function does it's job ok... but I get those errors mentioned... any pointers please.
I'm willing of course to do legwork.

I loaded the version from the top, 2 days ago. Perl things in place...etc. Please I need the base to work before I apply the other hacks.

I'm a mainframe guy :o

T.I.A.

George

see the urgency of this need requirement at this site

The USENET Forums are currently hidden.

fastforward 07-03-2001 08:25 PM

Quote:

Originally posted by george_proost
Just downloaded and activated basic setup. Exactly what I need.

HOWEVER... I get a

parse error on usenet.php on line 378

also

Warning: GLOBAL variable declaration meaningless in main() scope in /xx/xx/xx/admin/usenet.php on line 353


trying to do the administration ??

are these known errors. Or probably, have I missed something.


Could it have something to do with needing to insert xtra \\s in some SQL inserts?


Does the newnews.pl need to run first? before I do admin.


:confused:

I have never seen this error before and the usenet.php file has not been changed for months. What does your line 378 say?

george_proost 07-03-2001 08:31 PM

cpfooter();

if ($action=="manual") {
if ($mode=="Delete") {
foreach ($lostmsgid as $i){
$DB_site->query("DELETE FROM usenet_article WHERE msgid='" . addslashes($i) . "'");
}
echo "Message(s) Deleted<br><br>";
}
if ($mode=="Insert into thread") {

//$num_rows = $DB_site->num_rows($threadmsgids);
if ($threadmsgids=$DB_site->query("SELECT msgid,ord FROM post WHERE threadid=$threadid ORDER BY dateline LIMIT 1")){
$thread=$DB_site->fetch_array($threadmsgids);
$threadmsgid = $thread["msgid"];
$ord = $thread["ord"]; // most likely 0
foreach ($lostmsgid as $i){
$DB_site->query("UPDATE usenet_article SET refs='" . addslashes($threadmsgid) . "', ord=$ord, manual=1 WHERE msgid='" . addslashes($i) . "'");
$DB_site->query("INSERT IGNORE INTO usenet_ref (msgid,ref) VALUES ('" . addslashes($i) . "','" . addslashes($threadmsgid) . "')");
}
echo "Messages inserted.<br><br>";
}
else { echo "Thread was not found or not specified. Please go back and select a valid thread.";}
}
if ($mode=="New Threads") {
foreach ($lostmsgid as $i){
$subjects=$DB_site->query("SELECT subject FROM usenet_article WHERE msgid='" . addslashes($i) . "' LIMIT 1");
$subject=$DB_site->fetch_array($subjects);
$subject=$subject["subject"];
$subject = eregi_replace("^Re:[ ]*","",$subject);
$DB_site->query("UPDATE usenet_article SET refs='', ord=0, manual=1, subject='" . addslashes($subject) ."' WHERE msgid='" . addslashes($i) . "'");
}
echo "New threads created<br><br>";
}

fastforward 07-03-2001 08:32 PM

Quote:

Originally posted by webhost
fastforward:
ok I got all the code in place for the lastactivethread and I placed on the following location in the forumdisplaybit template but it still not showup on the opening page in my forums. Can you direct me on where I am going wrong below is the script. I have tried $forum, $forum2, and $thread in front of [lastactivethread] but none work.

Check in the forum table and see if the lastactivethread column is populated.

You might be better of not implementing this option. Instead, you can use this hack. It supports showing the icon aswell. newnews.pl works with it.


All times are GMT. The time now is 01:51 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.02005 seconds
  • Memory Usage 1,804KB
  • 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
  • (8)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