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

Pages: [1]