Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Beta Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
New Thread on Calendar Event Details »»
New Thread on Calendar Event
Version: 1.00, by Colin F Colin F is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

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;
                
    $DB_site->query("INSERT INTO " TABLE_PREFIX "thread
    (title, lastpost, forumid, open, replycount, postusername, postuserid, lastposter, dateline, iconid, visible)
    VALUES ('" 
    addslashes($threadtitle) . "', " TIMENOW ", $forumid, 1, 0, '$botusername', $botuserid, '$botusername', " TIMENOW ", $iconid, 1)
    "
    );
    $threadid $DB_site->insert_id();
                
    $DB_site->query("INSERT INTO " TABLE_PREFIX "post
    (threadid, parentid, title, username, userid, dateline, pagetext, allowsmilie, showsignature, ipaddress, iconid, visible)
    VALUES (
    $threadid, 0, '" addslashes($threadtitle) . "', '$botusername', $botuserid, " TIMENOW ", '" addslashes($postmessage) . "', 1, 0, 0, $iconid, 1)
    "
    );
    $firstpostid $DB_site->insert_id();

    $DB_site->query("UPDATE " TABLE_PREFIX "thread
    SET firstpostid = 
    $firstpostid
    WHERE threadid = 
    $threadid
    "
    );
                
    $DB_site->query("
    UPDATE " 
    TABLE_PREFIX "forum
    SET replycount = replycount +  1,
    threadcount = threadcount + 1,
    lastpost = " 
    TIMENOW ",
    lastposter = 
    $botusername,
    lastthread = '" 
    addslashes($threadtitle) . "',
    lastthreadid = 
    $threadid,
    lasticonid = 
    $iconid
    WHERE forumid = 
    $forumid
    "
    ); 
    The variables to be edited (marked green) are:
    • 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.

Comments
  #72  
Old 06-21-2005, 01:40 PM
Luciolle Luciolle is offline
 
Join Date: Nov 2003
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ^^)
Reply With Quote
  #73  
Old 06-21-2005, 02:47 PM
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
Posts: 1,551
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Luciolle
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 ^^)
See this post: https://vborg.vbsupport.ru/showpost....27&postcount=7
Reply With Quote
  #74  
Old 07-18-2005, 06:04 PM
YLP1 YLP1 is offline
 
Join Date: Aug 2004
Posts: 417
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Torqued
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($forumidfalse); 
$dateformat "d M, Y"
$threadtitle "[".vbdate($dateformat$dateline_from,false,true,false,true)."] ".$title
 
// Prepare the thread ... 
$post[title] = $threadtitle;
$post[poststarttime] = TIMENOW
$post[posthash] = md5($post[poststarttime] . $bbuserinfo['userid'] . $bbuserinfo['salt']); 
$post[message] = $message
$post[username] = $bbuserinfo[userid]; 
$post[iconid] = 0
$post[emailupdate] = 9999
 
// ... and create it 
require_once('./includes/functions_newpost.php'); 
build_new_post('thread'$foruminfo, array(), 0$post$errors);
//add check box functionality

//hack New Thread on Calendar Event 
Still in calendar.php, find this code:

PHP Code:
        require_once('./includes/functions_databuild.php'); 
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($forumidfalse); 
$dateformat "d M, Y"
$threadtitle "[".vbdate($dateformat$dateline_from,false,true,false,true)."] ".$title
 
// Prepare the thread ... 
$post[title] = $threadtitle;
$post[poststarttime] = TIMENOW
$post[posthash] = md5($post[poststarttime] . $bbuserinfo['userid'] . $bbuserinfo['salt']); 
$post[message] = $message
$post[username] = $bbuserinfo[userid]; 
$post[iconid] = 0
$post[emailupdate] = 9999
 
// ... and create it 
require_once('./includes/functions_newpost.php'); 
build_new_post('thread'$foruminfo, array(), 0$post$errors);
//add check box functionality

//hack New Thread on Calendar Event 
Adding the check box:

Log into your AdminCP and go to the Style Manager.

Open the calendar_edit template and find this code:
Code:
<legend>$vbphrase[miscellaneous_options]</legend>
And add this below that code:
Code:
<div><input type="checkbox" name="makepost" value="1">Copy calendar event to new thread</div>
I am so confused... I have three instances of this code: require_once('./includes/functions_databuild.php');

which one do I put the last piece of code above?
Reply With Quote
  #75  
Old 07-27-2005, 02:41 PM
jugo jugo is offline
 
Join Date: Feb 2004
Location: Reading your emails.
Posts: 573
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can someone port this to vb3.5.
Reply With Quote
  #76  
Old 09-24-2005, 04:11 AM
djsydeburnz djsydeburnz is offline
 
Join Date: May 2005
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

$post[title] = .$title"|".vbdate($dateformat, $dateline_from,false,true,false,true)."|" ?unknown code;

shoud give me:

Event Title | Event Date | Event Location
Reply With Quote
  #77  
Old 09-24-2005, 04:30 AM
djsydeburnz djsydeburnz is offline
 
Join Date: May 2005
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

thanks in advance.
Reply With Quote
  #78  
Old 02-02-2006, 04:40 PM
tendo's Avatar
tendo tendo is offline
 
Join Date: Jan 2006
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work for 3.5 at all? Seattle Dnb really needs this. I think it's stupid that vBulletin doesnt have this built in.

Thanks for your time.
Reply With Quote
  #79  
Old 02-20-2006, 05:10 PM
Ashiro Ashiro is offline
 
Join Date: Feb 2006
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm recieving the error:

Quote:
Call to a member function on a non-object in /home/ashiro/public_html/degenerates/board2/calendar.php on line 1944
Is there any chance you could help me out? I'd like to get this mod working as it'd be very useful. Thank you.
Reply With Quote
  #80  
Old 12-12-2007, 07:18 AM
Alphawolf83's Avatar
Alphawolf83 Alphawolf83 is offline
 
Join Date: Mar 2005
Location: Germany
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a product for vb3.6.x? I did search, but didnt find anything...
Reply With Quote
  #81  
Old 10-21-2008, 01:52 AM
conradk conradk is offline
 
Join Date: Aug 2007
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anybody running this mode with 3.7.3? Checking before I start hacking.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:30 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05275 seconds
  • Memory Usage 2,365KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (6)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete