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

User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Re: Topic Calendar (regular phpBB edition)

Post by Ptirhiik » Tue Mar 11, 2008 10:08 pm

This is highly probably due to page_header.php being included within a function in place of root level (as it should), without adding the global vars coming with the mod in the function.

InTimo
Registered User
Posts: 18
Joined: Fri Dec 07, 2007 10:08 pm

Re: Topic Calendar (regular phpBB edition)

Post by InTimo » Wed Mar 12, 2008 3:49 pm

Ptirhiik wrote:All the links are generated within includes/class_calendar_backport.php, class calendar_class_config, method url().
But how can I define the other Style in this File??


This is the Part ??

Code: Select all

class calendar_class_config
{
	var $data;
	var $root, $ext, $SID;

	function calendar_class_config()
	{
		global $board_config, $phpbb_root_path, $phpEx, $SID;

		$this->data = &$board_config;
		$this->root = $phpbb_root_path;
		$this->ext = $phpEx;
		$this->SID = '';
	}

	function url($basename, $parms=array(), $add_sid=false, $fragments='', $force=false, $external=false)
	{
		static $script_path;

		$url_parms = '';
		if ( empty($parms) )
		{
			$parms = array();
		}
		if ( $add_sid && empty($parms['sid']) )
		{
			$parms['sid'] = substr($this->SID, strlen('sid='));
		}
		if ( !empty($parms) )
		{
			foreach ( $parms as $key => $val )
			{
				if ( !empty($key) && (!empty($val) || $force) )
				{
					$url_parms .= (empty($url_parms) ? '?' : '&') . $key . '=' . $val;
				}
			}
		}
		if ( !empty($fragments) )
		{
			$url_parms .= (empty($url_parms) ? '?#' : '#') . $fragments;
		}
		if ( $external && empty($script_path) )
		{
			$script_path = $this->get_script_path();
		}
		return ($external ? $script_path : (trim(substr($this->root, 0, 2) == './') && $add_sid ? substr($this->root, 2) : $this->root)) . $basename . '.' . $this->ext . $url_parms;
	}

	function get_script_path()
	{
		$server_protocol = empty($this->data['cookie_secure']) ? 'http://' : 'https://';
		$server_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($this->data['server_name']));
		$server_port = ($this->data['server_port'] == 80 ? '' : ':' . trim($this->data['server_port'])) . '/';
		$script_path = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($this->data['script_path']));
		$script_path = $server_protocol . $server_name . $server_port . (empty($script_path) ? '' : $script_path . '/');
		return $script_path;
	}
}
But what means for the Style/Template ??

This is the Switch Style MOD

Code: Select all

##############################################################
## MOD Title:          Switch Style From URL
## MOD Author:         spooky2280 < webmaster@christianfecteau.com > (Christian Fecteau) http://portfolio.christianfecteau.com/
## MOD Description:    This MOD interprets a style=x argument in the URL and displays your board using the theme
##                     with id=x in the db. All links in the page have the style=x argument appended.
##                     A Style Switcher (using a frameset) is included with the MOD.
##                     See the MOD in action: http://christianfecteau.com/ssu
##
## MOD Version:        1.0.0
##
## Installation Level: Easy
## Installation Time:  5 Minutes
##
## Files To Edit:      3
##      common.php
##      includes/functions.php
##      includes/sessions.php
##
## Included Files:     styles.html
##                     styles.php
##
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## This MOD uses the superglobals $_GET and $_POST introduced in PHP 4.1.0
## You will need to adapt the code for earlier versions of PHP:
## use $HTTP_GET_VARS and $HTTP_POST_VARS and declare them as globals within functions.
##
## The URL for the style switcher is "http://www.example.com/yourboard/styles.html"
## If you try to load "http://www.example.com/yourboard/styles.php", there is a JavaScript
## redirection to "http://www.example.com/yourboard/styles.html"
##
## This MOD is like the Styles Demo at phpBB.com except that you can also submit and register.
## In other words, the board is fully functional while you're in the demo (a frameset).
## You don't actually need the demo. The style is changed if the style=x argument is found
## in the URL, whether you're in the frameset or not. But in the demo, the MOD uses JavaScript
## to keep you at the exact same URL when you switch style, instead of bringing you back to the
## index page like at phpBB.com
##
## The 2 included files are indeed optional. You can manually add
## a style=x argument to the URL and the MOD will display the style
## with id=x in the db. And all links in the page will have the
## argument appended so the user keeps the style from page to
## page. Only the admin and moderator links don't have the argument
## appended.
##
## 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.
##
## Credits must be given with my full name (Christian Fecteau)
## and a link to my portfolio: http://portfolio.christianfecteau.com/
##
## Removal or alteration of this notice is strongly prohibited.
##
##############################################################
## MOD History:
##
##   2005-02-13 - Version 1.0.0
##      - style argument is not appended anymore upon submission of profile
##      - Added a warning in the Author Notes about versions of PHP
##        prior to 4.1.0 and the use of the superglobals $_GET and $_POST in this MOD.
##      - Added a commented TITLE element in styles.php and styles.html:
##        <!-- title>Uncomment and put the title that you want</title -->
##
##   2005-02-12 - Version 0.1.0 BETA
##      - First release, tested with phpBB 2.0.11 and EasyMod 0.1.13
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ COPY ]------------------------------------------
#
copy styles.html to styles.html
copy styles.php to styles.php
#
#-----[ OPEN ]------------------------------------------
#
common.php
#
#-----[ FIND ]------------------------------------------
#
# around line 177
#
$gen_simple_header
#
#-----[ AFTER, ADD ]------------------------------------------
#

//---------start mod: Switch Style From URL-------------------------
$ssu_get = false;
//---------fin mod: Switch Style From URL-------------------------

#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
# around line 227
#
global $nav_links
#
#-----[ IN-LINE FIND ]------------------------------------------
#
global
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 $ssu_get, $db,
#
#-----[ FIND ]------------------------------------------
#
# around line 267
#
!$board_config['override_user_style']
#
#-----[ BEFORE, ADD ]------------------------------------------
#

	//---------start mod: Switch Style From URL-------------------------
	if (isset($_GET['style']))
	{
		$sql = "SELECT themes_id, template_name
			FROM " . THEMES_TABLE . " 
			ORDER BY template_name";

		if(!$result = $db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, "Could not get style information!", "", __LINE__, __FILE__, $sql);
		}

		$style_rowset = $db->sql_fetchrowset($result);

		foreach ($style_rowset as $ssu_sel)
		{
			if (strval($ssu_sel['themes_id']) === strval($_GET['style']))
			{
				$board_config['default_style'] = strval($ssu_sel['themes_id']);
				$ssu_get = strval($ssu_sel['themes_id']);
				break;
			}
			$ssu_get = false;
		}
	}
	//---------fin mod: Switch Style From URL-------------------------

#
#-----[ IN-LINE FIND ]------------------------------------------
#
!$board_config['override_user_style']
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 && !$ssu_get
#
#-----[ FIND ]------------------------------------------
#
# around line 324
#
$row['template_name']
#
#-----[ AFTER, ADD ]------------------------------------------
#
	$board_config['ssu_current'] = $row['themes_id'];
#
#-----[ OPEN ]------------------------------------------
#
includes/sessions.php
#
#-----[ FIND ]------------------------------------------
#
# around line 390
#
global $SID
#
#-----[ IN-LINE FIND ]------------------------------------------
#
global
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
 $ssu_get,
#
#-----[ FIND ]------------------------------------------
#
# around line 397
#
return $url;
#
#-----[ BEFORE, ADD ]------------------------------------------
#

	//---------start mod: Switch Style From URL-------------------------
	if (($ssu_get) && !preg_match('#style=#', $url) && !isset($_POST['style']))
	{
		$url .= ((strpos($url, '?') != false) ? (($non_html_amp) ? '&' : '&') : '?') . 'style=' . $ssu_get;
	}
	//---------fin mod: Switch Style From URL-------------------------

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Timo

melissalevy
Registered User
Posts: 6
Joined: Sun Apr 13, 2008 5:46 am

Re: Topic Calendar (regular phpBB edition)

Post by melissalevy » Mon Apr 14, 2008 2:20 am

Hi - I just installed this mod and am very excited to use it! However, I cannot figure out how to set authorization levels, i.e. who can create events/topics, who can respond, etc. Can you help? Many thanks in advance.

tnblueswirl
Registered User
Posts: 10
Joined: Mon Apr 14, 2008 1:43 pm

Re: Topic Calendar (regular phpBB edition)

Post by tnblueswirl » Mon Apr 14, 2008 2:15 pm

My apologies if this has already been addressed, but I did search this topic for this issue but found nothing pertaining to this particular issue.

I've installed this mod on a fairly heavily modded forum. Everything works fine except the index page is cut off just below where the calendar is supposed to display. I can view every other page on the site just fine, but the index page will not work. On the other pages, the calendar link is displayed, but clicking on it does nothing.

I've gone back through all the install processes and cannot find anything out of place. I cannot find anything that would be causing a conflict between other mods, and I've limited the issue down to the chunk of code placed in includes/page_header.php

Code: Select all

//-- mod : calendar ------------------------------------------------------------
//-- add
global $user, $config, $calendar_api;
$user->set();
$calendar_api->set();
if ( !defined('IN_CALENDAR') && !defined('HAS_DIED') && (intval($config->data['calendar_header_cells']) || (intval($user->data['user_calendar_header_cells']) && !intval($config->data['calendar_header_cells_over']))) )
{
	include($config->url('includes/class_calendar_handler'));

	calendar_extend_template();
	$calendar_header_box = new calendar_header_box('index');
	$calendar_header_box->display();
	$calendar_header_box->destroy();
	unset($calendar_header_box);
	calendar_extend_template();
}
$template->assign_vars(array(
	'L_CALENDAR' => $user->lang('Calendar'),
	'I_CALENDAR' => $user->img('menu_calendar'),
	'U_CALENDAR' => $config->url('calendar', '', true),
));
//-- fin mod : calendar --------------------------------------------------------
And more specifically something in this portion, as commenting it out allows my page to display correctly:

Code: Select all

include($config->url('includes/class_calendar_handler'));

	calendar_extend_template();
	$calendar_header_box = new calendar_header_box('index');
	$calendar_header_box->display();
	$calendar_header_box->destroy();
	unset($calendar_header_box);
	calendar_extend_template();
I've looked through includes/class_calendar_handler.php and can find nothing out of the ordinary. Does anyone have any ideas what might be causing this problem?

screenshot of the problem

User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Re: Topic Calendar (regular phpBB edition)

Post by Ptirhiik » Mon Apr 14, 2008 4:50 pm

You have probably a script including page_header within a function which has not all the globals vars. Try to change the error_reporting line in common.php adding | E_ALL in the parms to get all the messages.

tnblueswirl
Registered User
Posts: 10
Joined: Mon Apr 14, 2008 1:43 pm

Re: Topic Calendar (regular phpBB edition)

Post by tnblueswirl » Mon Apr 14, 2008 5:28 pm

I got no reported errors adding | E_ALL to the error_reporting line. But I think you may be on to the right track. I commented out the "global $user, $config, $calendar_api;" line in the problem code and got the same result as before. Now I just have to figure out where those variables are defined. If you could tell me that, I would greatly appreciate it.

User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Re: Topic Calendar (regular phpBB edition)

Post by Ptirhiik » Mon Apr 14, 2008 9:09 pm

At bottom of includes/class_calendar_backport.php, so when including includes/class_calendar_init.php (in common.php)

Hild2005
Registered User
Posts: 3
Joined: Sat Apr 26, 2008 3:57 pm

Re: Topic Calendar (regular phpBB edition)

Post by Hild2005 » Sat Apr 26, 2008 4:09 pm

I've inherited a forum that uses an older version of the calendar mod: 1.0.5 - 14/09/2003

The mod works fine with the current two templates (subSilver and WowMoonclaw01). I've just added a new template for the forum to change it's look (desigioBlack) but the calendar mod isn't showing up. I've toggled around but I've got no experience with this mod.

I downloaded the new version to at least read the install, but I'm hesitant to start mucking around without first asking if there's a simple change to ensure the mod shows when you add a new template to your forum (so, shows for older templates, won't show for new template).

User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Re: Topic Calendar (regular phpBB edition)

Post by Ptirhiik » Sat Apr 26, 2008 9:06 pm

TC has always been adding new files in the templates/ directory: have you ensured you have copied them ? Also, there are some modifications to add to your template for the mod : did you add them to your new one ?

Hild2005
Registered User
Posts: 3
Joined: Sat Apr 26, 2008 3:57 pm

Re: Topic Calendar (regular phpBB edition)

Post by Hild2005 » Sat Apr 26, 2008 10:20 pm

Ptirhiik wrote:TC has always been adding new files in the templates/ directory: have you ensured you have copied them ? Also, there are some modifications to add to your template for the mod : did you add them to your new one ?
I've done nothing yet, because the install instructions for the latest version show various edits to files, and when I look at those same files to see if they have similar edits, no edits exist for the old version, so I am concerned about having an existing, old version, and simply installing the new version without knowing where/how the old version knows what to do since the files I checked show no previous edits for the mod.

The mod works for the two original templates. But it does not show on/with the new template I added.

User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Re: Topic Calendar (regular phpBB edition)

Post by Ptirhiik » Sun Apr 27, 2008 8:48 am

Yes, the edits of the old versions were not in the same files (some were, but not all). Except for the .tpl's, all should be marked with comments (//-- mod: tc probably). One note: the database didn't changed, so you don't have to worry about this part. So your first problem is to uninstall the mod, prior going with the last version. Chek in the upgrade/ directory, you should have an unistall_.txt for the the 1.0 versions you can follow to help you.

Hild2005
Registered User
Posts: 3
Joined: Sat Apr 26, 2008 3:57 pm

Re: Topic Calendar (regular phpBB edition)

Post by Hild2005 » Sun Apr 27, 2008 4:07 pm

Excellent! Thank you for your assistance. :D

Landros
Registered User
Posts: 1
Joined: Wed Apr 30, 2008 9:52 pm

Re: Topic Calendar (regular phpBB edition)

Post by Landros » Wed Apr 30, 2008 10:06 pm

First off thank you for this mod. I absolutely love it. I just installed it problem free. I was wondering if anyone has made a mod or edited this one to include repeating events. Or if not if anyone out there would be willing to. I wouldn't mind paying for it.

Thanks

InTimo
Registered User
Posts: 18
Joined: Fri Dec 07, 2007 10:08 pm

Re: Topic Calendar (regular phpBB edition)

Post by InTimo » Thu May 01, 2008 6:44 pm

@ Ptirhiik .. no idea for my Problem posted above ?? I can´t find anything

User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Re: Topic Calendar (regular phpBB edition)

Post by Ptirhiik » Thu May 01, 2008 8:47 pm

> inTimo: As I suggest, you will probably have to do similar modification to the url() method than the ones done in session.php. However, you should sanatize the $_POST/$_GET (which will not work in certain cases within phpBB: the use of $HTTP_*_VARS[] array in place is mandatory) with a proper intval(), as you are opening some security issue without doing it - you should btw report this to the original author of this style select mod.

Post Reply

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

Who is online

Users browsing this forum: No registered users and 173 guests