PDA

View Full Version : Show Thread Enhancements - Private Debates


beebi
08-02-2006, 10:00 PM
Features List:

Allow members to add userIDs of debaters when creating a new thread so that only the thread owner and added members can reply, in addition of course to the Admin and mod of the forum
Admin and mod can add, remove debaters after the thread creation
When viewing the thread, it will show on top that this is a private debate between the thread owner and selected member names
If no userIDs added, the thread will act normal, allowing permitted members to reply.
It can be enabled per forum.
UserIDs added are separated by space.
Compatible with VB 3.5.4 and 3.6


Installation:

Import product-tdebates.xml into your products be going to Plugin System -> Manage Products -> Add/Import Product.
Enable it for any forum


Thanks go to Ghanem (https://vborg.vbsupport.ru/member.php?u=61943) for kindly providing the English phrases translation

Nominate this for Mod o.t. Month (https://vborg.vbsupport.ru/vborg_miscactions.php?do=nominatehotm&t=122897)

click install (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=122897) it you did installed this mod

beebi
08-03-2006, 09:24 AM
Oops! this is mine

beebi
08-03-2006, 09:25 AM
Oops! ... I Did It Again ;)

Barakat
08-03-2006, 09:42 AM
Oops Installed . thanks

paul41598
08-03-2006, 09:50 AM
Good idea, reminds me of Private Threads. Although I'd still like to see one of these hacks usergroup permissible so only certain groups have access to it.

Maybe for future plans, add a button or something so a user can search a name and get that persons userid in the result set. Most people wouldnt be able to find a userid since its not default shown

Nice job

BoYagoob
08-03-2006, 10:50 AM
installed ..

million thanks .. :)

beebi
08-03-2006, 10:50 AM
next release

FleaBag
08-03-2006, 07:37 PM
Great release Beebi! I really like it. :)

Is it possible for you to enable the thread starter the ability to add or remove debaters?

Alien
08-03-2006, 10:24 PM
Very cool, I like this a lot and would have use for it.

However, hopefully this will be updated to allow for usernames. :)

vphost
08-03-2006, 10:31 PM
Besides userid, can you use usernick as well?

apokphp
08-04-2006, 12:14 AM
Excellent feature...especially considering that my site is a full on debate site: www.onlinedebate.net ;)

However, it's currently working for RC3...is it also working fine for gold?

Tyegurl
08-04-2006, 01:06 AM
nice idea!! will put this in favorites and wait the need to arise

bada_bing
08-04-2006, 02:43 AM
Nice hack,,, A couple request..

Usergroups permissions
usernames instead of userId's this is easier to understand for a typical user.

SiriusBlack22
08-04-2006, 07:33 PM
Good hack, but there are loads of misspellings. I still love it though!

INSTALL!

SiriusBlack22
08-04-2006, 07:34 PM
Oh and bada_bing took the words out of my mouth.

FleaBag
08-05-2006, 06:48 PM
I just realised, you can ignore my last request. That is, unless I misunderstand.

Is it the mod of the forum who can view the Private Threads or is it a member of the moderator usergroup? If the former is true then I will just not assign a mod to the forum.

cavyspirit
08-05-2006, 08:21 PM
I use vbSEO and you don't see the userid # ANYWHERE! I was about to install this and realized I have no way of telling my members how to get to the user number.

Any chance you are going to upgrade this real quick? I really really need user names and strongly need the ability to allow or block by user group.

cavyspirit
08-05-2006, 08:22 PM
Also, agree it would be ideal to have the thread originator or moderators add or remove people from the thread once it's going.

Those three things are pretty necessary to make this usable--which would be great!

Ghanem
08-10-2006, 01:00 PM
## Some replies are my own openion. ##

Most people wouldnt be able to find a userid since its not default shownThis would solve it..
in templates postbit and postbit legacy, look for:
<if condition="$post['joindate']"><div>$vbphrase[join_date]: $post[joindate]</div></if>Add below
<div>$vbphrase[userid]: $post[userid]</div>
in template memberinfo, look for:
<if condition="$userinfo['usertitle']"><div class="smallfont">$userinfo[usertitle]</div></if>add below
<if condition="$userinfo['userid']"><div class="smallfont">$vbphrase[userid]: $userinfo[userid]</div></if>this will show the useID of the members, its much easier than copying usernames, specially concedring special charachters and non-English languages..

Is it possible for you to enable the thread starter the ability to add or remove debaters?I think its better to be up to the mod or admin so the debater retreat if he is not strong enough to debate..

However, it's currently working for RC3...is it also working fine for gold?Yes it is

usernames instead of userId's this is easier to understand for a typical userAdded solution above..

but there are loads of misspellings.My mistake :confused:

Is it the mod of the forum who can view the Private Threads or is it a member of the moderator usergroup? If the former is true then I will just not assign a mod to the forumEvery body can view the thread, only forum mode, admin and added debaters can reply, in addition of course to the thread starter..

Regards

Phaedrus
08-10-2006, 11:00 PM
Installed and working... Thanks for the Userid upgrade on the fly!

ktp101
08-18-2006, 07:23 PM
thanks :)

James T Brock
08-24-2006, 12:22 AM
Does this work with vB3.5 as well?

Ghanem
08-24-2006, 08:10 PM
Does this work with vB3.5 as well?Yes :)

voteforbird
08-28-2006, 12:12 AM
Any chance this can be modified so that usernames can be added instead of userIDs? Perhaps this can be done if commas or semicolons are used to separate them.

TheBlackPoet
09-09-2006, 10:31 PM
i couldnt figure out where to add the user id's.. but it was right in my face... i run a poetry site.. and this is absolutely perfect..... thank you for this....

question...... instead of having to put user id's in, can we just put in the username???

heyitsjeremy
09-10-2006, 09:16 AM
could this be done so I can enter the username instead of the userid ?

TheBlackPoet
09-10-2006, 12:34 PM
hahahah apparently none of us are reading the threads... this question has been asked... hopefully its answered... a good hack indeed!!

Calibre_k
09-11-2006, 09:27 PM
How would members know what the user id is?
Members can view the debate? is it supposed to work like that.

snyx
10-01-2006, 03:08 AM
The only peeve I have (and this maybe my issue) is the inability for a user to add/remove ID's thereafter by editing the first post or making a new post. I see admins have the abilty but I cant seem to sniff out the users.

Also, the AJAX username popup (such as in the recipient felid when sending a PM) would be great. Most of my users are not up to par on things like collecting ID numbers. The feature would be overlooked by many because they would have to hunt out their mates ID's at the time of posting.

All questions aside, top notch addon mate. Karma++

adonfun
10-06-2006, 12:13 PM
I am interested in this mod :) it is compatible with 3.6.2 too? Or does "Compatible with VB 3.5.4 and 3.6" also means that it is compatible with 3.6.2?

Antyrael
10-17-2006, 12:56 PM
Nice addon, I installed it too, but I have one request:

Could you modify this so that there's a checkbox option to make the topic visible only to those debaters who have been specified? (and the mods and admins ofcourse).
I would like this, because it would prevent people feeling left out.

Mr Pink
10-17-2006, 07:09 PM
Really great mod and idea! Thanks for release.

ccmoon
10-18-2006, 07:49 PM
I installed this but couldn't find userID ?? can I put username instead of UserID?

When regular user open a new thread, she/he don't know his/her userID to add in the private debate box.

ccmoon
10-19-2006, 12:27 AM
I found the UserID in User profile. I am planning to make a list of UserID and post in my board. Is there any security issue if I display userID outsite my board? just wanna make sure....
For example:
User: timlennon (id: 27)

yinyang
10-19-2006, 04:27 PM
brilliant work!

dina
12-02-2006, 06:46 PM
I tried this on 3.6.4 and it didn't work. I logged out and could see a thread that was supposed to be between 2 registered users

yui333
12-03-2006, 01:01 AM
very nice, thank you

Maxman1544
12-04-2006, 12:52 AM
Any way to allow this by group instead of member? Thanks.

kungfujesus
12-04-2006, 10:41 PM
I'm considering installing this... does anyone find it useful in flame wars or other 1-on-1 situations?

Maxman1544
12-10-2006, 03:39 AM
Anyone running this on 3.6.4 ?

jailer
12-11-2006, 08:01 AM
*subscribes to thread*

Hopefully the developer will think about upgrading this.
I'd love to install this, but it's missing that vital username entry instead of user ID.


*edit*
Tried it anyway.
Didn't work for me?
:surprised:
Not showing up in AdminCP.

http://img242.imageshack.us/img242/6676/untitled2copyyw0.jpg

apokphp
12-21-2006, 03:44 PM
Seems to be working fine. However, how can I make it a PUBLIC thread, open to all members, once X # of posts have been made in the private debate thread?

Is there an easy conditional for that? Say to just make the thread public after 12 or so posts?

bairy
12-26-2006, 01:11 PM
A request was made in Service Requests to do this via username instead of userid.
It's not a big change and I was bored so ... happy holidays...


Empty the plugin named "Save private debate data", location: "newthread_post_complete", and put the following in it:

$vbulletin->input->clean_gpc('p', 'tdebates', TYPE_STR);
if($vbulletin->GPC['tdebates'] = trim($vbulletin->GPC['tdebates']))
{
$tdebatesnames = explode(",", $vbulletin->GPC['tdebates']);
foreach ($tdebatesnames AS $name)
{
$name = $db->escape_string(htmlspecialchars_uni(trim($name)));
$querywhere .= ",'$name'";
}
$querywhere = substr($querywhere, 1);

$tquery = $db->query_read("SELECT userid FROM " . TABLE_PREFIX ."user AS user WHERE username IN ($querywhere)");

while ($row = $db->fetch_array($tquery))
{
$tuserids .= "," . $row['userid'];
}
$tuserids = substr($tuserids, 1);

$db->query_write("UPDATE " . TABLE_PREFIX . "thread SET debates = '" . $tuserids . "' WHERE threadid = " . $newpost['threadid'] . "");

$db->free_result($tquery);
unset ($censorwords, $a, $tquery, $querywhere, $tdebatesnames);
}



Empty the plugin named: "thread to debate", location: "threadmanage_action_switch" and put the following in it:

if ($_REQUEST['do'] == 'tdebates')
{
// only mods with the correct permissions should be able to access this
if (!can_moderate($threadinfo['forumid'], 'candeleteposts'))
{
print_no_permission();
}

// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);

// draw navbar
eval('$navbar = "' . fetch_template('navbar') . '";');

if (trim($threadinfo['debates'] != ''))
{
$threadinfo['debates'] = ',' . $threadinfo['debates'];
}
$query = $db->query_read("SELECT username FROM " . TABLE_PREFIX . "user AS user WHERE userid IN (0$threadinfo[debates])");
$threadinfo['debates'] = '';
while ($row = $db->fetch_array($query))
{
$threadinfo['debates'] .= ", " . $row['username'];
}
$threadinfo['debates'] = substr($threadinfo['debates'], 2);

// spit out the final HTML if we have got this far
eval('$HTML = "' . fetch_template('threadadmin_tdebates') . '";');
eval('print_output("' . fetch_template('THREADADMIN') . '");');
exit;
}

elseif ($_POST['do'] == 'dotdebates')
{
$vbulletin->input->clean_gpc('r', 'tdebates', TYPE_STR);

// only mods with the correct permissions should be able to access this
if (!can_moderate($threadinfo['forumid'], 'candeleteposts'))
{
print_no_permission();
}

// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);

$vbulletin->GPC['tdebates'] = trim($vbulletin->GPC['tdebates']);
$tdebatesnames = explode(",", $vbulletin->GPC['tdebates']);
foreach ($tdebatesnames AS $name)
{
$name = $db->escape_string(htmlspecialchars_uni(trim($name)));
$querywhere .= ",'$name'";
}
$querywhere = substr($querywhere, 1);

$tquery = $db->query_read("SELECT userid FROM " . TABLE_PREFIX ."user AS user WHERE username IN ($querywhere)");

while ($row = $db->fetch_array($tquery))
{
$tuserids .= "," . $row['userid'];
}
$tuserids = substr($tuserids, 1);

$db->free_result($tquery);
unset ($censorwords, $a, $tquery, $querywhere, $tdebatesnames);

$db->query_write("UPDATE " . TABLE_PREFIX . "thread SET debates = '" . $tuserids . "' WHERE threadid = '" . $threadid . "'");
$tdebates_phrase = 'Private debate';
$redirect='redirect_done_dotdebates';

log_moderator_action($threadinfo,'tdebates',$tdeba tes_phrase);
$vbulletin->url = 'showthread.php?' . "t=" . $threadid . "";
eval(print_standard_redirect($redirect, true, true));
exit;
}


Important: chosen usernames must be seperated by a comma (because some usernames have spaces), so you'll want to change the word "space" to "comma" in the templates:
Debates Templates > tdebates_newthread.
Thread Administration Templates > threadadmin_tdebates

Notes:
= If a non existant username is inputted, it will be ignored. If no valid usernames are inputted, it will not be a private-debate thread.
= I've copied the PM system's way of parsing usernames, therefore special characters and stuff should be accounted for. Or in other words: any valid username should work. However, it's still dependant on how the browser transmits special characters, so it's not 100% guaranteed.
= Any existing private-debate threads that anyone currently has won't be affected by this. Only the input method has been changed, everything else is the same.

MrPHD
12-26-2006, 04:09 PM
Nice Work very good in did. Regards and installed

Krumbz
12-26-2006, 09:11 PM
salaam aalaykum khayye, I installed it but I don't see where i can edit the settings from the vbulletin options...i have 3.6.2 vbulletin

can u tell me where i can enable it and adjust settings ??

shokran

apokphp
12-27-2006, 03:54 PM
That's great Bairy! :) Thanks for the edit there.

If you have the time, can you look into the feature requested in post #42 above? Here it is for convenience:

How can I make it a PUBLIC thread, open to all members, once X # of posts have been made in the private debate thread?

For instance, a private debate goes on between 2 members, each provide 6 posts in the thread, bringing the total to 12 posts (12 is just an an arbitrary #) in the thread. By this time, the debate is slowing down, one side is emerging more victorious than the other.

As such, the public can then start weighing in on the matter, either by posting themselves or by initiating a vote on who they think won the debate.

Any way to do this?

Brew
12-31-2006, 01:18 AM
A request was made in Service Requests to do this via username instead of userid.
It's not a big change and I was bored so ... happy holidays...


Empty the plugin named "Save private debate data", location: "newthread_post_complete", and put the following in it:

$vbulletin->input->clean_gpc('p', 'tdebates', TYPE_STR);
if($vbulletin->GPC['tdebates'] = trim($vbulletin->GPC['tdebates']))
{
$tdebatesnames = explode(",", $vbulletin->GPC['tdebates']);
foreach ($tdebatesnames AS $name)
{
$name = $db->escape_string(htmlspecialchars_uni(trim($name)));
$querywhere .= ",'$name'";
}
$querywhere = substr($querywhere, 1);

$tquery = $db->query_read("SELECT userid FROM " . TABLE_PREFIX ."user AS user WHERE username IN ($querywhere)");

while ($row = $db->fetch_array($tquery))
{
$tuserids .= "," . $row['userid'];
}
$tuserids = substr($tuserids, 1);

$db->query_write("UPDATE " . TABLE_PREFIX . "thread SET debates = '" . $tuserids . "' WHERE threadid = " . $newpost['threadid'] . "");

$db->free_result($tquery);
unset ($censorwords, $a, $tquery, $querywhere, $tdebatesnames);
}



Empty the plugin named: "thread to debate", location: "threadmanage_action_switch" and put the following in it:

if ($_REQUEST['do'] == 'tdebates')
{
// only mods with the correct permissions should be able to access this
if (!can_moderate($threadinfo['forumid'], 'candeleteposts'))
{
print_no_permission();
}

// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);

// draw navbar
eval('$navbar = "' . fetch_template('navbar') . '";');

if (trim($threadinfo['debates'] != ''))
{
$threadinfo['debates'] = ',' . $threadinfo['debates'];
}
$query = $db->query_read("SELECT username FROM " . TABLE_PREFIX . "user AS user WHERE userid IN (0$threadinfo[debates])");
$threadinfo['debates'] = '';
while ($row = $db->fetch_array($query))
{
$threadinfo['debates'] .= ", " . $row['username'];
}
$threadinfo['debates'] = substr($threadinfo['debates'], 2);

// spit out the final HTML if we have got this far
eval('$HTML = "' . fetch_template('threadadmin_tdebates') . '";');
eval('print_output("' . fetch_template('THREADADMIN') . '");');
exit;
}

elseif ($_POST['do'] == 'dotdebates')
{
$vbulletin->input->clean_gpc('r', 'tdebates', TYPE_STR);

// only mods with the correct permissions should be able to access this
if (!can_moderate($threadinfo['forumid'], 'candeleteposts'))
{
print_no_permission();
}

// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);

$vbulletin->GPC['tdebates'] = trim($vbulletin->GPC['tdebates']);
$tdebatesnames = explode(",", $vbulletin->GPC['tdebates']);
foreach ($tdebatesnames AS $name)
{
$name = $db->escape_string(htmlspecialchars_uni(trim($name)));
$querywhere .= ",'$name'";
}
$querywhere = substr($querywhere, 1);

$tquery = $db->query_read("SELECT userid FROM " . TABLE_PREFIX ."user AS user WHERE username IN ($querywhere)");

while ($row = $db->fetch_array($tquery))
{
$tuserids .= "," . $row['userid'];
}
$tuserids = substr($tuserids, 1);

$db->free_result($tquery);
unset ($censorwords, $a, $tquery, $querywhere, $tdebatesnames);

$db->query_write("UPDATE " . TABLE_PREFIX . "thread SET debates = '" . $tuserids . "' WHERE threadid = '" . $threadid . "'");
$tdebates_phrase = 'Private debate';
$redirect='redirect_done_dotdebates';

log_moderator_action($threadinfo,'tdebates',$tdeba tes_phrase);
$vbulletin->url = 'showthread.php?' . "t=" . $threadid . "";
eval(print_standard_redirect($redirect, true, true));
exit;
}


Important: chosen usernames must be seperated by a comma (because some usernames have spaces), so you'll want to change the word "space" to "comma" in the templates:
Debates Templates > tdebates_newthread.
Thread Administration Templates > threadadmin_tdebates

Notes:
= If a non existant username is inputted, it will be ignored. If no valid usernames are inputted, it will not be a private-debate thread.
= I've copied the PM system's way of parsing usernames, therefore special characters and stuff should be accounted for. Or in other words: any valid username should work. However, it's still dependant on how the browser transmits special characters, so it's not 100% guaranteed.
= Any existing private-debate threads that anyone currently has won't be affected by this. Only the input method has been changed, everything else is the same.

Sorry...can you be more specific?

I can't locate these templates :knockedout:

bairy
12-31-2006, 07:59 AM
Style Manager > Edit Templates.
The Debates Templates is alphabetically in the P area (for private debates), double click that to expand it and the tdebates_newthread will be revealed.
Same with Thread Administration, double click to expand it.

Rayanet
12-31-2006, 12:20 PM
Installed.
excellent:)

Krumbz
01-04-2007, 09:29 PM
I can't see the options of it, I imported the XML product, what now ?

mawby
01-26-2007, 01:13 PM
Hi, installed this with the username mods and it seems to work nicely. Thanks.

Just wondering if it would be possible to insist the private debate field is filled in and valid? Reason for asking is we use it for a disputes forum between our members and traders and this is an ideal mod as it prevents everyone else getting involved. However until the private debates field is populated the thread can be replied to by anyone which isn't so good.

morrow
01-30-2007, 03:16 AM
Anyway to get this to exclude certain users? I have some users who create threads and would like to exclude a user or two from viewing these threads.

There was a vbprivate threads hack but it doesn't work with 3.6.0...

Just a thought.

ViViD
01-30-2007, 02:16 PM
How can I have the options when I edit a first-post of a thread . We have some old threads that we moderate it manually . I wish to edit the options but there is not exist.

vectorfc
02-06-2007, 12:04 PM
Great idea, and nice mod. :)

There's one thing I'd like to do, though - I'd like to make a single user able to invite users to a thread without making that user a moderator. I thought I could do this using conditionals, but since the template is within the mod tools menu, I can't. Is there a quick and dirty way to do this? I'm only thinking of making one user able to do this, so could it possibly be done with a userid=87 or whichever statement?

TrIn@dOr
02-06-2007, 12:32 PM
Nice hack, installed and uninstalled.

Sorry but i need the possibility of translations.

MThornback
04-23-2007, 11:19 AM
Is it possible to set this up so that ONLY the people you add can participate and not all Forum Admins?

If I wanted to say use this for peer mediation and didn't want prying eyes outside the 3-4 people that needed to see it?

LordDB
04-25-2007, 09:43 PM
Anyway of hiding thread content so that only Member's authorised can view content & reply?

Hope you can help me here!

Br.

DeadBeet
05-27-2007, 05:53 AM
What if, only the members and admins and mods can see the thread.. If you don't belong to the debate, then you don't see the thread..?

SuperTaz
07-05-2007, 07:49 AM
Nice...Installed

Simplicity
08-14-2007, 07:57 AM
Anyway of hiding thread content so that only Member's authorised can view content & reply?

Hope you can help me here!

Br.

Thats exactly what I would like to see implemented. Would act much like the vbPrivate Threads mod worked for 3.5. As this mod isn't supported I guess this modification wont happen.

distractme
08-23-2007, 08:51 PM
we love this! we have it enabled in two sub forums but would like to enable it by specific groups in other subforums so mods (enabled) could control it and keep registered users (disabled) from getting pissy with it. :)

any way to do that?

JohnBee
09-27-2007, 11:48 AM
Oh boy! your the man! - Any chance to add a button for people to read(if they wanted too).

periphrastic
09-27-2007, 06:51 PM
installed on 3.6.8 & thank you

apokphp
10-03-2007, 10:49 PM
FYI, for those who cannot find the option for it in their admincp...it's there, just not where the screenshot says it should be.

Look at the very, very bottom of the options in the forum permissions page.

tqvn2004
09-28-2008, 10:24 AM
I need this Addon for my forum, and it stop working when I upgrade to VBB 3.7.3 PL1. This is the modification to the original plugin to make it works again:

Find in product-tdebates.xml:

<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="do" value="dotdebates" />

Replace with:

<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<input type="hidden" name="do" value="dotdebates" />

Hope this help!

Hornstar
10-01-2008, 12:09 AM
I have updated this addon for anyone who is not very technical. But please backup your database before installing this update. I hope you don't mind beebi (https://vborg.vbsupport.ru/member.php?u=108338) but since you have not been on for several months, I will release the update in your thread.

This update contains the fix for 3.7 (token error) and the username fix. I also re-worded some phrasing to make it more understandable for members (I hope)

Working for 3.7.x (not tested on anything else)

I'd like to add some new features in the future if I get time, but hopefully beebi (https://vborg.vbsupport.ru/member.php?u=108338) will come back and choose to support his mod.

Hope this helps a few people.

pureturk
12-14-2008, 09:48 PM
I have installed this hack. Great job!!

I ve set it up ina way where only admins and mods could start a debate. But my problem(which is not a huge problem) is that when I start a debate between two users. It also shows my username on top as a debater. How would I make some changes so it would only show the names of the userid's that I put when creating the debate exculding the thread creator?

For instance I ve created a debate thread between users 3567 and 5467. But when the thread opens, it shows my username on top along with the other 2 members as well.

Private debate between: admin(me) and user1 and user2

What do i have to do so admin doesnt show?