vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Annoucements Forum (with duplicates of announcements for people's replies) (https://vborg.vbsupport.ru/showthread.php?t=36297)

Tim Wheatley 03-18-2002 06:29 PM

Annoucements Forum (with duplicates of announcements for people's replies)
 
Basically I just want people to be able to reply to announcements so I can cut down on sticky threads.

But what I'd like to happen is:

I create a new forum called Forum Announcements.

Someone posts an Announcement, this is posted by an auto poster (or the anncment poster) automatically into that forum.

People can click reply when viewing the anncment and their reply goes into the relevant thread.

.....or something with those functions would be great... :)

Tim Wheatley 10-06-2002 12:33 PM

bump :)

Xenon 10-06-2002 07:59 PM

wow, what an old thread ;)

hmm, creating a new thread whenever an announcement has been created wouldn't be hard.

you've just to copy out some parts (where the first post and the thread is inserted into the db) of newthread.php and insert em into your announcement.php

for the replyingpart you have to add a field to announcementtable called threadid and fill it with the thread id of the new created thread..., then you just have to add a link to this newreply.php into the announcmentpostbit

Tim Wheatley 10-07-2002 11:38 PM

Um... (help) LOL!

Xenon 10-08-2002 12:34 PM

*ggg*

ok here you go

run this query:
ALTER TABLE `announcement` ADD `threadid` INT(9) UNSIGNED DEFAULT '0' NOT NULL;


open admin(mod)/announcement.php find
PHP Code:

  $DB_site->query("INSERT INTO announcement(announcementid,title,userid,startdate,enddate,pagetext,forumid,threadid) VALUES (NULL,'".addslashes($title)."','$bbuserinfo[userid]',UNIX_TIMESTAMP('".addslashes($startdate)."'),UNIX_TIMESTAMP('".addslashes($enddate)."'),'".addslashes($pagetext)."','$parentid','$threadid')"); 

before add:
PHP Code:

      $forumid=XX;
      
$DB_site->query("INSERT INTO thread (threadid,title,lastpost,forumid,open,replycount,postusername,postuserid,lastposter,dateline,iconid,visible,attach) VALUES (NULL,'".addslashes(htmlspecialchars($title))."','".time()."','$forumid','1','0','".addslashes($bbuserinfo['username'])."','$bbuserinfo[userid]','".addslashes($bbuserinfo['username'])."','".time()."','0','1','0')");
      
$threadid=$DB_site->insert_id();
      
$DB_site->query("INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$threadid','".addslashes(htmlspecialchars($title))."','".addslashes($bbuserinfo['username'])."','$bbuserinfo[userid]','".time()."','$attachmentid','".addslashes($pagetext)."','1','0','','0','1')");
      
$postid=$DB_site->insert_id();

      
indexpost($postid,1); 

replace the forumid=xx with the correct anouncementforumid you want.


then open your announcementbit template and add a link to newreply.php?s=$session[sessionhash]&threadid=$announcement[threadid]

normally this should work, if not, just ask ;)

Tim Wheatley 10-09-2002 06:39 PM

Woohoo! (said in best homer simpson voice) thank you, I'll go give it a shot right now. :D:D

Tim Wheatley 10-09-2002 07:03 PM

1 Attachment(s)
It works, first class job my friend. :up:

I only installed it on admin/annoucement.php not mod/...

Reason being, we host forums for others folks who keep their forums invisible to other users, we don't want their annous to be visible to everyone, but as I've only applied it to the admin one, this works great, what I've also done is:

in annoucement.php changed:

Code:

maketextareacode("Announcement","pagetext","",10,50);
to:

Code:

maketextareacode("Announcement<p><font color=\"red\">WARNING: This text is duplicated into posts in the announcement forum. Please use the moderator CP announcement link if you do not wish to do this.</font></p>","pagetext","",10,50);
Thanks very much for your help. :up:

See below:

Xenon 10-09-2002 09:31 PM

you're welcome :)

also wise decicion about the warning.. :)


All times are GMT. The time now is 08:22 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.00982 seconds
  • Memory Usage 1,741KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete