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.
Ok sorry I bump this old message but I try to install on vbulletin 3.0.7, I know it's for vb 3.0.3 but it'S supposed to work, but I have always the same error as some people before on this subjet:
Error:
Database error in vBulletin 3.0.7:
Invalid SQL:
UPDATE forum
SET replycount = replycount + 1,
threadcount = threadcount + 1,
lastpost = 1119364576,
lastposter = FrancoisEVENBOT,
lastthread = '[d-m-y] TEST 2435425252523 !!!',
lastthreadid = 119,
lasticonid = 0
WHERE forumid = 63
mysql error: Unknown column 'FrancoisEVENBOT' in 'field list'
mysql error number: 1054
Some body have a solution for that ?
Thanks
(P.S.: I read all messages and I don't find solution or I'm not looking so great ^^)
Ok sorry I bump this old message but I try to install on vbulletin 3.0.7, I know it's for vb 3.0.3 but it'S supposed to work, but I have always the same error as some people before on this subjet:
Error:
Database error in vBulletin 3.0.7:
Invalid SQL:
UPDATE forum
SET replycount = replycount + 1,
threadcount = threadcount + 1,
lastpost = 1119364576,
lastposter = FrancoisEVENBOT,
lastthread = '[d-m-y] TEST 2435425252523 !!!',
lastthreadid = 119,
lasticonid = 0
WHERE forumid = 63
mysql error: Unknown column 'FrancoisEVENBOT' in 'field list'
mysql error number: 1054
Some body have a solution for that ?
Thanks
(P.S.: I read all messages and I don't find solution or I'm not looking so great ^^)
Ok. Here is what I did to enable a check box. This will add a check box to the Miscellaneous Options when you are creating or editing a calendar event.
When creating a new event:
1: Checking the check box will copy the event as a new thread in $forumid (defined in the code).
2: Leaving the check box unchecked will only create the event on the calendar.
When editing an existing event:
1: Checking the check box will copy the event as a new thread in $forumid (defined in the code).
2: Leaving the check box unchecked will only update the calendar entry.
Now... if you already created a thread and go edit the event later and check the check box, it does not update the previous thread - it creates a new thread.
Also, if you want to convert an existing event to a new thread, you do not really have to "edit" anything. Just click on edit event, check the check box, and save. This will create the new thread in your forum.
In calendar.php, find the following code:
PHP Code:
if ($calendarinfo['neweventemail'])
And add this code above that. Be sure you edit the $forumid to be the forum you want posts to show up in.
PHP Code:
//hack New Thread on Calendar Event if ($_POST[makepost] == 1) { //add check box functionality $forumid = 1; // forumid in which to post
// Get forum info $foruminfo = fetch_foruminfo($forumid, false); $dateformat = "d M, Y"; $threadtitle = "[".vbdate($dateformat, $dateline_from,false,true,false,true)."] ".$title;
And add this code above it. Be sure you edit the $forumid to be the forum you want posts to show up in.
PHP Code:
//hack New Thread on Calendar Event if ($_POST[makepost] == 1) { //add check box functionality $forumid = 1; // forumid in which to post
// Get forum info $foruminfo = fetch_foruminfo($forumid, false); $dateformat = "d M, Y"; $threadtitle = "[".vbdate($dateformat, $dateline_from,false,true,false,true)."] ".$title;
quick question. lets say that i would prefer to have my title list as 'Event, Date, Location' and I have my 'location' listed as a custom field in my database. I know that in the database, the custom id #4 is for location. I can figure out everything but the location in posting it to the title of the forum.
oh, and also wanted to repost an earlier request about listing the information from the roll call feature. in case the rollcall feature is unknown, it is another hack where users can 'mark their attendance' to the event. in the calendar, it lists the members who have marked their attendance, and it would be cool to post this info at the bottom of the thread, just like in the calendar.