| Author |
Message |
Zhen-Xjell
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939
|
Posted:
Tue Jan 14, 2003 3:06 pm |
  |
| 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&file=viewtopic
&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] |
|
     |
 |
Zhen-Xjell
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939
|
Posted:
Tue Jan 14, 2003 3:09 pm |
  |
|
     |
 |
Zhen-Xjell
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939
|
Posted:
Tue Jan 14, 2003 7:27 pm |
  |
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] |
|
     |
 |
mikem
Theme Guru


Joined: Jan 13, 2003
Posts: 1582
Location: Corn fields of Indiana
|
Posted:
Wed Jan 15, 2003 8:26 am |
  |
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 |
|
|
   |
 |
chatserv
General


Joined: Jan 12, 2003
Posts: 3128
Location: Puerto Rico
|
Posted:
Wed Jan 15, 2003 8:54 am |
  |
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 |
|
    |
 |
mikem
Theme Guru


Joined: Jan 13, 2003
Posts: 1582
Location: Corn fields of Indiana
|
Posted:
Wed Jan 15, 2003 9:02 am |
  |
| 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 |
|
|
   |
 |
ArtificialIntel

Joined: Jan 31, 2004
Posts: -88
|
Posted:
Wed Jan 15, 2003 9:07 am |
  |
he was talking about the code in the block, which does have a topicsbb in there
ArtificialIntel |
|
|
   |
 |
chatserv
General


Joined: Jan 12, 2003
Posts: 3128
Location: Puerto Rico
|
Posted:
Wed Jan 15, 2003 9:07 am |
  |
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 |
|
    |
 |
mikem
Theme Guru


Joined: Jan 13, 2003
Posts: 1582
Location: Corn fields of Indiana
|
Posted:
Wed Jan 15, 2003 9:21 am |
  |
| 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
I'll get debugging turned on and re-check the code.
mikem |
|
|
   |
 |
ArtificialIntel

Joined: Jan 31, 2004
Posts: -88
|
Posted:
Wed Jan 15, 2003 9:27 am |
  |
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 |
|
|
   |
 |
mikem
Theme Guru


Joined: Jan 13, 2003
Posts: 1582
Location: Corn fields of Indiana
|
Posted:
Wed Jan 15, 2003 9:29 am |
  |
| 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 |
|
|
|
   |
 |
chatserv
General


Joined: Jan 12, 2003
Posts: 3128
Location: Puerto Rico
|
Posted:
Wed Jan 15, 2003 9:32 am |
  |
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 |
|
    |
 |
mikem
Theme Guru


Joined: Jan 13, 2003
Posts: 1582
Location: Corn fields of Indiana
|
Posted:
Wed Jan 15, 2003 9:33 am |
  |
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 |
|
|
   |
 |
chatserv
General


Joined: Jan 12, 2003
Posts: 3128
Location: Puerto Rico
|
Posted:
Wed Jan 15, 2003 9:36 am |
  |
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 |
|
    |
 |
mikem
Theme Guru


Joined: Jan 13, 2003
Posts: 1582
Location: Corn fields of Indiana
|
Posted:
Wed Jan 15, 2003 9:37 am |
  |
| 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' |
|
|
|
   |
 |
|
|