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:
$allow_download = 1;
}
add after:
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:
"image_votes" => $image_row['image_votes'],
add after:
"votes" => $votes,
Save and close functions.php
----------------------------
Open main.php in the lang/(your language) folder and find:
$lang['votes'] = "Vote(s)";
replace this with:
$lang['votes'] = "Votes";
$lang['vote'] = "Vote";
Save but keep main.php open!
----------------------------
Open details.html located in your templete folder...
Find:
<td valign="top" class="row2">{image_rating} ({image_votes} {lang_votes})</td>
Replace with:
<td valign="top" class="row1">{image_rating} ({image_votes} {votes})</td>
Save and close details.html
----------------------------
Open top.php and find:
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
Replace with:
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:
$register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
Replace with:
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:
var $first,$last,$total_pages,$config,$desc,$next,$back;
change to:
var $first,$last,$total_pages,$config,$desc,$next,$back,$pages,$images;
find:
$this->range = $config['paging_range'];
add after:
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:
"/".$site_template->start."last_page".$site_template->end."/iU"
change to:
"/".$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:
$replace_array = array(
$this->num_rows_all,
$this->total_pages,
$this->first,
$this->last
change to:
$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:
$lang['paging_stats'] = "Found: {total_cat_images} image(s) on {total_pages} page(s). Displayed: image {first_page} to {last_page}.";
change to:
$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:
$num_total_online = $num_registered_online + $num_guests_online;
add after:
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:
"user_online_list" => $user_online_list
change to:
"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:
$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:
$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!