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
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.
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
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
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.
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)
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?
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
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
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?
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.
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...
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).
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.
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.
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:
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);
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.
$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.
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.
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.
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.
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.
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.
That query wont work but I made one that does... lol along the same lines.
In the calendar addon they only need change one line in the addpost script so that E_Date also includes the time from E_Time.
This will allow for the events to be displayed as they happen. Otherwise the time display will not be in order. It will also be an option to show the location along with the subject in the dispaly []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]
My test site is 5.5 only... I am waiting for the 6.0 before upgrading my main site then I'll set the test site up with that. For the time being just kicking 5.5 around... lol []https://www.ubbdev.com/threads/php/images/icons/wink.gif[/]
Looking at this again, I'm confused here... why the complicated first part? Are you doing anything more than checking whether B_Calendar is equal to Y ?
How about simply
$query = " DELETE FROM w3t_Events WHERE E_Number = '$Number' "; $dbh -> do_query($query);
no if conditions, no double queries, just delete if you find it... why the rest of the stuff - am I missing something?
- The default view now has both the calendar as well as the posts. - Changed terminology as a result (show/hide calendar, instead of change views) - Several small bug fixes - Reworked code in postlist.php to make it much easier to upgrade in the future - Included small graphics to navigate from month to month - Event seperator is no longer browser-specific (the small > were previously only working in Explorer)
Were you going to make that change in the E_Date variable to include the time also? This doesn't seem to affect the display order for "days" and helps when sorting with time specific orders. []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]
I'm not sure which change you mean... is it this one, which calculates the date differently, or this one, where I think you're talking about modifying the fields? Or did I misunderstand the latter, are these two one and the same?
I had to remove the linked zip files from the thread as they violate copyright rules by including the full ubbthreads files modified to include the calendar modification. Sorry for any inconvenience.
As per my PM: would a possible solution entail "replacement" texts for each of the original scripts? Ie if an original script has a hundred lines, maybe the hack should say "replace lines 2 to 99 with the following" ... would that work for your copyright lawyer?
The only problem with using line numbers would be if they had already modified their files, then the numbers would be off. The same problem would occur if they just uploaded the files previously presented and had other modifications involved. Errors would most likely occur if there were conflicts []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]
The way I'm proposing to do it, I don't think that there could be many errors. In concept, I'm proposing:
In addpost.php, find the section that starts with:
# Note: if you modify ANY code within UBBThreads, we at Infopop Corporation # cannot offer you support-- thus modify at your own peril []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/] # --------------------------------------------------------------------------- */
and that ends with:
$html -> send_footer(); ?>
And replace it with the attached file.
I'm not being facecious... would the above address your copyright lawyer's concerns?
And your newer example is still basically the whole file, minus the copyright info.. heheh... we've always used just 1-2 lines above or below the code section needing to be replaced, it keeps us in copyright heaven and doesn't delete the 2 rows of post icons I see above this message box []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/] (it makes modifications minimally conflict with other modifications).
I'll ask Rick to look at this and post his thoughts... thanks for being patient.
If it would help, I can write one based on the currently available modification and show all developers how it should be done... would help with questions in the future.
What we are trying to do here is prevent those who have not paid for the rights to use the board to collect a majority of the files freely. If you send me your edited code, I can toss em in Beyond Compare and make an update text for all the differences and you can publish that.
Sorry, I thought the primary concern was a copyright concern, as opposed to the collection of the files by people who have not paid for the software.
I understand now.
I guess the best way would be to all agree on a utility to install hacks. I've never used Beyond Compare, but that might be an option - Allen mentions Multihack above. I hope we can find one which is open source, and that makes it easy to achieve the necessary pupose.
A much simpler way might be to restrict access to the hack board to those who have a current license. If you have a valid licence, you belong to a user group who has read/download privileges, otherwise you don't.
Someone mentioned diffs, as in deleting everything except the differences and 1-2 lines above and below. I had never thought of that before, but using Beyond Compare would make it extremely simple to copy those changes into the user's files. Should be fine with Rick as well and not violate any copyright concerns. I'll give it a shot with the calendar scripts you posted and see how well Beyond Compare handles it. []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]
hmmm.. the problem with that method is BC wants things to match up, so it will put pieces matching in the wrong place just so it does match. We may need 4-5 lines to get the differences to line up like they should, then we run into more possible conflicts. I'll look at it some more, any other ideas welcomed as well []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]
Ok I have tried and checked everything but this dosnt seem to work for me, I am on 5.5.1 I have checked all the changes have been made to the DB and they have I have created a new forum and checked a dump of the DB to check that the Calender flag is set and it is. When you post in the forum the only change I see is the header for the main box is 'Detailed Event Description', if you reply I see no changes and when you view the post it displays as normal? I have definetly changed the 5 files that come with the zip. Can anyone suggest what I may be wrong.
I would respectfully suggest that you/Scream/Infopop have to figure out what it is you're protecting yourselves against.
If it's copyright issues that you're worrying about, then I do suggest you get a copyright lawyer to draft up a standard agreement which covers derivative works, otherwise people posting hacks may have a claim to their work, regardless of the mechanism used to communicate these hacks to others.
If it's access to the scripts that you're worried about, then I would argue that a restricted-access board for certain hacks may be the easiest & most expedient solution.
Max, I really appreciate the work you put in and shared, but I don't understand what is difficult to understand about this. The files are copyrighted and as such cannot be redistributed to anyone:
# You may not distribute this program in any manner, modified or otherwise, # without the express, written written consent from Infopop Corporation.
That is at the top of every file included with threads. You've been around a while now, Rick has stated he didn't allow posting of complete files any time recently.
Restricted access to forums where files can be posted is impossible anytime soon as well - we do not have access to members area data and will not be getting it. Anything short of that will be circumvented quite easily.
We have been posting text files of changes to be added for a while now, it does take some time - if you'd like for me to do the first one, no problem, then you can edit it to update it for any future changes.
This copywrite arguement seems a bit silly to me, my point being that you can go to many serial/hack type site and download the whole version but you cant go to the official site and download a modified [no warrenty given] file !
It could be that the MySQL statement to turn on the calendar was inputted wrong. I was confused on this at first and found that the script wanted the Displayed name of the board, not the hidden name.
Here is the SQL Statement I ran: UPDATE w3t_Boards SET Bo_Calendar = 'Y' WHERE Bo_Title = 'TSCalendar' ;
The field is set to Y. if you look at the sql dump here: INSERT INTO w3t_boards VALUES ('Turbosport Calendar','The Turbosport Calendar','TSCalendar',NULL,2,1014130982,'Off','Off',47,1014112870,0,'Off','yes',2,'-1-','-1-',1,NULL,'General Discussion',0,'Slim',',CossieClint,','-1-',NULL);
[]https://www.ubbdev.com/threads/php/images/icons/blush.gif[/] Ouch... yes, sorry the instructions were incorrect. I entered the field manually using phpmydmin, so I just wrote out the query but didn't use it... sorry for the frustration I caused. I'm glad you got it working. It's looking good! Regards, Max
Frankly, it's a lot of work, and I don't think that I'm interested in re-writing the instructions for something that's working fine... but if you, Allen or others want to do it then that's perfectly cool .
Perhaps it would be best if Allen orchestrates the effort as he initially suggested. Allen?
FYI - I'm going on vactation in a few hours, I will be away for a week. I'll send Allen a PM and email him the latest scripts again.
FYI, the latest version that I sent you modifies the display: by default, it includes the calendar view as well as the threaded view, and it allows you to navigate to "hide" the calendar, as opposed to "switch views".
I did this in reaction to my readers, who felt with the prior version that although you could switch to a standard view, doing so was a little bit awkward.
It would be a relatively easy matter to change this back to the original way.
I would suggest that the best way to play around with this would be to install it here, decide on whether you like this approach or not, see if want to change some things (eg I hestated whether to include the original navbar in the calendar view), and then make the translations from a working final version.
After looking at the 100+K installation file... I got sick to my stomach (haha not quite) But how long does installing this take? I want to make sure I set enough time aside to do this and not end up somewhere in the middle and have to stop, and forget where I started, and blah.. no fun! []https://www.ubbdev.com/threads/php/images/icons/laugh.gif[/]
Well the good news is that it took me about 30 mins. and the majority of the file is one big chunk.
The bad news is that it's giveing me a bit of a problem working.
Looks like everything is going good, databases seem to have been inserted correctly and such. the calendar shows up in the forum I created for it. but the messages don't show up in the squares ???
It took me about 20-30 minutes to update from an untouched set of 5.5 files. As for the messages not showing up, I would suggest doing it again with a fresh set of those files.
Or use Editplus 2 on a fresh set and then use Beyond Compare to extract your own already added stuff into the fresh calendar ones that you just edited.
Was starting to re-start with a fresh set, and wouldn't you know it? The VERY First thing in the Find / Replace, (add Bo_Calendar) wasn't saved the first go around. Added that variable and everything runs great. []https://www.ubbdev.com/threads/php/images/icons/blush.gif[/]
I took a quick look at edit plus, looks pretty clean, but I'm into editpad pro and got used to it. Thanks anyway....
BTW, again, to those that made this one, Good Job! Just adding it you can see a LOT of coding went into it.
Hrmm... ok, so it takes about a half hour to install. So.. would you advise against installing this while intoxicated? As I'd like to do it right now since my users are bitching at me about it.. but I don't wanna mess it up if ya know what I mean []https://www.ubbdev.com/threads/php/images/icons/laugh.gif[/]
I am extemely new to this and it fired first time with no problems..........
Now I have caught the hacking bug could someone give me a clue as to where you change the "city" tag when posting and aslo where do you change the text limit in the "city" box. Or would it be easier to change the order of how the calender displays the texts, maybe subject first?
poil said: i have one request for this. make it its own file. not included with postlist and such. much easier solution for everyone. and no hacking invloved.
That's a really good idea, and something that should probably be considered more for the future of hacks in general. Making it a separate file eliminates the sometimes lenghty process of modifying existing code and then comparing that code to future releases. (yeah, I use Beyond Compare, but still...:)).
For the record, I use EditPad Pro as well and it's the best text-based editor I've ever seen. Clean, simple to use, able to support multiple files, spell check capability, templates for different file-types, etc.
and if you are on a macintosh, you should use BBedit. it is the best text editing software for the macintosh. simple search and replce functions, multiple file search end replace functions. and yes they are paying me to tell you this, or i wish they would. []https://www.ubbdev.com/threads/php/images/icons/frown.gif[/]
Question. Is there an easy way to disable/not require the "city"?
Another question. I've got these funny characters "õõõ" before each event instaead of arrows like I see on other peoples installs. Maybe it's just my browser. You can see at: http://www.AtlantaSinglesChoir.com/calendar
On the funny characters front: in postlist.php, look for
$events .= "<font color=red><b>
and immediately following that, check out what you've got... I'm using ››› , you might want to start with copying/pasting these characters right there, and if that doesn't work out you can change them to something else that works.
On the City front, the field name is "Location"... it's not supereasy, you need to tinker with it a bit. You would have to:
Just a little insight here as I saw earlier someone brought this up.
In your instructions you create the calendar to display on the top of all forums through the add table function. I followed your instructions to a tee and I did not like what I saw. Great work on the hack but I think most people would like to see threads not a calendar staring them in their face when they enter a forum. So here is what I did and I hope I did it correct. I made another forum called calendar and made sure the BO_Calender field had Y in it for that particular forum. I then edited all other forums to blank ( no Y ) so that there is nothing on that table and optimized my tables. I end up with forums all normal and a calendar forum which displays the calendar.
My only question is the table field Bo_Calendar for all the forums that are set to nothing is this fine?
I just want to say first I think what you are doing here is great. I was also with you guys over at wwwthreads and just renewed my subscription to UBB mainly because of the hacks I saw you guys come up with, so hats off! I would love to get my hands on the Calendar hack if you could give me some sort of location for it? (I did get the intergrated index pal thingy going on my site and I love it,Thanks Dave!) Just gotta twist my users arms to go with the PHP version of threads versus the Perl version! thanks in advance!.
Pappy My site is over at www.greatlakesalliance.com it is an online gaming site for ultima online and the calendar hack would work great on our Event forums.
Thanks Max. I decided not to take the field out, but to use the instructions you gave in another post to change the name and field length of it. Thanks! Excellent work!
in postlist.php, look for if ( !$cs ) { $cs = 2 ; }
If you change that to
if ( !$cs ) { $cs = 2 ; }
The result will be that by default, you will see calendar boards in their "hide calendar" mode, and you would have to click on "show calendar" on top to see the calendar. So it wouldn't "stare you in the face".
As for blank fields for Bo_Calendar for non-calendar boards, yes, that's OK.
Just noticed something in that the calendar doesn't seem to be operating on the same time offset as the rest of the board.......?
Is this just me and the way I have installed it? I use a 16 hr time offset and the main index page shows the correct time and date but the calendar is a day behind.
I have tried looking in postlist.php to see where the calendar gets the time from with no luck,
found this piece of code and was wondering if it will fis the time offset and the best way/place to insert it into the hack
$hourdiff = "16"; // hours difference between server time // and local time in this case, we're *ahead* // of our server by 16 hours $timeadjust = ($hourdiff * 60 * 60); $melbdate = date("l, d F Y h:i a",time() + $timeadjust); print ("$melbdate");
As a result of the bug, addpost was making unneeded entries into the Events table for replies. If desired, you can delete entries in the w3t_Events table which don't have a location listed.
Also, an old/incorrect date was being shown in the preview of replies on the calendar board.
This link https://www.ubbdev.com/mods/5.5/calendar_2_2.zip seemed to be working for me. Maybe Allen didn't have the files uploaded at the time you tried to access them. []/forum/images/icons/smile.gif[/]
Hmmm... not sure... You need to apply the change to the end-result.
If you implemented the changes using Allan's "differential" approach, and care to send me the resulting addpost.php, I can take a look and post the necessary change.
But you should be able to find the following string !$Location && !$replyto in your addpost.php to locate the section in question.
Small bug or maybe an improvement needed? when you have a board using dark colors such as what is created with nettomos Dark Style sheet you can not see the numbers for the dates. is ther a way to make the border change color and the dates depending on the stylesheet?
ok.... is that the same hack? the Netomo stylesheet has an image on a orange background. the image is black bricks. I wonder if it is only due to the back ground then? the other forums using that stylesheet come out normally sao maybe it is a problem with the stylesheet?
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.