PDA

View Full Version : Profile Enhancements - Lt - Ban Info


Leftenant
11-10-2012, 11:00 PM
Desc:
Show ban info on user profile..
Installation:


Download Lt_Ban_Info_113.zip.
Copy 'Leftenant' folder to Forum root directory
Import product-lacyc_ban_bilgileri_english.xml file on Product Manamegent.
Go to vBulletin Options/Lt - Ban Info and change variables.

Note:if you upgrade for Lt - Ban Info 1.1.1, go to forum root directory and rename Lt folder to Leftenant or copy Leftenant folder to Forum root...
This product id is changed. Please don't forget to delete the others version before your install version 1.1.3

Change Log:

Version 1.0:

First release.
Version 1.1:

Added vBulletin 4 compatible.
Added Lift ban and edit reason options.

Version 1.1.1:

Unnecessary query's removed.
Some bugs fixed.
Lt folder renamed to Leftenant.


Version 1.1.2:

Query problems fixed.



Version 1.1.3:

Added Appearance At Permanent Ban User Option.




For vBulletin 3.8: https://vborg.vbsupport.ru/showthread.php?t=235675

Alan_SP
11-13-2012, 04:56 AM
Excellent mod.

But, you have few small bugs. In zip you named your directory Lt, but in product you reference directory lt. Unix server differentiate between small and capital letters. It's easy to change, but as it is now, this reports error.

Also, I disabled in postbit pop-up, but it is still visible.

These are relatively small problems. A bigger problem is that you're not using English in variable names, so it is a bit of a problem to know what templates and variables actually do (so I have much harder time to correct such mistakes). Anyway, thank you very much...

Could you maybe add option that permanently banned users don't show this information about banning? I try to make them less obvious from those that are only banned for a certain period of time.

Alan_SP
11-13-2012, 05:14 AM
Just noticed serious problem with queries. It adds about 130 queries on my index page, also adds queries on threadshow pages.

Till you solve this problem, I'm disabling this mod. When you solve it, I'll use it again, it looks really good, but so many queries is a too big problem.

Leftenant
11-13-2012, 11:40 AM
Take care of the problems. Thank you for attention.

TheSupportForum
11-13-2012, 11:59 AM
like this mod, tagged it for later use, would like to see an option
to only show it to admins,mods,supermods

Leftenant
11-13-2012, 04:31 PM
This plugin upgraded.

Nirjonadda
11-13-2012, 04:31 PM
Does it work on 4.1.10 without manual template edit ?

Leftenant
11-13-2012, 04:45 PM
Does it work on 4.1.10 without manual template edit ?
this hack tested and working on vB 4.0, 4.2 without having to change template.

GPOClan
11-13-2012, 05:56 PM
Looks very good, tagged for later ;)

Alan_SP
11-13-2012, 06:44 PM
to only show it to admins,mods,supermods

Actually, this option is already in it. You need to select usergroups that will see banning info, if you don't no one will see it.

Alan_SP
11-13-2012, 07:01 PM
Take care of the problems. Thank you for attention.

Just tested it for queries. Problem isn't solved.

My index page (forum.php) now has 149-150 queries, but without your mod I have 21-24 queries (it depends). It also rises a bit (about 5-10%) page generation time, but it is maybe because all this queries.

On showthread pages, each post has two queries, so, as I have 25 post per page, I have additional 50 queries if that thread page has all posts.

This is too much queries. Please, try to solve it. If not, however I like your mod and it's usefulness, it's a too big impact on server for my liking.

Didn't tested other things (queries are too serious problem for me). And, if you be able to sort this queries out, please add check if user is permanently banned and option that such user's don't show banning info.

I really hope you'll be able to solve this problem with queries, like your mod very much.

Leftenant
11-13-2012, 07:12 PM
Just tested it for queries. Problem isn't solved.

My index page (forum.php) now has 149-150 queries, but without your mod I have 21-24 queries (it depends). It also rises a bit (about 5-10%) page generation time, but it is maybe because all this queries.

On showthread pages, each post has two queries, so, as I have 25 post per page, I have additional 50 queries if that thread page has all posts.

This is too much queries. Please, try to solve it. If not, however I like your mod and it's usefulness, it's a too big impact on server for my liking.

Didn't tested other things (queries are too serious problem for me). And, if you be able to sort this queries out, please add check if user is permanently banned and option that such user's don't show banning info.

I really hope you'll be able to solve this problem with queries, like your mod very much.
Event is now realized. Just interested...

Leftenant
11-13-2012, 10:23 PM
Just tested it for queries. Problem isn't solved.

My index page (forum.php) now has 149-150 queries, but without your mod I have 21-24 queries (it depends). It also rises a bit (about 5-10%) page generation time, but it is maybe because all this queries.

On showthread pages, each post has two queries, so, as I have 25 post per page, I have additional 50 queries if that thread page has all posts.

This is too much queries. Please, try to solve it. If not, however I like your mod and it's usefulness, it's a too big impact on server for my liking.

Didn't tested other things (queries are too serious problem for me). And, if you be able to sort this queries out, please add check if user is permanently banned and option that such user's don't show banning info.

I really hope you'll be able to solve this problem with queries, like your mod very much.

Ok. Problem is fixed. Thank you for attention.

Skyrider
11-14-2012, 11:01 AM
Installed, though currently disabled.

By Visiting a "&mode=threaded" URL, this pops up:



Database error in vBulletin 4.2.0:

Invalid SQL:

SELECT
post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted,
user.*, userfield.*, usertextfield.*,
icon.title as icontitle, icon.iconpath,
avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,


editlog.userid AS edit_userid, editlog.username AS edit_username, editlog.dateline AS edit_dateline,
editlog.reason AS edit_reason, editlog.hashistory,
postparsed.pagetext_html, postparsed.hasimages,
sigparsed.signatureparsed, sigparsed.hasimages AS sighasimages,
sigpic.userid AS sigpic, sigpic.dateline AS sigpicdateline, sigpic.width AS sigpicwidth, sigpic.height AS sigpicheight,

IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid

, lt_userban.userid AS lt_ban_id
FROM post AS post
LEFT JOIN user AS user ON(user.userid = post.userid)
LEFT JOIN userfield AS userfield ON(userfield.userid = user.userid)
LEFT JOIN usertextfield AS usertextfield ON(usertextfield.userid = user.userid)
LEFT JOIN icon AS icon ON(icon.iconid = post.iconid)
LEFT JOIN avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN customavatar AS customavatar ON(customavatar.userid = user.userid)


LEFT JOIN editlog AS editlog ON(editlog.postid = post.postid)
LEFT JOIN postparsed AS postparsed ON(postparsed.postid = post.postid AND postparsed.styleid = 3 AND postparsed.languageid = 1)
LEFT JOIN sigparsed AS sigparsed ON(sigparsed.userid = user.userid AND sigparsed.styleid = 3 AND sigparsed.languageid = 1)
LEFT JOIN sigpic AS sigpic ON(sigpic.userid = post.userid)

LEFT JOIN userban AS lt_userban ON ( lt_userban.userid = post.userid )
WHERE post.postid IN (1312708,1315013,1316647,1317613,1317778,1319370,1 320438,1320483,1323953,1325486,1326748,1326766,132 7288,1330991,1335287,1335964,1336122,1336131,13361 45,1336482,1336526,1336957,1337061,1337303,1337893 ,1339027,1339483,1340754,1340832,1341819,1342339,1 356457,1356473,1356505,1356621,1358098,1358567,135 8909,1359817,1360056);

MySQL Error : Column 'displaygroupid' in field list is ambiguous
Error Number : 1052
Request Date : Wednesday, November 14th 2012 @ 03:55:22 AM
Error Date : Wednesday, November 14th 2012 @ 03:55:23 AM
Script : http://xxx.xxx.com/threads/109622-Lot-s-Rep-Thread?p=1337303&mode=threaded
Referrer :
Username : Unregistered
Classname : vB_Database
MySQL Version :

Leftenant
11-14-2012, 01:52 PM
Installed, though currently disabled.

By Visiting a "&mode=threaded" URL, this pops up:

Temporary Workaround:
Goto AdminCp->plugin management->Lt - Ban Info - SQ
Replace All to:

$cid = htmlspecialchars($_GET["mode"]);
if($cid != 'threaded' AND $cid != 'hybrid')
{
$hook_query_fields .= ", lt_userban.userid AS lt_ban_id";
$hook_query_joins .= " LEFT JOIN " . TABLE_PREFIX . "userban AS lt_userban ON ( lt_userban.userid = post.userid ) ";
}


Note: Hack only work on normal mode.

Alan_SP
11-15-2012, 12:36 AM
Excellent, problem with queries is fixed, so I started using your mod.

But, there's still bug with postbit.

Just tested it, showing info in pop-up is "stuck", no matter what option I choose, I see information about banning there, even if I choose that there's no info in postbit.

And, to repeat my feature request, could you disable showing info for permanently banned users? As an option, of course, not for all, some of us would like to show that information.

Excellent mod and quick and good support. :up: Giving 5 stars and nominating it for mod of the month.

Leftenant
11-16-2012, 10:24 AM
Thanks Alan_Sp.
This product upgrdaded to 1.1.3 version.

megabink
11-16-2012, 04:30 PM
Installed and working on my 4.2.0 pl2.
Thanks buddy.

Alan_SP
11-17-2012, 01:22 AM
This product upgrdaded to 1.1.3 version.

Just to report.

Not showing information for permanently banned users works as it should. :up:

Information in postbit pop-up is still stuck, no matter what I select, there it is (I consider it small bug, but want to inform you about it).

Also, you changed product id (from Turkish to English), which resulted in having older version and newer after I tried to upgrade. When I found this out, I uninstalled both versions and installed only new one. Everything works, phrases wasn't lost (if anyone needs translation to Croatian of front end, ask).

Small suggestion, for next version, you have at settings for permanently banned users text:
Only Show As Profile (and Postbit)
As should be in.

Also phrase: Appearance At Permanent Ban User would better sound as Appearance for Permanently Banned Users.

These are just minor corrections, but just to mention them.

Excellent mod. :up:

Jigglez
11-17-2012, 01:20 PM
The mod seems great! I think I'm going to try it on my website. I'll let you know how it pans out on 4.2.0 pl3.

acast
12-23-2012, 09:30 PM
Temporary Workaround:
Goto AdminCp->plugin management->Lt - Ban Info - SQ
Replace All to:

$cid = htmlspecialchars($_GET["mode"]);
if($cid != 'threaded' AND $cid != 'hybrid')
{
$hook_query_fields .= ", lt_userban.userid AS lt_ban_id";
$hook_query_joins .= " LEFT JOIN " . TABLE_PREFIX . "userban AS lt_userban ON ( lt_userban.userid = post.userid ) ";
}


Note: Hack only work on normal mode.

It doesn't work. Still the same error:

I disable the plugin, too.

Rhodium
07-03-2016, 08:58 AM
The plugin works fine but i get db errors

Database error in vBulletin 4.2.3:

Invalid SQL:

SELECT
post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted,
user.*, userfield.*, usertextfield.*,
icon.title as icontitle, icon.iconpath,
avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,


editlog.userid AS edit_userid, editlog.username AS edit_username, editlog.dateline AS edit_dateline,
editlog.reason AS edit_reason, editlog.hashistory,
postparsed.pagetext_html, postparsed.hasimages,
sigparsed.signatureparsed, sigparsed.hasimages AS sighasimages,
sigpic.userid AS sigpic, sigpic.dateline AS sigpicdateline, sigpic.width AS sigpicwidth, sigpic.height AS sigpicheight,

IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid

, lt_userban.userid AS lt_ban_id, IF(lt_userban.liftdate > 0, lt_userban.userid, NULL) as lt_ban_lift
FROM post AS post
LEFT JOIN user AS user ON(user.userid = post.userid)
LEFT JOIN userfield AS userfield ON(userfield.userid = user.userid)
LEFT JOIN usertextfield AS usertextfield ON(usertextfield.userid = user.userid)
LEFT JOIN icon AS icon ON(icon.iconid = post.iconid)
LEFT JOIN avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN customavatar AS customavatar ON(customavatar.userid = user.userid)


LEFT JOIN editlog AS editlog ON(editlog.postid = post.postid)
LEFT JOIN postparsed AS postparsed ON(postparsed.postid = post.postid AND postparsed.styleid = 10 AND postparsed.languageid = 3)
LEFT JOIN sigparsed AS sigparsed ON(sigparsed.userid = user.userid AND sigparsed.styleid = 10 AND sigparsed.languageid = 3)
LEFT JOIN sigpic AS sigpic ON(sigpic.userid = post.userid)

LEFT JOIN userban AS lt_userban ON ( lt_userban.userid = post.userid )
WHERE post.postid IN (4498063,4498064,4498068,4498088,4498288,4498324,4 498107,4499481,4499804,4499819,4499830,4500038,450 0045,4500050,4500056,4500227,4500243,4500500,45011 70,4500971,4500084);

MySQL Error : Column 'displaygroupid' in field list is ambiguous
Error Number : 1052
Request Date : Sunday, July 3rd 2016 @ 02:01:18 AM
Error Date : Sunday, July 3rd 2016 @ 02:01:18 AM
Script : http://xxx.xxx.com/forums/forums/threads/66397-Hilo-oficial-de-fotografia
Referrer : http://xxx.xxx.com/forums/forums/200-Menorca
IP Address : xxxxxxxxxxxxxxxxxxxxxxxxxxx
Username : No registrado
Classname : vB_Database_MySQLi
MySQL Version :

Any one knows how to fix?

Elixar
11-13-2016, 01:53 AM
I had DB errors but it now works. The following changes were made to the plugin called Lt - Ban Bilgileri - GS:

$lt_ban_gruplar = explode(',',$vbulletin->options['lt_ban_gorebilecek_gruplar']);
if (($vbulletin->options['lt_ban_etkin']) AND (is_member_of($vbulletin->userinfo,$lt_ban_gruplar)))
{
$lt_sql_sorgu = $vbulletin->db->query_first("
SELECT usergrp.usergroupid, usergrp.adminpermissions AS adminperforgroup, admins.adminpermissions
FROM " . TABLE_PREFIX . "user AS user
LEFT JOIN " . TABLE_PREFIX . "usergroup usergrp ON(user.usergroupid = usergrp.usergroupid)
LEFT JOIN " . TABLE_PREFIX . "administrator admins ON (user.userid = admins.userid)
WHERE user.userid = '".$vbulletin->userinfo['userid']."'
");
if(($lt_sql_sorgu['adminperforgroup'] & 1) == 1)
{
$lt_allow_per = 1;
}

if($lt_allow_per != 1)
{
if(($lt_sql_sorgu['adminpermissions'] & 256) == 256)
{
$lt_allow_per = 1;

}
if($lt_allow_per != 1)
{
if (in_array($vbulletin->userinfo['userid'], preg_split('#\s*,\s*#s', $vbulletin->
config['SpecialUsers']['superadministrators'], -1, PREG_SPLIT_NO_EMPTY)) )
{
$lt_allow_per = 1;
}
}
}



if ((THIS_SCRIPT == 'misc') && ($_REQUEST['do'] == 'lt_ban_bilgileri' || $_REQUEST['do'] == 'lt_lift_ban'))
{
$vbulletin->input->clean_gpc('r', 'userid', TYPE_UINT);

if ($vbulletin->GPC['userid'] AND $post = verify_id('user', $vbulletin->GPC['userid'], 0, 1))
{

}
}


}

Thanks to MarkFL for his help on this. :)

Alan_SP
11-22-2016, 11:37 AM
Can you post fixed version of mod here as attachment? It would make things easier for the rest of us.