1. Limiting Usergroup views per day

Limiting Usergroup views per day

  |   16
There are cases where you like to limit certain user groups to view full story articles only a limited amount of times each day.
The inspiration came from a request in the forum!
Here a little tutorial on how something like that could be implemented!
But before you start!
1. BACKUP any files BEFORE you modify them!
2. This is just a quick solution! it is not FULLY tested as i just had 10 min free time to write this tut and do the hack!
3. I quickly tested it on dle 10.1
4 don't ask me for any older versions i don't have them and not even want to look at them
5. You find bug and suggestions. feel free to comment I'm sure well find a solution together!
6. Last but not least, do not resell this solution as it's freeeeeeeee 4 allll

Installation
3 files have to be modded
- engine/modules/show.full.php
- engine/inc/usergroup.php
- language/English/adminpanel.lng (or whatever language you use)

Information!You must register before you can view this text. Please register or Login


Now you can go to manage usergroups
click on the article tab and at the bottom you see your new options
one is to enable the limit and the other is to set the amount of views for full story that the group has x day.
that's it!
ENJOY
Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.

Details

-1

Comments 16

phuongdzu
phuongdzu
Members
Commented By phuongdzu on February 21, 2014 (12:29 pm)
Thank you, It works but
System Message says:
System Message
Members Sorry, you are not authorized to access to this page.

I know I can edit this message in website.lng ("news_err_28')
But this message is warning for other case (ex: only specific group such as Admin/Mod can view).

How to show other message when member was limited like this:
System Message
Members Sorry, you can show only XXX articles/day. To view more you must upgrade to VIP.


Or better than if only show shortnews and below shortnews show:
System Message
Members Sorry, you can show only XXX articles/day. To view more you must upgrade to VIP.


Thanks
N/A 13Forum topics : 6Forum replies : 29Forum likes : 1
phuongdzu
phuongdzu
Members
Commented By phuongdzu on February 23, 2014 (10:22 am)
In this:
	// construct your error message below:
	// below an example
	if( $limit_user_view ) msgbox( $lang['all_err_1'], "<b>{$user_group[$member_id['user_group']]['group_name'
; ; ; ;]} is limited to {$user_group[$member_id['user_group']]['max_view_day']} articles views each day</b> " . $lang['news_err_28'] ); // elseif( !$news_found AND !$perm ) msgbox( $lang['all_err_1'], "<b>{$user_group[$member_id['user_group']]['group_name'
; ; ; ;]}</b> " . $lang['news_err_28'] );


It works if replace this:
if ( $limit_user_view )

with:
if ( $user_view_blocked )


Now when users get limited, it only shows:
Limited message


I like it shows:
Short_story
+
Limited message


Thanks
N/A 13Forum topics : 6Forum replies : 29Forum likes : 1
phuongdzu
phuongdzu
Members
Commented By phuongdzu on April 19, 2014 (7:38 pm)
Hello steven1
There is a problem: If I open single article and refresh X times, it will get limited
Please fix this
Thanks
N/A 13Forum topics : 6Forum replies : 29Forum likes : 1
steven1
steven1
Members
Commented By steven1 on April 21, 2014 (5:36 am)
that's not a problem as the article states is limit user views not limit unique user views!
To do that you need to add the article that he/she viewd and change the queries around a little
1 3Forum topics : 0Forum replies : 101Forum likes : 14

<?php
$possible = "it is";
?>
phuongdzu
phuongdzu
Members
Commented By phuongdzu on April 21, 2014 (9:02 pm)
@steven1:
Can you help me to edit, I am newbie and don't know how to do
N/A 13Forum topics : 6Forum replies : 29Forum likes : 1
jeanmic
jeanmic
Members
Commented By jeanmic on April 28, 2014 (3:26 pm)
Hey
Can u give codes for dle 9.2
Bcz in 9.2 i didnt find the lines i hv to replace with your codes in show.full.php

Any help
Thx
N/A 8Forum topics : 7Forum replies : 24Forum likes : 0
noobos
noobos
DLE TEAM
Commented By noobos on April 29, 2014 (8:43 am)
jeanmic
if( ! $perm ) break;

if( ! $news_found and ! $perm ) msgbox( $lang['all_err_1'], "<b>{$user_group[$member_id['user_group']]['group_nam
e']}</b> " . $lang['news_err_28'] );
16 302Forum topics : 12Forum replies : 1036Forum likes : 170
jeanmic
jeanmic
Members
Commented By jeanmic on May 2, 2014 (2:47 am)
hey
with usergroup.php on dle 9.2
what we have to edit?
thx
N/A 8Forum topics : 7Forum replies : 24Forum likes : 0
yorismith
yorismith
Moderators
Commented By yorismith on May 2, 2014 (4:25 am)
ask question one by is terrible...if you keep give up the first step you will never finished it dude
1) find: $max_mail_day = intval( $_REQUEST['max_mail_day'] );
2) same
3) same
4) find: $force_leech_no = "checked";
5) find: if( $user_group[$id]['admin_tagscloud'] ) $admin_tagscloud_yes = "checked"; else $admin_tagscloud_no = "checked";
6) same
32 288Forum topics : 2Forum replies : 699Forum likes : 117

- Nothing comes free...
- A generous heart, kind speech, and compassion are the things which renew humanity
jeanmic
jeanmic
Members
Commented By jeanmic on May 2, 2014 (1:37 pm)
after i made all the changes
and when i am updating the views >usergroup
i got mysql error

The Error returned was:
Unknown column 'allow_vote' in 'field list'

Error Number:
1054

UPDATE dle_usergroups SET group_name='User', allow_cats='all', allow_adds='0', cat_add='all', allow_admin='0', allow_addc='1', allow_editc='0', allow_delc='0', edit_allc='0', del_allc='0', moderation='0', allow_all_edit='0', allow_edit='0', allow_pm='1', max_pm='20', max_foto='100', allow_files='0', allow_hide='1', allow_short='1', time_limit='0', rid='4', allow_fixed='0', allow_feed='1', allow_search='1', allow_poll='1', allow_main='0', captcha='0', icon='{THEME}/images/icon_4.gif', allow_modc='0', allow_rating='1', allow_offline='0', allow_image_upload='1', allow_file_upload='0', allow_signature='1', allow_url='1', news_sec_code='1', allow_image='0', max_signature='500', max_info='1000', admin_addnews='0', admin_editnews='0', admin_comments='0', admin_categories='0', admin_editusers='0', admin_wordfilter='0', admin_xfields='0', admin_userfields='0', admin_static='0', admin_editvote='0', admin_newsletter='0', admin_blockip='0', admin_banners='0', admin_rss='0', admin_iptools='0', admin_rssinform='0', admin_googlemap='0', allow_html='1', group_prefix='', group_suffix='', allow_subscribe='1', allow_image_size='0', cat_allow_addnews='all', flood_news='0', max_day_news='0', force_leech='0', edit_limit='0', captcha_pm='1', max_pm_day='0', max_mail_day='0', admin_tagscloud='0', allow_vote='', admin_complaint='', news_question='', comments_question='', max_comment_day='', max_images='', max_files='', disable_news_captcha='', disable_comments_captcha='', pm_question='', captcha_feedback='', feedback_question='', files_type='', max_file_size='', files_max_speed='', allow_lostpassword='', spamfilter='',limit_views='0', max_view_day='5' WHERE id='4'

plz help thx

i cant anymore edit usergroup preferences
it gives me this error too...

what to do help
dle 9.2
N/A 8Forum topics : 7Forum replies : 24Forum likes : 0
noobos
noobos
DLE TEAM
Commented By noobos on May 2, 2014 (7:09 pm)
I think steven1 was right, what the heck are you doing with dle 9.2?
4 don't ask me for any older versions i don't have them and not even want to look at them

The answer is very simple...allow_vote doesn't existing in DLE 9.2 in usergroup manage, the setting was moved to usergroup manage in DLE 9.7 or 9.8, so there still have many options in the code above will not work with 9.2 because back in 9.2 everything was not moved to usergroup manager.

DLE 9.2 was released on January 3, 2011
Today is 10.2 May 2, 2014

Still living in old day...time to move on if you want some thing real new.

Here is for 9.2: http://codepaste.net/qv5ov6

Don't ask if it's not working because you asked to fix error...no clue if the hack will work or not...not my concern.
16 302Forum topics : 12Forum replies : 1036Forum likes : 170
jeanmic
jeanmic
Members
Commented By jeanmic on May 3, 2014 (4:25 pm)
K thx :) im just asking no more
N/A 8Forum topics : 7Forum replies : 24Forum likes : 0
remixata
remixata
Members
Commented By remixata on May 5, 2014 (10:16 am)
hey,
i hv the same version of jeanmic (9.2)
everything is working fine:
it give error, user can see x times above
but the news still showing

any help
N/A 1Forum topics : 0Forum replies : 0Forum likes : 0
steven1
steven1
Members
Commented By steven1 on May 8, 2014 (8:54 am)
ok. i have mentioned it before i mention it again!
this was quickly tested on 10.1 now latest dle is 10.2 witch is untested but i guess not much has changed just try it out.
for any older version there is and will be no support!
why you may be asking??
if i recall well 9.7 and below have some major security breaches!
major changes happened 9.7/9.8 above
Just like noobs mentioned earlier releases are old so upgrade!
(now you may say but i have a lot of modules installed)
as much as dle is a simple script it's kind of crappy as everything is manual but at the same time for who has some knowledge of php dle is nice because it doesn't consume much ram and easily hackable for various uses.
This sayed if you don't like it go for WordPress (fool proof)!
1 3Forum topics : 0Forum replies : 101Forum likes : 14

<?php
$possible = "it is";
?>
DLEStarter
DLEStarter
DLE TEAM
Commented By DLEStarter on May 8, 2014 (7:34 pm)
Quote: steven1
This sayed if you don't like it go for WordPress (fool proof)!

Well said thumbsup

Everything in 9.6 and older versions settings that used to be in any configurations regarding to user/usergroup/file uploads/downloads are moved to "usergroup manager" and major changes are {views} now you can set to "Disable/Show All Views/Show Unique Views", what 9.2 option you have? Enable/Disable? so don't waste time on making this to work with those old versions even no error but it will just ignore the hack like it doesn't exist or cause new headache...unless you use 9.8 to 10.2 this hack will work but 9.7 I would doubt it because this version is real junk just like 9.0 and 9.4...but it's just personal opinion so don't count on my opinion...still confirm waste of time to fix just like trying to fix Windows 98 or ME today..not worth it.
29 225Forum topics : 9Forum replies : 558Forum likes : 116
Kathryn
Kathryn
V.I.P.
Commented By Kathryn on August 24, 2014 (6:03 pm)
Hi... I would like to configure this for my site I am using 10.2. This will save me from hiding links which I do not like the way it looks... rather unfriendly. I was looking for something to limit the number of downloads but I guess I will have to approach someone to make that mod or teach me .. but I can use this in the meantime and I thank you

15 47Forum topics : 109Forum replies : 481Forum likes : 6
Information!Would you like to leave your comment? Please Login to your account to leave comments. Don't have an account? You can create a free account now.
DLEStarter Notice!Please note...Every hack and every module will get additional queries from your database and some hacks and some modules may result your server overload, so install only what you "need", remove any hacks and modules from your script when you don't need them, all hacks and modules appears in this website are not guaranteed by DLEStarter Team for your script security and compatibility, please read instruction carefully and use hacks and modules at your own risk...Thank you.