vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   New Thread on Calendar Event (https://vborg.vbsupport.ru/showthread.php?t=67074)

scratche 05-04-2005 03:12 PM

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

Benj 05-05-2005 09:06 AM

does this hack add calendar custom fields to the post as well ?

Torqued 05-11-2005 12:10 AM

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>

scratche 05-15-2005 02:48 AM

Quote:

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?

Cyricx 05-16-2005 12:06 PM

That's awesome Torqued!! I can totally use that code to do exactly what I need with this :)

Thank you so much!!!

scratche 05-16-2005 05:20 PM

how can i have the information from this hack
https://vborg.vbsupport.ru/showthrea...ight=roll+call
post with the message in the thread????

Torqued 05-16-2005 07:06 PM

Quote:

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. :)

lionslair 05-21-2005 05:50 AM

Quote:

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()?

PHP Code:

$forumid 1// forumid in which to post 

// Get forum info
$foruminfo fetch_foruminfo($forumidfalse);

// Prepare the thread ...
$post[title] = "[".date($dateformat$dateline_from)."] ".$title
$post[poststarttime] = TIMENOW;
$post[posthash] = md5($post[poststarttime] . $bbuserinfo['userid'] . $bbuserinfo['salt']);
$post[message] = "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=".date("Y-n-j")."&c=".$calendarid."]this page[/url]."
$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); 

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?

SamirDarji 05-26-2005 03:17 AM

Quote:

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.

HeloHi 05-26-2005 11:56 PM

Quote:

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?


All times are GMT. The time now is 11:07 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01173 seconds
  • Memory Usage 1,791KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (5)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete