MyBB Codes
[Release 1.4.x] View Thread Readers 1.0 - Printable Version

+- MyBB Codes (http://www.mybbcodes.com)
+-- Forum: Mods Database (/forumdisplay.php?fid=4)
+--- Forum: Premium Mods (/forumdisplay.php?fid=8)
+---- Forum: MODS DATABASE (/forumdisplay.php?fid=23)
+---- Thread: [Release 1.4.x] View Thread Readers 1.0 (/showthread.php?tid=577)


[Release 1.4.x] View Thread Readers 1.0 - exdiogene - 11-27-2009 11:57 AM

//----------------
//PLUGIN OVERVIEW:
//----------------

Name: View Thread Readers
Author: exdiogene
Description: This plugin will allow you to View All Members who previously read a thread at the bottom of each thread.
Website: http://www.mybbcodes.com
Version: 1.2
Compatibility: 1.4.x,1.6.x,1.8.x,2.0.x
Files To Upload: One
Files To Edits: None
Author is Responsible For Any Damage: NO
Author Provide Support For This Product: YES
License: Inside the License Folder
Copyrights: All codes within the product are strongly copyrighted to Regentronique.


//-----------------------
//INSTALLATION PROCEDURE:
//-----------------------

1. Upload file in ./inc/plugins folder
2. Activate Plugin
3. Adjust settings to suit your needs


//----------
// DOWNLOAD:
//----------
[attachment=508]

Last upgrade V1.1 (Jan 17, 2010): [attachment=546]

Last upgrade V1.2 (Jan 21, 2010):
Added groups to be excluded from viewing Thread Readers. [attachment=555]

Last upgrade V1.3 (Apr 24, 2010):
Added editable text for viewing Thread Readers.[attachment=616]

Last upgrade V1.4 (Jun 6, 2011):
Changed header for better compatibility.[attachment=809]

//--------
//SUPPORT:
//--------

I can be reached at http://www.mybbcodes.com with username exdiogene

---
I hope that you will appreciate this plugin.
Thank You
exdiogene


RE: [Release 1.4.x] View Thread Readers 1.0 - atomjani - 04-23-2010 07:47 AM

Where can I edit the text? I using other languages.


RE: [Release 1.4.x] View Thread Readers 1.0 - exdiogene - 04-23-2010 11:02 AM

(04-23-2010 07:47 AM)atomjani Wrote:  Where can I edit the text? I using other languages.

I will add the formated displayed text, that could be edited, in the AdminCP settings.

This will be fixed today!

Smile


RE: [Release 1.4.x] View Thread Readers 1.0 - atomjani - 04-23-2010 10:00 PM

Thank you. And i not want 70 days interval or edit this value.Smile


RE: [Release 1.4.x] View Thread Readers 1.0 - exdiogene - 04-23-2010 11:20 PM

(04-23-2010 10:00 PM)atomjani Wrote:  Thank you. And i not want 70 days interval or edit this value.Smile

The maximum retension delay is editable in your AdminCP... Wink


RE: [Release 1.4.x] View Thread Readers 1.0 - exdiogene - 04-24-2010 12:12 AM

Version 1.3 is now available for download.

You will find in the readme file how to change the retension days delay...

Enjoy!


RE: [Release 1.4.x] View Thread Readers 1.0 - atomjani - 04-24-2010 02:41 AM

(04-23-2010 11:20 PM)exdiogene Wrote:  
(04-23-2010 10:00 PM)atomjani Wrote:  Thank you. And i not want 70 days interval or edit this value.Smile

The maximum retension delay is editable in your AdminCP... Wink

(04-24-2010 12:12 AM)exdiogene Wrote:  Version 1.3 is now available for download.

You will find in the readme file how to change the retension days delay...

Enjoy!
Thank you.Smile
And I have last problem. There are "(deleted)" users. Can you hide this user?
I uploaded screenshote:
[attachment=617]


RE: [Release 1.4.x] View Thread Readers 1.0 - exdiogene - 04-24-2010 10:34 AM

Deleted users are a problem here, because they have view the thread and should increase the view count. But if your usernames list do not have the same amount of view, then some people will see that something is wrong.

This is why i decided to make a "(deleted)" name to fill the gap when no name is available for the user who viewed the thread.

Logically if i take out the "(deleted)" name, i should also reduce the view count to be coherent.

What would you consider to be the most appropriate action for all users installing this plugin :

1- The possibility to excluded viewers not having a name and write nothing without counting them.

2- Have the possibility to edit what would be showed when no name is available, then it could be an empty string instead of "(deleted)" if you want.


RE: [Release 1.4.x] View Thread Readers 1.0 - atomjani - 04-26-2010 07:43 AM

One string count deleted user.
Example there is 5 user and 6 deleted user. The number is 11.
The default text is :"11 member(s) viewed this thread in the last 149 days : ".
We don't want see deleted user, so will use mathematic: 11-6=5.
So the text: "5 member(s) viewed this thread in the last 149 days :".
So hide the 6 deleted user.
Or you write cycle, what don't count deleted user and don't write to list.
If this is problem, then excluded the "deleted user" from list. A lot of "deleted user" is show badly in list.


RE: [Release 1.4.x] View Thread Readers 1.0 - exdiogene - 04-26-2010 11:04 AM

Then i would add a new setting "Enable Display of Deleted users" that could be toggled ON or OFF and also provide the possibility to edit the text for "(deleted)". This seem to be the more logical way.

I will do this in the next two days...

Wink


RE: [Release 1.4.x] View Thread Readers 1.0 - atomjani - 04-26-2010 11:13 AM

Thank you.Smile I think it makes people nervous.
And one last request.: D
I like, that every member see, that how many members view this threads. But only some groups see that who view the thread.
I created screenshote.
Example the registered group see the next:[attachment=618]
When he have permission(example VIP members):
[attachment=619]

I want, that only VIP members(VIP group) can see the member. I editing to next text: "Only VIP members can see that who viewed this thread. You can subcribed here: link."
I think that "19 member(s) viewed this thread in the last 149 days : " of the attractiveness of this feature and the member will be subcribe to VIP group.
My forum is Community forum, where are interest threads, we can make friends etc.


RE: [Release 1.4.x] View Thread Readers 1.0 - exdiogene - 04-26-2010 11:37 AM

Ok, i can see the logic behind your request, this way you could get more subscription by people wanting to see who read the thread... Wink

Ok i will add a 2 new settings for the users in excluded groups :

1- Text displayed instead of the Usernames.
2- Enable/disable the display of the main bar just showing the count in days.

This should be completed this week...


RE: [Release 1.4.x] View Thread Readers 1.0 - atomjani - 04-26-2010 11:46 AM

Thank you and good working.Smile


RE: [Release 1.4.x] View Thread Readers 1.0 - atomjani - 04-27-2010 12:50 AM

And I can edit or add this text, because my forum languages is hungary. I haven't more problem.Smile


RE: [Release 1.4.x] View Thread Readers 1.0 - Technoman - 07-05-2010 04:51 AM

Sorry but im getting a weird error in the plugins section in ACP ?

Please make sure IN_MYBB is defined."); } global $mybb, $lang; $plugins->add_hook("showthread_threaded", "Regentronique_ViewThreadReaders_Show"); $plugins->add_hook("showthread_linear", "Regentronique_ViewThreadReaders_Show"); function Regentronique_ViewThreadReaders_info() { /** * Array of information about the plugin. * name: The name of the plugin * description: Description of what the plugin does * website: The website the plugin is maintained at (Optional) * author: The name of the author of the plugin * authorsite: The URL to the website of the author (Optional) * version: The version number of the plugin * guid: Unique ID issued by the MyBB Mods site for version checking * compatibility: A CSV list of MyBB versions supported. Ex, "121,123", "12*". Wildcards supported. */ return array( "name" => "Regentronique View Thread Readers!", "description" => "This plugin will allow you to View Thread Readers at the bottom of each thread.", "website" => "http://MyBBCodes.com", "author" => "Exdiogene", "authorsite" => "http://Regentronique.com", "version" => "1.3", 'guid' => '', "compatibility" => "*" ); } function Regentronique_ViewThreadReaders_install(){ global $db; $regentronique_group = array( 'gid' => 'NULL', 'name' => 'Regentronique_ViewThreadReaders', 'title' => 'Regentronique ViewThreadReaders Settings', 'description' => 'Settings for the Regentronique ViewThreadReaders plugin', 'disporder' => '1', 'isdefault' => 'no', ); $db->insert_query('settinggroups', $regentronique_group); $gid = $db->insert_id(); $regentronique_setting = array( 'sid' => 'NULL', 'name' => 'Regentronique_ViewThreadReaders_Text', 'title' => 'View Thread Readers Text', 'description' => 'Text used for the View Thread Readers bar.(You can include {MemberNumber} and {DayNumber})', 'optionscode' => 'text', 'value' => '{MemberNumber} members viewed this thread in the last {DayNumber} days :', 'disporder' => 1, 'gid' => intval($gid), ); $db->insert_query('settings', $regentronique_setting); $regentronique_setting = array( 'sid' => 'NULL', 'name' => 'Regentronique_ViewThreadReaders_TextColor', 'title' => 'View Thread Readers Text Color', 'description' => 'Text Color used for the View Thread Readers bar.', 'optionscode' => 'text', 'value' => '#906000', 'disporder' => 2, 'gid' => intval($gid), ); $db->insert_query('settings', $regentronique_setting); $regentronique_setting = array( 'sid' => 'NULL', 'name' => 'Regentronique_ViewThreadReaders_EnableGroupStyle', 'title' => 'Enable Group Style Display for users', 'description' => 'If this is enabled, then the users name will be formated with its group style.', 'optionscode' => 'yesno', 'value' => '1', 'disporder' => 3, 'gid' => intval($gid), ); $db->insert_query('settings', $regentronique_setting); $regentronique_setting = array( 'sid' => 'NULL', 'name' => 'Regentronique_ViewThreadReaders_EnableBanned', 'title' => 'Enable Display of Banned users', 'description' => 'If this is enabled, then the banned users will be displayed.', 'optionscode' => 'yesno', 'value' => '1', 'disporder' => 4, 'gid' => intval($gid), ); $db->insert_query('settings', $regentronique_setting); $regentronique_setting = array( 'sid' => 'NULL', 'name' => 'Regentronique_ViewThreadReaders_UserCount', 'title' => 'Number of User in the ViewThreadReaders', 'description' => 'The maximum number of users that will be displayed.', 'optionscode' => 'text', 'value' => '50', 'disporder' => 5, 'gid' => intval($gid), ); $db->insert_query('settings', $regentronique_setting); $regentronique_setting = array( 'sid' => 'NULL', 'name' => 'Regentronique_ViewThreadReaders_ExcludedGroups', 'title' => 'Groups excluded from viewing ViewThreadReaders', 'description' => 'The users groups, separated by commas, excluded from having ViewThreadReaders displayed.(Leave blank for all to see.)', 'optionscode' => 'text', 'value' => '0,1,2,5,7', 'disporder' => 6, 'gid' => intval($gid), ); $db->insert_query('settings', $regentronique_setting); rebuildsettings(); } function Regentronique_ViewThreadReaders_is_installed() { global $db, $mybb; $query = $db->simple_select("settinggroups", "name", "name='Regentronique_ViewThreadReaders'"); $num = $db->num_rows($query); if($num != "0"){ return true; }else{ return false; } } function Regentronique_ViewThreadReaders_uninstall() { global $mybb, $db; $db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='Regentronique_ViewThreadReaders'"); $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN( 'Regentronique_ViewThreadReaders_TextColor', 'Regentronique_ViewThreadReaders_EnableBanned', 'Regentronique_ViewThreadReaders_EnableGroupStyle', 'Regentronique_ViewThreadReaders_UserCount', 'Regentronique_ViewThreadReaders_ExcludedGroups' )"); } function Regentronique_ViewThreadReaders_Show(){ global $mybb, $db, $tid, $posts, $showthread, $thread; if ( $mybb->settings['Regentronique_ViewThreadReaders_ExcludedGroups'] ){ $ExcludedGroups = explode(',', $mybb->settings['Regentronique_ViewThreadReaders_ExcludedGroups']); }else{ $ExcludedGroups = Array(); } if (!in_array($mybb->user['usergroup'], $ExcludedGroups)){ if ( $mybb->settings['Regentronique_ViewThreadReaders_EnableBanned'] != '1'){ $Banned = 'AND u.usergroup <> 7'; }else{ $Banned = ''; } $query1 = $db->query(" SELECT t.uid, t.dateline , u.username , u.usergroup FROM ".TABLE_PREFIX."threadsread t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid) WHERE t.tid='$tid' $Banned ORDER BY dateline DESC "); $rows = $db->num_rows($query1); $MyList = ''; $x = 0; if ($rows < $mybb->settings['Regentronique_ViewThreadReaders_UserCount']){ $xMax = $rows; }else{ $xMax = $mybb->settings['Regentronique_ViewThreadReaders_UserCount']; } while (($TUser = $db->fetch_array($query1)) && ($x < $mybb->settings['Regentronique_ViewThreadReaders_UserCount'])){ if ($mybb->settings['Regentronique_ViewThreadReaders_EnableGroupStyle'] != '0'){ $UserText = format_name($TUser['username'],$TUser['usergroup']); }else{ $UserText = $TUser['username']; } if (!$UserText){ $UserText = '(deleted)'; } /* if ( $mybb->settings['Regentronique_ViewThreadReaders_EnableBanned'] != '1'){ if ($TUser['usergroup'] == '7'){ if ($rows < $mybb->settings['Regentronique_ViewThreadReaders_UserCount']){ $xMax = $xMax - 1; } continue; } } */ $x++; if (($rows > 1) && ($x < $xMax)){ $MyList = ', '.$UserText.'' . $MyList; }else{ $MyList = ''.$UserText.'' . $MyList; } } if (substr($MyList,0,2) == ', '){ $MyList = substr($MyList,2); } $Days = Floor((time() - $thread['dateline']) / 86400); if ($Days > $mybb->settings['threadreadcut']){ $Days = $mybb->settings['threadreadcut']; } $text = str_replace(array('{MemberNumber}','{DayNumber}'),array($rows,$Days),$mybb->settings['Regentronique_ViewThreadReaders_Text']); $posts .= '
'.$text.'
'.$MyList.'
'; } } ?>



RE: [Release 1.4.x] View Thread Readers 1.0 - exdiogene - 07-05-2010 10:48 AM

@Technoman :

Which version of MyBB do you use?

Can you show me a printscreen of the ACP with the error?

It could be because of another plugin interference...


RE: [Release 1.4.x] View Thread Readers 1.0 - Technoman - 07-05-2010 01:34 PM

Picture 1: this is what it looks like in plugins section (errors)
Picture 2: MyBB version
(all my pictures are uploaded threw imageshack)

[Image: pluginsinacp.jpg]

[Image: mybbversion.jpg]


RE: [Release 1.4.x] View Thread Readers 1.0 - exdiogene - 07-05-2010 04:09 PM

First i have to tell you that you have quite a lot of active plugins there... UHH

I would recommend to try reinstalling the plugin again, because there seem to have been some corruption of the file there...


RE: [Release 1.4.x] View Thread Readers 1.0 - Technoman - 07-05-2010 04:36 PM

theres 4 versions so maybe its the wrong one im downloading?

Which 1 of the 4 should i be downloading?


RE: [Release 1.4.x] View Thread Readers 1.0 - exdiogene - 07-05-2010 04:49 PM

The more recent one V1.3


RE: [Release 1.4.x] View Thread Readers 1.0 - Technoman - 07-05-2010 06:04 PM

Thanks and yes v1.3 is what I been downloading and it still gives this error


RE: [Release 1.4.x] View Thread Readers 1.0 - exdiogene - 07-05-2010 07:04 PM

Try to replace your plugin file with the one inside this ZIP file to see if the problem is the one i suspect :

http://regentronique.com/fichiers/Regentronique_ViewThreadReaders_new.zip


RE: [Release 1.4.x] View Thread Readers 1.0 - Technoman - 07-05-2010 07:17 PM

(07-05-2010 07:04 PM)exdiogene Wrote:  Try to replace your plugin file with the one inside this ZIP file to see if the problem is the one i suspect :

http://regentronique.com/fichiers/Regentronique_ViewThreadReaders_new.zip

The error is gone now, and Yes it now works!


RE: [Release 1.4.x] View Thread Readers 1.0 - exdiogene - 07-05-2010 07:22 PM

The main reason seem to be that your PHP option for short shebang is disabled. So you must have
PHP Code:[Highlight]
<?php 
instead of
PHP Code:[Highlight]
<? 
This can be enabled on your server to alleviate futur problems...

Wink


RE: [Release 1.4.x] View Thread Readers 1.0 - Technoman - 08-16-2015 10:49 PM

(07-05-2010 07:04 PM)exdiogene Wrote:  Try to replace your plugin file with the one inside this ZIP file to see if the problem is the one i suspect :

http://regentronique.com/fichiers/Regentronique_ViewThreadReaders_new.zip

2 things

The zip folder that im quoting you with i think anyone can download (just letting you know) UHH

Also is there anyway in being able to move this viewed users box??


RE: [Release 1.4.x] View Thread Readers 1.0 - exdiogene - 08-17-2015 02:36 PM

The file have been removed, thank you for telling me...

Actually, the information is displayed after the POSTS. If you want it elsewere, it would need the modification of a template and also a plugin modification.


RE: [Release 1.4.x] View Thread Readers 1.0 - Technoman - 08-17-2015 05:11 PM

(08-17-2015 02:36 PM)exdiogene Wrote:  The file have been removed, thank you for telling me...

Wink

(08-17-2015 02:36 PM)exdiogene Wrote:  Actually, the information is displayed after the POSTS. If you want it elsewere, it would need the modification of a template and also a plugin modification.

oh ok, thank you