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.
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..
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
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....
Would be very cool! I have installed the "Colin F" version of this hack.
=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
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.