Topic Calendar (regular phpBB edition)

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
265
59%
Very Good
97
22%
Good
44
10%
Fair
10
2%
Poor
32
7%
 
Total votes: 448

SeiferTim
Registered User
Posts: 5
Joined: Tue Dec 26, 2006 10:26 pm

topic_calendar_time not populated

Post by SeiferTim » Wed Mar 07, 2007 5:59 pm

Hello, I installed this mod on 2.0.22, with no problems at all. I have no errors, and all the options in the forms show up properly, except, when I add or edit a Topic and enter a date, it's not being saved into the database. In phpMyAdmin, the values are all always "0", for both calendar_time and duration. Any ideas?

gillster
Registered User
Posts: 2
Joined: Wed Mar 07, 2007 1:54 am

Post by gillster » Wed Mar 07, 2007 11:18 pm

the_raider wrote: That is a function of the calender - you get to select which one gets seen via a drop down list


so Does this mean I have more than one Calenders (instances)?

Eg Calendar 1 for forum 1, and Calendar 2 for Forum2, and so on?

ISSUE# 2:

I followed the directions in install file and calendar works, but I dont have administation options in admin.

Please help!

SeiferTim
Registered User
Posts: 5
Joined: Tue Dec 26, 2006 10:26 pm

Post by SeiferTim » Thu Mar 08, 2007 4:02 pm

I thought I might explain a little more of my problem - I've gone through the instructions about 5 times just to make sure I didn't miss anything...

As far as I can tell, all the forms are in place, and working. I can set up the options in the ACP, and in the Profile screen for each user, and all of that seems to get saved to the DB just fine.

When I try to add a new Topic, or edit an existing Topic, I get the form to enter a date. It defaults to "---" etc.
I enter any date (usually just today or tomorrow just to test), hit save, and it does not save the date I picked to the DB. I thought it was a problem with auth_cal, but I get the message at the bottom of the screen that says: "You can edit calendar topics in this forum" or whatever it says.

If I edit the Topic, the date is back to "---", and in the DB it's always "0" for the calendar field. If I enter something into the DB, it shows up correctly.

I know a bit of PHP, but not much about phpBB's structure to really be able to pinpoint the problem. I only have one other MOD installed - the Attachment MOD, and it works just fine. I don't know if the two are conflicting with each other, but if I have to pick one, I need the Attachment MOD more than the Calendar... Preferably, I want to be able to use both.

If anyone can give me any ideas, that would be great. I read through many pages of this topic, but couldn't find anything that sounded like the similar problem....

SeiferTim
Registered User
Posts: 5
Joined: Tue Dec 26, 2006 10:26 pm

Post by SeiferTim » Thu Mar 08, 2007 4:33 pm

Hmm... I just noticed that in both the User and Group Permission Control Panel, other than the Forum Name and Moderator status columns, all the other columns are empty - in simple and advanced mode.
Again, going through the steps in the instructions, and all the changes have been made, and are in the right place...

Wingzfan
Registered User
Posts: 441
Joined: Wed Jan 25, 2006 4:55 pm

Post by Wingzfan » Thu Mar 08, 2007 4:58 pm

I apologize if this has been asked already but theres 256 pages in this thread

Is there a way to allow all the calendar entries to be seen by all registered users even if the post was made in a private forum? Ive got forums where I only want certain people to be able to discuss the event but I want all members and guests of the site to be able to see when they happened on the calendar.

the_raider
Registered User
Posts: 22
Joined: Fri Jun 17, 2005 7:32 am

Post by the_raider » Thu Mar 08, 2007 5:45 pm

SeiferTim wrote: Hmm... I just noticed that in both the User and Group Permission Control Panel, other than the Forum Name and Moderator status columns, all the other columns are empty - in simple and advanced mode.
Again, going through the steps in the instructions, and all the changes have been made, and are in the right place...


I had that problem (screenshot posted above) - you have to set the permission on the calendar to private in the forum permissions so that you can set permissions (on or off) in the user / group permissions.

HTH

The_Raider

SeiferTim
Registered User
Posts: 5
Joined: Tue Dec 26, 2006 10:26 pm

Post by SeiferTim » Thu Mar 08, 2007 5:51 pm

the_raider wrote:
SeiferTim wrote:Hmm... I just noticed that in both the User and Group Permission Control Panel, other than the Forum Name and Moderator status columns, all the other columns are empty - in simple and advanced mode.
Again, going through the steps in the instructions, and all the changes have been made, and are in the right place...


I had that problem (screenshot posted above) - you have to set the permission on the calendar to private in the forum permissions so that you can set permissions (on or off) in the user / group permissions.

HTH

The_Raider


Thanks, that makes sense, and seems to work just fine... however, I'm still having the other problem. I can't get the event date to be saved in the DB. I have checked everything I can think of, it seems to be a problem in the $calendar_form->validate($topic_id); section of Posting.php - as far as I can tell, the script is calling that function (which is supposed to update those fields in the DB), but it doesn't actually update the fields... I can't figure it out.

the_raider
Registered User
Posts: 22
Joined: Fri Jun 17, 2005 7:32 am

Post by the_raider » Thu Mar 08, 2007 6:09 pm

Can't help you with that one I'm afraid - the events show up on my calendar fine.

As an aside, does anyone know if this mod is compatible with mini_cal to get a calendar on a non-forum page?

SeiferTim
Registered User
Posts: 5
Joined: Tue Dec 26, 2006 10:26 pm

Post by SeiferTim » Thu Mar 08, 2007 9:13 pm

I was finally able to get the mod setup. I had to completely remove all my files, add the un-touched phpBB2 files, and then use the "already modded" files, and it works. Now I have to find out how to also implement the Attachment MOD....

the_raider
Registered User
Posts: 22
Joined: Fri Jun 17, 2005 7:32 am

Re:

Post by the_raider » Sat Mar 24, 2007 8:19 pm

the_raider wrote: I've been having a go at getting the calendar to appear in a separate page by taking code from the page_header.php and index.php files.

I now have an error message as follows:-

Code: Select all

Fatal error: Call to a member function on a non-object in \phpbb\includes\class_calendar_backport.php on line 313
Line 313 is

Code: Select all

return $this->template->assign_vars($vararray);
Any thoughts on what I need to add to my test page to get round this error?

Thanks in advance

The_Raider

anyone got any thoughts on how to get this working?

merebel
Registered User
Posts: 195
Joined: Mon Mar 13, 2006 6:18 pm
Location: Lewiston, Maine

Re: Topic Calendar (regular phpBB edition)

Post by merebel » Sun Mar 25, 2007 2:39 pm

Install errors
when I goto run the install_call/install.php I get this error

Code: Select all

Fatal error: Call to a member function on a non-object in /home/merebel/public_html/test/install_cal/install.php on line 30
Any help would be great

dougle
Registered User
Posts: 83
Joined: Sat Feb 04, 2006 10:47 am
Location: Blackpool, England

Re: Topic Calendar (regular phpBB edition)

Post by dougle » Mon Mar 26, 2007 5:35 am

Download link not working?

Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 25325
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Topic Calendar (regular phpBB edition)

Post by Paul » Mon Mar 26, 2007 8:27 am

dougle wrote: Download link not working?

Please read the announcments posted in this forum ;)
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

whodat63
Registered User
Posts: 32
Joined: Thu Feb 22, 2007 5:21 am

Re: Topic Calendar (regular phpBB edition)

Post by whodat63 » Tue Mar 27, 2007 5:55 pm

Sorry if this has been asked before...

How do I disable the calendar row for guests?

I have this inside my calendar.php file:

Code: Select all

if ($userdata['user_id'] == ANONYMOUS) 
{ 
redirect(append_sid('login.'.$phpEx)); 
}
But unregistered Guests can still open the calendar row at the login page. I only want logged in users to have the ability to view any calendar entries.

Thanks!

Rishidan
Registered User
Posts: 2
Joined: Thu Mar 29, 2007 9:45 pm

Re: Topic Calendar (regular phpBB edition)

Post by Rishidan » Thu Mar 29, 2007 9:56 pm

Hello,

The calendar was successfuly installed on my forum and it seems to work fine.
No errors or anything, except when I go to my administration panel it gives the following error in the menu.

Parse error: parse error, unexpected ';', expecting ')' in /html/forum/admin/admin_forumauth.php on line 76

Code: Select all

<?php
//-- mod : calendar ------------------------------------------------------------
/***************************************************************************
 *                            admin_forumauth.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: admin_forumauth.php,v 1.23.2.5 2004/03/25 15:57:19 acydburn Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   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, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

define('IN_PHPBB', 1);

if( !empty($setmodules) )
{
	$filename = basename(__FILE__);
	$module['Forums']['Permissions']   = $filename;

	return;
}

//
// Load default header
//
$no_page_header = TRUE;
$phpbb_root_path = './../';
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);

//
// Start program - define vars
//
//                View      Read      Post      Reply     Edit     Delete    Sticky   Announce    Vote      Poll      Desc      ModDesc      Tooltip
$simple_auth_ary = array(
	0  => array(AUTH_ALL, AUTH_ALL, AUTH_ALL, AUTH_ALL, AUTH_REG, AUTH_REG, AUTH_MOD, AUTH_MOD, AUTH_REG, AUTH_REG, AUTH_ALL, AUTH_ALL, AUTH_ALL),
	1  => array(AUTH_ALL, AUTH_ALL, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_MOD, AUTH_MOD, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_ALL),
	2  => array(AUTH_REG, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_MOD, AUTH_MOD, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_REG, AUTH_REG),
	3  => array(AUTH_ALL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_MOD, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ALL),
	4  => array(AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_MOD, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL, AUTH_ACL),
	5  => array(AUTH_ALL, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_ALL),
	6  => array(AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD),
);

$simple_auth_types = array($lang['Public'], $lang['Registered'], $lang['Registered'] . ' [' . $lang['Hidden'] . ']', $lang['Private'], $lang['Private'] . ' [' . $lang['Hidden'] . ']', $lang['Moderators'], $lang['Moderators'] . ' [' . $lang['Hidden'] . ']');


// mod topic description mod add to array

$forum_auth_fields = array('auth_view', 'auth_read', 'auth_post', 'auth_reply', 'auth_edit', 'auth_delete', 'auth_sticky', 'auth_announce', 'auth_vote', 'auth_pollcreate', 'auth_desc', 'auth_moddesc', 'auth_tooltip');

$field_names = array(
	'auth_view' => $lang['View'],
	'auth_read' => $lang['Read'],
	'auth_post' => $lang['Post'],
	'auth_reply' => $lang['Reply'],
	'auth_edit' => $lang['Edit'],
	'auth_delete' => $lang['Delete'],
	'auth_sticky' => $lang['Sticky'],
	'auth_announce' => $lang['Announce'], 
	'auth_vote' => $lang['Vote'], 
	'auth_pollcreate' => $lang['Pollcreate'],

//-- mod : calendar ------------------------------------------------------------
//-- add
$user->set();
$calendar_api->set();
$field_names['auth_cal'] = $lang['Calendar'];
$forum_auth_fields[] = 'auth_cal';

// where stands auth_delete ?
$delete_pos = array_flip(array_keys($field_names));
$delete_pos = $delete_pos['auth_delete'];

// add the auth to the presets
foreach ( $simple_auth_ary as $preset_id => $presets)
{
	$simple_auth_ary[$preset_id][] = $presets[$delete_pos] == AUTH_ACL ? AUTH_ACL : AUTH_MOD;
}
//-- fin mod : calendar --------------------------------------------------------

// mod topic description mod add
'auth_desc' => $lang['desc'],
'auth_moddesc' => $lang['moddesc'],
'auth_tooltip' => $lang['tooltip']);
// mod topic description mod end


$forum_auth_levels = array('ALL', 'REG', 'PRIVATE', 'MOD', 'ADMIN');
$forum_auth_const = array(AUTH_ALL, AUTH_REG, AUTH_ACL, AUTH_MOD, AUTH_ADMIN);
attach_setup_forum_auth($simple_auth_ary, $forum_auth_fields, $field_names);

if(isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_URL])
{
	$forum_id = (isset($HTTP_POST_VARS[POST_FORUM_URL])) ? intval($HTTP_POST_VARS[POST_FORUM_URL]) : intval($HTTP_GET_VARS[POST_FORUM_URL]);
	$forum_sql = "AND forum_id = $forum_id";
}
else
{
	unset($forum_id);
	$forum_sql = '';
}

if( isset($HTTP_GET_VARS['adv']) )
{
	$adv = intval($HTTP_GET_VARS['adv']);
}
else
{
	unset($adv);
}

//
// Start program proper
//
if( isset($HTTP_POST_VARS['submit']) )
{
	$sql = '';

	if(!empty($forum_id))
	{
		if(isset($HTTP_POST_VARS['simpleauth']))
		{
			$simple_ary = $simple_auth_ary[intval($HTTP_POST_VARS['simpleauth'])];

			for($i = 0; $i < count($simple_ary); $i++)
			{
				$sql .= ( ( $sql != '' ) ? ', ' : '' ) . $forum_auth_fields[$i] . ' = ' . $simple_ary[$i];
			}

			if (is_array($simple_ary))
			{
				$sql = "UPDATE " . FORUMS_TABLE . " SET $sql WHERE forum_id = $forum_id";
			}
		}
		else
		{
			for($i = 0; $i < count($forum_auth_fields); $i++)
			{
				$value = intval($HTTP_POST_VARS[$forum_auth_fields[$i]]);

				if ( $forum_auth_fields[$i] == 'auth_vote' )
				{
					if ( $HTTP_POST_VARS['auth_vote'] == AUTH_ALL )
					{
						$value = AUTH_REG;
					}
				}

				$sql .= ( ( $sql != '' ) ? ', ' : '' ) .$forum_auth_fields[$i] . ' = ' . $value;
			}

			$sql = "UPDATE " . FORUMS_TABLE . " SET $sql WHERE forum_id = $forum_id";
		}

		if ( $sql != '' )
		{
			if ( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not update auth table', '', __LINE__, __FILE__, $sql);
			}
		}

		$forum_sql = '';
		$adv = 0;
	}

	$template->assign_vars(array(
		'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("admin_forumauth.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">')
	);
	$message = $lang['Forum_auth_updated'] . '<br /><br />' . sprintf($lang['Click_return_forumauth'],  '<a href="' . append_sid("admin_forumauth.$phpEx") . '">', "</a>");
	message_die(GENERAL_MESSAGE, $message);

} // End of submit

//
// Get required information, either all forums if
// no id was specified or just the requsted if it
// was
//
$sql = "SELECT f.*
	FROM " . FORUMS_TABLE . " f, " . CATEGORIES_TABLE . " c
	WHERE c.cat_id = f.cat_id
	$forum_sql
	ORDER BY c.cat_order ASC, f.forum_order ASC";
if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, "Couldn't obtain forum list", "", __LINE__, __FILE__, $sql);
}

$forum_rows = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);

if( empty($forum_id) )
{
	//
	// Output the selection table if no forum id was
	// specified
	//
	$template->set_filenames(array(
		'body' => 'admin/auth_select_body.tpl')
	);

	$select_list = '<select name="' . POST_FORUM_URL . '">';
	for($i = 0; $i < count($forum_rows); $i++)
	{
		$select_list .= '<option value="' . $forum_rows[$i]['forum_id'] . '">' . $forum_rows[$i]['forum_name'] . '</option>';
	}
	$select_list .= '</select>';

	$template->assign_vars(array(
		'L_AUTH_TITLE' => $lang['Auth_Control_Forum'],
		'L_AUTH_EXPLAIN' => $lang['Forum_auth_explain'],
		'L_AUTH_SELECT' => $lang['Select_a_Forum'],
		'L_LOOK_UP' => $lang['Look_up_Forum'],

		'S_AUTH_ACTION' => append_sid("admin_forumauth.$phpEx"),
		'S_AUTH_SELECT' => $select_list)
	);

}
else
{
	//
	// Output the authorisation details if an id was
	// specified
	//
	$template->set_filenames(array(
		'body' => 'admin/auth_forum_body.tpl')
	);

	$forum_name = $forum_rows[0]['forum_name'];

	@reset($simple_auth_ary);
	while( list($key, $auth_levels) = each($simple_auth_ary))
	{
		$matched = 1;
		for($k = 0; $k < count($auth_levels); $k++)
		{
			$matched_type = $key;

			if ( $forum_rows[0][$forum_auth_fields[$k]] != $auth_levels[$k] )
			{
				$matched = 0;
			}
		}

		if ( $matched )
		{
			break;
		}
	}

	//
	// If we didn't get a match above then we
	// automatically switch into 'advanced' mode
	//
	if ( !isset($adv) && !$matched )
	{
		$adv = 1;
	}

	$s_column_span == 0;

	if ( empty($adv) )
	{
		$simple_auth = '<select name="simpleauth">';

		for($j = 0; $j < count($simple_auth_types); $j++)
		{
			$selected = ( $matched_type == $j ) ? ' selected="selected"' : '';
			$simple_auth .= '<option value="' . $j . '"' . $selected . '>' . $simple_auth_types[$j] . '</option>';
		}

		$simple_auth .= '</select>';

		$template->assign_block_vars('forum_auth_titles', array(
			'CELL_TITLE' => $lang['Simple_mode'])
		);
		$template->assign_block_vars('forum_auth_data', array(
			'S_AUTH_LEVELS_SELECT' => $simple_auth)
		);

		$s_column_span++;
	}
	else
	{
		//
		// Output values of individual
		// fields
		//
		for($j = 0; $j < count($forum_auth_fields); $j++)
		{
			$custom_auth[$j] = '&nbsp;<select name="' . $forum_auth_fields[$j] . '">';

			for($k = 0; $k < count($forum_auth_levels); $k++)
			{
				$selected = ( $forum_rows[0][$forum_auth_fields[$j]] == $forum_auth_const[$k] ) ? ' selected="selected"' : '';
				$custom_auth[$j] .= '<option value="' . $forum_auth_const[$k] . '"' . $selected . '>' . $lang['Forum_' . $forum_auth_levels[$k]] . '</option>';
			}
			$custom_auth[$j] .= '</select>&nbsp;';

			$cell_title = $field_names[$forum_auth_fields[$j]];

			$template->assign_block_vars('forum_auth_titles', array(
				'CELL_TITLE' => $cell_title)
			);
			$template->assign_block_vars('forum_auth_data', array(
				'S_AUTH_LEVELS_SELECT' => $custom_auth[$j])
			);

			$s_column_span++;
		}
	}

	$adv_mode = ( empty($adv) ) ? '1' : '0';
	$switch_mode = append_sid("admin_forumauth.$phpEx?" . POST_FORUM_URL . "=" . $forum_id . "&adv=". $adv_mode);
	$switch_mode_text = ( empty($adv) ) ? $lang['Advanced_mode'] : $lang['Simple_mode'];
	$u_switch_mode = '<a href="' . $switch_mode . '">' . $switch_mode_text . '</a>';

	$s_hidden_fields = '<input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '">';

	$template->assign_vars(array(
		'FORUM_NAME' => $forum_name,

		'L_FORUM' => $lang['Forum'], 
		'L_AUTH_TITLE' => $lang['Auth_Control_Forum'],
		'L_AUTH_EXPLAIN' => $lang['Forum_auth_explain'],
		'L_SUBMIT' => $lang['Submit'],
		'L_RESET' => $lang['Reset'],

		'U_SWITCH_MODE' => $u_switch_mode,

		'S_FORUMAUTH_ACTION' => append_sid("admin_forumauth.$phpEx"),
		'S_COLUMN_SPAN' => $s_column_span,
		'S_HIDDEN_FIELDS' => $s_hidden_fields)
	);

}

include('./page_header_admin.'.$phpEx);

$template->pparse('body');

include('./page_footer_admin.'.$phpEx);

?>
I have some mods installed as you can see so I had to do some things different with the installation of the Topic Calendar mod then it describes.
Probably I messed up some things and I'm afraid other errors might appear if this is fixed.

Maybe someone can offer me help because the forum is working but can't access the admin panel.

Thanks in advance,

Post Reply

Return to “[2.0.x] MOD Database Releases”