PDA

View Full Version : Newreply outsided closed forum


Jawelin
06-07-2002, 12:37 PM
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
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.php?s=&action=newreply&threadid=39567&message=More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here-More-Than-250-Chars-Right-Here

Jawelin
06-09-2002, 02:13 PM
Very very interesting. Nice !
:D
Thnaks

Jawelin
06-10-2002, 02:11 PM
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:
if (trim($forum[title])=="ANNOUNCEMENTS") {
$threadtitle=urlencode("Announcement #$threadid Reply: '".$thread[title]."'");
eval("\$replyopenclosed = \"".gettemplate("showthread_replynewforum")."\";");
}

and created a new template showthread_replynewforum :<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
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:
<a href="newreply.php?s=$session[sessionhash]&forumid=XX&subject=$threadtitle">
and added the following code at the beginning of newreply.php:

//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