vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Newreply outsided closed forum (https://vborg.vbsupport.ru/showthread.php?t=39567)

Jawelin 06-07-2002 12:37 PM

Newreply outsided closed forum
 
I have an Announcements forum writable only by staff members. I would create another forum like Annoucement Discussions to let users to reply ...
But would 'automatize' the reply.
I mean, for example, to add a 'reply' button after an announcements thread leading the user to create a new thread, with the same title and quoting the announce text, into another forum.

Is it too difficult ? Is there anything similar ?
Thank you.

Admin 06-07-2002 12:49 PM

You can create a reply button with this sort of links: newthread.php?s=$session[sessionhash]&forumid=XX&subject=XX

Jawelin 06-08-2002 07:21 AM

Quote:

Originally posted by FireFly
&subject=XX
Thanks.
An way to fill-up some part of the message body ? I guess I should slightly modify the code to parse querystring...
Right ?

Admin 06-08-2002 07:34 AM

You can include &message=YYY in the URL, that should work.

Jawelin 06-08-2002 11:40 AM

The usual missing variable initialization ?? :) :) :)

Btw, query string (and url) is limited to 250 chars. I don't think with the right htmlparsestring() function they are enough.
Thanks. I'll think to something else... :)

Bye

Admin 06-08-2002 11:47 AM

Query strings are not limited in any way (other than your internet connection).

https://vborg.vbsupport.ru/newreply....ars-Right-Here

Jawelin 06-09-2002 02:13 PM

Very very interesting. Nice !
:D
Thnaks

Jawelin 06-10-2002 02:11 PM

Quote:

Originally posted by FireFly
You can create a reply button with this sort of links: newthread.php?s=$session[sessionhash]&forumid=XX&subject=XX
I think I should parserize some way the subject and the message values to replace spaces with '%20' for example.
Which VB function could I use for example for $thread[title] ?

Thanks

Admin 06-10-2002 02:43 PM

You can use the PHP function urlencode(), but I'm not sure it's needed.

Jawelin 06-10-2002 03:10 PM

Oh, YES it is !!! :D
I added in showthread.php something like:
PHP Code:

    if (trim($forum[title])=="ANNOUNCEMENTS") {
      
$threadtitle=urlencode("Announcement #$threadid Reply: '".$thread[title]."'");
      eval(
"\$replyopenclosed = \"".gettemplate("showthread_replynewforum")."\";");
    } 

and created a new template showthread_replynewforum :
Code:

<a href="newthread.php?s=$session[sessionhash]&forumid=XX&subject=$threadtitle">
<img src="{ replyimage }" border="0" alt="Post a Reply to This Thread in Another Forum!"></a>

with 'XX' as my chit-chat forumid...
GREAT !!

Thanks for your support.

Next step: to look for an existing thread with such title instead of creating a new one each time ...

:D :D :D

Admin 06-10-2002 03:23 PM

Glad I could help. :)

BTW, it's much wiser to check the $forum[forumid] rather than its title. :)

Jawelin 06-10-2002 03:27 PM

Yes... First I would give a touch of 'GA'... :D

Jawelin 06-11-2002 11:34 AM

Quote:

Originally posted by Jawelin
Next step: to look for an existing thread with such title instead of creating a new one each time ...

I realized it, finally. Actually don't know if it could be useful to release it as a packed hack.
Btw, Chen, I created a button with a link:
Code:

<a href="newreply.php?s=$session[sessionhash]&forumid=XX&subject=$threadtitle">
and added the following code at the beginning of newreply.php:
PHP Code:

//HACK: Newreply in another forum (with check for thread already exists)
if (isset($forumid) and isset($subject) and !isset($postid)) {

  
$forumid=verifyid("forum",$forumid);
  
$foruminfo=getforuminfo($forumid);
  if (
$foruminfo['allowposting']==0) {
    eval(
"standarderror(\"".gettemplate("error_forumclosed")."\");");
  }

  if ( 
$prevthread=$DB_site->query_first("SELECT threadid FROM thread WHERE forumid='$forumid' AND title='".addslashes(htmlspecialchars($subject))."'") )  {
    
$threadid=$prevthread[threadid];
    
$action="newreply";
  } else {
    
$goto'newthread.php?'.($QUERY_STRING)."&action=newthread";
    eval(
"standardredirect(\"Creating a new reply-thread in forum <b><i>".$foruminfo[title]."</i></b>\",\"$goto\");");
  }
}
//HACK: Newreply in another forum (with check for thread already exists) 

Is there any macroscopic error ? :bunny:
Thanks

Chris M 06-11-2002 11:48 AM

I think it would be a great hack to release!:)

Satan


All times are GMT. The time now is 02:57 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.01188 seconds
  • Memory Usage 1,762KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (14)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