## [ABD] News Mod v1.2.1

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
[Matt]
Registered User
Posts: 9
Joined: Tue Sep 10, 2002 11:35 pm
I got a copy of the mod finally (thanks MJ), I installed it and everything worked fine.

However, is there anyway I can output the news onto the main page of my site without getting a heap of errors? I put this in the main page of my site:

Code: Select all

``````<?
/***************************************************************************
*                                 news.php
*                            ------------------
*   begin                : Monday, Jan 14, 2002
*   copyright            : (C) 2002 Samuel Cochran
*   email                : sam@wyvern.com.au
*
*   \$Id: news.php,v 1.2 2002/05/31 0:37:00 sj26 Exp \$
*
***************************************************************************/

/***************************************************************************
*
*   This program is free software; you can redistribute it and/or modify
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
define('NEWS_ARCHIVE', true);
\$phpbb_root_path = "forum/";
include(\$phpbb_root_path . 'extension.inc');
include(\$phpbb_root_path . 'common.'.\$phpEx);

//
// Start session management
//
\$userdata = session_pagestart(\$user_ip, PAGE_INDEX, \$session_length);
init_userprefs(\$userdata);
//
// End session management
//

//
// Generate the page
//

\$template->set_filenames(array(
'body' => 'NEWS_ON_INDEX.tpl')
);

include(\$phpbb_root_path . "includes/news.\$phpEx");

\$template->pparse('body');
?>``````
And this was the result:

Test Subject

Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah
Posted by Matt on 09-18 10:10PM (Yes reads)

Is there anyway to fix it so I don't get the errors?
VVouter
Registered User
Posts: 46
Joined: Fri May 17, 2002 1:44 pm
Location: Netherlands
Contact:
Can someone please send me a copy of this mod aswell?

postmaster@VVouter.com

Thanks

VV.
sj26
Registered User
Posts: 447
Joined: Fri Dec 14, 2001 4:06 pm
Location: /dev/cpu/[0-9]+ :D
Contact:
http://wyvern.com.au/~sam/share/NMv1.1.3.zip

Sorry...
[ Working on: It's a secret! ]
[ Links: My Mods | My Site | PALGN ]
dreamz
Registered User
Posts: 69
Joined: Fri Apr 05, 2002 12:02 pm
Location: Camp X-ray
Contact:
getting 500 Internal Server Error
VVouter
Registered User
Posts: 46
Joined: Fri May 17, 2002 1:44 pm
Location: Netherlands
Contact:
dreamz wrote: getting 500 Internal Server Error

The same here, yesterday it wouldnt load, and now this error
breukie
Registered User
Posts: 32
Joined: Thu May 23, 2002 2:04 pm
Contact:
Yup, same here.
Would love to see this mod
MJ
Registered User
Posts: 180
Joined: Thu Jan 03, 2002 10:20 pm
Contact:
sbyhost
Registered User
Posts: 5
Joined: Wed Sep 11, 2002 7:41 pm
Contact:
Ok, also, if anyone wants to send me d/l zips that dont work anymore from the authors site, I will host them, just email me the original zip (authors can do it too)

Josh
jovenile
Registered User
Posts: 4
Joined: Sun Sep 15, 2002 2:08 am
it's tough to get exactly what you want..
elipse..
sj26
Registered User
Posts: 447
Joined: Fri Dec 14, 2001 4:06 pm
Location: /dev/cpu/[0-9]+ :D
Contact:
I excepted the 'share/' folder from my rewrite...

http://www.wyvern.com.au/~sam/share/NMv1.1.3.zip
[ Working on: It's a secret! ]
[ Links: My Mods | My Site | PALGN ]
jovenile
Registered User
Posts: 4
Joined: Sun Sep 15, 2002 2:08 am
the mod works fine.. .. but there's a couple of things i've gone through and while testing it.. here's some stuff that might make a note for future updates..

when clicking on the _comments_ link and trying to reply, it returns a link to reply as a _guest_.. not being as logged in.. so i've changed some minor html in v1.1.3 for my use..

GREAT mod & look forward for new things..

problem solved & still modding..
elipse..
sneeky
Registered User
Posts: 25
Joined: Fri Sep 13, 2002 5:18 pm
Can i add the file phpbb/news.php also to my template from my website so i get the newspage on my index.php page?

if yes how i do it? i alreddy tryed it whit
<?php include("phpbb/news.php"); ?>

But that isnt working. then i did copy the entire news.php code to my templates index.php.
then its working but if i press comments or read more it goes not to my /phpbb/ directory but it skipz that. and it want to load the imgaes in images/smiles/icon_wink.gif and not phpbb/images/smiles/icon_wink.gif

So can anny1 help me to put this script on my index page from my site?
leokor
Registered User
Posts: 94
Joined: Wed Sep 25, 2002 3:37 am
Contact:

### Misplaced tags

Hey, thanks for an awesome mod!

A minor problem, though. Some <tr> and <td> tags are not nested properly in your index_news.tpl. While Internet Explorer and Netscape 6 do not seem to care, Netscape 4 is very nitpicky and doesn't like it. As a result, the rows and columns are screwed in the expanded news display. A simple rearrangement of tags fixes it, though.

Happens also that Netscape 4 doesn't like the rollout.js script. It is all expanded the first time you visit the page. And the "+" links don't work. The opposite effect with Opera. The news are not expanded, though the "+" links still don't work.

Now, I don't know about Opera. But Netscape 4 does not have the "style.display" property. Instead, it uses "visibility" with the values of "hide" and "show." Still tricky, though. Unlike IE and Netscape 6, Netscape 4 does not compute the total height of the page display dynamically. Therefore, the Netscape 4 version of the rollout script would have to compute the total height of all news elements when visible, and add it to the total height of the page display. Of course, the bottom of the page will be quite empty when the news are not expanded, but this is the space reserved for expansion.

People are also reporting script errors with the AOL browser.

Leo
leokor
Registered User
Posts: 94
Joined: Wed Sep 25, 2002 3:37 am
Contact:

### Re: Misplaced tags

leokor wrote: A minor problem, though. Some <tr> and <td> tags are not nested properly in your index_news.tpl. While Internet Explorer and Netscape 6 do not seem to care, Netscape 4 is very nitpicky and doesn't like it. As a result, the rows and columns are screwed in the expanded news display. A simple rearrangement of tags fixes it, though.

Allright, this is taken care of by replacing the line 16 in index_news.tpl

Code: Select all

``````			<td class="row2" align="center" rowspan="2">&nbsp;</td>
``````
with

Code: Select all

``````			<td class="row2" align="center">&nbsp;</td>
``````
You don't need the rowspan if the cell to the right is made into a table. Personally, I wouldn't do nested tables, though, using rowspan and colspan instead within a single table. But the change above is the shortest one for the file as is.

It still doesn't fix the issue with Netscape 4 and Opera not interpreting rollout script correctly. For that, the entire script has to be reworked. It should be able to identify different browsers and adjust accordingly.

Leo
dyingeyes
Registered User
Posts: 47
Joined: Fri Nov 01, 2002 1:14 am
Contact:
i just installed the news mod from the link you gave us http://www.wyvern.com.au/~sam/share/NMv1.1.3.zip and it's not working at all for me. it gives this message when i have it enabled on one forum, for only announcement posts.

Fatal error: Cannot redeclare news_auth() (previously declared in C:\Program Files\Apache Group\Apache2\htdocs\phpBB2\includes\news.php:36) in C:\Program Files\Apache Group\Apache2\htdocs\phpBB2\includes\news.php on line 36

this is what mine looks like:

<?php
/***************************************************************************
* includes/news.php
* -------------------
* begin : Monday, Jan 14, 2002
* copyright : (C) 2002 Samuel Cochran
* email : sam@wyvern.com.au
*
* \$Id: news.php,v 1.2.1 2002/05/30 20:41:00 sj26 Exp \$
*
***************************************************************************/

/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/

if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}

include_once(\$phpbb_root_path . 'includes/bbcode.'.\$phpEx);

/**
* News auth
* Authenticates a forum and checks if the user can view/read it.
* If not, pops the news item out of the array and checks the next
* news item.
**/
function news_auth(&\$news, \$i)
{
global \$userdata, \$is_auth;

// Get all forum data (only once)
if( empty(\$is_auth) )
{
\$is_auth = auth(AUTH_ALL, AUTH_LIST_ALL, \$userdata);
}
... (flood)
Having potential means you havent done anything yet!