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.
Comments
  #2  
Old 11 Jul 2004, 21:52
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
Tips and Tricks

What's with the ugly US date format in the title?
If you want to change the date format in the title, just change the variable dateformat.
The european format is: d.m.Y (with leading zeros on day and month)
or j.n.Y (without leading zeros on day and month).
All the recognized characters in the date format can be found under http://www.php.net/date

It's all english! Where can I translate it? ORHow can I change the post text?
The whole posttext is saved in the postmessage variable. It can be translated, changed to your liking. New lines are achieved simply by having a new line in the code, no <br /> or \n\r. Also, smileys,bbcode,img tag as well as HTML can be used if you have these options enabled for the forum specified in forumid

I want all these event threads to have a special icon
Easy. Just edit the variable iconid to the iconid of the icon you wish to use.

Can I use the Event poster as the user that posts the thread?
Sure. Just change the 2 lines
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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

Careful: these posts don't update the users post count.

Questions and Problems

The postcount of my bot/the user that is used to post threads hasn't changed!
It isn't supposed to. As the whole system is automated, I don't think they count as posts. Also, no one is interested in the postcount of a bot
__________________

Last edited by Colin F; 12 Jul 2004 at 11:30.
Reply With Quote
  #3  
Old 12 Jul 2004, 02:25
FleaBag's Avatar
FleaBag FleaBag is offline
 
Join Date: Dec 2001
Just what I've been looking for - but is there a way to make the thread creator the user who adds the event to the calendar?
__________________
AndroidETC.com :: Android, and other stuff.
Reply With Quote
  #4  
Old 12 Jul 2004, 02:44
nexialys
Guest
 
yeah i was to suggest this.. i don't know why you use a BOT... just put the author's ID would do better... i don't see why using a bot anyway, it's not an automated feature, the creation of the thread is asked by a user...
Reply With Quote
  #5  
Old 12 Jul 2004, 02:52
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
Originally Posted by FleaBag
Just what I've been looking for - but is there a way to make the thread creator the user who adds the event to the calendar?
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
Reply With Quote
  #6  
Old 12 Jul 2004, 02:56
teksigns's Avatar
teksigns teksigns is offline
 
Join Date: Sep 2003
getting error


Database error in vBulletin 3.0.0:

Invalid SQL: INSERT INTO thread
(title, lastpost, forumid, open, replycount, postusername, postuserid, lastposter, dateline, iconid, visible)
VALUES ('[] test event', 1089597260, 41, 1, 0, EventBot, 1364, EventBot, 1089597260, 0, 1)

mysql error: Unknown column 'EventBot' in 'field list'

mysql error number: 1054
Reply With Quote
  #7  
Old 12 Jul 2004, 03:08
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
Originally Posted by teksigns
getting error

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

should be


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

And

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

should be before

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

Reply With Quote
  #8  
Old 12 Jul 2004, 03:43
alkatraz alkatraz is offline
 
Join Date: Oct 2002
Location: Vancouver, Canada
Real name: Colin
awesome hack! thank you
__________________
-alkatraz
Northwest Nissans Classifeds
Reply With Quote
  #9  
Old 12 Jul 2004, 11:34
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
OK, looks like my small hack just got fully rewritten Thanks for the help KirbyDe!

I just did this the first way I saw how from looking at the code. I haven't tested it, but KirbyDe's Code would probably work just as well if anyone wants to use that.
__________________
Reply With Quote
  #10  
Old 12 Jul 2004, 11:47
nexialys
Guest
 
maybe a little setting in the admincp, calendar section, where we can disable the feature, and select what forum to use, and maybe more options, like groups that can post...

i'm suggesting, maybe i will do that later anyway.
Reply With Quote
  #11  
Old 12 Jul 2004, 18:44
MrNase's Avatar
MrNase MrNase is offline
 
Join Date: May 2003
Real name: Dominik
Could we make it so that we can select wether a new thread is started or not? Not every entry is worth a discussion
Reply With Quote
  #12  
Old 12 Jul 2004, 19:25
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
Originally Posted by MrNase
Could we make it so that we can select wether a new thread is started or not? Not every entry is worth a discussion
Sure. Just add a checkbox in the template with value=1, and put this at the beginning of the code
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and a } at the end of the code.
__________________
Reply With Quote
  #13  
Old 13 Jul 2004, 14:34
MrNase's Avatar
MrNase MrNase is offline
 
Join Date: May 2003
Real name: Dominik
That's cool. Thank you


I will use it
Reply With Quote
  #14  
Old 14 Jul 2004, 08:34
snyx's Avatar
snyx snyx is offline
 
Join Date: Oct 2001
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 don't like this automated message within the thread, is it possible it mimic the calendar post into the new thread?
Reply With Quote
  #15  
Old 14 Jul 2004, 16:19
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
Theoretically yes.

Try making $post[message] = $message;
__________________
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 00:41.

Layout Options | Width: Wide Color: