You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 48 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Original phpBB port block forums bug - fix [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Tue Jan 14, 2003 3:06 pm Reply with quoteBack to top

Code:
<?php

/************************************************************************/
/* Forums Block for phpBB 2.0.0 port to PHP Nuke 5.5                    */
/* =================================================                    */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com)         */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* Version 1, modified by Sébastien Vaast                               */
/* http://membres.lycos.fr/projectpluto/                                */
/*                                                                      */
/* Updated by Tom Nitzschner 22/06/2002 to add the scrolling text       */
/*                                                                      */
/* Updated by Paul Laudanski 14 Jan 2003 to remove private forums posts */
/* http://NukeCops.com http://ComputerCops.biz                                    */
/*                                                                      */
/* Last Edited - 14 Jan 2003                                            */
/*                                                                      */
/* This Block shows the last 10 topics where a message was posted,      */
/* along with the uname of the last poster and the day and time      */
/* of the post.                                                         */
/* It will also show smileys in the topic titles thanks to the          */
/* smileys.php file found in Leo Tan Block Forums version               */
/* (http://www.cybercomp.d2g.com).                                      */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if (eregi("block-Forums.php", $PHP_SELF)) {
    Header("Location: index.php");
    die();
}

include_once ('blocks/smileys.php');

global $prefix, $dbi, $sitename, $user, $cookie, $group_id;
$count = 1;
$content = "<A name= \"scrollingCode\"></A>";
$content .="<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"20\" onmouseover='this.stop()' onmou
seout='this.start()'>";
$content .="<center> <STYLE=\"text-decoration: none\"><font color=\"#666666\"><b>Last 10 Forum Messages</b></center>";
$result1 = sql_query("SELECT t.topic_id, t.topic_last_post_id, t.topic_title FROM ".$prefix."_topicsbb t, ".$prefix."_forums f where t.forum_id=f.forum_id and f.auth_view=0 ORDER BY t.topic_last_post_id DESC LIMIT 10", $dbi);
$content .= "<br>";
while(list($topic_id, $topic_last_post_id, $topic_title) = sql_fetch_row($result1, $dbi)) {
$result2 = sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%b %d, %Y at %T') as post_time FROM ".$prefix."_posts where post_id='$topic_last_post_id'
", $dbi);
list($topic_id, $poster_id, $post_time)=sql_fetch_row($result2, $dbi);

$result3 = sql_query("SELECT uname, uid FROM ".$prefix."_users where uid='$poster_id'", $dbi);
list($uname, $uid)=sql_fetch_row($result3, $dbi);

$topic_title=parseEmoticons($topic_title);
// Remove the comment below to add the counter
//$content .="<STYLE=\"text-decoration: none\"><font color=\"#666666\"><b>Message: $count<br></b>";

$content .= "<img src=\"modules/Forums/templates/subSilver/images/icon_mini_message.gif\" border=\"0\" alt=\"\"><a href=\"modules.php?name=Forums&amp;file=viewtopic
&amp;p=$topic_last_post_id#$topic_last_post_id\"STYLE=\"text-decoration: none\"><b> $topic_title </b></a><br><font color=\"#666666\"><i>Last post by <A HREF=\"modul
es.php?name=Forums&file=profile&mode=viewprofile&u=$uid\"STYLE=\"text-decoration: none\"> $uname </a> on $post_time</i></font><br><br>";
$count = $count + 1;
}
$content .= "<br><center>[ <a href=\"modules.php?name=Forums\"STYLE=\"text-decoration: none\">$sitename ]</center>";
?>


The main change is from this line:

Code:
$result1 = sql_query("SELECT topic_id, topic_last_post_id, topic_title FROM ".$prefix."_topicsbb ORDER BY topic_last_post_id DESC LIMIT 10", $dbi);


To this line of code:

Code:
$result1 = sql_query("SELECT t.topic_id, t.topic_last_post_id, t.topic_title FROM ".$prefix."_topicsbb t, ".$prefix."_forums f where t.forum_id=f.forum_id and f.auth_view=0 ORDER BY t.topic_last_post_id DESC LIMIT 10", $dbi);

_________________
Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Tue Jan 14, 2003 3:09 pm Reply with quoteBack to top

Forgot to mention, this question was first posed here:

http://bbtonuke.sourceforge.net/modules.php?name=Forums&file=viewtopic&t=1885

_________________
Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Tue Jan 14, 2003 7:27 pm Reply with quoteBack to top

If you need to add more auth_view types, then simply change the SQL code segment from:

f.auth_view=0

to this:

(f.auth_view=0||1||2||3)

Of course, leaving only what you need. Say you need only 1 and 3:

(f.auth_view=1||3)

_________________
Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
mikem
Theme Guru
Theme Guru


Joined: Jan 13, 2003
Posts: 1582

Location: Corn fields of Indiana

PostPosted: Wed Jan 15, 2003 8:26 am Reply with quoteBack to top

I've triede this block twice Zhen and it gives me
Code:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /www/f/fauxpas69/htdocs/phpbbport/includes/sql_layer.php on line 301


everytime...dangnabbit..Man am I really that tired this morning..hehe

Is this one designed for 6.5?

mikem
Find all posts by mikemView user's profileSend private message
chatserv
General
General


Joined: Jan 12, 2003
Posts: 3128

Location: Puerto Rico

PostPosted: Wed Jan 15, 2003 8:54 am Reply with quoteBack to top

Try changing topicsbb to bbtopics

_________________
Feed a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
ScriptHeaven | NukeResources
Find all posts by chatservView user's profileSend private messageVisit poster's website
mikem
Theme Guru
Theme Guru


Joined: Jan 13, 2003
Posts: 1582

Location: Corn fields of Indiana

PostPosted: Wed Jan 15, 2003 9:02 am Reply with quoteBack to top

chatserv wrote:
Try changing topicsbb to bbtopics


uh yeah..I was getting ready to post about that I don't see a _topicsbb in 6.0 with 2.0.6 port OR 6.5 nuke

EDIT______
Same results.


mikem
Find all posts by mikemView user's profileSend private message
ArtificialIntel



Joined: Jan 31, 2004
Posts: -88


PostPosted: Wed Jan 15, 2003 9:07 am Reply with quoteBack to top

he was talking about the code in the block, which does have a topicsbb in there

ArtificialIntel
Find all posts by ArtificialIntelView user's profileSend private message
chatserv
General
General


Joined: Jan 12, 2003
Posts: 3128

Location: Puerto Rico

PostPosted: Wed Jan 15, 2003 9:07 am Reply with quoteBack to top

Apply the line 300 debug hack to your sql_layer.php file (the one that appears in the welcome message) so we can find out what mysql is complaining about.

_________________
Feed a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
ScriptHeaven | NukeResources
Find all posts by chatservView user's profileSend private messageVisit poster's website
mikem
Theme Guru
Theme Guru


Joined: Jan 13, 2003
Posts: 1582

Location: Corn fields of Indiana

PostPosted: Wed Jan 15, 2003 9:21 am Reply with quoteBack to top

ArtificialIntel wrote:
he was talking about the code in the block, which does have a topicsbb in there

ArtificialIntel

Right, but what I'm saying is there is no MySQL table called _topicsbb in Nuke 6.5 or 2.0.6 port. I should have typed more clearly..hehe Confused

I'll get debugging turned on and re-check the code.

mikem
Find all posts by mikemView user's profileSend private message
ArtificialIntel



Joined: Jan 31, 2004
Posts: -88


PostPosted: Wed Jan 15, 2003 9:27 am Reply with quoteBack to top

yes, but in the block, there's code that tells it to look up a table called _topicsbb - a table used by the port 2.0.4

This is what needs changing to _bbtopics

ArtificialIntel
Find all posts by ArtificialIntelView user's profileSend private message
mikem
Theme Guru
Theme Guru


Joined: Jan 13, 2003
Posts: 1582

Location: Corn fields of Indiana

PostPosted: Wed Jan 15, 2003 9:29 am Reply with quoteBack to top

ArtificialIntel wrote:
yes, but in the block, there's code that tells it to look up a table called _topicsbb - a table used by the port 2.0.4

This is what needs changing to _bbtopics

ArtificialIntel


You know..that's what I get for READING..BAH on me...

ok here's the feedback from the Debug

Code:
SQL query: SELECT t.topic_id, t.topic_last_post_id, t.topic_title FROM nuke_bbtopics t, nuke_forums f where t.forum_id=f.forum_id and f.auth_view=0 ORDER BY t.topic_last_post_id DESC LIMIT 10

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /www/f/fauxpas69/htdocs/phpbbport/includes/sql_layer.php on line 301
Find all posts by mikemView user's profileSend private message
chatserv
General
General


Joined: Jan 12, 2003
Posts: 3128

Location: Puerto Rico

PostPosted: Wed Jan 15, 2003 9:32 am Reply with quoteBack to top

Actually i meant the debug hack which requires a few lines changes in sql_layer.php, turning debug on seems to echo the code that is having problems which is good but the other way most of the times will return what the actual error is.

_________________
Feed a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
ScriptHeaven | NukeResources
Find all posts by chatservView user's profileSend private messageVisit poster's website
mikem
Theme Guru
Theme Guru


Joined: Jan 13, 2003
Posts: 1582

Location: Corn fields of Indiana

PostPosted: Wed Jan 15, 2003 9:33 am Reply with quoteBack to top

Wait a minute...so why am I even trying this block..It won't work with 2.0.6 I need to migrate the auth view bit of code to the original block-Forums scroller for phpBB port 2.0.6..

mikem
Find all posts by mikemView user's profileSend private message
chatserv
General
General


Joined: Jan 12, 2003
Posts: 3128

Location: Puerto Rico

PostPosted: Wed Jan 15, 2003 9:36 am Reply with quoteBack to top

Don't have that block here but most likely you'll also have to change nuke_forums to nuke_bbforums.

_________________
Feed a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
ScriptHeaven | NukeResources
Find all posts by chatservView user's profileSend private messageVisit poster's website
mikem
Theme Guru
Theme Guru


Joined: Jan 13, 2003
Posts: 1582

Location: Corn fields of Indiana

PostPosted: Wed Jan 15, 2003 9:37 am Reply with quoteBack to top

chatserv wrote:
Actually i meant the debug hack which requires a few lines changes in sql_layer.php, turning debug on seems to echo the code that is having problems which is good but the other way most of the times will return what the actual error is.


hehe yeah,

Code:
Unknown column 'f.auth_view' in 'where clause'
Find all posts by mikemView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.534 Seconds - 533 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::