[MOD-DB] Topic Calendar 1.2.2 (regular edition)

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.
jcproduction
Registered User
Posts: 16
Joined: Thu Aug 04, 2005 2:14 pm

Topic Calendar

Post by jcproduction » Wed Aug 02, 2006 3:10 pm

the program you asked me to download and compare is very useful, thanks alot, but since i am not furmiliar with this error i really don't know what i am suppose to look for or how to remedy the problem. maybe it needs something in that line 916 of function_post.php. thanks again.

jcproduction
Registered User
Posts: 16
Joined: Thu Aug 04, 2005 2:14 pm

Post by jcproduction » Wed Aug 02, 2006 7:18 pm

Ok guys i think i fixed it after one week of stress :? well since i am using both super charged gallery by smartor and the topic calendar they both were kinda using the same script in clown_album_functions.php and functions_post.php so what you have to do is this.

open
functions_post.php and find:
=====================
//
// Fill smiley templates (or just the variables) with smileys
// Either in a window or inline
//
//function generate_smilies($mode, $page_id)
{
=====================
replace by:
=====================
//
// Fill smiley templates (or just the variables) with smileys
// Either in a window or inline
//
function generate_smilies($mode, $page_id)
{
========================
open album_mod/clown_album_functions.php find:
========================
//to have smilies window popup
function generate_smilies($mode, $page_id) //borrowed from phpbbforums...modified to work with album
{
========================
replace by:
//to have smilies window popup
//function generate_smilies($mode, $page_id) //borrowed from phpbbforums...modified to work with album
{
========================
that't it, i am no professor in this i just happened to like phpbb and know some of its coding, if some still has any questions or can't figure it out, i am 100% glad to help any one. stay cool cause its hot in rhode island!

imoore
Registered User
Posts: 26
Joined: Fri Feb 10, 2006 1:16 pm

Re: Can't add users after installing the calendar mod

Post by imoore » Thu Aug 03, 2006 10:57 am

imoore wrote: Could not insert data into users table
DEBUG MODE
INSERT INTO phpbb_users (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey) VALUES (62, 'test', 1154219314, '143949a054f988e0fe1a', 'no-spam@swiftdsl.com.au', '', '', '', '', '', '', '', '', 0, 0, '', '', '', 1, 1, 0, 1, 1, 0, 1, 1, 9.5, 'D M d, Y g:i a', 'english', 1, 0, 1, 0, 'de18938a4d')

Line : 659
File : usercp_register.php


I'm still having trouble with this - I've tried to work out what's missing, but no luck so far. I've mostly concentrated on usercp_confirm.php, usercp_register.php and class_calendar_settings.php since they seem to be the likely candidates - comparing what I've got to the "installed" version, but I can't find anything that's missing in my files.

I think I've figured out where, in the "installed version", a new user record is added to the phpbb_users table, so I can work out why the calendar preference fields for that record are not being passed to the INSERT ROW command string in my board.

As far as I can see, the code is in usercp_register.php:
$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, ";
if ( $board_config['require_activation'] == USER_ACTIVATION_SELF || $board_config['require_activation'] == USER_ACTIVATION_ADMIN || $coppa )
{
$user_actkey = gen_rand_string(true);
$key_len = 54 - (strlen($server_url));
$key_len = ( $key_len > 6 ) ? $key_len : 6;
$user_actkey = substr($user_actkey, 0, $key_len);
$sql .= "0, '" . str_replace("\'", "''", $user_actkey) . "')";
}
{
$user_actkey = gen_rand_string(true);
$key_len = 54 - (strlen($server_url));
$key_len = ( $key_len > 6 ) ? $key_len : 6;
$user_actkey = substr($user_actkey, 0, $key_len);
$sql .= "0, '" . str_replace("\'", "''", $user_actkey) . "')";
}
else
{
$sql .= "1, '')";
}

if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Could not insert data into users table', '', __LINE__, __FILE__, $sql);
}


That code doesn't include any of the user calendar preference fields, which are manatory (ie NOT NULL) fields, so I guess they are supposed to be added to the sql command somewhere else before the command is actually executed and I guess those values come from $sql in class_calendar_settings.php.

I can't understand this - there is not mention of the calendar preferences in this code, yet those fields are mandatory (ie NOT NULL) and don't have default values in the database structure (and the postgres.sql file in the mod doesn't list any default values).

If anyone can suggest a fix or tell me where the code is that actually adds a record to the phpbb_users table, I'd be most grateful :-)

Alternatively, if I set a default value for those fields within the database, would that stop the above error occurring and is that likely to cause other problems?

Cheers,
Ian

PS, I've being comparing my files against the "Installed" version files. This is what I get for the three files mentioned above:
% diff phpBB2/includes/usercp_register.php temp/mod-TC122_installed/root/includes/usercp_register.php
10c10
< * $Id: usercp_register.php,v 1.20.2.70 2005/12/29 11:51:11 acydburn Exp $
---
> * $Id: usercp_register.php,v 1.20.2.76 2006/05/30 19:29:43 grahamje Exp $
90,99c90,99
%

% diff phpBB2/includes/usercp_confirm.php temp/mod-TC122_installed/root/includes/usercp_confirm.php
9c9
< * $Id: usercp_confirm.php,v 1.1.2.2 2005/12/29 11:51:11 acydburn Exp $
---
> * $Id: usercp_confirm.php,v 1.1.2.4 2006/05/30 19:29:43 grahamje Exp $
152d151
<
200d198
<
256d253
%

% diff phpBB2/includes/class_calendar_settings.php temp/mod-TC122_installed/root/includes/class_calendar_settings.php
%

So it looks like the mod applied cleanly to those files at least.

fenrick
Registered User
Posts: 5
Joined: Wed Aug 02, 2006 10:32 pm

Post by fenrick » Thu Aug 03, 2006 12:21 pm

Hi Guys,
I absolutely love this mod. I noticed another post in this thread that another World of Warcraft guild is using this and I don't blame them! It's a must!

Anyway, here is the problem I am having that is probably an easy fix.
I recently upgraded from 2.0.17 to 2.0.21 just so that I could use this mod.
Before upgrading, i switched to the default subsilver template, upgraded, installed the topic calendar mod and tested it out. it worked perfectly.

Now, I went back into the ACP to switch back to my old Cobalt Template (Theme) but as soon as this change was made, I was stopped cold with errors. In fact i could not log on at all to change back to Subsilver without copying the Topic Calendar template files to (and overwriting) the old Cobalt template files in the templates directory. Once i did this i was able to log in again and go to the ACP and change back to default SubSilver.

It appears that the Template I am using (and i am guessing any other template) is either not compatable with the Topic Calendar or is simply missing some files in the template directory that allows TC to be used.

Are there any tips to help me get my old Template theme back and still use this excellent mod?
Thanks,
Fenrick
http://horderlies.com

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

Post by Ptirhiik » Thu Aug 03, 2006 1:06 pm

Nothing particular: ensure you have no remaining modifications from an older version, then apply to cobalt the similar modifications required for subSilver, and of course, don't forget to remove older tpls files before putting the new ones. Take care if you are using a template cacher (like eXtreme style ie) to clear the cached files.

fenrick
Registered User
Posts: 5
Joined: Wed Aug 02, 2006 10:32 pm

Post by fenrick » Thu Aug 03, 2006 1:27 pm

Ptirhiik wrote: Nothing particular: ensure you have no remaining modifications from an older version, then apply to cobalt the similar modifications required for subSilver, and of course, don't forget to remove older tpls files before putting the new ones. Take care if you are using a template cacher (like eXtreme style ie) to clear the cached files.


Hi Ptirhiik,
Thanks for replying so quickly!
So far from what I can tell playing around, is that I am simply missing the Calendar Code from the overall_header.tpl file.
Looks like i have 1 of 2 options unless I am making things harder than I need to.
1) FIND the proper calendar code from the topic calendar overall_header.tpl and put it into the cobalt one. Or...
2) Edit a copy of the overall_header.tpl file in the subsilver+topic calendar do a find/replace with Subsilver and replace with Cobalt.

I'm gonna go ahead and try this, but please let me know if Iam over complicating things or fixing a symtom and not the problem.
:)

EDIT: Ok, #2 did not work as there is still all the Subsilver styles but Cobalt logos.. oops. Looks like i'll have to go through each file manually in the templace and fo the [find] & [change] stuff

jcproduction
Registered User
Posts: 16
Joined: Thu Aug 04, 2005 2:14 pm

Post by jcproduction » Thu Aug 03, 2006 2:47 pm

Hello All, Does any one knows how to make the codes work to make an image appear when you mouse over a calendar event? i tried manipulating with a mod that makes it possible by inserting Image but since topic calendar does not use its own bbcode.php nor .tpl i really can't make it happen. this is how it looks now. i really don't know where the heck the [/url] is coming from? any ideas thanks guys.
Image

ps. i will try to make it work, once i do i will let the world know.

jcproduction
Registered User
Posts: 16
Joined: Thu Aug 04, 2005 2:14 pm

Post by jcproduction » Thu Aug 03, 2006 3:17 pm

Ok guys its me again, i finally found the solution:

open includes/class_callendar_topics_parse.php and find:
=====================================
// replace img with url
$message = str_replace(array('[img]', '[/img]'), array('', ''), $message);
}
=====================================
replace with:
=====================================
// replace img with url
$message = str_replace(array('[img( | =left | =right )]', '[/url]'), array('', ''), $message);
}
=====================================
thats it, any questions let me know.

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

Post by Ptirhiik » Thu Aug 03, 2006 3:23 pm

The [img] bbCode are cleaned on purpose, to prevent a too large image to be displayed in the overview. In your case, as you are using a specific mod, you can do this:

Code: Select all

#
#---[ OPEN ]--------
#
includes/class_calendar_topics_parse.php
#
#---[ FIND ]------
#
	$str = preg_replace('/\[img:[a-z0-9]{10,}\].*?\[\/img:[a-z0-9]{10,}\]/', ' ', $str);
#
#---[ REPLACE WITH ]----------
#
	$str = preg_replace('/\[img:[a-z0-9]{10,}(=?.*?)\].*?\[\/img:[a-z0-9]{10,}\]/', ' ', $str);
#
#---[ FIND ]--------
#
			$message = str_replace(array('[img]', '[/img]'), array('[url]', '[/url]'), $message);
#
#---[ AFTER, ADD ]--------
#
			$message = preg_replace('/\[img(=?.*?)\]/', '[url]', $message);
his will properly clean up the [img] bbCode.

jcproduction
Registered User
Posts: 16
Joined: Thu Aug 04, 2005 2:14 pm

Post by jcproduction » Thu Aug 03, 2006 3:32 pm

do you approve what i did or would i encounter any errors or problem in the long run? thanks

jcproduction
Registered User
Posts: 16
Joined: Thu Aug 04, 2005 2:14 pm

topics calendar on index

Post by jcproduction » Thu Aug 03, 2006 3:36 pm

have any of you know how to place the topic calendar events on the index.php, i was trying to take the ezportal codes and implement them into index.php, i don't get any errors but the calendar events are not appearing, i will work on it later. thanks

imoore
Registered User
Posts: 26
Joined: Fri Feb 10, 2006 1:16 pm

Post by imoore » Fri Aug 04, 2006 11:33 am

Looks like I fixed my problem - adding default values for the calendar pref fields in the phpbb_users table fixes the error when new users try to register. I can edit those preferences once I've created my login, so I guess it's only registering a new user that was a problem.

It's seems very unlikey that no-one would have had this problem before (even it's only postgres users that are affected) so I guess I've fixed the symptom, not the cause of the problem, but hopefully it doesn't matter.
Ian

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

Post by Ptirhiik » Fri Aug 04, 2006 12:23 pm

hm.. interesting: I have to check this one against the schema.

jcproduction
Registered User
Posts: 16
Joined: Thu Aug 04, 2005 2:14 pm

Post by jcproduction » Fri Aug 04, 2006 2:04 pm

after clicking the memberlist link i get this error:
Fatal error: Call to a member function on a non-object in /home/latineve/public_html/le/includes/page_header.php on line 855

i have noticed that its happening after i place this script after
}
header ('Expires: 0');
header ('Pragma: no-cache');:

//-- mod : calendar ------------------------------------------------------------
global $user, $config, $calendar_api;
$user->set();<<<this is line 855 with the error
$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 --------------------------------------------------------

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

Post by Ptirhiik » Fri Aug 04, 2006 2:08 pm

Ensure you have correctly applied the mod comparing all your files with the "installed" pack.

Locked

Return to “[2.0.x] MODs in Development”