![]() |
New Thread on Calendar Event
New Thread on Calendar Event
What it does: This rather small hack is easy: it starts a new thread in a specific forum for every Event that is posted in the calendar. On our forum it is used for discussion of partys (as it's a party calendar). Is it complicated? There is actually very little to change, but in that small part, there are a lot of variables to be edited which are forum specific. That might make it a bit hard for php newlings Changes: New files (0): none Changed files(1): calendar.php New database fields/tables(0): none New templates(0): none Changed templates(0): none New phrases(0): none Screenshots: No visible changes Instructions:
|
Tips and Tricks
What's with the ugly US date format in the title? If you want to change the date format in the title, just change the variable dateformat. The european format is: d.m.Y (with leading zeros on day and month) or j.n.Y (without leading zeros on day and month). All the recognized characters in the date format can be found under http://www.php.net/date It's all english! Where can I translate it? ORHow can I change the post text? The whole posttext is saved in the postmessage variable. It can be translated, changed to your liking. New lines are achieved simply by having a new line in the code, no <br /> or \n\r. Also, smileys,bbcode,img tag as well as HTML can be used if you have these options enabled for the forum specified in forumid I want all these event threads to have a special icon Easy. Just edit the variable iconid to the iconid of the icon you wish to use. Can I use the Event poster as the user that posts the thread? Sure. Just change the 2 lines PHP Code:
PHP Code:
Questions and Problems The postcount of my bot/the user that is used to post threads hasn't changed! It isn't supposed to. As the whole system is automated, I don't think they count as posts. Also, no one is interested in the postcount of a bot :) |
Just what I've been looking for - but is there a way to make the thread creator the user who adds the event to the calendar?
|
yeah i was to suggest this.. i don't know why you use a BOT... just put the author's ID would do better... i don't see why using a bot anyway, it's not an automated feature, the creation of the thread is asked by a user...
|
Quote:
And I wonder why this hack re-invents the wheel instead of just using build_new_post()? PHP Code:
|
getting error
Database error in vBulletin 3.0.0: Invalid SQL: INSERT INTO thread (title, lastpost, forumid, open, replycount, postusername, postuserid, lastposter, dateline, iconid, visible) VALUES ('[] test event', 1089597260, 41, 1, 0, EventBot, 1364, EventBot, 1089597260, 0, 1) mysql error: Unknown column 'EventBot' in 'field list' mysql error number: 1054 |
Quote:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
awesome hack! thank you
|
OK, looks like my small hack just got fully rewritten :) Thanks for the help KirbyDe!
I just did this the first way I saw how from looking at the code. I haven't tested it, but KirbyDe's Code would probably work just as well if anyone wants to use that. |
maybe a little setting in the admincp, calendar section, where we can disable the feature, and select what forum to use, and maybe more options, like groups that can post...
i'm suggesting, maybe i will do that later anyway. |
Could we make it so that we can select wether a new thread is started or not? Not every entry is worth a discussion :)
|
Quote:
PHP Code:
|
That's cool. Thank you :)
I will use it :) |
Quote:
|
Theoretically yes.
Try making $post[message] = $message; |
Quote:
|
Do you want the message content as well as a link back, or just part of the message content and a link saying something like [...more]?
The first could be done with something like PHP Code:
|
Code:
Invalid SQL: |
surround EventBot with 's
making it: PHP Code:
|
I tried this out using Colins original hack and it comes up with a thread title that is one day off of the event. The "posted by" on the thread view is also blank. I ended up trying Kirby's code as well and the username shows up but the date is 1 day off as well.
Edit: After digging through the calendar.php file I assume this is because I am using a single all day event. If I do the ranged event it comes up correctly. I guess when it gets the single all day event it starts the previous day plus how ever many hours. Anyways anyone have an idea on a simple fix for it :) |
Quote:
Anyone got a fix? BTW great hack colin |
So, is anyone working on a fix for the all-day-event bug mentioned above? It would be very much appreciated by at least several users.
|
I assume this is because of the timezone settings of some users. As I'm in GMT+1, I don't have any problems with this.
I'll have a look at it tonight though... |
I've updated the first post with some info to (hopefully) fix the allday problem some users are having.
The changes are in the two calles to the function date(). These are now changed to vbdate() and some parameters were added. |
This is exactly the type of hack I've been searching for. Well, all except one thing--I want the new thread to be displayed as part of the calendar event listing page. It doesn't sound too hard in theory, but you never know until you get into it. Thoughts anyone?
|
I am able to fix the problems on that one. Wish I could solve my problem with the other hack by the same author.
|
Quote:
Actually.. I want both. :) I want the $message text as well as an automated message @ the bottom of the post.. so how do I modify the code below to put a couple of blank lines between the $message and the "This is an automatically generated blah blah blah" Quote:
|
Quote:
Code:
$postmessage = $message."This is an automatically generated thread for the event ".$title.". Code:
$postmessage = $message." |
I used \n to insert a blank line
|
Is there a way to move the forum jump dropdown into this and use it as a selection box for where to post the thread? Reason I ask is that I now have a couple calendars for different groups. I would like to be for the people to post their events on their private calendar and have this hack post the thread in their private forum.
|
Is there anyway to make the calendar event link to the forum post about it, allowing users to discuss the calendar item easily?
Just also found the vb2 version of this hack, which actually allowed you to specify a forum and when a user went to start a new thread in it, it would automatically take them to the calendar input instead (which was then inserted into the forum as well as the calendar). This would be an awesome feature, as it would make sure people were entering events in the calendar and not just making a forum post.... |
Check out my calendar for a small change that allows me to put various event-related links. It's still a manual process as there is no way to keep a hard link between the thread and event listing. :(
|
it's easy to keep a link to the thread and event... but Colin F will have to update his code... not sure he will:
1- add a new field to events, adding the new threadid when new thread is created. 2- when thread is created, modify the event message by adding a new line with the thread url... (go to this url to read the thread XXX) ... with that threadid in a field, you can do a lot of things.. |
Nice idea, but it's quite confusing on how to do this. Could someone clean up these two hacks and make them easier to try?
|
hi guys, Colin,
I am getting the follwing error message when i add a new calender event. Once I go back to my forum i see the thread and the event but the error message occurs each time a new event is added. Error message== =============== Database error in vBulletin 3.0.3: Invalid SQL: UPDATE forum SET replycount = replycount + 1, threadcount = threadcount + 1, lastpost = 1104462847, lastposter = , lastthread = '[12-30-04] new event', lastthreadid = 62, lasticonid = 0 WHERE forumid = 18 mysql error: You have an error in your SQL syntax near ' lastthread = '[12-30-04] new event', lastthreadid = 62, lasticonid = 0 WHER' at line 6 mysql error number: 1064 Date: Thursday 30th of December 2004 10:14:08 PM Script: http://www.myforums.com/forums/calendar.php Referer: http://www.myforums.com/forums/calen...ype=single&c=1 Username: A IP Address: 64.1.2.3 ============================================ please help. thanks vik |
Hi there, I was hoping to get some assistance on this. kindly help.
thanks Vik |
Quote:
=Mika= |
I am also getting the mysql error as posted by Viks, any help?? - the calendar event and thread seem to work fine but the error isn't nice to see when ppl are adding events :(
|
no update on this one yet .. Colin?
|
Was wondering if there is a hack, or a way that this can be switched around.. In PhpbbFM you post a thread, and in the thread you can edit the date you would like this to go to and it will automatically be added into the calendar.. Pretty much just the opposite of what it is now.. But it was much easier.
|
All times are GMT. The time now is 04:49 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|