[ Video Sharing CMS v4 ] Daily upload limit per user /How to limit daily uploads in PHPVibe

Started by ASDF,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ASDFTopic starter

  •  

Marius P.

Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

ASDFTopic starter

  •  

Marius P.

Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

Marius P.

I've even clearly explained you how to put the querys in PHPVibe

Quote from: @Mario on

Now that you know the logic query here is how it goes in PHPVibe:

$uservids = $db->get_row("Select count(*) as nr from ".DB_PREFIX."videos WHERE `user_id` = '".user_id()."' AND DATE( DATE ) = DATE( NOW( ) ) AND media = '1' ");


Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

ASDFTopic starter

  •  

Marius P.

Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

ASDFTopic starter

Bro.... i am tired too.... :-\ :-\ :-\....thinking to shut this topic......
line 143.... ...from 'vibe_videos' line.
  •  

ASDFTopic starter

From line 142....i have copied and pasted the codes as you have told....
I believe this will simplify the things....you can now see and tell me what's wrong......or the whole thing id fked up?
  •  

Marius P.

OMG! You are still pasting raw sql in the file even if I've given you it with the php wrapper!
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

ASDFTopic starter

 :eek: :eek: :eek:...  :-[..
Bro, i have told you that i don' code and knows nothing.
  •  

Marius P.

Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

ASDFTopic starter

Hey Mario.....honestly, you have helped me a lot, no complaints, from you and community.
Sorry from my side....m not a coder, but still requesting you,if possible for you to just give me the code i should copy and paste, also, if you think it's impossible or you can't do it anymore, you can remove the topic.... :).
  •  

Marius P.


For images

$uservids = $db->get_row("Select count(*) as nr from ".DB_PREFIX."videos WHERE `user_id` = '".user_id()."' AND DATE( DATE ) = DATE( NOW( ) ) AND media = '3' ");

if(($uservids->nr > 4) && !is_moderator()){
if((get_option('uploadrule') == 1) ||  is_moderator()) {   
add_filter( 'the_defaults', 'modify_content' );
} else {
add_filter( 'the_defaults', _lang("Uploading is disabled") );
}

} else {
add_filter( 'the_defaults', _lang("You have passed your daily limit of X images") );
}



For videos


$uservids = $db->get_row("Select count(*) as nr from ".DB_PREFIX."videos WHERE `user_id` = '".user_id()."' AND DATE( DATE ) = DATE( NOW( ) ) AND media = '1' ");
if(($uservids->nr > 4) && !is_moderator()){if((get_option('uploadrule') == 1) ||  is_moderator()) {   add_filter( 'the_defaults', 'modify_content' );} else {add_filter( 'the_defaults', _lang("Uploading is disabled") );}} else {add_filter( 'the_defaults', _lang("You have passed your daily limit of X videos") );}


I'm surprised you could not understand a simple to very simple thing.
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

ASDFTopic starter

Getting these errors after adding the code....
One pic contains the error....and the second one,shows the actual place where error is, line 142.
  •  

ASDFTopic starter

  •  

Marius P.

Hmm, I don't have that, but, here is a solution.

Change:

add_filter( 'the_defaults', _lang("You have passed your daily limit of X videos/images/music bla bla") );



to
function limr() {
return _lang("You have passed your daily limit of X videos/images/music bla bla") ;
}
add_filter( 'the_defaults','limr' );
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

ASDFTopic starter

Hey Mario, not errors but this is what i am getting when trying to upload, in the pic.
If this is because i haven't created the cron job....then what will be the command/path......as i have seen on youtube and examples......will it be......public_html/com_com.images.php, :p :-\ :-\.
Also, am i supposed to enter the timing of ...once a day...
  •  

ASDFTopic starter

  •  

Marius P.

What cron job man?  ;D  There is no cron job in PHPVibe except for the youtube importer's one!  ::)
Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

Marius P.

Show me all the code you have placed there (only the new/changed code).

Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

ASDFTopic starter

 :o....But i read a conversation/topic by ollipoust (a user) and Alexander on the same topic, and alexander did advised about him for some cron stuff.ok, leave it, Alexander isn't here :p.
  •  

Marius P.

Happy with my help? Buy me a coffee.
Please, always use the search before opening a new topic! We're all here on our (limited) free time! Make sure you help yourself too!
  •  

ASDFTopic starter

Quote$uservids = $db->get_row("Select count(*) as nr from ".DB_PREFIX."videos WHERE `user_id` = '".user_id()."' AND DATE( DATE ) = DATE( NOW( ) ) AND media = '3' ");

if(($uservids->nr > 4) && !is_moderator()){
if((get_option('uploadrule') == 1) ||  is_moderator()) {   
add_filter( 'the_defaults', 'modify_content' );
} else {
add_filter( 'the_defaults', _lang("Uploading is disabled") );
}

} else {
function limr() {
return _lang("You have reached the daily upload limits, no more uploads for today.") ;
}
add_filter( 'the_defaults','limr' );
}
  •  

ASDFTopic starter

$uservids = $db->get_row("Select count(*) as nr from ".DB_PREFIX."videos WHERE `user_id` = '".user_id()."' AND DATE( DATE ) = DATE( NOW( ) ) AND media = '3' ");

if(($uservids->nr > 4) && !is_moderator()){
if((get_option('uploadrule') == 1) ||  is_moderator()) {   
add_filter( 'the_defaults', 'modify_content' );
} else {
add_filter( 'the_defaults', _lang("Uploading is disabled") );
}

} else {
function limr() {
return _lang("You have reached the daily upload limits, no more uploads for today.") ;
} 
add_filter( 'the_defaults','limr' );
}
  •  

Similar topics (7)