Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
New Thread on Calendar Event Details »
New Thread on Calendar Event
Mod Version: 1.00, by Colin F (Member) Colin F is offline
Developer Last Online: Apr 2014 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.0.3 Rating: (0 vote - 0 average) Installs: 19
Released: 11 Jul 2004 Last Update: Never Downloads: 1
Not Supported Re-usable Code Translations Is in Beta Stage  

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.

    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

    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
    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

  • Above that add the code you just edited.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #46  
Old 03 Apr 2005, 00:06
Crazy Serb Crazy Serb is offline
 
Join Date: Mar 2005
ok, just a question regarding starting new threads.

if i am inserting a new thread/post (from that calendar.php hack code that needs to be added) and if I want it to be moderated before going public, does that INSERT statement need to be changed to insert the new thread somewhere else, or is it being inserted into the same tables but with a different flag or something. How does the vbulletin know which threads need to be moderated and which don't? Where is that setting or where are those threads stored?

I'm just asking because I can't figure out how to moderate the new threads made with this script first, since it publishes the new thread right away, directly into the tables/database.
Reply With Quote
  #47  
Old 03 Apr 2005, 01:04
Crazy Serb Crazy Serb is offline
 
Join Date: Mar 2005
^^

never mind, i got it from another hack...

if you want to have the thread being created from the calendar event to be moderated first, add this line of code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

just before the last block of code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and change the "visible" value for the first two INSERT statements to zero (from "...$iconid, 1" to "...$iconid, 0" to make the threads invisible until approved)
Reply With Quote
  #48  
Old 03 Apr 2005, 07:30
YLP1 YLP1 is offline
 
Join Date: Aug 2004
I broke something but don't know what......I have about 40 events for the Month of April yet it says No events for the next 30 days... any ideas on how to fix this issue?
Reply With Quote
  #49  
Old 14 Apr 2005, 16:13
YLP1 YLP1 is offline
 
Join Date: Aug 2004
Newbie here...... Where would KirbeDEs code go and is his code in addition to Colin's?
The checkbox feature..which template does that get added to.

Sorry for my noobeness. Thanks in advance.
Reply With Quote
  #50  
Old 14 Apr 2005, 18:08
Torqued Torqued is offline
 
Join Date: Oct 2004
Originally Posted by obsidian
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.
I would love to see this feature as well!!!!!
Reply With Quote
  #51  
Old 04 May 2005, 17:12
scratche scratche is offline
 
Join Date: Feb 2005
hi there i wanted to know if ne one could help.. im using the roll call feature for my calendar... and i want it too post that in my forum aswell for each thread can anyone assist me in doin this
Reply With Quote
  #52  
Old 05 May 2005, 11:06
Benj's Avatar
Benj Benj is offline
 
Join Date: May 2006
does this hack add calendar custom fields to the post as well ?
Reply With Quote
  #53  
Old 11 May 2005, 02:10
Torqued Torqued is offline
 
Join Date: Oct 2004
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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And add this code above that. Be sure you edit the $forumid to be the forum you want posts to show up in.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Still in calendar.php, find this code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And add this code above it. Be sure you edit the $forumid to be the forum you want posts to show up in.



Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Adding the check box:

Log into your AdminCP and go to the Style Manager.

Open the calendar_edit template and find this code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And add this below that code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #54  
Old 15 May 2005, 04:48
scratche scratche is offline
 
Join Date: Feb 2005
Originally Posted by scratche
hi there i wanted to know if ne one could help.. im using the roll call feature for my calendar... and i want it too post that in my forum aswell for each thread can anyone assist me in doin this
can anyone help me with this i can seem to get the roll call options to post aswell into the thread that this hack creates... any suggestions?
Reply With Quote
  #55  
Old 16 May 2005, 14:06
Cyricx Cyricx is offline
 
Join Date: Sep 2002
That's awesome Torqued!! I can totally use that code to do exactly what I need with this

Thank you so much!!!
__________________
Cyricx (Chris)
Reply With Quote
  #56  
Old 16 May 2005, 19:20
scratche scratche is offline
 
Join Date: Feb 2005
how can i have the information from this hack
http://www.vbulletin.org/forum/showt...ight=roll+call
post with the message in the thread????
Reply With Quote
  #57  
Old 16 May 2005, 21:06
Torqued Torqued is offline
 
Join Date: Oct 2004
Originally Posted by Cyricx
That's awesome Torqued!! I can totally use that code to do exactly what I need with this

Thank you so much!!!
I'm sort of using it as a blog. You can see the results here: http://www.torqued.org/news

I'm glad someone else found it useful.
Reply With Quote
  #58  
Old 21 May 2005, 07:50
lionslair lionslair is offline
 
Join Date: Apr 2005
Real name: Nathan
Originally Posted by KirbyDE
Instead of $botuserid and $botusername use $bbuserinfo[userid] and $bbuserinfo[username].

And I wonder why this hack re-invents the wheel instead of just using build_new_post()?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

If you want to be fully flexible, one could make the text as a phrase, forum ID and date format string as a setting

I have public and private events and if the event is public I want it to be posted into the public forum. If it is a private event I want it to be posted into the proivate forum. Is this able to be done?
Reply With Quote
  #59  
Old 26 May 2005, 05:17
SamirDarji SamirDarji is offline
 
Join Date: Apr 2004
Originally Posted by lionslair
I have public and private events and if the event is public I want it to be posted into the public forum. If it is a private event I want it to be posted into the proivate forum. Is this able to be done?
It is possible to be done, but will add to the complexity of this hack as the destination forum has to vary with the source calendar. So some code will have to be put in that checks what calendar the event is being posted to, to determine the destination forum for the thread. I'm no coder, but it's a bit of work from the current implementation.
__________________
Pics of the Huntsville Car Scene: www.huntsvillecarscene.com, hsv.streetracing.org
Pics of the Huntsville Night Life: www.thetoe.cc
Reply With Quote
  #60  
Old 27 May 2005, 01:56
HeloHi's Avatar
HeloHi HeloHi is offline
 
Join Date: Feb 2005
Originally Posted by Viks
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
I am getting this error too. Anyone else run into this problem and figured out what is wrong with it?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 15:28.

Layout Options | Width: Wide Color: