Previous Thread
Next Thread
Print Thread
Rating: 14
Page 1 of 4 1 2 3 4
#213713 02/13/2002 10:57 PM
Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
OK... This one made me see variables in my sleep. Thanks Gamejag for the great base.

Max


[Edit: For those looking for the current files:

For those experienced that can handle diff comparisons, I have the differences between stock 5.5.1 threads files and the calendar modification (v2.2).

diff.zip
(stock 5.5.1 on the left and modifications on the right)

For us mere mortals, here is a more understandable instruction set:
calendar_2_2.zip
Attachments
44342-calendar_v2.zip (0 Bytes, 31 downloads)

Last edited by AllenAyres; 03/30/2002 9:08 AM.
Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Somebody's been very busy []https://www.ubbdev.com/threads/php/images/icons/laugh.gif[/]

Thanks for this, I'll be adding it here and a few of yours and Dave's other stuff to assist with bug-testing []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]


- Allen wavey
- What Drives You?
Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I'll have the "Upcoming Events" pal box in with the next indexpal release []https://www.ubbdev.com/threads/php/images/icons/wink.gif[/]

I haven't had time to set the files up you sent but I'll try to get some time in tonight. Things got bizy around here... []https://www.ubbdev.com/threads/php/images/icons/crazy.gif[/]

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
I keep getting an error. Will do further investigation and post again.


Silly ricer.. Wings are for airplanes!
Sponsored Links
Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Sorry... I forgot to back out my customized outoing message for reply notifications. Look for the words "from The Hang" and modify either to the original or to the text of your choice.
Max

Franky #213719 02/14/2002 11:05 PM
Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
On the calendar? What's the nature of the error?

If your error is during addpost... I did ran into some unexpected difficulties with Gamejag's prior script, where he had

$ETime = mktime ($hour_convert,$min,0,0,0,0);

which I replaced with

$ETime = mktime ($hour_convert,$min,0,0,0,$year);

because the prior mktime was giving me -1 for some reason. I believe that older versions of PHP handle the mktime variables slightly differently. You may want to try to change it back to 0,0,0); to see if that helps.

Regards,
Max

Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Looking forward to it! FYI, the files I sent you are slightly older than this posted version, use this one instead. I added the navigation to be able to go to the next month without having to use the dropdown, and might have corrected a couple of minor bugs.
Max

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
The error usually is in line 1281 (the end). I already caught the custom message. Beyond Compare rocks!


Silly ricer.. Wings are for airplanes!
Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
Parse error: parse error in /home/stylus/public_html/forums/addpost.php on line 1288

Line 1288 for me is...

?>



Silly ricer.. Wings are for airplanes!
Sponsored Links
Joined: May 1999
Posts: 90
Member
Member
Offline
Joined: May 1999
Posts: 90
> because the prior mktime was giving me -1 for some reason.
It's because you can't have all three of them (month, day and year) equal to 0.

Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Makes sense... but Gamejag's prior version worked for him. So maybe prior version of php had different error handling, eg would assume year to be equal to current year in case of error... wild guess.
Max

Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Hey Excel,

A couple of suggestions....

1) in the production version of ubbthreads 5.5, addpost.php doesn't have a ?> at the end. I initially had the calendar working without this, but added it in as a result of a suggestion. Try to just remove it and see if that solves your problem.

2) My version is 1320 lines... did you really delete that many lines?! That sounds weird, you my want to doublecheck.

If the above doesn't solve it, try to figure out whether the problem is specific to your setup: try installing the calendar, as is, and see if it works for you. If it doesn't, let me know the problem. If it does work, then it means that your further changes are causing the problem, and it might help you zero in on what's going on.

Cheers,
Max

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I just set the calendar up to play with... went smooth! I'll be working on the upcoming events pal box this weekend... (tonight, maybe tomorrow, maybe tomorrow night... lol)

Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Cool - looking forward to it.

The majority of readers seemed to miss the threaded view - so what I'm planning next is to have a "combined" view, where the calendar will be shown along with a few of the latest threads. Maybe I'll use the "latest threads" script, if I could get my hands on it... a number of people seem to be asking for it, no replies so far. Do you have it?

Max

Joined: Jan 2001
Posts: 374
Enthusiast
Enthusiast
Offline
Joined: Jan 2001
Posts: 374
Is there a aorking demo (has somebody got it up an (running) so that I can evaluate what is does and whether I want it on my boards?

Thanks!

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
You can mess with it on my test site.. http://www.chattersonline.com/test/ubbthreads.php

click on the "Chat Calendar" board and add events after you have registered... []https://www.ubbdev.com/threads/php/images/icons/wink.gif[/]

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Do you mean have the calendar display the event with x number of replies under it?

Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
No... I mean have the calendar displayed as is, and then display a few of the latest threads so that people can easily spot the latest additions.

I don't know if these show be on the side or at the bottom.

Regards,
Max

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Oh so show the recent posts according to B_Posted and not B_Last_Post on the same page as the calendar is being displayed?

lol otherwise I was just going to say that there is a "Current Threads" pal box that is in with the next release.. any posts made to the calendar show up there also according to B_Posted

[]https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I was just thinking that E_Date and E_Time could be one single unix time stamp... one less thing to convert for displays...

Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Yep, maybe... but if someone doesn't want to use Location as a primary sort field, ie someone who is running a particular venue so that Location is always the same, then it's useful to sort by time... so it's handy to have it in a separate field. This minimizes the necessary modifications.
Regards,
Max

Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Hi Dave,

Yes... recent posts shown on the same page as the calendar. That way, you wouldn't need to switch views to find recent additions.

I'll wait for your "Current Threads" box... it sounds like this will serve the purpose, with minor modifications, since what I'm talking about is a board-specific "Current Threads".

Any ideas about whether to display these threads below the calendar, or to the side?

Cheers,
Max

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
hmmmm I guess for myself I would want the calendar to always sort with the date/time and let the locations fall where they may... []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]

(just my personal prefs) []https://www.ubbdev.com/threads/php/images/icons/wink.gif[/]

Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
So you can easily modify postlist.php ...

Just replace
ORDER BY E_Location

with

ORDER BY E_Time

You don't need to sort by date, because you're showing one date at a time anyway.

After the above, you may also play around with the next 4 lines which contain $Evnt in order to modify the events display, and not to show the location as the first thing in the string. Or whatever your preference.

Max

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Right []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]

I was just thinking that the "Upcoming Events" pal box doesn't quite reflect the true chronalogical display when the time and the date are in two different fields...

Take a look at the display in the bottom left corner of my test site.. []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Hey Max I was wondering if you have had any problems with the calendar? I created about 15 events then deleted them and now when I post a single event it gets placed in other dates and in some cases the display format is wrong (location,time,subject).

Anyone else having problems?

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I think I see the problem... well not sure if it is but I'll find out. When deleting the calendar post the related event entry in w3t_Events is not deleted also. I'm going to set it up so it does check to see if the post is being deleted from the calendar board and then delete the corrosponding event entry.

Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Hi Dave,

No, I don't see what you mean.

I registered on your site and couldn't post new threads, do you have permissions set up right?

I can delete all the events on my calendar, post new ones, and everything is fine.

Max

Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Correct, I wanted to keep the changes confined, and didn't want to modify the deletion scripts as well.

If you delete an event, its date remains in the w3t_evenst board, but that shoudn't be a problem.

It was initially causing a problem if you moved threads, but in postlist:

SELECT E_ID,B_Username,E_Date,E_Time,E_Location,B_Subject, B_Number, B_Replies,B_Board
FROM w3t_Events, w3t_Posts
WHERE E_Date >= '$lowdate'
AND E_Date < '$highdate'
AND B_Number = E_Number
AND B_Board = '$Board_q'
ORDER BY E_Location

I added the B_Board check to make sure that an event didn't displayed if it was moved out of the calendar board.

You need to have B_Number = E_Number for an event to be displayed... if you delete a post, B_Number disappears, and the event never gets displayed.

Did you modify the scripts from their originals?

I think that the first thing to do to debug on your end would be to take a look at B_Number and E_Number for the event that is giving you a problem.

Regards,
Max

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Hi Max

It seemd that when I deleted posts from the calendar and added new ones that the new ones had the same B_Number as some of the old ones and that in turn matched E_Number or something like that.

The only thing I modified was in the addpost script I changed this:

$EDate = mktime (0,0,0,$mon,$day,$year);

To this:

$EDate = mktime ($hour_convert,$min,0,$mon,$day,$year);

So that the "Upcoming Events" pal box could pull the events in the correct order that they are happening.


Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I added/changed this in the deletepost.php script:

// -----------------------------------
// Get the post info from the database
$Board_q = addslashes($Board);
$query = "
SELECT w3t_Boards.Bo_Calendar,w3t_Posts.B_Username,w3t_Posts.B_Subject,w3t_Posts.B_Body,w3t_Posts.B_Approved,w3t_Posts.B_File,w3t_Posts.B_Poll,w3t_Posts.B_Main
FROM w3t_Posts,w3t_Boards
WHERE w3t_Posts.B_Number = '$Number'
AND w3t_Posts.B_Board = '$Board_q'
AND w3t_Boards.Bo_Keyword = '$Board_q'
";
$sth = $dbh -> do_query($query);

// -------------------------
// Assign the retrieved data
list($Calendar,$Postedby,$Subject,$Body,$Approved,$File,$Poll,$Main) = $dbh -> fetch_array($sth);
$dbh -> finish_sth($sth);


And this:

if ($Calendar == "Y") {

$query = "
DELETE FROM w3t_Events
WHERE E_Number = '$Number'
";
$dbh -> do_query($query);

}

Just above the file deletion.

It seems to be working in deleting related events. []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
These changes seemed to have helped me. I haven't had any problems while testing and deleting posts. []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]

Oh and I corrected the permissions for the calendar postings so people can test it out. (thanks letting me know)

Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
I understand what you did Dave, but I still don't understand why you had a problem in the first place. Normally, unless you've changed something on your end, if you delete a post the B_Number doesn't get used again.

On my board, I can add an event, say number 123, delete it, then post a new event, and the new post number is 124 - there is no 123 any more.

This makes sense - otherwise, if you had a link to a post from somewhere, that link could pull up a different post altogether (if there was a delete/add in the meantime).

So there's something else happening on your boards, that's causing B_Number to get re-used. That's not good I think, I can't think of the exact scenarios that would result in bugs but I know that they must be there.

Max

Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Ah... I thought you would do

$date = find today's date
i=0
do while (i <= xxx){
show $date
show events in user-selected order, eg by time or by location/time
i = i+1
date = date + 1
}

This would let you select the number of days to display. I believe that with the method you're talking about, you're going to have to select the total number of events to display, so if you have a day with a lot of events, your time-horizon will be smaller - I personally don't like that. I would like to see "this week's events" by setting xxx to 7 days, for instance.

Thoughts?

Max



Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Hi again Dave... I think we've uncovered a 5.5.1 bug which is causing your problem.

See https://www.ubbdev.com/threads/php/showthreaded.php?Cat=&Board=phpbugs&Number=44450

I checked your board, confirmed that post numbers are getting "re-used" after getting deleted... then I tested over here, and noticed that the same thing was happening.

My boards, on 5.5 , don't re-use post numbers.

Max

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
In reply to:


1) in the production version of ubbthreads 5.5, addpost.php doesn't have a ?> at the end. I initially had the calendar working without this, but added it in as a result of a suggestion. Try to just remove it and see if that solves your problem.



Tried that with no success, then the error would just be the last line.
In reply to:


2) My version is 1320 lines... did you really delete that many lines?! That sounds weird, you my want to doublecheck.



Your version has a LOT of blank lines in it for some reason. In addition to me using the checkbox Post Icon hack and the message boc clickable icons that I am writing up.

If the above doesn't solve it, try to figure out whether the problem is specific to your setup: try installing the calendar, as is, and see if it works for you. If it doesn't, let me know the problem. If it does work, then it means that your further changes are causing the problem, and it might help you zero in on what's going on.

Cheers,
Max




Silly ricer.. Wings are for airplanes!
Franky #213750 02/16/2002 11:21 AM
Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Hi Excelsior,

Ah, yes, I think I added the blank lines in the process of lining things up with the unhacked version in a side-by-side view.

Could you try to implement the calendar as is, to see if it's working for you w/out your own hacks added in?

The next thing I'm thinking of doing, is instead of weaving the calendar everywhere in the script, to create a clean
if calendar {
bla bla
}
elseif calendarinstandardview {
bla bla
}
elseif notcalendar {
unhacked version
}

this will make future upgrades much easier, and will allow better/easier interaction with other hacks.

Do you think this will be useful to you?

Max

Joined: Aug 1999
Posts: 184
Member
Member
Offline
Joined: Aug 1999
Posts: 184
OK I threw out the two out of the three hacks I have in. The Mark All Posts read does not effect this.

It works fine, but since I do have Netscape users AND its still my choice, I changed line 897 and 900 to ¦ instead of what you had because Netscape does not know what to do with Entities over 255.

Now I go back and add those two hacks in and find the problem.


Silly ricer.. Wings are for airplanes!
Franky #213752 02/16/2002 3:11 PM
Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Hi Excelsior....

Here's a new version of postlist.php (attached) -

I broke it out into 3 separate cases. To find the beginning and end of each section, look for the word "Hack".

This way, it should be *much* easier to merge your old hacks - just include the old hacks into the appropriate section. Also, this should make future upgrades much easier.

I'll package this up with the updated deletepost.php which is needed if you're running 5.51 , and I'll repost the package later on.

Regards,
Max
Attachments
44460-postlist_v2.1.txt (0 Bytes, 35 downloads)

Last edited by Max Fisch; 02/16/2002 4:09 PM.
Page 1 of 4 1 2 3 4

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
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 2001
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)