4images Forum & Community
4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: Bomba on February 20, 2003, 04:19:44 AM
-
is it possible to limit the upload limit by time
like only one image per day (24 hours) ?
-
no, it's not possible.
And I dont recall any mods for that.
-
:cry: ok
thanks for your quick answer
-
.
-
well, actualy there is a way to do so, without any modification of database.
since each uploaded photo has date when it was uploaded, it's possible make a script that will check last uploaded by that user picture and check the date.
but, this way only would work correctly when the category has "direct upload" permission. otherwise, uploaded date will be when admin validated it.
-
.
-
well, actualy there is a way to do so, without any modification of database.
but, this way only would work correctly when the category has "direct upload" permission. otherwise, uploaded date will be when admin validated it.
Hmmm!! It's indeed what I was looking for, in my Web all the categories have "direct upload" permission.
Can you explain how to make the script? I don't know PHP :(
Thanks
-
How please create the upload limit by one image per day (24 hours) ?
PLEASE :cry: :cry: :cry:
-
Try this (no guests support). In member.php find:
if ($action == "uploadform") {
if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
show_error_page($lang['no_permission']);
exit;
}
Insert below: if ($user_info['user_level'] > GUEST && $user_info['user_level'] != ADMIN)
{
$sql = "SELECT COUNT(image_id) AS num
FROM ".IMAGES_TABLE."
WHERE user_id = ".$user_info['user_id']." AND image_date > ".(time()-60*60*24);
if ($result = $site_db->query_firstrow($sql))
{
if ($result['num'] >= 1)
{
$lang['upload_limit_reached'] = "Sorry, your upload limit per 24 hours has been reached";
show_error_page($lang['upload_limit_reached']);
exit;
}
}
}
Also, it wont hurt if you also insert the same code below:if ($action == "uploadimage") {
if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
show_error_page($lang['no_permission']);
exit;
}
Done :)
Its not so hard to figure out what numbers must be changed if you want use different timing and number of allowed images per that time ;)
P.S. you can move$lang['upload_limit_reached'] = "Sorry, your upload limit per 24 hours has been reached";
into lang/<your language>/main.php
-
it's not functional (it is no go) :cry:
help me please!
-
Ok, now should defenetly work. Make sure you test it with a regular member, not admin.
-
Im tested as reg. member... :roll:
it's not functional
help me please !!!!!!
-
Im tested as reg. member... :roll:
it's not functional
help me please !!!!!!
I've tested on fresh v1.7 and v1.7.1 - works fine for me. You do something wrong then or possible some other mods interfernce.
-
Thank you V@no,
i have got installed MOD "small credit system" and there are some conflicts with this modifikation.
So I deleted "MOD CSS" a than :upload limit by time " works perfectly ;]
-
Hello Vano,
how can i limit the upload for example 10 Pics per Week?
I have many requests for this in my Gallery.
-
[qcode] WHERE user_id = ".$user_info['user_id']." AND image_date > ".(time()-60*60*24*7);
if ($result = $site_db->query_firstrow($sql))
{
if ($result['num'] > 10)[/qcode]
-
Vano, May i show to user, in the error message, how many time remain for cancel his limit?
-
thanks for your quick answer
-
Hello,
I picked up this old Thread because I searched for a solution limiting one upload per Day for example.
I copied the passages in my member.php of my homepage www.c124.de but after login and clicking the upload-button the following error occured.
Parse error: syntax error, unexpected $end in /var/www/web299/html/4images/member.php on line 1361
I checed the memmber.php but it only has 1355 lines.
What happend, what can I do ?
Greetings from germany
joergW
-
... but after login and clicking the upload-button the following error occured.....
irgend welche klammern oder semicolon beim kopieren vergessen?
kontrollier halt alles nochmal nach.
mfg Andi
-
puuuh ... geschafft.
Wahrscheinlich hatte ich das Leerzeichen vor dem ersten Buchstaben nicht mitkopiert.
jetzt geht´s so wie ich mir vorstellte.
Danke / Thanks
joergW
-
Moin,
nachdem das geänderte Script funktionierte, stellte ich fest, dass User trotzdem mehrfach uploaden können.
Bei mir ist das Limit im Firefox da, im InternetExplorer nicht.
Hat jemand eine Ahnung woran das liegen könnte ?
###
t works only with Firefox, but not with InternetExplorer on my normal User-Account und test-Accounts
Anybody any idea why it is so ?
###
bis denn
joergW
-
eingebaut und getestet unter 1.7.9 :
läuft einwandfrei unter IE-8 und Firefox..
:D Danke !!
Wolfgang