Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
Mod Name / Version: Eventspal.php v1.0

Description: Ok I can now

Get Yearly public dates and filter them correctly even recurring yearly

Get Monthly public dates and filter them correctly even recurring Monthly

Get Birthdates and filter them correctly

Lastly I can now get dates from the post table and calendar according to usergroup.

Added a check so that if you have no events, it will spit out so.

Working Under: UBB.Threads 6.4 and 6.4.1

Mod Status: Beta

Any pre-requisites: IIP because you will not authenicated without it unless you add a function for that.

Author(s): scroungr

Date: 01/13/04

Credits: David Lozier for original IIP, Joshpet for updating IIP

Files Altered: eventspal.php

New Files: eventspal.php

Database Altered: No

Info/Instructions: Just change extension from .txt to .php upload this into the pals directory and overwrite existing eventspal.php and set the variables

// Setable variables

// should admins/mods see all dates
// 0 - yes
// 1 - no
$adminmodshow = '1';

// should all events for a given date show under one date
// 0 - yes
// 1 - no
$showdatesunderone = '0';

// show Group Dates on events pal
// 0 - Show Seperately Below the Events under a Group Heading
// 1 - Show Mixed in with the Events
// 2 or other means won't show at all
$groupshow = '0';
// show all Group Dates or just the users in events pal
// 0 - Show all dates for okay board's for all
// 1 - Show all dates for okay board's just for user
$showallgroupdates = '1';

// show Birth Dates on events pal
// 0 - Show Seperately Below the Events under a Birthday Heading
// 1 - Show Mixed in with the Events
// 2 or other means won't show at all
$birthdayshow = '2';

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
Attachments
105068-eventspal.zip (0 Bytes, 63 downloads)

Last edited by scroungr; 05/23/2004 4:39 PM.
Sponsored Links
Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
if someone with a buset sight with alot of users and alot of events can try this I would appreciate it. it works fine on my site..

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Very cool scroungr, nice job.

Will definitely be testing this out once I'm finished hacking away on my upgrade.

Joined: Nov 2000
Posts: 210
Member
Member
Offline
Joined: Nov 2000
Posts: 210
I can view the events for a private forum when I am not logged in (although when I click the event it does not show any details) is this by design or is it a bug?

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
thats what I needed to know.. try and clear your cookies when your not logged in and see if you can see the same.

Sponsored Links
Joined: Nov 2000
Posts: 210
Member
Member
Offline
Joined: Nov 2000
Posts: 210
Yep I can still see them when I have no cookies on the computer at all.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
damn ok thanx...

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
think it has to do with the $users['U_Group'];

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
okay this is fixed now.. had a logi problem.. now it shows all public dates whether they reccur yearly or monthly or never to anyone.. only show private dates to people within the same group as the user whether they reccur yearly or monthly or never and it also shows dates that are entered whether in calendar or events and also shows birthdays..

Someone with alot of events and alot of groups please try this..

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
would have been nice if I had put the correct one in there good thing I checked...

Sponsored Links
Joined: Nov 2000
Posts: 210
Member
Member
Offline
Joined: Nov 2000
Posts: 210
Ok it checks for login properly now but I can see stuff(topics) for groups that I am not a part of still.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
I am betting you are part of those groups somewhere or they of yours.... make sure you are not in users just in admin and make sure you and they share no common groups. if say you have and users1 and a users2 group and a third group lets say users3 and a user from users1 is put into users3 he will see all events for all users in users1 and users3 even if there is a user in user2 and user3. Also MODS and ADMIN will see ALL events because they see ALL groups.. create a user and just put him in users2 group and he will only see events for people in users2.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
I can probably put another switch in there so that the admin could choose NOT to see everyone's events?

Joined: Nov 2000
Posts: 210
Member
Member
Offline
Joined: Nov 2000
Posts: 210
I am not sure I follow that hehe.
The problem I have with this is that I can see topics for groups that I am not a member of. This makes the event pal usecure for events that are private for say a particulkar group that holds group events. although I can click on the event and get a blank enough information is normally in the title to figureout what is happening.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
but your the admin or are you using a user account when you can see that?

Joined: Nov 2000
Posts: 210
Member
Member
Offline
Joined: Nov 2000
Posts: 210
I am admin but I have a lot of boards that I dont monitor, They are private forums for other gaming guilds that use our forums as a place to hang there hat and I only go there if it is absolutely necessary which is almost never. I am not a member of thsoe groups.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
yeah but your an admin hence you see it all. So I will have to add a switch that is basically.. if your an admin or a mod do you WANT to see it all

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
OK - this is great.

A couple of things.

Indeed when you login as a regular user, you can see events for forums they don't have access to.

I didn't totally wrap my head around all that you did, but I don't see a query to the w3t_Boards table in there, so somewhere along the line, you've got to query the read permissions of the w3t_Baords table and see if whatever forum that event belongs to is seen by this group.

This is pretty complicated. So I'm not sure exactly how to go about it, but if you study how it's done in the the calendar script, that should give a bit of an idea.


One other suggestion, and I'm not sure if it's easily possible. But it would be great for the different event types to get 'grouped' under the date. So that the same date doesn't have to repeate if there are multiple things listed under a day.

Wonderful work on this.

As soon as this is set, we'll put out 5.4.5 with this inclluded. I'm finishing up some other IIP improvements.

thanks again!

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
thanx Josh I will take a look at the code and see what I can do.. and a regular user can only access events of people in his group bur yeah if that user is in another group he sees those also so yeah maybe I will have to look at using that from the w3t_Boards table first prior to figuring out what the user can actually see... I will work on this more this week

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Well actually in my testing, if it helps, I posted an event in a forum only visible to the moderators group - and it was visible when I was logged in as a regular user, but not if I wasn't logged in.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
ok I will have to change the function I am using a bit but yeah I can see where the w3t_Boards should be polled for the ones posted as an event in a post but there is not much can do with ones added to the calendar directly as an event.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
I can just add a check when it grabs the events from the post table that if the user can't view the board it was posted in not to spit it out.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
Okay did some more work on this can someone with alot of groups check this. I made it so you can select whether an admin can see all dates or just his and also did a query at the board level.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
I think the last thing left now is to format it like Josh suggests so that all dates on a specific date will be under one date heading

Joined: Nov 2000
Posts: 210
Member
Member
Offline
Joined: Nov 2000
Posts: 210
I have aproximately 30 groups on my boards and I tested it with an unregistered user, a user member of all groups and my admin account. This works nicely, Thanks for fixing it

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
okay then one last thing and should be set...

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
I will also bring up another point with my mod.. since I handle end of the month Events correctly and UBBthreads does not.. If the event is scheduled for the last day of the month say the 31st.. Threads will only show the date if there is 31 days in the month and will not show them if there is less... My mod takes into account there is a last day of the month and it may not be 31...

Joined: Nov 2000
Posts: 210
Member
Member
Offline
Joined: Nov 2000
Posts: 210
you might want to bring that up to scream at ubbcentral... since it sounds like a bug

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
I looked at their calendar code and unfortunately it isn't a bug... but I will post it

Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
When I just installed this (With default settings), I recieved the following error:
Warning: array_multisort(): Argument #1 is expected to be an array or a sort flag in .../forum/pals/eventspal.php(79) : eval()'d code on line 1

What's wrong here ?

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
try the non-default settings? May be the way your server is configured?

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
actually it could also be the fact you dont have those kind of events what else does the error say.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
okay I emptied my tables and I see the error. it only happened when I had no events so I will have to add a check before the sort.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
okay try this new one I added a check so that if no events you will get a message and not an error

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
added the show dates all under one heading.. please try...

Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
Excuse me for my late answer, but last night it was already pretty late.
Ok, I tried it again and now it works!
Indeed I had no events listed yet.

How could I change the dateformat to what we are using ?
We use DD/MM/YY 10:19 AM

Also it would be good if an event could last for more day, but that's something for infopop
(we would like to post exhibitions which have a start & end date).

Keep up the good work!

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
you could alter the order it prints out. Look in the for loops at the end where it prints out and exchange the $outputyaddayadda[$i][0] and $outputyaddayadda[$i][1] variables but ONLY in the for loop.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
mouse over anything important? I never got the thing about Mousing over?

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
I run it right out of the box and get this....

Code
Fatal error: Call to a member function on a non-object in /home/drumlin/public_html/threads/pals/eventspal.php on line 230


Line 230 is:

Code
	$sth = $dbh -> do_query($query);


The query that this tries to run is:

Code
		SELECT Bo_Keyword <br />		FROM {$config['tbprefix']}Boards <br />		WHERE $Grouppostsquery <br />		ORDER  BY  Bo_Keyword ASC


I'm guessing it doesn't like the $Grouppostquery variable?

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
can you see what it is setting the $grouppostsquery to?...

Page 1 of 2 1 2

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)