[ABD] phpBB Calendar 0.1.1 (alightner)

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.
krackq
Registered User
Posts: 8
Joined: Tue May 28, 2013 1:50 pm

Re: [Beta] phpBB Calendar 0.1.1 (alightner)

Post by krackq »

@Joshua203

Oops.. my bad. I was trying to work and skim this at the same time and looked at the subject instead of poster name. Fixed now!


Also, I tried your suggestion. It didn't seem to make a difference. Poking around at the code, I think it is pretty specific that you have to be a member of the group or the one that created the event to see it. It looks like there is a common function that grabs your group membership and uses it to view events. Perhaps I can tweak it to make an additional check for a specific group membership and if so, return all of the groups or something similar.
User avatar
Feneck91
Registered User
Posts: 115
Joined: Mon May 20, 2013 9:47 am
Name: Stéphane Château
Contact:

Re: [Beta] phpBB Calendar 0.1.1 (alightner)

Post by Feneck91 »

The first post who explain this mod is from alightner.
I can suppose it's alightner but I don't read the 279 page before !
I don't know if it continue to develop this mod0
And I'm french and I'm not very good in english....
User avatar
Joshua203
Registered User
Posts: 227
Joined: Tue Jul 21, 2009 7:01 pm
Location: Rotterdam, Netherlands, Europe, Earth.
Name: Joshua 203
Contact:

Re: [Beta] phpBB Calendar 0.1.1 (alightner)

Post by Joshua203 »

@ Feneck91

My name is not google, please do your own research before posting silly questions that show how much you want to invest in learning or answering your own questions before asking someone else to waste their time for you.

Sorry ..not nice but true in my humble opinion, (you don't do the research, you hardly know coding basics... but you do want to realease it on your forum while anyone wrapped their brain arround it exept you???... no chance..not through me anyway :lol:

I'm Dutch and I DID read all 279 pages and even will do again if needed!!
Last edited by Joshua203 on Sat Jun 01, 2013 5:50 pm, edited 1 time in total.
Image
http://DutchaGoGo.com (development/under construction ..forever?¿?) ;)
User avatar
Joshua203
Registered User
Posts: 227
Joined: Tue Jul 21, 2009 7:01 pm
Location: Rotterdam, Netherlands, Europe, Earth.
Name: Joshua 203
Contact:

Re: [Beta] phpBB Calendar 0.1.1 (alightner)

Post by Joshua203 »

krackq wrote:@Joshua203

Oops.. my bad. I was trying to work and skim this at the same time and looked at the subject instead of poster name. Fixed now!


Also, I tried your suggestion. It didn't seem to make a difference. Poking around at the code, I think it is pretty specific that you have to be a member of the group or the one that created the event to see it. It looks like there is a common function that grabs your group membership and uses it to view events. Perhaps I can tweak it to make an additional check for a specific group membership and if so, return all of the groups or something similar.
Never mind ..I just wanted to make sure who this was pointed at :lol:

I think the keyword here is "private" in "pivate group", I'm amazed though why switching the last suggestion did not help or even did nothing.

another thought to make this adding of 12 staff-members to groups easier.. have you researched if phpbb makes adding groups to groups is possible? That would save alot of work :idea:
Image
http://DutchaGoGo.com (development/under construction ..forever?¿?) ;)
mokatu
Registered User
Posts: 3
Joined: Thu Jul 19, 2007 6:47 am

Re: [Beta] phpBB Calendar 0.1.1 (alightner)

Post by mokatu »

One thing I wish that was different with this mod is that each event posted on the calendar be searchable by the forums, and counts as a post.. reason being.. I would like to RSS the events to widgets on other websites.

Any ideas on how I could accomplish this?
User avatar
Joshua203
Registered User
Posts: 227
Joined: Tue Jul 21, 2009 7:01 pm
Location: Rotterdam, Netherlands, Europe, Earth.
Name: Joshua 203
Contact:

Re: [Beta] phpBB Calendar 0.1.1 (alightner)

Post by Joshua203 »

I think in this case the other calendar mod would be better for you? topic calnedar or something like that.
Image
http://DutchaGoGo.com (development/under construction ..forever?¿?) ;)
krackq
Registered User
Posts: 8
Joined: Tue May 28, 2013 1:50 pm

Re: [Beta] phpBB Calendar 0.1.1 (alightner)

Post by krackq »

We got a fix up and running to the issue we were having. In the process of testing it out still but it seems promising. Essentially there was no check for having the "Can create/edit events for groups that they do not belong to" configured, meaning that even though you have this set to yes, you still could not see events for groups that you did not belong to, but you could edit them. Not sure if that was intentional. Kind of doesn't make sense in our particular case at least. On our forums, this permission is only set for forum administrators and for those considered a global moderator.
In functions_calendar.php, first find every instance of:

Code: Select all

		$group_options = get_sql_group_options($user->data['user_id']);
There are a bunch of functions there using it needing the fix. Add a new line after each with:

Code: Select all

		$nonmember_allowed = $auth->acl_get('u_calendar_nonmember_groups');
Next replace every instance of:

Code: Select all

(event_access_level = 1 AND ('.$group_options.')
with:

Code: Select all

(event_access_level = 1 AND (('.$group_options.') OR ('.$nonmember_allowed.') ) )
$group_options is the check for being a member of the group, and the new $nonmember_allowed one is to see if they have the "Can create/edit events for groups that they do not belong to" permission set. It is checked when displaying groups while posting a new event, but was missed when populating the calendar.

The second part involved using the same permission setting and checking for authorization to view the events themselves. The events were now showing up properly on the calendar but clicking on them gave an access denied message essentially. This next part resolves that.
Fix for viewing events. Find the following in functions_calendar.php and change the last line to match the second code block.

Change:

Code: Select all

function is_user_authorized_to_view_event($user_id, $event_data)
{
	global $auth, $db;
	$user_auth_for_event = 0;

	// no matter what the author can always see their own events
	if( $user_id === $event_data['poster_id'] )
to:

Code: Select all

function is_user_authorized_to_view_event($user_id, $event_data)
{
	global $auth, $db;
	$user_auth_for_event = 0;

	// no matter what the author can always see their own events
   // "Can create/edit events for groups that they do not belong to" can see events
       	if( $user_id === $event_data['poster_id'] OR $auth->acl_get('u_calendar_nonmember_groups') )

So far this seems to work for us. Props to one of our users (forum name Gorgon though not on here that I know of) that helped sort this out.
User avatar
A1_Gorgon
Registered User
Posts: 1
Joined: Tue Jun 04, 2013 8:03 am

Re: [Beta] phpBB Calendar 0.1.1 (alightner)

Post by A1_Gorgon »

krackq wrote:So far this seems to work for us. Props to one of our users (forum name Gorgon though not on here that I know of) that helped sort this out.
That'd be me, and yes, I've been following this mod since krackq first started looking at adding it to our board. Great work on it.

The last line in the code above should have used ||, not OR by the way. I sent krackq the changes before actually testing/implementing them (sorta thinking out loud on the problem while chatting on IRC with him and looking at the code, though supposedly php was fine with OR as well.). So far nothing has blown up, so good sign. :P

Code: Select all

    function is_user_authorized_to_view_event($user_id, $event_data)
    {
       global $auth, $db;
       $user_auth_for_event = 0;

       // no matter what the author can always see their own events
       // "Can create/edit events for groups that they do not belong to" can see events
              if( $user_id === $event_data['poster_id'] || $auth->acl_get('u_calendar_nonmember_groups') )
User avatar
Joshua203
Registered User
Posts: 227
Joined: Tue Jul 21, 2009 7:01 pm
Location: Rotterdam, Netherlands, Europe, Earth.
Name: Joshua 203
Contact:

Re: [Beta] phpBB Calendar 0.1.1 (alightner)

Post by Joshua203 »

Congrats sofar guys, fingers crossed :lol:

Keep up the great work ;)

Off topic:
Geee phpbb.com and not accepting images ...hrrrmmpfff
Image
http://DutchaGoGo.com (development/under construction ..forever?¿?) ;)
User avatar
muggins
Registered User
Posts: 1183
Joined: Fri Feb 22, 2008 5:12 pm
Location: Texas
Name: Donovan
Contact:

Re: [Beta] phpBB Calendar 0.1.1 (alightner)

Post by muggins »

Hmm. I can post images here as Image

Did you want to attach one? There are only a few fora here that allow that...
Muggins
User avatar
Hippie459MN
Registered User
Posts: 964
Joined: Mon Oct 15, 2007 10:13 pm
Location: Minnesota, USA
Contact:

Re: [Beta] phpBB Calendar 0.1.1 (alightner)

Post by Hippie459MN »

I can post images just fine too using the IMG tags.
fnys
Registered User
Posts: 26
Joined: Sun Oct 24, 2010 11:52 pm
Location: Stockholm
Name: Fredrik Nyström

SQL commands code working for MySQL 4.0

Post by fnys »

Hi
I'm Getting the same error every time when trying to execute the SQL commands in phpMyAdmin:
Image
I've always tried (several times now!) on a new installed, unmodified phpBB forum but still can't get it to work.

I've also read this thread (that the "Troubleshooting guide" refers to):
http://www.phpbb.com/community/viewtopi ... 5#p3824905
Still getting the same error! ...and this thread is for much older calendar versions too. :?

I think I know what the problem is and I KNOW that I got the answer in the MySQL error message but I still can't solve it cause of my bad SQL knowledge. :cry:
My MySQL client version is 4.0 and my guess is that the code is made for later MySQL versions. Could that be right?
I would be more than superhappy if someone could change the SQL commands so they work for MySQL 4.0.


phpBB forum version: 3.0.11
Calendar version: 0.1.1
phpMyAdmin - 2.11.10
MySQL client version: 4.0.27
Used PHP extensions: mysql


Thanks in advance!
RSHKwee
Registered User
Posts: 5
Joined: Wed Jun 05, 2013 11:27 am

Re: [Beta] phpBB Calendar 0.1.1 (alightner)

Post by RSHKwee »

I am using this great MOD.
And I have the following question:

I want users to give the possibillity to modify a groupevent of the group they belong to.
But I can only find the permission to modify a nonmember groupevent ...
Do I miss something? Or is it not possible in the current version?

With kind regards,

René
RSHKwee
Registered User
Posts: 5
Joined: Wed Jun 05, 2013 11:27 am

Re: [Beta] phpBB Calendar 0.1.1 (alightner)

Post by RSHKwee »

By the way, I have a Dutch translation available for version 0.1.1 but I have no site to make the files available. Can I mail them to someone (who)?

René
jullman
Registered User
Posts: 1
Joined: Thu Jun 13, 2013 9:03 pm

Re: [Beta] phpBB Calendar 0.1.1 (alightner)

Post by jullman »

Hello guys

I install this mod in my phpbb forum. But i have this probleme when i open calendar.php :

Code: Select all

SQL ERROR [ mysqli ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND ((( event_start_time >= 1370037600 AND event_start_time <= 13701239' at line 4 [1064]

SQL

SELECT * FROM phpbb_calendar_events WHERE ( (event_access_level = 2) OR (poster_id = 2 ) OR (event_access_level = 1 AND ((group_id = 5 OR group_id_list LIKE '%,5,%' OR group_id = 4 OR group_id_list LIKE '%,4,%' OR group_id = 2 OR group_id_list LIKE '%,2,%') OR (0) ) ) ) ) AND ((( event_start_time >= 1370037600 AND event_start_time <= 1370123999 ) OR ( event_end_time > 1370037600 AND event_end_time <= 1370123999 ) OR ( event_start_time < 1370037600 AND event_end_time > 1370123999 )) OR ((event_all_day = 1) AND (event_day LIKE ' 1- 6-2013'))) ORDER BY event_start_time ASC

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/includes/db/dbal.php
LINE: 757
CALL: trigger_error()

FILE: [ROOT]/includes/db/mysqli.php
LINE: 182
CALL: dbal->sql_error()

FILE: [ROOT]/includes/functions_calendar.php
LINE: 198
CALL: dbal_mysqli->sql_query()

FILE: [ROOT]/calendar.php
LINE: 94
CALL: calendar_display_month()
thank you
Locked

Return to “[3.0.x] Abandoned MODs”