A special photo gallery

October 11th, 2009

I feel like I’m going mad. Ever since I started putting my stuff on the net I found that existing web software solutions did not provide what I need. Not even the commercial ones.
Like now, here I am, again, facing my 20k+ photos and trying yet again to manage them using gallery2. But I have a very special need when it comes to photos:
– some photos I don’t want nobody to see. so they’re private
– others, only a few people can see
– others, just a few group of people
– others must be deleted
– and finally, the rest can be seen by the wide public

now, in order to easily support this, I’ve made 5 albums:
– 1 that contains all unsorted photos and which is totally private
– 1 which is my private album
– 1 that is totally public
– 1 that is only for family
– 1 that is for family and friends only

now, when I go into sorting the photos, I need to create sub-albums in most of the main albums and then:
– go over all photos in the managed album and delete what is not needed
– again go over all (remaining) photos in that album and move the needed one to my public
– again go over all (remaining) photos in that album and move the needed one to family only
– again go over all (remaining) photos in that album and move the needed one to family and friends
– move all remaining photos to my private album

so basically I am iterating the photos like 3 to 5 times. It is ANNOYING.

But there is another annoying part. Imagine you’re a family member. That means you have access to 3 albums that contain *related* photos. now that sucks.

The alternative for this is to keep all photos in once place, BUT, manually edit each and every single photos permissions to suit the restrictions on it. 20.000. photos. Twenty THOUSAND photos. If it takes 1 minute per photo, this equals a total of almost 14 continuous DAYS. to be more realistic, using this technique and say 3 hours per day, it means I’d be done in about 111 days. almost 4 months.

It’s a killer because I don’t have 3 hours every single day for this task.

which means I will be writing my own gallery software most likely based on joomla 😀

Cheers.

Related posts

JOOMSUITE 1.4.5: how to add SEF to file downloads [UPDATE]

October 5th, 2009

This is an update for http://blog.ciuly.com/website/joomsuite-how-to-add-sef-to-file-downloads/ which is valid for joomsuite 1.4.0

You need to edit 3 files and add url rewrite rules.
/components/com_resource/controller.php:373 (download function)

// Ciuly – file SEF
$fn = basename($res->field_value);
if (JRequest::getInt(‘timestamp’)==1){
$a = explode(‘_’, $fn, 2);
$fn = $a[1];
}
if($browser==’IE’) {
header(‘Content-Disposition: attachment; filename=”‘.$fn.'”‘);
header(‘Cache-Control: must-revalidate, post-check=0, pre-check=0’);
header(‘Pragma: public’);
} else {
header(‘Content-Disposition: attachment; filename=”‘.$fn.'”‘);
header(‘Cache-Control: no-cache, must-revalidate’);
header(‘Pragma: no-cache’);
}

./components/com_resource/controller.php:495 (download2 function, after adding above code)

// Ciuly – file SEF
$fn = basename($res->field_value);
if (JRequest::getInt(‘timestamp’)==1){
$a = explode(‘_’, $fn, 2);
$fn = $a[1];
}
if($browser==’IE’) {
header(‘Content-Disposition: attachment; filename=”‘.$fn.'”‘);
header(‘Cache-Control: must-revalidate, post-check=0, pre-check=0’);
header(‘Pragma: public’);
} else {
header(‘Content-Disposition: attachment; filename=”‘.$fn.'”‘);
header(‘Cache-Control: no-cache, must-revalidate’);
header(‘Pragma: no-cache’);
}

./components/com_resource/controllers/article.php:855 (download_attachment function)

// Ciuly – file SEF
$fn = basename($comment->attachmente);
if (JRequest::getInt(‘timestamp’)){
$a = explode(‘_’, $fn, 2);
$fn = $a[1];
}
if($browser==’IE’) {
header(‘Content-Disposition: attachment; filename=”‘.$fn.'”‘);
header(‘Cache-Control: must-revalidate, post-check=0, pre-check=0’);
header(‘Pragma: public’);
} else {
header(‘Content-Disposition: attachment; filename=”‘.$fn.'”‘);
header(‘Cache-Control: no-cache, must-revalidate’);
header(‘Pragma: no-cache’);
}

./plugins/joomsuite_content_fields/file.php:227 (onRenderFieldValue function)
if($params->get(‘show_name’))
{
// Ciuly – make it SEF
if (JROUTER_MODE_SEF)
$download = JURI::base().”download.php/$field->id/”;

$label = basename($field->field_value);
// Ciuly – remove timestamp from display
if ($params->get(‘attach’)){
$a = explode(‘_’, $label, 2);
$label = $a[1];
if (JROUTER_MODE_SEF)
$download = $download . “1/”;
else
$download = $download . “&timestamp=1”;
} else
if (JROUTER_MODE_SEF)
$download = $download . “0/”;
if (JROUTER_MODE_SEF)
$download = $download . $label;
}
else {
$label = $field->title;
}

and finally, url rewrite:
RewriteEngine on
RewriteRule ^/download.php/([0-9]+)/([0-1])/.*$ /index2.php?option=com_resource&task=download&no_html=1&file=$1&timestamp=$2

Related posts

Problem with article file display fixed

October 5th, 2009

I managed to find and fix the problem that prevented the files from being displayed in the articles on my site.
Long story short, everything should be back to normal now.

Related posts

Joomla issue with articles not showing partially fixed.

October 5th, 2009

Ever since I switched my site to joomla, my articles were not showing to the public, only to registered users.
I was informed about this issue about a week ago or so. Very late but I’m glad I was informed about it eventually.
So I logged a bug with joomsuite resources (which is the component that actually manages the articles) and I finally got the solution by upgrading to the latest version of that component.
Right now, the articles are showing, the text is there, but the files are not shown. I hope to get this fixed ASAP.

Sorry for the trouble for those who were expecting things to be there. This also got me loose a few rankings in google. Stupid thing.

Related posts

Changes in email system on my server

September 21st, 2009

I finally got some time to set up some DNS and xmail server for multiple domains.
As such, I also managed to set up a noreply@ address which is kind of a requirement for the web directory.
As such I also had to adapt some of my xmail filters.
Unfortunately, I still need to setup php on a per-site basis to use a specific email address and not the global one. I’m yet to find a nice way.

Related posts

JOOMSUITE: how to add SEF to file downloads

August 23rd, 2009

I finally managed to finish my SEF-related hacks on joomsuite for joomla in order to add SEF url support to the filw downloads.
You need to edit 3 files and add url rewrite rules.
/components/com_resource/controller.php:335 (download function)

$fn = basename($res->field_value);
if (JRequest::getInt('timestamp')==1){
  $a = explode('_', $fn, 2);
  $fn = $a[1];
}
if($browser=='IE') {
  header('Content-Disposition: attachment; filename="'.$fn.'"');
  header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  header('Pragma: public');
} else {
  header('Content-Disposition: attachment; filename="'.$fn.'"');
  header('Cache-Control: no-cache, must-revalidate');
  header('Pragma: no-cache');
}

./components/com_resource/controller.php:450 (download2 function, after adding above code)

$fn = basename($res->field_value);
if (JRequest::getInt('timestamp')==1){
  $a = explode('_', $fn, 2);
  $fn = $a[1];
}
if($browser=='IE') {
  header('Content-Disposition: attachment; filename="'.$fn.'"');
  header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  header('Pragma: public');
} else {
  header('Content-Disposition: attachment; filename="'.$fn.'"');
  header('Cache-Control: no-cache, must-revalidate');
  header('Pragma: no-cache');
}

./components/com_resource/controllers/article.php:778 (download_attachment function)

$fn = basename($comment->attachmente);
if (JRequest::getInt('timestamp')){
  $a = explode('_', $fn, 2);
  $fn = $a[1];
}
if($browser=='IE') {
  header('Content-Disposition: attachment; filename="'.$fn.'"');
  header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  header('Pragma: public');
} else {
  header('Content-Disposition: attachment; filename="'.$fn.'"');
  header('Cache-Control: no-cache, must-revalidate');
  header('Pragma: no-cache');
}

./plugins/joomsuite_content_fields/file.php:179 (onRenderFieldValue function)

if($params->get('show_name'))
{
  // Ciuly - make it SEF
  if (JROUTER_MODE_SEF)
    $download = JURI::base()."download.php/$field->id/";

  $label = basename($field->field_value);
  // Ciuly - remove timestamp from display
  if ($params->get('attach')){
    $a = explode('_', $label, 2);
    $label = $a[1];
    if (JROUTER_MODE_SEF)
      $download = $download . "1/";
    else
      $download = $download . "×tamp=1";
  } else
    if (JROUTER_MODE_SEF)
      $download = $download . "0/";
  if (JROUTER_MODE_SEF)
    $download = $download . $label;
}
else {
  $label = $field->title;
}

and finally, url rewrite:

    RewriteEngine on
    RewriteRule ^/download.php/([0-9]+)/([0-1])/.*$ /index2.php?option=com_resource&task=download&no_html=1&file=$1×tamp=$2

Related posts

Nice filenames on new site

August 22nd, 2009

As always, I started hacking into the joomsuite recources components and field plugins. I made it so it no longer displays nor sends the file with the preceding timestamp in it.
Now it is looking nice.
Next step will probably be to make it seofriendly url, not for the SEO part but for my greasemonkey section where in order to install the scripts in firefox and IE they need to have the filename in the url as last element and as a file not parameter.
So, more hacking to be done in the following days.

Related posts

An existing directory does not exist…

August 19th, 2009

I am working on making indy 10 tiburon compile under lazarus/fpc and right now I’m trying to get a modified package file to compile the needed stuff as apparently cannot do it (probably lack of time as with everyone)
I got the system stuff compiled but then while trying to compile the core, I got an error that IDException unit cannot be found. So I rushed to the package dirs and add the path to the system stuff. And then I got the following, stupid, error:

existing dir not found

existing dir not found


Now, as you can see this error practically says that, and now I’m playing the compiler:
“I know I am compiling the core, which is in the directory I’m looking for, but I just cannot see the directory I’m working from”.
Is there a medic in the house?

Later edit: the following picture is a bit more suggestive. It shows the loaded package path and the error, thus clearly marking that the idiot lazarus cannot find a path that is actually the one in which is located the package it tries to compile.

Existing dir not found 2

Existing dir not found 2

Related posts

Site relaunch/redesign. Stage 1

August 19th, 2009

I have almost completed the re-design/launch/write of the site, stage 1. That means the Delphi section.
It’s written in joomla 1.5 and I still need to get the ads to show up properly.
I spent a lot of time trying to get the hit counts, but for some files I only had 1 year worth of usable logs so … some stuff will remain with hit count 0.
Everything in delphi section SHOULD be 301-ed to the new locations.

Enjoy and let me know of issues/improvements.

Related posts

API module structure `php5_module’ in file modules/libphp5.so is garbled – perhaps this is not an Apache module DSO?

August 17th, 2009

While trying ot install php 5 in apache 2.2 I was getting the following error on apache startup: API module structure `php5_module’ in file modules/libphp5.so is garbled – perhaps this is not an Apache module DSO?
although both apache and php work fine run separatelly.
After a lot of debugging and reading I figured I’d do the php thing all over again and then noticed:

libtool: install: warning: remember to run `libtool –finish /kits/php-5.2.9/libs’

AND

You may want to add: /usr/local/lib/php to your php.ini include_path

minor details but they DID NOT help. But I am taking the time to rant a bit: why for the love of god won’t teh installer do the libtool call when it finishes? beats me.

Anyway, the problem is because there is an old version of apache on the system. Get rid of it first. ALL of it. rm -rf does a good job. But don’t delete your sites.
So, if unsure, backup frist.

Related posts