Version: 1.00, by Colin F
Developer Last Online: Apr 2014
Version: 3.0.3
Rating:
Released: 07-10-2004
Last Update: Never
Installs: 19
Re-useable Code Translations Is in Beta Stage
No support by the author.
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:
Backup all your forum files as well as your database
Copy the following code into your favorite PHP editing program (Dreamweaver, Wordpad, Notepad...) and edit it to fit your forums.
PHP Code:
$forumid = 1; // forumid in which to post
$botuserid = 1; //userid of poster
$botusername = "EventBot"; // username of poster
$dateformat = "m-d-y";
$threadtitle = "[".vbdate($dateformat, $dateline_from,false,true,false,true)."] ".$title;
$postmessage = "This is an automatically generated thread for the event [b]".$title."[/b].
More information on this event is available on [url=".$vboptions['bburl']."/calendar.php?".$session[sessionurl]."do=getinfo&e=".$eventid."&day=".vbdate("Y-n-j",TIMENOW,false,true,false,true)."&c=".$calendarid."]this page[/url].";
$iconid = 0;
forumid is the forumid of the forum in which the Bot will be posting the threads to the calendar events
botuserid is the userid of the user that will be shown as the author of the thread. I suggest making a special user and naming him something like EventBot
botusername is the username of the user that will be shown as the author of the thread. Should be the username to the userid indicated in botuserid. Make sure the username is enclosed in quotation marks ("").
Open your calendar.php and look for
PHP Code:
if ($calendarinfo['neweventemail'])
Above that add the code you just edited.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
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
I'm having the same problem. Links to all day events always link to the day *before* the event starts, but ranged events work fine.
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?
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:
$postmessage = $message."This is an automatically generated thread for the event ".$title.".
More information on this event is available on [url=".$vboptions['bburl']."/calendar.php?".$session[sessionurl]."do=getinfo&e=".$eventid."&day=".vbdate("Y-n-j",TIMENOW,false,true,false,true)."&c=".$calendari d."]this page[ /url].";
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"
Change this:
Code:
$postmessage = $message."This is an automatically generated thread for the event ".$title.".
to this:
Code:
$postmessage = $message."
This is an automatically generated thread for the event ".$title.".
Not sure if that works though.... you might also be able to use /n
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.