PDA

View Full Version : Mini Mods - Change Threads Prefix Inline


Milad
04-15-2007, 10:00 PM
Brought to you by Syrian Medical Society (http://www.syrianmeds.net/) & Milado (http://www.milado.net/)

Introduction & Description:
It was difficult to change a thread prefix, thread by thread, the editing process of first post to change the prefix is inappropriate and it takes a long time.
This product allows you to set a prefix to multiple threads inline, using the moderation drop-down menu in forum display page (see the screen shoot). you will save your time and effort.

Installation:
One step! Import the product file product-threadprefix_changeinline.xml and you're done.

Of course, it depends on the product Thread Prefixes 1.6.1 which must be installed.

You may also upload the language file for your language if it's attached below.

How to use?
It works exactly like closing, opening, sticking or unsticking multiple threads inline.

Change log:
- 1.0.0 released on April, 16 2007
- 1.1.0 released on September, 13 2007 (Added the default prefixes and fixed some bugs)

Thanks to COBRAws (https://vborg.vbsupport.ru/member.php?u=22513) for his Spanish translation (attached).
Thanks to nexialys (https://vborg.vbsupport.ru/member.php?u=56130) for his French translation (attached).

Click install to receive support & updates.

vspro
04-16-2007, 01:57 AM
thax I intall now

COBRAws
04-16-2007, 03:58 AM
spanish translation

aLReeMi
04-16-2007, 08:29 AM
nice add

thanks

Hornstar
04-16-2007, 09:48 AM
Hey, this is what i needed when i had that hack installed, now ive removed it. this may make me consider reinstalling it now ^^

ps, any chance you may consider adding inline moderation to some other hacks? because I would love it if you could add it for the bump thread/make thread older hack.

AzzidReign
04-16-2007, 02:02 PM
Wow, this looks awesome! I'll have to install this on my board later tonight.

*Clicks install

TheMilkCarton
04-16-2007, 04:55 PM
This is great work.

This solves my issues with using Thread Prefixes together with the vB Event Forums and Farcaster's Event Attendance. When adding a calendar event you couldn't choose a prefix, so it was very very tedious having to go in and edit every single thread to add the prefix.

Thanks!

Pottsy
04-16-2007, 06:44 PM
Thank you! :)

BobbyBig
04-17-2007, 10:20 AM
I love you for this. Installed

cklimas
04-17-2007, 12:15 PM
Even though it works, I receive this error msg:

Could not find phrase 'inline_prefix_changed'.

Mecho
04-17-2007, 02:55 PM
Hi Milad ,

u have no idea how much i was looking for this one . Thanks for making it .

but i have problem with it :

when i tried to change prefix i get this error :
" You tried to set an invalid prefix (for certain forum) to a thread. "

and in other sections that have more than 2 Prefixs , prefix doesnt shows up at all in moderation ...


Thanks in advance

any idea ??

Thanks

Mecho
04-21-2007, 12:23 PM
any support ??

Nathan2006
04-21-2007, 10:19 PM
Thank you Milad

Just what I needed.

Just a problem I found if you created a prefix like this:
<Problem>
It will not show up in the list :( it will only show up blank space of the selector

Thanks for any help

Install

cklimas
04-23-2007, 05:48 AM
Just a problem I found if you created a prefix like this:
<Problem>
It will not show up in the list :( it will only show up blank space of the selector

This seems to be a problem with vBulletin. Text like this <text> will be interpreted as pseudo html tag. Try this [text] to avoid any problems.

Milad
04-24-2007, 05:09 PM
Even though it works, I receive this error msg:

Could not find phrase 'inline_prefix_changed'.

try to overwrite the product.

Hi Milad ,

u have no idea how much i was looking for this one . Thanks for making it .

but i have problem with it :

when i tried to change prefix i get this error :


and in other sections that have more than 2 Prefixs , prefix doesnt shows up at all in moderation ...


Thanks in advance

any idea ??

Thanks

You have to change prefix forum by forum, don't try to apply a prefix in a forum to a thread in another forum.

Thank you Milad

Just what I needed.

Just a problem I found if you created a prefix like this:
<Problem>
It will not show up in the list :( it will only show up blank space of the selector

Thanks for any help

Install

I'll try to solve that for you.

nexialys
04-24-2007, 05:21 PM
a little gift from myself... the French / Fran?ais phrases ;)

Milad, just add this to your distribution, i will delete the file afterward

Mecho
04-24-2007, 07:52 PM
You have to change prefix forum by forum, don't try to apply a prefix in a forum to a thread in another forum.


!! of course i did like that ! but no work for me !

Nathan2006
04-25-2007, 08:55 PM
I'll try to solve that for you.


Thanks :)

cklimas
05-02-2007, 12:31 PM
Hi Milad,

it is not possible to unassign selected threads. Could you add this?

Regards
Chris

Princeton
05-21-2007, 08:16 PM
not forward compatible - if a prefix is similar to one of the default admin dropdown values it will not work..

for example, if you or the staff creates a prefix called "close", "open", etc .. it will conflict with existing values

hence, this modification may have a negative affect on new options that jelsoft may add (in the future) to the admin moderation dropdown menu

a fix would be to prepend 'p_' to each prefix value (forumdisplay_start)
if ($foruminfo['allowprefix'])
{
if (!function_exists(insert_to_template))
{
function insert_to_template($templatename, $remark, $location, $position = 'after')
{
global $vbulletin;

if ($position == 'after')
{
$location = $remark . $location;
}
else if ($position == 'before')
{
$location = $location . $remark;
}

$vbulletin->templatecache[$templatename] = str_replace($remark, $location, $vbulletin->templatecache[$templatename]);
}
}

insert_to_template('FORUMDISPLAY', '<optgroup label=\"____________________\">', $vbulletin->templatecache['forumdisplay_inlineprefix'], 'before');

$prefix_array = explode("\r\n", trim($foruminfo['threadprefix']));

foreach ($prefix_array as $key => $value)
{
$inlineprefix .= "\t\t\t\t\t<option value=\"p_" . urlencode($value) . "\">$value</option>\r\n";
//DEVDEBUG("prefix = ". $value);
}
unset($prefix_array);
}and remove 'p_' in inlinemod_action_switch before any action is taken

I changed inlinemod_action_switch to:
if ($foruminfo['allowprefix'])
{
$prefix_array = explode("\r\n", trim($foruminfo['threadprefix']));

$newprefix = urldecode($_POST['do']);
// remove 'p_'
$newprefix = str_replace('p_', '', $newprefix);

if (in_array($newprefix, $prefix_array))
{
/**
* $newprefix exists in database so let's go ahead and use it
* $newprefix exists so let's change $_POST action
* Check threadids exist
*/

$handled_do = true;
$_POST['do'] = 'changeprefix';

if (empty($vbulletin->GPC['tlist']))
{
eval(standard_error(fetch_error('you_did_not_selec t_any_valid_threads')));
}

if (count($vbulletin->GPC['tlist']) > $threadlimit)
{
eval(standard_error(fetch_error('you_are_limited_t o_working_with_x_threads', $threadlimit)));
}

$threadids = implode(',', $vbulletin->GPC['tlist']);
}
// we're finished with $prefix_array
unset($prefix_array);
}

Mecho
06-12-2007, 03:32 PM
not forward compatible - if a prefix is similar to one of the default admin dropdown values it will not work..

for example, if you or the staff creates a prefix called "close", "open", etc .. it will conflict with existing values

hence, this modification may have a negative affect on new options that jelsoft may add (in the future) to the admin moderation dropdown menu

a fix would be to prepend 'p_' to each prefix value (forumdisplay_start)


is it possible that u post Fixed XML file here ? Thanks

Milad
06-19-2007, 09:19 AM
I'll fix it. When I have the time.

Do you have any problem with it?

Mecho
06-22-2007, 12:19 PM
yeap :

https://vborg.vbsupport.ru/showpost.php?p=1229743&postcount=11

thanks

WarDoGG
07-03-2007, 02:17 PM
This mod screwed my inline moderation system.... Helpppppppp inline moderation doesnt work now !!

whenever i select thread by clicking on checkbox, and try to perform any action, all that happens is, i return to the same page... no action performed..

I please request the author of this mod to help me out :(

Milad
07-11-2007, 12:45 PM
I'll release new version.

Alfa1
07-24-2007, 11:56 PM
My inline moderation is screwed as well. Please release a new version.

TheMilkCarton
07-25-2007, 07:38 AM
This mod screwed my inline moderation system.... Helpppppppp inline moderation doesnt work now !!

whenever i select thread by clicking on checkbox, and try to perform any action, all that happens is, i return to the same page... no action performed..

I please request the author of this mod to help me out :(

My inline moderation is screwed as well. Please release a new version.No, this mod didn't screw the inline moderation system. This one did (https://vborg.vbsupport.ru/showthread.php?t=125776).

Specifically, check my post (https://vborg.vbsupport.ru/showpost.php?p=1207215&postcount=21) on the 2nd page with the fix.

If this mod broke inline moderation, then it was your fault. :)

0tolerance
07-25-2007, 08:37 AM
I LOVE YOU!!!
i was thinking the other day that i hope some one made one of these

Alfa1
07-25-2007, 09:22 AM
No, this mod didn't screw the inline moderation system. This one did (https://vborg.vbsupport.ru/showthread.php?t=125776).

Specifically, check my post (https://vborg.vbsupport.ru/showpost.php?p=1207215&postcount=21) on the 2nd page with the fix.

If this mod broke inline moderation, then it was your fault. :)
I didn't install that hack.

TheMilkCarton
07-25-2007, 09:22 AM
I didn't install that hack.
Well then you did something wrong with this one.

Alfa1
07-25-2007, 10:01 AM
Yes, I imported the product. What else can you do with it?

I am running 3.7pl1 but this is patched to 3.7PL1 from 3.62. Can this have anything to do with why this problem is caused?

WarDoGG; what version are you running? Are you running a patched upgrade like me?

Mecho
07-25-2007, 12:24 PM
I'll release new version.

any news ??

Alfa1
08-14-2007, 08:24 PM
Any news on the ETA of the new version? I really like this hack, but the current version doesn't work for me.

Adam21
08-18-2007, 04:43 PM
installed in my vb368 without no problems,thanks! :)

Alfa1
09-05-2007, 12:17 PM
Yes, but you changed the code in order to be able to do so.
Here's what i use.In your FORUMDISPLAY template:
Add this code:

<!-- Fixed Threadprefix Inline -->
<if condition="$show['threadprefix']">
</form>
<td class="smallfont">
<form action="forumdisplay.php" method="get">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="f" value="$forumid" />
<input type="hidden" name="page" value="$pagenumber" />
<input type="hidden" name="pp" value="$perpage" />
<input type="hidden" name="sort" value="lastpost" $sort[lastpost] />
<input type="hidden" name="order" value="desc" $order[desc] />
<input type="hidden" name="daysprune" value="-1" $daysprunesel[all] />
<strong>Filter by prefix:</strong> $threadprefixes
<input type="submit" class="button" value="Show" /></form></td></if>
<!-- /Fixed Threadprefix Inline -->


AFTER this code:

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead"><phrase 1="$limitlower" 2="$limitupper" 3="$totalthreads">$vbphrase[showing_threads_x_to_y_of_z]</phrase></td>

</tr>
<tr valign="top">
<td class="alt1">

<table cellpadding="3" cellspacing="0" border="0" align="center">
<tr>


and BEFORE this code


</select></td>
<td><select name="order">
<option value="asc" $order[asc]>$vbphrase[ascending]</option>
<option value="desc" $order[desc]>$vbphrase[descending]</option>
</select></td>

Good luck!
I tried to do this, but the code Adam says I should place it after does not exist in my FORUMDISPLAY.

Any idea's on this?

Milad
09-06-2007, 10:49 AM
OK, I'm really sorry.

I have much works than you can imagine.

I'll post a new version within two days.

bjhuang
09-09-2007, 08:51 AM
to support global prefixes:


[OPEN]
plugin: Forum Display Inline Prefix

[REPLACE ALL]

if ($foruminfo['allowprefix'])
{
if (!function_exists(insert_to_template))
{
function insert_to_template($templatename, $remark, $location, $position = 'after')
{
global $vbulletin;

if ($position == 'after')
{
$location = $remark . $location;
}
else if ($position == 'before')
{
$location = $location . $remark;
}

$vbulletin->templatecache[$templatename] = str_replace($remark, $location, $vbulletin->templatecache[$templatename]);
}
}

if ($foruminfo['threadprefix']) $threadprefixes_inline = explode("\r\n", trim($foruminfo['threadprefix']));
else $threadprefixes_inline = array();

if ($vbulletin->options['showdefaultprefixes'] AND $vbulletin->options['defaultprefixes']) {
$defaultprefixes_inline = explode("\r\n", trim($vbulletin->options['defaultprefixes']));
switch($vbulletin->options['showdefaultprefixes'])
{
case 1:
if (empty($threadprefixes_inline)) $threadprefixes_inline = $defaultprefixes_inline;
break;
case 2:
$threadprefixes_inline = array_merge($defaultprefixes_inline, $threadprefixes_inline);
break;
case 3:
$threadprefixes_inline = array_merge($threadprefixes_inline, $defaultprefixes_inline);
break;
}
unset($defaultprefixes_inline);
}

if(!empty($threadprefixes_inline )){
insert_to_template('FORUMDISPLAY', '<optgroup label=\"____________________\">', $vbulletin->templatecache['forumdisplay_inlineprefix'], 'before');
$threadprefixes_inline = &array_unique($threadprefixes_inline);
foreach($threadprefixes_inline as $prefix_inline) {
if(!empty($prefix_inline)) {
$inlineprefix .= "\t\t\t\t\t<option value=\"" . urlencode($prefix_inline) . "\">" . unhtmlspecialchars($prefix_inline) . "</option>\r\n";
}
}
}
unset($threadprefixes_inline);
}

[OPEN]
plugin: Inline Mod Action Switch

[REPLACE ALL]
if ($foruminfo['allowprefix'])
{
if ($foruminfo['threadprefix']) $threadprefixes_inline = explode("\r\n", trim($foruminfo['threadprefix']));
else $threadprefixes_inline = array();

if ($vbulletin->options['showdefaultprefixes'] AND $vbulletin->options['defaultprefixes']) {
$defaultprefixes_inline = explode("\r\n", trim($vbulletin->options['defaultprefixes']));
switch($vbulletin->options['showdefaultprefixes'])
{
case 1:
if (empty($threadprefixes_inline)) $threadprefixes_inline = $defaultprefixes_inline;
break;
case 2:
$threadprefixes_inline = array_merge($defaultprefixes_inline, $threadprefixes_inline);
break;
case 3:
$threadprefixes_inline = array_merge($threadprefixes_inline, $defaultprefixes_inline);
break;
}
unset($defaultprefixes_inline);
}

$prefix_array = $threadprefixes_inline;
if (in_array(urldecode($_POST['do']), $prefix_array))
{
$handled_do = true;
$newprefix = urldecode($_POST['do']);
$_POST['do'] = 'changeprefix';

if (empty($vbulletin->GPC['tlist']))
{
eval(standard_error(fetch_error('you_did_not_selec t_any_valid_threads')));
}

if (count($vbulletin->GPC['tlist']) > $threadlimit)
{
eval(standard_error(fetch_error('you_are_limited_t o_working_with_x_threads', $threadlimit)));
}

$threadids = implode(',', $vbulletin->GPC['tlist']);
unset($prefix_array);
}
}

Alfa1
09-09-2007, 02:01 PM
What does your global prefixes code exactly do?
Does it allow to make a number of prefixes global, while letting other prefixes remain local?

I would really appreciate the code for allowing prefixes to be applied to categories, but not global.

bjhuang
09-10-2007, 04:38 AM
thread prefix supports global prefixes. you can choose how to apply to single forum. but this mod doesn't recognize them.

Milad
09-13-2007, 04:22 PM
- 1.1.0 released on September, 13 2007 (Added the default prefixes and fixed some bugs).

xandizitxu
09-13-2007, 04:39 PM
Coool

cunder
09-14-2007, 09:50 AM
It will not show up in the list it will only show up blank space of the selector

Look Pics:

https://vborg.vbsupport.ru/

Mecho
09-14-2007, 04:05 PM
it works just in the forums that u created prefix manually .. not via Prefix Option in vboptions .

Alfa1
09-16-2007, 01:46 PM
It seems to work well in my test forum.
If you install the new version, please post here to let me know how it works out for you.

Mecho
09-16-2007, 01:50 PM
i did ! but as i said it shows Prefix JUST if u added prefix manually in each forum one by one ! not via Main Option ...

Alfa1
09-16-2007, 01:55 PM
It seems to me as that is how it should work.
The advantage of this add-on is that you can select multiple threads and add a prefix to them in one go, instead of adding the prefix to each thread one by one.

We could certainly use another add-on to add prefixes to multiple forums.

bjhuang
09-17-2007, 10:57 AM
the new version does not work for default prefixes either.
you can try my code above instead.


It will not show up in the list it will only show up blank space of the selector

Look Pics:

http://img396.imageshack.us/img396/2774/picsfo5.jpg

Mecho
09-17-2007, 11:26 AM
the new version does not work for default prefixes either.
you can try my code above instead.

after the changed to what u said i got this error :'

Unable to add cookies, header already sent.
File: /home/public_html/forum/forumdisplay.php(106) : eval()'d code
Line: 115

Milad
09-19-2007, 03:14 AM
the new version does not work for default prefixes either.
you can try my code above instead.
Dear
try to see the hack in default style. anyway I'll look to see your problem.

Milad
09-19-2007, 03:16 AM
It seems to me as that is how it should work.
The advantage of this add-on is that you can select multiple threads and add a prefix to them in one go, instead of adding the prefix to each thread one by one.

We could certainly use another add-on to add prefixes to multiple forums.
Thanks to be around, I hope you like it.

Alfa1
09-23-2007, 12:17 PM
What happens if a moderator selects threads in various forums and then changes the prefix of all of those threads in one go (through the inline moderation)? Would that break anything?

Milad
10-03-2007, 11:13 AM
He will get error message indicating that a prefix is not allowed for the threads.

wluther
10-10-2007, 07:41 AM
the new version does not work for default prefixes either.
you can try my code above instead.

The default prefixes did not show up on my forum either until I scrolled up to the top of the forum, clicked on the "Forum Tools" drop down box, selected the "Manage Thread Prefixes" option under "Admin Tools," and once the Thread Prefix Manager loads up, I just saved it and it has worked perfectly ever since then....

I hope it helps..

Grazu
11-16-2007, 04:37 PM
Just great! A BIG thank you!

|Jordan|
02-24-2008, 01:57 AM
THANK YOU SOOO MUCH FOR THIS!

I was facing editing over 300 threads manually.

Spermy
03-09-2008, 05:36 PM
Can this be made to work with 3.7 prefixes?

Milad
03-16-2008, 12:20 AM
Can this be made to work with 3.7 prefixes?
https://vborg.vbsupport.ru/showthread.php?t=172633

princeedward
05-25-2008, 10:45 AM
thanks marked installed! :)