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

Pages: [1]
1
Chit Chat / How strange these forums appear when...
« on: February 21, 2003, 08:40:20 AM »
When one surfs through a translator like this...

www.4homepages.de (translated)

...the translated German sure looks strange sometimes and also Funny how it translates some of the names, like Jan, become Janurary.... Even the English seems strange...

Can anyone tell me what "Language of luggage" is??? Weird!

Check it out...   :D

2
You are welcome...

But it should work.. I've tested this on a clean install of 4images, using copy and paste from the post I made, so you must have made some errors, when doing the last modification. Try again, and I am sure it will work...

3
Quote from: Jasondavis
I really like this mod...I have been wanting one similar to it that will change the page(s) to page if theres 1 page if more than 1 page have pages....anyone know how I can do that?


I will look into it... I would like that too! Shouldn't be too hard... well, for me it might, cause I am such a novice...

But I will try this very night, and if I can get it to work, with Page and Pages, I will post it here...

Thanx... :)

4
Mods & Plugins (Requests & Discussions) / Yeah! Well, I expanded it!
« on: February 07, 2003, 09:16:17 PM »
I wasn't trying to impress anyone...

I was only doing this for myself... but I though maybe there was someone else, who wanted it too...

And, yes, I know it's not that easy ín Russian, but it's very easy to change and add more conditions... if you like that..

Yeah, I have updated the mod now, so it fixes all the other places too!
And if you need help to fix more condition, we would be happy to help you!

In another version of this "fix" this could maybe be easier to accomplish with arrays, but for now... this is what I could do.

5
Hi everyone,

I got irritated with vote(s), so I wrote this little simple modification...
When there is only 1 vote it says "1 vote", when there is 0 or 2 and more it says "x votes"... (x being 0, 2 or higher)
This was quite easy to do, but I am a novice in PHP so, if you find any mistakes here, please let me know, so I can correct it!

(update)

Then after getting a suggestion I changed image(s) and page(s) too... Now it says 1 page 1 image, and if 2 it says 2 pages and 2 images.

Finally after thinking about it I fixed Currently active users so that it says 1 guest and 1 user, otherwise it says guests and users...

----------------------------

This mod changes the following:

/includes/functions.php
includes/paging.php
includes/sessions.php
/lang/<yourlanguage>/main.php
/templates/<yourtemplate>/details.html
top.php

----------------------------
---- FIXING VOTE(S)----
----------------------------

Open functions.php and find:

Code: [Select]
   $allow_download = 1;
  }

 
add after:

Code: [Select]
   if ($image_row['image_votes'] == "1"){$votes=$lang['vote'];}
    else {$votes=$lang['votes'];}


I don't know if above can be put somewhere else, but this works for me...

find:

Code: [Select]
   "image_votes" => $image_row['image_votes'],
   
add after:

Code: [Select]
   "votes" => $votes,

Save and close functions.php
----------------------------
Open main.php in the lang/(your language) folder and find:

Code: [Select]
$lang['votes'] = "Vote(s)";
replace this with:

Code: [Select]
$lang['votes'] = "Votes";
$lang['vote'] = "Vote";


Save but keep main.php open!
----------------------------
Open details.html located in your templete folder...

Find:

Code: [Select]
                           <td valign="top" class="row2">{image_rating} ({image_votes} {lang_votes})</td>
                           
Replace with:

Code: [Select]
                           <td valign="top" class="row1">{image_rating} ({image_votes} {votes})</td>

Save and close details.html
----------------------------
Open top.php and find:

Code: [Select]
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";

Replace with:

Code: [Select]
   if ($top_list[$i]['image_votes'] == "1") {$votes=$lang['vote'];}
    else {$votes=$lang['votes'];}
    $register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$votes.")";


Now find:

Code: [Select]
  $register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
   
Replace with:

Code: [Select]
   if ($top_list[$i]['image_votes'] == "1") {$votes=$lang['vote'];}
    else {$votes=$lang['votes'];}
    $register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$votes.")";

   
Now save and close top.php


------------------------------------------------
----- FIXING PAGE(S) and IMAGE(S) ------
------------------------------------------------

open includes/paging.php

find:

Code: [Select]
 var $first,$last,$total_pages,$config,$desc,$next,$back;
 
change to:

Code: [Select]
 var $first,$last,$total_pages,$config,$desc,$next,$back,$pages,$images;  
find:

Code: [Select]
   $this->range = $config['paging_range'];
   
add after:

Code: [Select]
   if ($this->total_pages == "1") {$this->pages=$lang['page'];}
    else $this->pages=$lang['pages'];
    if ($this->num_rows_all == "1") {$this->images=$lang['image'];}
    else $this->images=$lang['images'];

   
find:

Code: [Select]
     "/".$site_template->start."last_page".$site_template->end."/iU"

change to:

Code: [Select]
     "/".$site_template->start."last_page".$site_template->end."/iU",
      "/".$site_template->start."images".$site_template->end."/iU",
      "/".$site_template->start."pages".$site_template->end."/iU"

     
find:

Code: [Select]
   $replace_array = array(
      $this->num_rows_all,
      $this->total_pages,
      $this->first,
      $this->last

     
change to:

Code: [Select]
   $replace_array = array(
      $this->num_rows_all,
      $this->total_pages,
      $this->first,
      $this->last,
      $this->images,
      $this->pages

     
Save and close paging.php
----------------------------

Go back to main.php

find:

Code: [Select]
$lang['paging_stats'] = "Found: {total_cat_images} image(s) on {total_pages} page(s). Displayed: image {first_page} to {last_page}.";

change to:

Code: [Select]
$lang['paging_stats'] = "Found: {total_cat_images} {images} on {total_pages} {pages}. Displayed: image {first_page} to {last_page}.";
$lang['page'] = "page";
$lang['pages'] = "pages";
$lang['image'] = "image";
$lang['images'] = "images";


Save but keep main.php open!

---------------------------------------------------
------ FIXING USER(S) and GUEST(S) -------
---------------------------------------------------

First open includes/sessions.php

Find:

Code: [Select]
 $num_total_online = $num_registered_online + $num_guests_online;

add after:

Code: [Select]
 if ($num_registered_online == 1){$reg_online=$lang['member_online'];}
  else $reg_online=$lang['members_online'];
  if ($num_guests_online == 1){$guest_online=$lang['guest_online'];}
  else $guest_online=$lang['guests_online'];

 
A little further down find:

Code: [Select]
   "user_online_list" => $user_online_list
   
change to:

Code: [Select]
   "user_online_list" => $user_online_list,
    "reg_online" => $reg_online,
    "guest_online" => $guest_online

   
Save and close sessions.php
----------------------------
Go back to main.php

Find:

Code: [Select]
$lang['user_online_detail'] = "There are currently <b>{num_registered_online}</b> registered user(s) ({num_invisible_online} among them invisible) and <b>{num_guests_online}</b> guest(s) online.";        
Replace with:

Code: [Select]
$lang['user_online_detail'] = "There are currently <b>{num_registered_online}</b> registered {reg_online} ({num_invisible_online} among them invisible) and <b>{num_guests_online}</b> {guest_online} online.";
$lang['member_online'] = "user";
$lang['members_online'] = "users";
$lang['guest_online'] = "guest";
$lang['guests_online'] = "guests";


Finally close main.php
----------------------------

All done! As you can see, it's quite a simple mod, and if your language requires more alternatives, you can easily add those conditions...
If you have any questions how to do this, I am sure I or someone more skilled than I can help out...

By the way, there is one condition that I will not fix and that is if you have only one category and one image in your gallery...
If you have that, well, it wouldn¨t be much of a gallery, would it. So, I will not fix it... I think that would be overkill... Or am I wrong?

Cheers!

6
Thank you V@no, for that modification to the mod!!

With some modding of my own, I got it working the way I wanted it... though yours did most of the work...

The problem is if you want to use a folder that is not an integer, that is a whole number. That is because intval is used... So, I remover that from.... this... part

Code: [Select]
 if (isset($HTTP_GET_VARS['size2']) || isset($HTTP_POST_VARS['size2'])) {
    $size2 = (isset($HTTP_GET_VARS['size2'])) ? intval($HTTP_GET_VARS['size2']) : intval($HTTP_POST_VARS['size2']);
  }
  else {
    $size2 = 0;
  }


I changed it to...

Code: [Select]
if (isset($HTTP_GET_VARS['size2']) || isset($HTTP_POST_VARS['size2'])) {
    $size2 = (isset($HTTP_GET_VARS['size2'])) ? ($HTTP_GET_VARS['size2']) : ($HTTP_POST_VARS['size2']);
  }
  else {
    $size2 = 0;
  }


This way it doesn't matter if you use "1024" or "big" as the foldername....

The reason I wanted this is that I wanted to combine it with V@no's hack...
[Mod] Show original image in new window by clicking on image!

In that mod there is a folder is named big and put into the same folder as the images(1,2,3,4...). In the big folder images are put that are (surprisingly) bigger (could of course use smaller too, but what would the point be) Then that image will pop up in a new window... Great mod, I got it working!

Now, I also wanted the option to have a download button for big and also maybe other sizes like 1024 and so on...

But in the big modification there is no extension _big placed after each imagename (and no reason to if you have it in a different foler)... so I had to remove some code from this one as well...

 
Code: [Select]
$additional_download_sizes = array(72, 120, 300);

  $register_array = array();
  foreach ($additional_download_sizes as $size) {
    ereg("(.+)\.(.+)", basename($image_row['image_media_file']), $regs);
    $file = ((is_local_file($image_row['image_media_file'])) ? dirname($image_row['image_media_file'])."/" : MEDIA_PATH."/".$image_row['cat_id']."/").$size."/".$regs[1].".".$regs[2];
    if (!$allow_download || !get_file_path($file, "media", $image_row['cat_id'], 0, 0)) {
      $register_array['download_button_'.$size] = "<img src=\"".get_gallery_image("download_off.gif")."\" border=\"0\" alt=\"\" />";
      $register_array['download_zip_button_'.$size] = (function_exists("gzcompress") && function_exists("crc32")) ? "<img src=\"".get_gallery_image("download_zip_off.gif")."\" border=\"0\" alt=\"\" />" : "";
    }
    else {
      $register_array['download_button_'.$size] = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?".URL_IMAGE_ID."=".$image_row['image_id']."&amp;size2=".$size."&amp;size=".$size)."\"".$target."><img src=\"".get_gallery_image("download.gif")."\" border=\"0\" alt=\"\" /></a>";
      $register_array['download_zip_button_'.$size] = (function_exists("gzcompress") && function_exists("crc32")) ? "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=zip&amp;".URL_IMAGE_ID."=".$image_row['image_id']."&amp;size2=".$size."&amp;size=".$size)."\"><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>" : "";
    }
  }
  $site_template->register_vars($register_array);


this I changed to...

 
Code: [Select]
 $additional_download_sizes = array(800, 1024, 1280, 1600, big);

  $register_array = array();
  foreach ($additional_download_sizes as $size) {
    ereg("(.+)\.(.+)", basename($image_row['image_media_file']), $regs);
    $file = ((is_local_file($image_row['image_media_file'])) ? dirname($image_row['image_media_file'])."/" : MEDIA_PATH."/".$image_row['cat_id']."/").$size."/".$regs[1].".".$regs[2];
    if (!$allow_download || !get_file_path($file, "media", $image_row['cat_id'], 0, 0)) {
      $register_array['download_button_'.$size] = "<img src=\"".get_gallery_image("download_off.gif")."\" border=\"0\" alt=\"\" />";
      $register_array['download_zip_button_'.$size] = (function_exists("gzcompress") && function_exists("crc32")) ? "<img src=\"".get_gallery_image("download_zip_off.gif")."\" border=\"0\" alt=\"\" />" : "";
    }
    else {
      $register_array['download_button_'.$size] = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?".URL_IMAGE_ID."=".$image_row['image_id']."&amp;size2=".$size)."\"".$target."><img src=\"".get_gallery_image("download.gif")."\" border=\"0\" alt=\"\" /></a>";
      $register_array['download_zip_button_'.$size] = (function_exists("gzcompress") && function_exists("crc32")) ? "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=zip&amp;".URL_IMAGE_ID."=".$image_row['image_id']."&amp;size2=".$size."&amp;size=".$size)."\"><img src=\"".get_gallery_image("download_zip.gif")."\" border=\"0\" alt=\"\" /></a>" : "";
    }
  }
  $site_template->register_vars($register_array);


The difference lies in that I don't want to send the size value, only the size2 value because size gives the "_big" extension and size2 the name of the folder... I guess it could be changed more, to take away that function all together, but this was an easy change...

so the thing I removed was
Code: [Select]
."&amp;size=".$size from 2 places...

Of course you might want to incorporate Fox Mulder's change to have seperate buttons made for each SIZE or in this case foldername... then the code would look like this... (remember to make buttons named "download_(foldername).gif" and "download_zip_(foldername).gif" Same thing for the ones with "_off". In my case I made an image called "download_big.gif" and one called "download_off_big.jpg)

Code: [Select]
 $additional_download_sizes = array(800, 1024, 1280, 1600, big);

  $register_array = array();
  foreach ($additional_download_sizes as $size) {
    ereg("(.+)\.(.+)", basename($image_row['image_media_file']), $regs);
    $file = ((is_local_file($image_row['image_media_file'])) ? dirname($image_row['image_media_file'])."/" : MEDIA_PATH."/".$image_row['cat_id']."/").$size."/".$regs[1].".".$regs[2];
    if (!$allow_download || !get_file_path($file, "media", $image_row['cat_id'], 0, 0)) {
      $register_array['download_button_'.$size] = "<img src=\"".get_gallery_image("download_off_$size.gif")."\" border=\"0\" alt=\"\" />";
      $register_array['download_zip_button_'.$size] = (function_exists("gzcompress") && function_exists("crc32")) ? "<img src=\"".get_gallery_image("download_zip_off_$size.gif")."\" border=\"0\" alt=\"\" />" : "";
    }
    else {
      $register_array['download_button_'.$size] = "<a href=\"".$site_sess->url(ROOT_PATH."download.php?".URL_IMAGE_ID."=".$image_row['image_id']."&amp;size2=".$size)."\"".$target."><img src=\"".get_gallery_image("download_$size.gif")."\" border=\"0\" alt=\"\" /></a>";
      $register_array['download_zip_button_'.$size] = (function_exists("gzcompress") && function_exists("crc32")) ? "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=zip&amp;".URL_IMAGE_ID."=".$image_row['image_id']."&amp;size2=".$size."&amp;size=".$size)."\"><img src=\"".get_gallery_image("download_zip_$size.gif")."\" border=\"0\" alt=\"\" /></a>" : "";
    }
  }
  $site_template->register_vars($register_array);



Now, I can have a folder named big that works with other mod, I also now have the option of having a download button for getting the biggest file placed in the big folder...
I also have the option of having different folders with different sizes, and downloadbuttons for them...

All in all! I am very pleased!

We are here to share... right??

Thanx!

7
Discussion & Troubleshooting / Re: Well...
« on: February 04, 2003, 11:48:44 PM »
Quote from: V@no
mod_rewrite I belive is apache side, not PHP ( I might be wrong though)


Yes of course, but the Gallery application that I used before, made some specific calls, for mod_rewrite that is icombatible with the "new" Apache 2... so true it's not a PHP problem, rather a badly programmed php script....

Yes, it's Apache but the functions needs to be called from PHP... would be nice to have that in 4images too...

Instead of getting long urls you can get links like....

www.yoursite.com/4images/cars
www.yoursite.com/4images/busses
www.yoursite.com/4images/food

But I guess, in some cases that wouldn't make much of a difference...

Sorry for digressing.....

8
Discussion & Troubleshooting / Well...
« on: February 04, 2003, 06:34:20 PM »
Well, I am using the latest Apache and PHP and autoresize and the thumbnailer works fine....
But I had problems with some scripts that uses mod_rewrite... Didn't work at all...

9
Mods & Plugins (Releases & Support) / Great! :)
« on: February 04, 2003, 02:58:18 PM »
I was thinking of another sort (thing) that could be useful!
How about having an option in the edit category where you could decide the default sort that category is sorted as...

And also, an adition, sorting by image_id would also be nice... so you can have the orignal upload order...
And finally, sorting by filename, not just by image name.... (which can be changed)...

Don't these ideas make sense...???

Anyway.. I know I sure would like to see it implemented, and I am sure others would find it useful too!

Anyway, great work V@no...
Your name sure do pop up here alot! :D

10
Thank you V@no!

A truly great mod, that works just perfectly for me!
And also thanks for the extra help to get it working!
Nice with nice guys! :D

Anyway, if you ever are in the northern part of Stockholm and need a place to crash, call me!

:D

So, great modding, and keep 'em comming, you seem to have the talent for it!

Enough with the superlatives.... :D

11
Thanx for this mod...

I have a suggestion... I am trying to mod this so that instead of having to put the same files in the same folder with a new extension, one could make a new folder called 150 or 300... (in my case for resolution, like 800 and 1024)

I have managed for it to find if there is a file with the same name in the folder, but I just can't seem to get new version of the picture from a different folder when clicking on the icon...

Still trying... but I am sadly not very good at php... yet...
Anyone else can do this??

If I succed I will post it here.... if not... well....

Pages: [1]