Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Private Debates Details »»
Private Debates
Version: 1.1, by beebi beebi is offline
Developer Last Online: Jan 2009 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 3.6.0 Rating:
Released: 08-02-2006 Last Update: Never Installs: 115
DB Changes
 
No support by the author.

Features List:
  1. 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
  2. Admin and mod can add, remove debaters after the thread creation
  3. When viewing the thread, it will show on top that this is a private debate between the thread owner and selected member names
  4. If no userIDs added, the thread will act normal, allowing permitted members to reply.
  5. It can be enabled per forum.
  6. UserIDs added are separated by space.
  7. Compatible with VB 3.5.4 and 3.6

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

Thanks go to Ghanem for kindly providing the English phrases translation

Nominate this for Mod o.t. Month

click install it you did installed this mod

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 12-11-2006, 08:01 AM
jailer jailer is offline
 
Join Date: Jun 2006
Location: Manchester, UK
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Reply With Quote
  #43  
Old 12-21-2006, 03:44 PM
apokphp apokphp is offline
 
Join Date: Nov 2002
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #44  
Old 12-26-2006, 01:11 PM
bairy bairy is offline
 
Join Date: Oct 2005
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Code:
$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:
Code:
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',$tdebates_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.
Reply With Quote
  #45  
Old 12-26-2006, 04:09 PM
MrPHD's Avatar
MrPHD MrPHD is offline
 
Join Date: Feb 2006
Location: Portugal
Posts: 385
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice Work very good in did. Regards and installed
Reply With Quote
  #46  
Old 12-26-2006, 09:11 PM
Krumbz Krumbz is offline
 
Join Date: Feb 2006
Location: Poconos, PA
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #47  
Old 12-27-2006, 03:54 PM
apokphp apokphp is offline
 
Join Date: Nov 2002
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:

Quote:
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?
Reply With Quote
  #48  
Old 12-31-2006, 01:18 AM
Brew's Avatar
Brew Brew is offline
 
Join Date: Sep 2002
Posts: 359
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bairy View Post
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:
Code:
$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:
Code:
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',$tdebates_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:
Reply With Quote
  #49  
Old 12-31-2006, 07:59 AM
bairy bairy is offline
 
Join Date: Oct 2005
Posts: 184
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #50  
Old 12-31-2006, 12:20 PM
Rayanet Rayanet is offline
 
Join Date: Dec 2006
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed.
excellent
Reply With Quote
  #51  
Old 01-04-2007, 09:29 PM
Krumbz Krumbz is offline
 
Join Date: Feb 2006
Location: Poconos, PA
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can't see the options of it, I imported the XML product, what now ?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:24 PM.


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.04672 seconds
  • Memory Usage 2,323KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete