MyBB Community Forums

Full Version: An image gallery
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

I want to integrate an Image gallery to my forum. I did a search to find any existing image gallery. But I could not find an image gallery software that works with myBB. So I thought of writting an image gallery by my own.

I am an absoute beginner in PHP. Actually I started learning PHP a couple days back only. Now when I started coding for my image gallery, I am getting a warning in my php page.

"Warning: Cannot modify header information - headers already sent by (output started at X\gallery\admin\category.php:1) in X\forum\inc\functions.php on line 1121"


The contents of my category.php is
<?php
	require_once "../init.php";
?>

and in init.php I have

<?php
	define("IN_MYBB", 1);
	
	require_once "config/config.php";

	if(!isset($config['mybbroot']))
	{
		die("MyBB root not set.");
	}

	global $MYBB_ROOT;
	$MYBB_ROOT= $config['mybbroot'];
	
	require_once $MYBB_ROOT. "global.php";
?>

and in my config.php,

<?php
	$config['mybbroot'] = '../../forum/';

	// main images directory
	define('PATH', 'X/images/');

	// valid image types, all other files will be ignored
	define('TYPE', serialize(array('image/jpg', 'image/jpeg', 'image/pjpeg')));

?>

These are the only contents in my files. Still I am getting these warning. How can I avoid this warning. Please help me.


** Note: Please use [code][/code] or [php][/php] tag to make your code easier to read - Dale Hay **