[ABD] News Forum

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
zalhain
Registered User
Posts: 8
Joined: Wed Jan 23, 2008 8:53 pm

Re: [BETA] News Forum

Post by zalhain »

spoooo wrote:Thanks for the mod btw, finally got it working -

I have a sneaky suspicioun that the link on the first page is one of the earlier releases of this mod, as I saw some posts later on in this thread where you had corrected some errors - yet they're in the current release.

Though, I could be wrong :)

Also, any update on allowing [IMG] tags to work yet?

edit - nevermind about the IMG tag thing, I missed out a post where someone posted how to do it :)
Would you mind pointing me to the post explaining the img tags? Thats something I'm wanting to get going.

Mav1323
Registered User
Posts: 5
Joined: Thu Mar 09, 2006 5:51 am
Contact:

Re: [BETA] News Forum

Post by Mav1323 »

Erik Frèrejean wrote:
Mav1323 wrote:I'm having a problem with this code. I have version 2.0
Version 2 of what? Of phpBB? This mod is not phpBB2.x compatible!

No, I have version 2 of the Mod, I have version 3.0.1 of phpBB
Mav1323 wrote:but my news.php page has this error:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/xxx/public_html/phpbb3/includes/news.php on line 45
You are running php4. This mod doesn't support php4. It's easy to get it working with this version but from the next release this will be an php5 only[/b] mod.

On my site's cpanel it says we have PHP version 5.2.5

Mav1323 wrote:and when I go to the admin panel of phpBB and go to edit a forum it doesn't have the option to "use as news forum". Anyone know how to fix that? Thanks.

Did you purge the cache?


I just purged the cache and it has "use as news forum" now. Thanks, but I still don't know how to fix the problem with the news.php file. Any ideas?

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: [BETA] News Forum

Post by Erik Frèrejean »

Can you post all the code between lines 40 and 50 of news.php?
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

bhast2
Registered User
Posts: 12
Joined: Sun May 25, 2008 8:53 pm

Re: [BETA] News Forum

Post by bhast2 »

how do i make an html page for this
i have the mod working
it is posting to a my php page but it is just text and i want graphics
i know i have to make an html page
but how do i begin because if i add a link to the html page in the php i get this error

[phpBB Debug] PHP Notice: in file /includes/session.php on line 1810: strtr() [function.strtr]: The second argument is not an array
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1810: strtr() [function.strtr]: The second argument is not an array
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1810: strtr() [function.strtr]: The second argument is not an array
Return to index page
General Error
template->_tpl_load_file(): File /faq_body.html does not exist or is empty

User avatar
JunglistPerfection
Registered User
Posts: 611
Joined: Mon Apr 09, 2007 11:58 pm
Location: Chicago, IL

Re: [BETA] News Forum

Post by JunglistPerfection »

Any demos?
Last edited by JunglistPerfection on Mon May 26, 2008 3:18 am, edited 1 time in total.

bhast2
Registered User
Posts: 12
Joined: Sun May 25, 2008 8:53 pm

Re: [BETA] News Forum

Post by bhast2 »

this is the code where do i put in the link to the html page

Code: Select all

<?php
error_reporting(E_ALL);
// Start the phpbb 3 session
define( 'IN_PHPBB', true );

$phpbb_root_path = './'; // change in your own root path.

$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

/*$user->session_begin();
$auth->acl( $user->data );
$user->setup();*/


   
    
// Include the needed files
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
include($phpbb_root_path . 'includes/news.' . $phpEx);

// Instance the needed classes
$bbcode	= new bbcode();
$news		= new news();

// Is the rss feed called?
$rss = request_var ('view', 'news'); // $_GET['view']
if( strtolower($rss) === 'rss' )
{
	// Build the rss page
	$news->build_rss ();
}
else
{
  echo "soemthing2";
	// Get the array with news data
	$news_data = $data = $news->get_news(true);
	
	
	echo'<pre>';
	print_r($news_data);
	echo'</pre>';
	
	
};
;


?>


User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: [BETA] News Forum

Post by Erik Frèrejean »

JunglistPerfection wrote:Any demos?
This page uses this mod, but it is slightly edited to fit my needs op that site.

@ bhast2
First clean up the code, cause you commented things out that should be there in order to work correct:

Code: Select all

<?php
error_reporting(E_ALL);
// Start the phpbb 3 session
define( 'IN_PHPBB', true );
$phpbb_root_path = './'; // change in your own root path.
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

$user->session_begin();
$auth->acl( $user->data );
$user->setup();

// Include the needed files
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
include($phpbb_root_path . 'includes/news.' . $phpEx);

// Instance the needed classes
$bbcode   = new bbcode();
$news      = new news();

// Is the rss feed called?
$rss = request_var ('view', 'news'); // $_GET['view']
if( strtolower($rss) === 'rss' )
{
   // Build the rss page
   $news->build_rss ();
}
else
{
  echo "soemthing2";
   // Get the array with news data
   $news_data = $data = $news->get_news(true);

   echo'<pre>';
   print_r($news_data);
   echo'</pre>';  
}
?>
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

bhast2
Registered User
Posts: 12
Joined: Sun May 25, 2008 8:53 pm

Re: [BETA] News Forum

Post by bhast2 »

k took the code that you posted and it is still working
this is what it looks like

soemthing2

Array
(
[0] => Array
(
[subject] => hgfdhgf
[text] => hgfdhgfdhgfd
[time] => 1211781564
[bitfield] =>
[bbc_uid] => gov6we1z
[reply_count] =>
[news_poster] => bhast2
[news_poster_colour] => AA0000
[forum_id] => 3
[topic_id] => 9
[post_id] => 12
[forum_name] => News
)

)
now how to i make it cleaner and add a theme to it
i want the theme to match my forum board but what is the basic setup to make the html page work with this code

imperialxt
Registered User
Posts: 27
Joined: Thu Jun 12, 2008 4:09 pm

Re: [BETA] News Forum

Post by imperialxt »

hi,

i downloaded the mod and installed it etc. I have enabled the forum i want to be the news one etc and my example.php is blank and i have no clue why :(.

here is my example.php code

Code: Select all

<?php

// Start the phpbb 3 session
define( 'IN_PHPBB', true );
$phpbb_root_path = './forums/'; // change in your own root path.
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

$user->session_begin();
$auth->acl( $user->data );
$user->setup();

// Include the needed files
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
include($phpbb_root_path . 'includes/news.' . $phpEx);

// Instance the needed classes
$bbcode	= new bbcode();
$news		= new news();

// Is the rss feed called?
$rss = request_var ('view', 'news'); // $_GET['view']
if( strtolower($rss) === 'rss' )
{
	// Build the rss page
	$news->build_rss ();
}
else
{
	// Get the array with news data
	$news_data = $data = $news->get_news();
	
	/*
	echo'<pre>';
	print_r($news_data);
	echo'</pre>';
	*/
}
?>

Largo84
Registered User
Posts: 36
Joined: Tue Jun 24, 2008 1:31 pm

Re: [BETA] News Forum

Post by Largo84 »

I managed to get it working and looking acceptable, there are a few problems I have though.

reply_count doesn't work. It doesn't fetch anything at all so there must be somethign wrong with the SQL query, but that's over my head.

Another couple of things are, BBCodes, how do I get these to work?

Also, new lines/line breaks don't seem to carry over, so I can do I a nice little story or what ever with a few paragraphs in it, but displaying it on the news page just shows a wall of text.

This is my first play with PHP other than to edit and mod already exsisting code, so any help would be great. Thanks.

Here's my page: http://thugs.nonplayercharacters.co.uk/news.php

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: [BETA] News Forum

Post by Erik Frèrejean »

Sorry for the late responce, guess that I missed your post :oops:
imperialxt wrote:hi,

i downloaded the mod and installed it etc. I have enabled the forum i want to be the news one etc and my example.php is blank and i have no clue why :(.

here is my example.php code

Code: Select all

<?php

// Start the phpbb 3 session
define( 'IN_PHPBB', true );
$phpbb_root_path = './forums/'; // change in your own root path.
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

$user->session_begin();
$auth->acl( $user->data );
$user->setup();

// Include the needed files
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
include($phpbb_root_path . 'includes/news.' . $phpEx);

// Instance the needed classes
$bbcode	= new bbcode();
$news		= new news();

// Is the rss feed called?
$rss = request_var ('view', 'news'); // $_GET['view']
if( strtolower($rss) === 'rss' )
{
	// Build the rss page
	$news->build_rss ();
}
else
{
	// Get the array with news data
	$news_data = $data = $news->get_news();
	
	/*
	echo'<pre>';
	print_r($news_data);
	echo'</pre>';
	*/
}
?>
If you read back in this topic you'll find the solution. This mod only gives you the ability to access the data very easily. What ever you want to do is something you must implement your self ($news_data contains all the raw data).
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: [BETA] News Forum

Post by Erik Frèrejean »

Largo84 wrote:I managed to get it working and looking acceptable, there are a few problems I have though.

reply_count doesn't work. It doesn't fetch anything at all so there must be somethign wrong with the SQL query, but that's over my head.

Another couple of things are, BBCodes, how do I get these to work?

Also, new lines/line breaks don't seem to carry over, so I can do I a nice little story or what ever with a few paragraphs in it, but displaying it on the news page just shows a wall of text.

This is my first play with PHP other than to edit and mod already exsisting code, so any help would be great. Thanks.

Here's my page: http://thugs.nonplayercharacters.co.uk/news.php
Can you post your code? Without that I can't see what goes wrong :).
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

Largo84
Registered User
Posts: 36
Joined: Tue Jun 24, 2008 1:31 pm

Re: [BETA] News Forum

Post by Largo84 »

Woops, sorry.

Code: Select all

	<?php
    error_reporting(E_ALL);
    // Start the phpbb 3 session
    define( 'IN_PHPBB', true );
    $phpbb_root_path = './'; // change in your own root path.
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);

    $user->session_begin();
    $auth->acl( $user->data );
    $user->setup();

    // Include the needed files
    include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
    include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
    include($phpbb_root_path . 'includes/news.' . $phpEx);

    // Instance the needed classes
    $bbcode   = new bbcode();
    $news      = new news();

    // Is the rss feed called?
    $rss = request_var ('view', 'news'); // $_GET['view']
    if( strtolower($rss) === 'rss' )
    {
       // Build the rss page
       $news->build_rss ();
    }
    else
    {
echo'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
echo'<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-gb" xml:lang="en-gb">';
echo'<head>';
echo'<meta http-equiv="content-type" content="text/html; charset=UTF-8" />';
echo'<meta http-equiv="content-style-type" content="text/css" />';
echo'<meta http-equiv="content-language" content="en-gb" />';
echo'<meta http-equiv="imagetoolbar" content="no" />';
echo'<meta name="resource-type" content="document" />';
echo'<meta name="distribution" content="global" />';
echo'<meta name="copyright" content="2000, 2002, 2005, 2007 phpBB Group" />';
echo'<meta name="keywords" content="" />';
echo'<meta name="description" content="" />';
echo'<!-- DREAMWEAVER -->';
echo'<link href="../theme/stylesheet.css" rel="stylesheet" type="text/css" />';
echo'<title>The Crimson Foot Thugs &bull;';
echo'News</title>';

echo'<script type="text/javascript" src="./styles/aphoticumbra_aoc/template/styleswitcher.js"></script>';
echo'<script type="text/javascript" src="./styles/aphoticumbra_aoc/template/forum_fn.js"></script>';
echo'<link href="./styles/aphoticumbra_aoc/theme/print.css" rel="stylesheet" type="text/css" media="print" title="printonly" />';
echo'<link href="./style.php?sid=c8e87fdcd6bead7e95bcc346e064f026&id=3&lang=en" rel="stylesheet" type="text/css" media="screen, projection" />';
echo'<link href="./styles/aphoticumbra_aoc/theme/normal.css" rel="stylesheet" type="text/css" title="A" />';
echo'<link href="./styles/aphoticumbra_aoc/theme/medium.css" rel="alternate stylesheet" type="text/css" title="A+" />';
echo'<link href="./styles/aphoticumbra_aoc/theme/large.css" rel="alternate stylesheet" type="text/css" title="A++" />';
echo'</head><body id="phpbb" class="section-memberlist ltr">';
echo'<div id="aoc_wrap">';
echo'<div id="aoc_header">';
echo'  <div class="aoc_header_bar aoc_background_position_top_center">';
echo'    <div class="aoc_menu">';
echo'      <ul>';
echo'        <!--<li><a href="./index.php"><span>Board index</span></a></li>-->';
echo'      </ul>';
echo'    </div>';
echo'    <!-- aoc_menu -->';
echo'  </div>';
echo'  <!-- aoc_header_bar -->';
echo'  <div id="aoc_header_main"> &nbsp; </div>';
echo'  <!-- aoc_header_main -->';
echo'  <div class="aoc_header_bar aoc_background_position_bot_center"> &nbsp; </div>';
echo'</div>';
echo'<!-- aoc_header_bar -->';
echo'<div id="aoc_page_body">';
echo'<div class="navbar">';
echo'  <ul class="linklist navlinks">';
echo'    <li class="icon-home"><a href="./index.php" accesskey="h">Board index</a>';
echo'          </li>';
echo'    <li class="rightside"><a href="#" onclick="fontsizeup(); return false;" onkeypress="fontsizeup(); return false;" class="fontsize" title="Change font size">Change font size</a></li>';
echo'      </ul>';
echo'    <ul class="linklist leftside">';
echo'    <li class="icon-ucp"> <a href="./ucp.php" title="User Control Panel" accesskey="u">User Control Panel</a>';
echo'          </li>';
echo'  </ul>';
echo'</div>';
echo'<!-- navbar -->';
echo'<a name="start_here"></a>';
echo'<br class="clear" />';
echo'<div class="panel" id="message">';
	
echo'	<h2>News</h2>';
echo'	<table>';
       // Get the array with news data
       $news_data = $data = $news->get_news(true);
	   // Parse Array loop
	   $bg_col = 0;
	   foreach ($news_data as $subject => $subject)
		{
			if ($bg_col == 0)
			{
				echo'<tr bgcolor="#f9edd1">';
				$bg_col = 1;
			}
			else
			{
				echo'<tr bgcolor="#dfd3b5">';
				$bg_col = 0;
			}
			echo'<br />';
			echo'<font size="3"><b><a class="news" href="viewtopic.php?f=' . $news_data[$subject][forum_id] . '&t=' . $news_data[$subject][post_id] . '">' . $news_data[$subject][subject] . '</a></b></font>'; 
			$t = $news_data[$subject][time];
			echo'<br /><font size="1">Posted by <b><u><font color="#' . $news_data[$subject][news_poster_colour] . '">' . $news_data[$subject][news_poster] . '</font></u></b> at ' . date("d/m/Y H:i",$t) . '</font><br /><br />';
			echo'<font size="2">' . $news_data[$subject][text] . '</font><br /><br />'; 
			echo'<a href="viewtopic.php?f=' . $news_data[$subject][forum_id] . '&t=' . $news_data[$subject][post_id] . '">Comments(' . $news_data[$subject][reply_count] . ')</a><br /><br />'; 
			echo'</tr>';
			
			
		}
echo'	</table>';
		
echo'</div>';

echo'<br class="clear" />';
echo'<div id="page-footer">';
echo' 	<div class="navbar">';
echo'		<ul class="linklist">';
echo'			<li class="icon-home"><a href="./index.php" accesskey="h">Board index</a></li>';
echo'							<li class="rightside"><a href="./memberlist.php?mode=leaders">The team</a> &bull; <a href="./ucp.php?mode=delete_cookies">Delete all board cookies</a> &bull; All times are UTC </li>';
echo'		</ul>';
echo'	</div>';

echo'	<div class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a> &copy; 2000, 2002, 2005, 2007 phpBB Group';
echo'        <br /><strong><a href="./adm/index.php?sid=c8e87fdcd6bead7e95bcc346e064f026">Administration Control Panel</a></strong>	</div>';
echo'</div>';
echo'<!-- footer -->';
echo'<div> <a id="bottom" name="bottom" accesskey="z"></a>';
echo'      </div>';
echo'</div>';
echo'<!-- aoc_page_body -->';
echo'<div class="copyright">Aphotic Umbra: Age of Conan v1.0.0 Created by <a href="http://www.tyriandesign.com">Tyrian Design</a></div>';
echo'</div>';
echo'<!-- aoc_wrap -->';
echo'</body>';
echo'</html>';
	   
	   
    }
    ?>
Thanks :D

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: [BETA] News Forum

Post by Erik Frèrejean »

After a quick look. See what happens if you change the second $subject in:

Code: Select all

foreach ($news_data as $subject => $subject) 
to something else. This way the server won't be able to know which var you're using later on. And they are overwriting each other. (Don't forget to update the vars inside the loop if needed).
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

Largo84
Registered User
Posts: 36
Joined: Tue Jun 24, 2008 1:31 pm

Re: [BETA] News Forum

Post by Largo84 »

I tried using $test as the second var, but it didn't seem to work, it only worked with $subject for some reason.

I should add that this is my first peice of proper PHP coding. I'm experienced with C though so I know basic layout and functions.

Here is the result of changing the second vars to $current: http://thugs.nonplayercharacters.co.uk/news2.php

Locked

Return to “[3.0.x] Abandoned MODs”