Author Topic: [Feature-addon] - New images total count from site header.  (Read 9899 times)

0 Members and 1 Guest are viewing this topic.

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
[Feature-addon] - New images total count from site header.
« on: February 09, 2006, 04:05:04 PM »
// New images total count v1.0 (Please proceed to v1.1 below)

// Introduction

This MOD allows you to see directly how many new images you have from your site header like this :

Quote

new images (x)


rather than clicking on it all the time to see how many new images has been in your database lately. ;)

// Affected files



- index.php
- templates/<your_template>/home.html



// Backup your files

Always backup your files before proceeding to these steps below.

// Step 1

In your index.php file,

find :

Quote

if (!$num_rows)  {


add above :

Code: [Select]

$new_images_count = str_replace("{new_images_count}", "", $num_rows);


Then, find :

Quote

$site_template->register_vars("new_images", $new_images);


add above :

Code: [Select]

$site_template->register_vars("new_images_count", $new_images_count);


// Step 2

In your templates/<your_template>/home.html file,

find :

Quote

<a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;


replace with :

Code: [Select]

<a href="{url_new_images}"><b>{lang_new_images} ({new_images_count})</b></a>&nbsp;


========================================================================================

// New images total count v1.1

// Step 1

Uninstall v1.0 before proceeding to this steps below (of course, if you already installed it in the first place).

// Step 2

In your includes/page_header.php file,

find :

Quote

// Replace Globals in $lang
$lang = $site_template->parse_array($lang);


add below :

Code: [Select]

// Verification of new images in your gallery.
$is_new = ($image_row['image_date'] >= (time() - 60 * 60 * 24 * $config['new_cutoff'])) ? 1 : 0;


Then, find :

Quote

"lang_new_images" => $lang['new_images'],


add below :

Code: [Select]

"image_is_new" => ($is_new) ? $is_new : "",


Then, on all your HTML templates that you can find the following :

Quote

<a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;


Change them all to :

Code: [Select]

<a href="{url_new_images}"><b>{lang_new_images}</a>{if image_is_new} ({image_is_new}){endif image_is_new}</b>&nbsp;


// Installation complete

That's it. You're done !

Go to your home gallery page and check out your 'new images' link. You should see the total number right aside of it. ;)

Additional note: This should work on all your pages from the clickstream bar.

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: [Feature-addon] - New images total count from site header.
« Reply #1 on: February 09, 2006, 05:25:13 PM »
great job! thank you very much!
it works fine.  :wink:

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Feature-addon] - New images total count from site header.
« Reply #2 on: February 09, 2006, 05:41:50 PM »
:D tested thanks a lot Oracle for this, another smalll addition that adds so much to my gallery.

i do get this result though  New images (3)  then when i click i get 99 images found Found: 99 image(s) on 9 page(s). Displayed: image 1 to 12.

RT

Yes, of course. Since the image cells's value from the ACP's configuration page is configured differently. ;)

great job! thank you very much!
it works fine.  :wink:

Glad to see it was in demand. By the way, next one is coming right up. ;)

Offline trez

  • Hero Member
  • *****
  • Posts: 613
    • View Profile
    • blog / photography
Re: [Feature-addon] - New images total count from site header.
« Reply #3 on: February 09, 2006, 05:52:02 PM »
works great, just installed it, thanks Oracle :)
DEMO: http://www.zapomnime.com

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: [Feature-addon] - New images total count from site header.
« Reply #5 on: February 09, 2006, 06:43:52 PM »
Glad to see it was in demand. By the way, next one is coming right up. ;)
Ah yes!  :wink:

that addon counts the new images which are in the rows of new images. is it possible to count the new marked  images ?

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Feature-addon] - New images total count from site header.
« Reply #6 on: February 09, 2006, 07:30:05 PM »
Quote

that addon counts the new images which are in the rows of new images. is it possible to count the new marked  images ?


I'll see what I can do and keep this topic updated.

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Feature-addon] - New images total count from site header.
« Reply #7 on: February 09, 2006, 08:18:13 PM »
There you go. Topic updated with a new version and steps. ;)

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Feature-addon] - New images total count from site header.
« Reply #8 on: February 10, 2006, 12:09:28 AM »
Quote

sorry, this should be so simple


I know. Althought, this MOD is a failure. I wish I could find other answer on this one. :(

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Feature-addon] - New images total count from site header.
« Reply #9 on: February 10, 2006, 12:51:08 AM »
i have used the new version where you edit page header.php, but i do not get a numeric value it just says New images
Install v1.0 and then v1.1 but skip Step 1
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline artpics

  • Full Member
  • ***
  • Posts: 173
    • View Profile
    • my site
Re: [Feature-addon] - New images total count from site header.
« Reply #10 on: February 11, 2006, 02:39:04 PM »
thanks i have reinstalled but it still only says new images 3 when there are 112,


rt


Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [Feature-addon] - New images total count from site header.
« Reply #11 on: February 11, 2006, 03:01:13 PM »
As I said, this MOD is a failure. :roll: