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.


Messages - Lucifix

Pages: 1 2 3 4 [5] 6 7 8 9 ... 29
61
Thx guys!

One thing... how safe is to modify this? I mean if I register with public computer and browser save your url with activation link. Will other user be able to log in if he enters that url even if I log off that computer?

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

63
I still think that 4images need to integrate SWFUpload or any similar script.

As I said, I vote for SWFUpload:
http://demo.swfupload.org/v220/index.htm

PS: i tried to integrate it but without success :(

64
Glad that you like it.

Can you confirm if it's working correct?

65
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!

66
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

67
I didn't try this with remote images, but I would consider about security:

Q: Are there / have there been any security issues in phpThumb?
A: http://secunia.com/product/5199/

http://phpthumb.sourceforge.net/demo/docs/phpthumb.faq.txt

68
Hey Nicky!

Why not popular tags? :) Let say that in summer many users will tag their pictures with tags like: summer, beach, sea, sunny etc. This modification will show you tags within last week - and for me those are popular tags :)  :roll:

And of course you can interpreted this modification otherwise ;)

69
Nobody can solve this problem of mine?  :roll:

70
Just a short modification if you want to show popular tags from last week / months or year:

Modify STEP2 from:
Code: [Select]
//---[ [MOD] Tag Cloud]
function get_tag_clouds() {
global $site_db, $lang, $site_sess, $mode;
$output = "";
   
  $sql = "SELECT i.word_id, i.word_text, COUNT(c.word_id) AS quantity
  FROM ".WORDLIST_TABLE." i
LEFT JOIN ".WORDMATCH_TABLE." c ON i.word_id = c.word_id
WHERE keys_match > 0
  GROUP BY i.word_text
  ORDER BY  RAND()
LIMIT 20";

  $result = $site_db->query($sql);
  while ($row = $site_db->fetch_array($result)) {
    $tags[$row['word_text']] = $row['quantity'];
  }
 
  //uncommentnext line to sort the tag array in reverse order (+ => -)
   //arsort($tags);   
        $max_size = 250; // max font size in %
        $min_size = 50; // min font size in %
       
        // largest and smallest array values
        $max_qty = max(array_values($tags));
        $min_qty = min(array_values($tags));
       
        // find the range of values
        $spread = $max_qty - $min_qty;
        if ($spread == 0) { // we don't want to divide by zero
                $spread = 1;
        }
       
        // set the font-size increment
        $step = ($max_size - $min_size) / ($spread);
       
        // loop through the tag array
        foreach ($tags as $key => $value) {
                // calculate font-size
                // find the $value in excess of $min_qty
                // multiply by the font-size increment ($size)
                // and add the $min_size set above
                $size = round($min_size + (($value - $min_qty) * $step));
       
                $output .= '<a href="'.$site_sess->url(ROOT_PATH."search.php?search_keywords=".$key.((!empty($mode)) ? "&amp;mode=".$mode : "")).'" style="font-size:'.$size.'%;color:rgb('.mt_rand(0, 255).', '.mt_rand(0, 255).', '.mt_rand(0, 255).');font-family:Verdana, Arial, Helvetica, sans-serif;" title="'.$value.' '.$lang['tagged_with'].' '.$key.'">'.$key.'</a> ';
        }

 
  return $output;
}
//---[/[MOD] Tag Cloud]

To:
Code: [Select]
//---[ [MOD] Tag Cloud]
function get_tag_clouds() {
global $site_db, $lang, $site_sess, $mode;
$output = "";
   
$sql = "SELECT w.word_id, w.word_text, c.image_id, i.image_date, COUNT( c.word_id ) AS quantity
FROM ".WORDLIST_TABLE." w
LEFT JOIN ".WORDMATCH_TABLE." c ON w.word_id = c.word_id
LEFT JOIN ".IMAGES_TABLE." i ON c.image_id = i.image_id
WHERE keys_match >0
AND i.image_date >= ".(time() - 60 * 60 * 24 * 7)." // 7 means 7 days, if you want to show popular tags from last months replace 7 with 30, for last year 365
GROUP BY w.word_text
ORDER BY quantity DESC
LIMIT 20";
  $result = $site_db->query($sql);
  while ($row = $site_db->fetch_array($result)) {
    $tags[$row['word_text']] = $row['quantity'];
  }
 
  //uncommentnext line to sort the tag array in reverse order (+ => -)
   //arsort($tags);   
        $max_size = 250; // max font size in %
        $min_size = 80; // min font size in %
       
        // largest and smallest array values
        $max_qty = max(array_values($tags));
        $min_qty = min(array_values($tags));
       
        // find the range of values
        $spread = $max_qty - $min_qty;
        if ($spread == 0) { // we don't want to divide by zero
                $spread = 1;
        }
       
        // set the font-size increment
        $step = ($max_size - $min_size) / ($spread);
       
        // loop through the tag array
        foreach ($tags as $key => $value) {
                // calculate font-size
                // find the $value in excess of $min_qty
                // multiply by the font-size increment ($size)
                // and add the $min_size set above
                $size = round($min_size + (($value - $min_qty) * $step));
       
                $output .= '<a href="'.$site_sess->url(NUKE_PATH."search&search_keywords=".$key.((!empty($mode)) ? "&amp;mode=".$mode : "")).'" style="font-size:'.$size.'%;color:rgb('.mt_rand(0, 255).', '.mt_rand(0, 255).', '.mt_rand(0, 255).');font-family:Verdana, Arial, Helvetica, sans-serif;" title="'.$value.' '.$lang['tagged_with'].' '.$key.'">'.$key.'</a> ';
        }

 
  return $output;
}
//---[/[MOD] Tag Cloud]

Note:      AND i.image_date >= ".(time() - 60 * 60 * 24 * 7)." // 7 means 7 days, if you want to show popular tags from last months replace 7 with 30, for last year 365

71
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?

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


73
Mods & Plugins (Releases & Support) / Re: [MOD] Ajax Username Checker
« on: March 19, 2009, 11:36:23 AM »
For image verification  defenitly not! But for email... maybe yes :roll:

74
Mods & Plugins (Releases & Support) / Re: [MOD] User Gravatars
« on: March 15, 2009, 06:29:55 PM »
Can you tell me what is your email? And the wordpress site where it shows your gravatar?

75
Mods & Plugins (Requests & Discussions) / Re: Datetime
« on: February 18, 2009, 02:52:47 PM »

Pages: 1 2 3 4 [5] 6 7 8 9 ... 29