Author Topic: [Mod] New images since last visit  (Read 63244 times)

0 Members and 1 Guest are viewing this topic.

Offline LoOpP

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
[Mod] New images since last visit
« Reply #15 on: March 26, 2003, 05:59:01 PM »
is it possible to use this script but not for new pictures,-> for comments

new comments since last visit

thx

Offline PuCK

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • http://www.acidarts.net
[Mod] New images since last visit
« Reply #16 on: March 26, 2003, 10:34:21 PM »
Is it possible to do this with a cookie? So guests see only the new images since last visit?

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Here's an alternative.
« Reply #17 on: April 03, 2003, 01:13:58 AM »
.
If you would like the existing "new images" link to work for both logged in users and guests, you could simplify the mod to this single step.

Open search.php

find:
Code: [Select]
if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
    $new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
    $sql_where_query .= "AND i.image_date >= $new_cutoff ";
  }

replace with:
Code: [Select]
 if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
    if ($user_info['user_level'] != GUEST) {        
      $new_cutoff = $user_info['user_lastvisit'];
    } else {
      $new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
}
    $sql_where_query .= "AND i.image_date >= $new_cutoff ";
  }


This returns the new images since the user last visited if they're logged in and the new images that fall within the admin control panel date range if they are not logged in.

If you want to go the extra mile, you can tell the user what's the link will do.

Open lang/english/main.php

Find:
Code: [Select]
$lang['new_images'] = "New images";
Add after:
Code: [Select]

$lang['new_images_config_cutoff'] = "New Images From Last ".$config['new_cutoff']." Days";
$lang['new_images_user_lastvisit'] = "New Images Since Your Last Visit";


Open includes/page_header.php

Find
Code: [Select]
 "lang_new_images" => $lang['new_images'],
Add after:
Code: [Select]
 "lang_new_images_alt" => ($user_info['user_level'] == GUEST) ? $lang['new_images_config_cutoff'] : $lang['new_images_user_lastvisit'],

Then anywhere in your templates

Replace:
Code: [Select]
<a href="{url_new_images}"><b>{lang_new_images}</b></a>
With:
Code: [Select]
<a href="{url_new_images}" alt="{lang_new_images_alt}"><b>{lang_new_images}</b></a>

Thanks jengwen for this mod !

Offline Josef Florian

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: [Mod] New images since last visit
« Reply #18 on: May 16, 2005, 02:30:01 AM »
WOW, it works!

Thanks!
    • running v1.7.6 with MOD: SortImageAsYouLike / Cooliris Slideshow
    • with © removal
    • i have problems with:
actually no[/list]

Offline karimun

  • Newbie
  • *
  • Posts: 49
    • View Profile
    • http://www.at6pm.com
Re: [Mod] New images since last visit
« Reply #19 on: July 18, 2005, 08:49:41 PM »
I installed the solution of Chris and it works great.

I would like to use following modification:
For logged in users both ways, the setting from the control panel AND this mod, should co-exist.
I will add the ´new_images_since_your_last_visit´ into user_logininfo.html so guests will never see it.

Thank you very much in advance.

Offline pkitty

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: [Mod] New images since last visit
« Reply #20 on: July 19, 2005, 12:50:46 AM »
I installed this, and got a huge sessions.php error, I couldnt log out, couldnt go to my control panel.... and for some reason, my backups are not working.


Chris, If I use your code, is what you have an add on to the first code?  Or do I simply follow your instructions...

Offline nyiguinyogui

  • Pre-Newbie
  • Posts: 6
    • View Profile
New sign on images should reflect new behaviour
« Reply #21 on: September 01, 2005, 09:27:37 AM »
This is my 1st post so hi to everybody.

I have been using 4images for about a month and I think it is a nice application.
I specially appreciate the contributions of community with mods and plug-ins.

And about this "New images since last visit" mod, in my opinion there is something which is missing:
The "new images" function has been changed so that -for a logged user-, it shows new images since user's last visit, then it is not coherent that the "new" sign still appears on images which are new according to "old new criteria" (new images for the last X days). Actually, "new" sign should appear only in images new since user's last visit.

Regards.

Offline MEXX

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: [Mod] New images since last visit
« Reply #22 on: March 24, 2006, 12:52:03 AM »
Отличный мод! Все работает! Спасибо! :lol:
   

Offline jerseygirl

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: [Mod] New images since last visit
« Reply #23 on: March 28, 2006, 03:17:26 PM »
this mod doesn't work with version 1.7.2, does it? these lines are not in seach.php:

Code: [Select]
if (isset($HTTP_POST_VARS['search_new_images']) || isset($HTTP_GET_VARS['search_new_images'])) {
 $search_new_images = 1;

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: [Mod] New images since last visit
« Reply #24 on: March 28, 2006, 03:45:04 PM »
then search for include(ROOT_PATH.'global.php');
and insert it below.
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 Nasser

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [Mod] New images since last visit
« Reply #25 on: April 25, 2006, 02:26:12 PM »
 include(ROOT_PATH.'global.php');
is not there also V@no

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: [Mod] New images since last visit
« Reply #26 on: April 25, 2006, 02:40:55 PM »
include(ROOT_PATH.'global.php');
is not there also V@no

Are you serious? hope it was a joke :P
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 Nasser

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [Mod] New images since last visit
« Reply #27 on: April 25, 2006, 02:46:12 PM »
wait .. something wrong

Offline Nasser

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: [Mod] New images since last visit
« Reply #28 on: April 25, 2006, 03:35:26 PM »
I found it .. I was searching with a space before the line ..

ok I did every thing .. but the link doesn't appear

this is the link :
&raquo; <a href="{url_new_images_last}">{lang_new_images_last}</a><br />
I put it in the userlogininfo template

Offline wallpapers

  • Full Member
  • ***
  • Posts: 107
    • View Profile
    • Tuned-Cars.Net
Re: [Mod] New images since last visit
« Reply #29 on: April 25, 2006, 07:18:29 PM »
i see this error:
Code: [Select]
Parse error: parse error, unexpected $ in /home/tunedcar/public_html/search.php on line 428
but line 428 is the ?> (end of file) the are no spaces or what else.
i am using 4images 1.7.2
« Last Edit: April 25, 2006, 07:58:50 PM by wallpapers »