PDA

View Full Version : "moved" hack.


Kedmyster
10-10-2002, 04:19 AM
I would like to add a filed in a moved post that says from where the post had moved (which category - forum).
how do I do it?

Thanks in advance.

Xenon
10-10-2002, 09:12 AM
hmm, you can try this:
open showthread.php
find:$threadid = intval($threadid);
$thread = verifyid("thread",$threadid,1,1);

if ($wordwrap!=0) {
$thread['title']=dowordwrap($thread['title']);
}

if (!$thread['visible']) {
$idname="thread";
eval("standarderror(\"".gettemplate("error_invalidid")."\");");
exit;
}

if ($thread['open'] == 10) {
// send them to their correct thread
header("Location: showthread.php?s=$session[sessionhash]&threadid=$thread[pollid]");
exit;
}
$forum=getforuminfo($thread['forumid']);


below add:
$orgthread=$DB_site->query_first("SELECT forumid FROM thread WHERE pollid=$threadid AND open=10");
$orgforum=getforuminfo($orgthread['forumid']);


Now you can use $orgforum[title] in your Showthread template to show the original forum the thread was in.

Kedmyster
10-10-2002, 05:16 PM
ok thanks, i'll try it.

Kedmyster
10-10-2002, 05:33 PM
it works fine but I have one more request.
My PHP knowledge is absolutely 0 so sorry if it might sounds stupid.

How can I add so it'll right "moved from: $orgforum[title]".
I want it to be in the postbit template too if it's possible.

Thanks

Xenon
10-10-2002, 07:25 PM
well you should put after$orgforum=getforuminfo($orgthread['forumid']);

this line:
if($orgforum['title'] != '') $orgforum['title']='moved from: ' . $orgforum['title'];

then it'll show up correctly and just if you have moved the thread :)

in the postbit too?
don't see why, but you have to edit function getpostbit
in your admin/functions.php and add $orgforum in your one of the global lines...

then you can use the same var in your postbit template

Kedmyster
10-11-2002, 03:42 AM
thanks alot, worked perfectly.
I wanted it to be in the postbit couse on my board it's a bit different from other boards.
I did a makeover to the showthread (well maybe it's not a makeover but it's the first time i'm using vB and it's went preety well and unique).

Thanks again.

Xenon
10-11-2002, 10:10 AM
:)
you're welcome

Kedmyster
10-14-2002, 05:21 PM
one last request (hopefully) :)
how do I add - "moved from by *username*.
Thanks alot, and sorry i'm nagging you...

Chris M
10-14-2002, 05:48 PM
Thats cool:)

Thanks Xenon:D

Satan

Xenon
10-14-2002, 05:54 PM
@Ked: that would be possible, too, but not as easy, because then you have to make DB-changes.
also it won't work for old threads...

Kedmyster
10-14-2002, 05:57 PM
oh, ok.
Thanks alot for the help anyawy :)

Xenon
10-14-2002, 06:00 PM
:)
you're always welcome to ask more.
here are many out which try to help :)