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)

MrNase 07-12-2004 04:44 PM

Could we make it so that we can select wether a new thread is started or not? Not every entry is worth a discussion :)

Colin F 07-12-2004 05:25 PM

Quote:

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
PHP Code:

if ($_POST[checkboxname] == 1) { 

and a } at the end of the code.

MrNase 07-13-2004 12:34 PM

That's cool. Thank you :)


I will use it :)

snyx 07-14-2004 06:34 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 don't like this automated message within the thread, is it possible it mimic the calendar post into the new thread?

Colin F 07-14-2004 02:19 PM

Theoretically yes.

Try making $post[message] = $message;

DaveLogic 07-14-2004 06:58 PM

Quote:

Originally Posted by Colin F
Theoretically yes.

Try making $post[message] = $message;

This works with the main message content but would it be possible to say include a link (alike the original ) say Click here for full info which would rthen link back to the calendat???

Colin F 07-14-2004 08:05 PM

Do you want the message content as well as a link back, or just part of the message content and a link saying something like [...more]?

The first could be done with something like
PHP Code:

$post[message] = $message."
[url="
.$vboptions['bburl']."/calendar.php?".$session[sessionurl]."do=getinfo&e=".$eventid."&day=".date("Y-n-j")."&c=".$calendarid."]Click here for full info[/url]"


FleaBag 07-16-2004 04:52 AM

Code:

Invalid SQL: 
UPDATE forum
SET replycount = replycount +  1,
threadcount = threadcount + 1,
lastpost = 1089956923,
lastposter = EventBot,
lastthread = '[07-12-04] hkhkhk',
lastthreadid = 12529,
lasticonid = 0
WHERE forumid = 47

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

Any idea what went wrong?

Colin F 07-24-2004 07:46 AM

surround EventBot with 's
making it:
PHP Code:

$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
"
); 


obsidian 07-28-2004 02:35 PM

I tried this out using Colins original hack and it comes up with a thread title that is one day off of the event. The "posted by" on the thread view is also blank. I ended up trying Kirby's code as well and the username shows up but the date is 1 day off as well.

Edit: After digging through the calendar.php file I assume this is because I am using a single all day event. If I do the ranged event it comes up correctly. I guess when it gets the single all day event it starts the previous day plus how ever many hours. Anyways anyone have an idea on a simple fix for it :)


All times are GMT. The time now is 10:38 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.01118 seconds
  • Memory Usage 1,757KB
  • 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
  • (1)bbcode_code_printable
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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