Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Beta Releases

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
  #32  
Old 11-24-2004, 12:00 AM
benFF benFF is offline
 
Join Date: Jul 2004
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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....
Reply With Quote
  #33  
Old 11-24-2004, 02:46 PM
SamirDarji SamirDarji is offline
 
Join Date: Apr 2004
Posts: 645
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #34  
Old 11-25-2004, 10:18 AM
nexialys
Guest
 
Posts: n/a
Default

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..
Reply With Quote
  #35  
Old 12-11-2004, 01:40 PM
Bison's Avatar
Bison Bison is offline
 
Join Date: Jun 2002
Location: Virginia Beach, Virginia
Posts: 522
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #36  
Old 12-31-2004, 01:18 AM
Viks Viks is offline
 
Join Date: Sep 2004
Location: Toronto
Posts: 295
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #37  
Old 01-05-2005, 04:06 AM
Viks Viks is offline
 
Join Date: Sep 2004
Location: Toronto
Posts: 295
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi there, I was hoping to get some assistance on this. kindly help.

thanks

Vik
Reply With Quote
  #38  
Old 01-06-2005, 08:26 AM
MikaK's Avatar
MikaK MikaK is offline
 
Join Date: Nov 2004
Location: Helsinki, Finland
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by benFF
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=
Reply With Quote
  #39  
Old 01-23-2005, 05:44 PM
scottishcruise scottishcruise is offline
 
Join Date: Dec 2004
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #40  
Old 02-27-2005, 03:07 PM
Viks Viks is offline
 
Join Date: Sep 2004
Location: Toronto
Posts: 295
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no update on this one yet .. Colin?
Reply With Quote
  #41  
Old 03-01-2005, 02:04 AM
CyberSlash69 CyberSlash69 is offline
 
Join Date: Jan 2005
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools

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 08:15 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.06720 seconds
  • Memory Usage 2,318KB
  • 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_php
  • (1)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
  • (4)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
  • (10)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