Version: , by Mas*Mind
Developer Last Online: Sep 2003
Version: 2.2.x
Rating:
Released: 02-22-2001
Last Update: Never
Installs: 24
No support by the author.
This is what the hack does: It let's you preview a message when you're editing it, you can only preview when you're posting or replying the way it is now:
It works on my testserver, but I've not tested on a 'live' forum, but it seems to be working allright...
Instructions
1 Backup your editpost.php file!!! and open the original one...
Then:
after:
PHP Code:
if (!isset($action) or $action=="") {
$action="editpost";
}
insert:
PHP Code:
if($preview AND $action="updatepost")
$action = "editpost";
after:
PHP Code:
if ($action=="editpost") {
// draw nav bar
$navbar=makenavbar($threadinfo[threadid],"thread",1);
if ($checkid=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE userid='$userinfo[userid]' AND threadid=$threadinfo[threadid]")) {
$emailchecked="CHECKED";
} else {
$emailchecked="";
}
with:
PHP Code:
if(!$preview)
$email=$DB_site->query_first("SELECT subscribethreadid FROM subscribethread WHERE userid=$userinfo[userid] AND threadid=$threadinfo[threadid]");
$emailchecked=iif($email,"CHECKED","");
Make a new template called 'editpost_postpreview' with the following content:
I'm using Mystics version on my forum and it stopped working after upgrading to v2.2.6. It seems to execute template 'standardredirect' in some way beacuse it's redirect to the post again after 1sec.
Please, can someone verify if this is working with v2.2.6.
Originally posted by webForum Please, can someone verify if this is working with v2.2.6.
It's working perfect with 2.2.6
I think, you have forgotten this step:
Code:
Search for
-----------------------------------------------------------
if ($HTTP_POST_VARS['action']=="updatepost") {
-----------------------------------------------------------
REPLACE it with
-----------------------------------------------------------
if ($action=="updatepost") {
-----------------------------------------------------------
For anyone still using this hack, I have fixed the problem with the signature showing for the original poster instead of the person editing the post.
Change:
PHP Code:
if ($signature && $bbuserinfo[signature]) {
$previewmessage.=bbcodeparse("\n__________________\n$bbuserinfo[signature]",0,$allowsmilies);
}
To:
PHP Code:
if ($signature) {
$userinfo=$DB_site->query_first("
SELECT signature
FROM user
WHERE userid='$postinfo[userid]'");
$post[username]=$postinfo[username];
$post['signature'] = bbcodeparse($userinfo['signature'],0,$allowsmilie);
eval("\$post[signature] = \"".gettemplate("postbit_signature")."\";");
$previewmessage.=$post['signature'];
}
It does add one query, but this is the only way to fix it AFAIK.
Very cool, i installed it, the only problem what i have is that the preview of the changes of the post looks good, but in the form the changes aren't there anymore. So i need to edit it again whenever i preview the edit post.
Anyone knows what could have caused that? Very ackward! :ermm:
Search for
-----------------------------------------------------------
if ($HTTP_POST_VARS['action']=="updatepost") {
-----------------------------------------------------------
REPLACE it with
-----------------------------------------------------------
if ($action=="updatepost") {
-----------------------------------------------------------
Mystics
Installed nicely into 2.3.5 Thanks.
Just posting here to point out that that part of code isnt actually in the first post instructions So I missed it twice until I came further into the thread. just an FYI