Related Topics


[Video CMS v4]Daily upload limit per user /How to limit daily uploads in PHPVibe  (Read 2546 times) Print

1 2 3  All B


ASDF  September 23, 2014, 08:52:27 PM

sorry sent you the wrong pic..... :( :( :p.

Logged


@Mario  September 23, 2014, 08:52:35 PM

And line 142 is...?

Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!


ASDF  September 23, 2014, 08:57:30 PM

In the previous message, in picture.

Logged


@Mario  September 23, 2014, 09:00:21 PM

You must be kidding me!

Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!


@Mario  September 23, 2014, 09:01:27 PM

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


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

Code
$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' ");


Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!


ASDF  September 23, 2014, 09:23:16 PM

Getting this error on line 143...in pic.
 :-\ :-[ :-[.....

Logged


@Mario  September 23, 2014, 09:27:48 PM

What is on line 143?
You really wanna do this till tomorrow?

Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!


ASDF  September 23, 2014, 09:35:26 PM

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

Logged


ASDF  September 23, 2014, 09:43:43 PM

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?

Logged


@Mario  September 23, 2014, 10:07:11 PM

OMG! You are still pasting raw sql in the file even if I've given you it with the php wrapper!

Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!


ASDF  September 24, 2014, 05:09:00 AM

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

Logged


@Mario  September 24, 2014, 12:36:02 PM

Read reply #29

Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!


ASDF  September 24, 2014, 09:28:58 PM

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.... :).

Logged


@Mario  September 24, 2014, 09:56:59 PM


For images

Code
$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


Code
$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.

Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!


ASDF  September 25, 2014, 06:43:40 AM

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.

Logged


ASDF  September 25, 2014, 06:45:04 AM

type of error...

Logged


@Mario  September 25, 2014, 09:23:12 PM

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

Change:

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


to
Code
function limr() {
return _lang("You have passed your daily limit of X videos/images/music bla bla") ;
}
add_filter( 'the_defaults','limr' );

Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!


ASDF  September 26, 2014, 01:14:37 PM

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

Logged


ASDF  September 26, 2014, 01:21:42 PM

Picture

Logged


@Mario  September 26, 2014, 01:23:58 PM

What cron job man?  ;D  There is no cron job in PHPVibe except for the youtube importer's one!  ::)

Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!


@Mario  September 26, 2014, 01:24:59 PM

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


Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!


ASDF  September 26, 2014, 01:31:54 PM

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

Logged


@Mario  September 26, 2014, 01:34:13 PM

Paste the code so I can test it. Not picture it.

Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!


ASDF  September 26, 2014, 01:36:31 PM

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' );
}

Logged


ASDF  September 26, 2014, 01:37:38 PM

Code
$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' );
}

Logged