Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Lucifix

Pages: [1] 2 3 4 5
1
Discussion & Troubleshooting / Lost password function
« on: June 26, 2013, 08:16:16 PM »
I've just figured it out that Lost password function is really "strange". Why? Let say I've got email from my friend who is using the same gallery as I. I can just enter his email and send him new password. And I can do that all the time... and someone will be very furious :twisted:.

This should be fix somehow, maybe you should received email with link, which contain generated number. And after click on that link (server verify number) you can change you password.

Maybe I've overlooked this and this function is in this forum already?

2
Mods & Plugins (Requests & Discussions) / Max keyword per image?
« on: May 06, 2011, 12:20:33 PM »
Does anyone know how to set limit lets says 30 keywords per image?

I'm afraid that members will start using 100 or more keywords one one image...

3
Mods & Plugins (Requests & Discussions) / Autoresize - size limit
« on: November 05, 2010, 02:10:30 PM »
I know that there is mod that will autoresize image if width or height is too big, but I couldn't find any mod that would lower image quality if image size (KB/MB) is too big?

So if member would like to upload image that is 5MB size, script would change quality to fit max size (etc. 500KB).

4
I checked my cache directory and I found out that there are some very old cache files which have already been expired but till now none of the visitors has visit that page which cache belongs to.

That's why I'm wondering wouldn't be good if somehow cache is automatically deleted/removed when cache lifetime is expired?

I don't know how that would effect server load if every time someone refresh page cache directory is checked if there are expired files?

5
Discussion & Troubleshooting / Different cache lifetime for guests?
« on: October 26, 2010, 12:44:50 PM »
Does anyone know if it's possible to have different lifetime of cache for guests and registered users?

Looks like calling user_info in global.php file is too early...

6
Does anyone else have problem with with uploading files that have extension JPG or JPEG (with big letters)?

I have added two new lines in files upload_definitions.php and it looks like it's working now:
Code: [Select]
$mime_type_match['JPG'] = array("image/jpg", "image/jpeg", "image/pjpeg");
$mime_type_match['JPEG'] = array("image/jpg", "image/jpeg", "image/pjpeg");

7
Mods & Plugins (Requests & Discussions) / [MOD] Firefox Search Engine
« on: August 13, 2010, 09:35:36 AM »
I've made little mod that allow you to add your 4images gallery to your Firefox search engine.

1st open Notepad and past this in it:
Code: [Select]
<search
version="7.1"
name=""
description=""
action=""
searchForm=""
method="GET"
>

<input name="sourceid" value="Mozilla-search">
<input name="search_keywords" user >
  
</search>

Then change (only red text)
name="Name of your website"
description="description of your website"
action="path-to-your-website/search.php"
searchForm="path-to-your-website"

Then: File > Save as > (go to directory: C:\Program Files\Mozilla Firefox\searchplugins)
File name: yourwebsitename.src
Save as type: All type
Encoding: ANSI

After restarting Firefox select on the top your new search engine, enter keywords and let me know if its working ;)


EDIT:

I've also found way to submit your gallery to Firefox search engine list.

You can read this tutorial:
http://www.hacktheday.com/step-by-step-create-your-own-search-engine-for-firefox-twitter-contacts/


And submit your search engine here:
http://mycroft.mozdev.org/submitos.html

Here is some info about inputs:
Search URL: http://www.yourdomain.com/search.php?search_keywords={searchTerms}
Search Form URL: http://www.yourdomain.com/search.php
Reference: (whatever you want)



8
Mods & Plugins (Requests & Discussions) / [MOD REQ] User Activity
« on: November 11, 2009, 09:13:34 AM »
For drupal platform I've found interesting mod called activity.
Quote
The Activity module keeps track of the things people do on your site and provides mini-feeds of these activities in blocks, in a specialized table, and via RSS. The module is extensible so that any other module can integrate with it. The messages that are produced are customizable via the admin interface and are context sensitive.

Url: http://drupal.org/project/activity

I'm aware that integrating such mod in 4images system would take some time, but since this looks like very interesting mod, it's worth to.

Is anyone willing to give it a shot?  :roll:

9
I found interesting website that contains database from different forum spam bots: http://www.stopforumspam.com/

I've integrated their API in 4images gallery to prevent bots to register (even thought I'm using capcha system, bots somehow managed to register).

This mod is taken from their forum so all the credit goes to author:
http://www.stopforumspam.com/forum/t598-Basic-file-read

1. Open includes/functions.php and before:
Code: [Select]
?>
add
Code: [Select]
function checkspammers($input,$inputtype='email'){
    //Load the file, and implode the array.
    $xml = implode('',file("http://www.stopforumspam.com/api?".$inputtype."=".$input));

//Start new xml parser.
    $p = xml_parser_create();
   
    //Get the xml into an array
    xml_parse_into_struct($p, $xml, $vals, $index);
   
    //Free some memory by clearing the xml parser
    xml_parser_free($p);
   
    //We don't need $index or the $xml any more
    unset($index,$xml);
   
   
    //Prepare the return array
    $return = array();
   
    //Now we are going to make the aray useable
    foreach($vals as $array){
        //If it's the opening array we can do it slightly differnetly
        if($array['type'] == 'open'){
            //Just get weather it was sucess or not.
            $return[$array['tag']] = $array['attributes']['SUCCESS'];
        }elseif($array['type'] == 'complete'){
            //Else just get the value
            $return[$array['tag']] = $array['value'];
        }
    }
   
    //Save a bit mroe memory by clearing the vals array
    unset($vals);
   
    //Now make time into a unix timestamp
    if($return['LASTSEEN']){
        //Sepparate the timestamp into the time and the date
        $time = explode(' ',$return['LASTSEEN']);
        //Sepparate the date
        $date = explode("-",$time[0]);
        //Sepparate the time
        $time = explode("-",$time[0]);
       
        //Now make the time, note we times by 1 to remove leading zeros, if we don't then php cansometimes use teh octal system instead of decimal.
        $return['UNIXLASTSEEN'] = gmmktime($time[0]*1,$time[1]*1,$time[2]*1,$date[1]*1,$date[2]*1,$date[0]*1);
    }
   
    //RESPONCE would be better as booleen, not a string
    if($return['RESPONCE'] == 'true'){ $return['RESPONCE'] = true; }else{ $return['RESPONCE'] = false; }
   
    //Now return our array.
    return $return;
}

//Example function to check in ip
function isaspammer($ip){
    //Get the xml results as an array from teh function above
    $result = checkspammers($ip);
    //Is he reported?
    if($result['FREQUENCY'] > 0 && (time() - $result['UNIXLASTSEEN']) < (3600 * 24 * 365)){
        //He is a spammer
        return true;
    }else{
        //He is not reported as a spammer
        return false;
    }
}

2. Open register.php

before:
Code: [Select]
if ($user_password == "") {
add
Code: [Select]
    if (isaspammer($user_email)) {
      $msg .= (($msg != "") ? "<br />" : "").$lang['invalid_email_format']; // or add anything else, bots doesn't understand nothing :)
      $error = 1;
    }

Simple as that  :wink:

PS: it's also possible to check their IP, but email check is working for me (now)

10
On web I've found interesting jquery plugin that suggest you some keywords. To understand it plz check first demo:
http://remysharp.com/wp-content/uploads/2007/12/tagging.php

I was thinking to integrated it with 4images gallery but the everytime I connect it with 4images database my server crashed.

Does anyone have idea how to implent it with database (4images_wordlist table)?

Link: http://remysharp.com/2007/12/28/jquery-tag-suggestion/

UPDATE: after searching on 4images forum I've found great idea. Comming soon ;)

11
Does anyone have idea how to set that users will be automatically logged in when they active their account?

12
I found out that many spam bots are registering on my site with domain such as mail.ru, nlist.ru etc.

So I decided to disable new registration from those domains and here is small mod that will do that:

1. Add new row in 4images_settings table:
Code: [Select]
ALTER TABLE 4images_settings
ADD bad_mail

2. Open /includes/functions.php and before
Code: [Select]
?>

add

Code: [Select]
function mailCheck($user_email) {
global $site_db, $config;
$user_email = strtolower($user_email);
$return = 'true';
if ($config['bad_mail'] > '') {
$BadMailList = explode("\r\n", $config['bad_mail']);
$j = count($BadMailList);
for ($i = 0;$i < $j;++$i) {
if (eregi($BadMailList[$i], $user_email)) $return = 'false';
}
}
return $return;
}

3. Open register.php and before
Code: [Select]
if ($user_password == "") {
add

Code: [Select]
   if (mailCheck($user_email) == "false") {
      $msg .= (($msg != "") ? "<br />" : "").$lang['invalid_email_format'];
      $error = 1;
    }

4. Open admin/settings.php and after:
Code: [Select]
show_setting_row("highlight_admin", "radio");
add
Code: [Select]
show_setting_row("bad_mail", "textarea");
Now you can in admin settings add bad domain names that you want to banned from registration; one after another.

Example:
aravensoft.com
bk.ru
list.ru
mail.ru
mysite.com
ya.ru
yoursite.com

You are welcome to test this mod first and add you suggestion how to improve it.

Enjoy!

13
My main language in my 4images gallery is Slovenian. What concern me that when visitor from outside my country come to my site, he/she will live it as soon as he/she will see that the site has strange language.

I would like that based on user IP (country) gallery language would change. If user is not (myip != SI) from Slovenia -> change to English language.

I've already installed GEO IP (from http://www.maxmind.com/app/geoip_country) but I don't have idea how to automatically change language...  :roll:

EDITED:
lol i think I found the way :)

Please someone test it first!

First you have to upload GEO IP files (Next few line taken from: http://www.4homepages.de/forum/index.php?topic=7831.0)

Visit the home page of the tools will be used in this mod:
http://www.maxmind.com/app/geoip_country
Read the licence and make sure its NOT conflicts with your usage.

Download the following files:
1) http://www.maxmind.com/download/geoip/api/php/geoip.inc
Save it in includes/ directory of your 4images installation

2) http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz
Extract the content of this archive (u can use WinZIP, WinRAR, 7-Zip or any other archivers)
Save the extracted file (GeoIP.dat) into includes/ directory (make sure u keep the case: its GeoIP.dat not geoip.dat)

3) http://www.maxmind.com/download/geoip/database/flag.zip
or
http://web.tampabay.rr.com/vano/redirect.html?flags.zip

4) Go to global.php and before:
Code: [Select]
include_once(ROOT_PATH.'lang/'.$config['language_dir'].'/main.php');
add:
Code: [Select]
if ($_SERVER['HTTP_X_FORWARD_FOR']) {
$ip = $_SERVER['HTTP_X_FORWARD_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
if (!class_exists("GeoIP")) {
 include(ROOT_PATH."includes/geoip.inc");
}

$gi = geoip_open(ROOT_PATH."includes/GeoIP.dat",GEOIP_STANDARD);
$countries = array();

$cid = geoip_country_code_by_addr($gi, $ip);
//$countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;

if (strtolower($cid) == "hr") { // Croatian visitors
$config['language_dir'] = "hrvatski"; // change depend on secondary language
} elseif (strtolower($cid) == "si") { // visitors from my country Sloveniange
$config['language_dir'] = "slovenian"; // change depend on secondary language
} else { // all other visitors
$config['language_dir'] = "english";  //
}

Watch out! This is just my modification, because I have install in my 4images gallery three languages in those directories:
- slovenian
- english
- hrvatski

So depend on your installed languages change those line...

Please let me know if it's working or if you have any other suggestion.

You can check demo: http://www.slo-foto.net/galerija

14
I saw that many users in my gallery are adding characters like , . in keywords fields.

Does anyone know the solution how to exclude those characters and shows only valid one (a-z-A-Z-0-9 - numbers and letters) in details page?

15
I saw that many people simply doesn't activate their account after registration. I was wondering if someone could help me with mod that would notify nonactive users in xy days after their registration. Automatically ... ;)
Like this:

Code: [Select]
Hi {user_name},

you have registered on {your_site} xy days ago. If you wish to start using our service please activate your account or it will be deleted.

Activation link: ...


Pages: [1] 2 3 4 5