vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   "moved" hack. (https://vborg.vbsupport.ru/showthread.php?t=44455)

Kedmyster 10-10-2002 04:19 AM

"moved" hack.
 
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:
PHP Code:

$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:
PHP Code:

$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
PHP Code:

$orgforum=getforuminfo($orgthread['forumid']); 

this line:
PHP Code:

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


All times are GMT. The time now is 01:10 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.01071 seconds
  • Memory Usage 1,742KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete