Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Offline
Joined: Feb 2007
Posts: 329
I hate manually having to copy/paste message id's for the merge function in ubb.threads. So I've made a little copy/paste thingy.

As soon as you edit a post, the current message id is written to a cookie. If you go into the move/merge screen, that id is put into the Merge topic with Post# field.

Let's go to work!

open /scripts/editpost.inc.php

find
Code
	// ---------------------------------------------------------------------------
// For security purposes we need to verify that this is user made this post or
// if they are an admin or a moderator for this board.

Just above it add:

Code
	// -------------------------------------------
// Writes a cookie with the current message id

$html->ubbt_setcookie("lasteditnumber",$Number);

Open /scripts/movethread.inc.php

Find:
Code
	extract($in, EXTR_OVERWRITE | EXTR_REFS); // quick and dirty fix - extract hash values as vars

Just below it add:
Code
	$lasteditnumber = get_input("lasteditnumber","cookie");

Find:
Code
		"days" => $days,

Add below:
Code
		"lasteditnumber" => $lasteditnumber,

open /templates/default/movethread.inc.php

Find:
Code
<label for="type-2">{$lang.MERGE_TOPIC}</label> <input type="text" name="number" size="10" class="form-input" />

replace with:
Code
<label for="type-2">{$lang.MERGE_TOPIC}</label> <input type="text" name="merge" size="10" class="form-input" value="{$lasteditnumber}" />

----------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------

open /templates/default/inline_move.tpl

find:
Code
<label for="type-2">{$lang.MERGE_TOPIC}</label> <input type="text" name="number" size="10" class="form-input" />

replace with:
Code
<label for="type-2">{$lang.MERGE_TOPIC}</label> <input type="text" name="number" size="10" class="form-input" value="{$lasteditnumber}" />

open /scripts/inline_moderation.inc.php
find:
Code
function _inline_move() {
global $config, $dbh, $ubbt_lang, $html, $in, $userob;

Just below add:
Code
	$lasteditnumber = get_input("lasteditnumber","cookie");

find:
Code
		'totalposts' => $total_posts,
'is_gallery' => $is_gallery,
);

$cfrm = make_ubb_url("ubb=cfrm", "", false);
return array(
"header" => array (
"title" => $ubbt_lang['CONFIRM_MOVE'],
"refresh" => 0,
"javascript" => array(),
"bypass" => "",
"onload" => "",
"breadcrumb" => <<<BREADCRUMB
<a href="{$cfrm}">{$ubbt_lang['FORUM_TEXT']}</a> » {$ubbt_lang['CONFIRM_MOVE']}
BREADCRUMB

Add before:
Code

"lasteditnumber" => $lasteditnumber,

Anything under the big line in this post you can skip if you don't want the feature enabled in inline moderation!

Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Nice, helpful moderating mod thumbsup


- Allen wavey
- What Drives You?
Joined: Nov 2003
Posts: 482
Enthusiast
Enthusiast
Offline
Joined: Nov 2003
Posts: 482
[good mod] wink


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)