4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Fugaziman on May 14, 2003, 08:52:02 PM

Title: [Mod] New Images in Category v2
Post by: Fugaziman on May 14, 2003, 08:52:02 PM
V.2. Thanks to V@no (were have I heard that before   :?:   :lol: ) and his performance tuning and 4images knowledge I have updated the part of this mod that changes the page_header.php file.

If you have already installed this mod don't worry just change the bit you added in the page_header.php file with the new code.

I'm afraid I can take no credit of this re-write at all. All must go to V@no.
I think for now on we should all come up with the ideas and V@no writes them up for us  :lol:  


This Mod creates a table that displays the number of new images in each category (that has new images)
and provides links to the search page that will only display new images for that specific category.
It will only show categories that the user has access to.

To see this in action just look at the left side column of my site under the Random Image
http://www.newman.d2g.com/

Time to add Mod:
15-20 minutes

Files Changed
- includes/page_header.php
- Search.php
- templates/your_template/home.html

Note: As usual - BACKUP all of these files before changing them.


 :arrow: Edit includes/page_header.php

At the end of the page before:
Code: [Select]
?>
Add:

Code: [Select]
//-----------------------------------------------------
//---Show New Image count in category------------------
//-----------------------------------------------------

$new_image_category = "<table border=1 cellpadding=3 cellspacing=1 width=\"100%\">";

foreach ($new_image_cache as $key => $val) {
     if ($val && check_permission("auth_viewcat", $key)) {
     $category_link = "<a href=\"".$site_sess->url(ROOT_PATH."search.php?search_new_images=1&cat_id=".$key."&sub_cat=no")."\">".$val."</a>";
     $new_image_category .= "<tr><td><a href=\"".$site_sess->url(ROOT_PATH."categories.php?cat_id=".$cat_cache[$key]['cat_id'])."\">".$cat_cache[$key]['cat_name']."</a></td><td><b>".$category_link."</b></td></tr>";
   }
}
  
  $new_image_category .= "</table>";
  $site_template->register_vars("new_image_cats", $new_image_category);
  unset($new_image_category);


 :arrow: Edit Search.php

Find:
Code: [Select]
if (isset($HTTP_POST_VARS['search_fields'])) {
  $search_fields = trim($HTTP_POST_VARS['search_fields']);
}
else {
  $search_fields = "all";
}

Add After:

Code: [Select]
//-----------------------------------------------------
//---Show New Image count in category Mod -------------
//-----------------------------------------------------

if (isset($HTTP_GET_VARS['sub_cat'])) {
  $sub_cat = trim($HTTP_GET_VARS['sub_cat']);
}
else
{
  $sub_cat = isset($HTTP_POST_VARS['sub_cat']) ? trim($HTTP_POST_VARS['sub_cat']) : 1;
}

if (isset($HTTP_GET_VARS['cat_id'])) {
  $search_cat = intval($HTTP_GET_VARS['cat_id']);
}
else {
$search_cat = (isset($HTTP_POST_VARS['cat_id']) ) ? intval($HTTP_POST_VARS['cat_id']) : 0;
}
//-----------------------------------------------------
//---End of Show New Image count in category Mod ------
//-----------------------------------------------------

Be careful with this bit, make shure you have all the }'s in place
Find:

Code: [Select]
if (check_permission("auth_viewcat", $search_id['search_cat'])) {
      $cat_id_sql .= ", ".$search_id['search_cat'];
      if (!empty($sub_cat_ids[$search_id['search_cat']])) {
        foreach ($sub_cat_ids[$search_id['search_cat']] as $val) {
          if (check_permission("auth_viewcat", $val)) {
            $cat_id_sql .= ", ".$val;
          }
        }
      }
    }


Replace with:

Code: [Select]
if (check_permission("auth_viewcat", $search_id['search_cat'])) {
      $cat_id_sql .= ", ".$search_id['search_cat'];
      if ($sub_cat != "no") { // Show New Image count in category Mod
       if (!empty($sub_cat_ids[$search_id['search_cat']])) {
         foreach ($sub_cat_ids[$search_id['search_cat']] as $val) {
           if (check_permission("auth_viewcat", $val)) {
             $cat_id_sql .= ", ".$val;
           }
         }
       }
     }   // Show New Image count in category Mod
}

 


 :arrow: In your home.html file

Add:
Code: [Select]
{new_image_cats}
where you want the "New images in Category" to appear.

That's all there is to it.
Have fun
Fugaziman 8)
Title: [Mod] New Images in Category v2
Post by: V@no on May 14, 2003, 08:56:25 PM
I saw this at your site yesterday...it's very nice!
and today u saved me from asking u to share with us that mod...hehe
good job ;)
Title: [Mod] New Images in Category v2
Post by: Maweryk on May 14, 2003, 09:25:53 PM
Great idea, but if I open index.php, {new_image_cats} is there instead of the new image cats.
Any idea?

Thanks and cheers,

Markus
Title: [Mod] New Images in Category v2
Post by: Fugaziman on May 14, 2003, 09:37:50 PM
Quote from: Maweryk
Great idea, but if I open index.php, {new_image_cats} is there instead of the new image cats.
Any idea?

Thanks and cheers,
Markus


Not quite sure what you mean  :roll:
The {new_image_cats}  should be added to your template files where you want it to display.

Can you give me a little more info  :?:
Fugaziman
Title: [Mod] New Images in Category v2
Post by: Maweryk on May 14, 2003, 09:54:18 PM
Now, everything works fine.

Thanks Fugaziman for his very good support.

Cheers,

Markus
Title: Fatal error: Call to undefined function:  get_permission()
Post by: moritzh on May 15, 2003, 06:46:26 AM
Hi,

I checked out your mod on your page and it is great! So I tried to install it. However, I get this error message:

Fatal error: Call to undefined function:  get_permission() in /abc/xyz/homepage/ewb/gallery/includes/page_header.php on line 321

Line 321 is the following:
$user_access = get_permission();

When I comment out this line, the error message disappears. And the mod still works! Any idea why? Where is this function defined? Do you need $user_access anywhere? I don't see where it is used. Or can you do without this line 321???
If I am not mistaken, get_permission is not php function, right? (I searcehd  www.php.net on that.)

Any help is appreciated!
Moritz
Title: [Mod] New Images in Category v2
Post by: Apollo13 on May 15, 2003, 07:38:29 AM
great job i think i was the first beta tester... :lol:  :lol:


BTW. V@no whats wrong with your icq?
Title: Re: Fatal error: Call to undefined function:  get_permission()
Post by: V@no on May 15, 2003, 11:31:00 AM
Quote from: moritzh
Fatal error: Call to undefined function:  get_permission() in /abc/xyz/homepage/ewb/gallery/includes/page_header.php on line 321

Line 321 is the following:
$user_access = get_permission();

When I comment out this line, the error message disappears. And the mod still works! Any idea why? Where is this function defined? Do you need $user_access anywhere? I don't see where it is used. Or can you do without this line 321???
If I am not mistaken, get_permission is not php function, right?

no, u dont need that line at all.
in each main file, before page_header.php being include, $user_access = get_permission(); already executes, so, it's just doublicate line, wasting server's recources ;)


Quote from: Cr@zy Sash
BTW. V@no whats wrong with your icq?

I dont know, I'm online...but it seems none can see me and I cant receive messages? gotta try reinstall it, or... finaly reinstall the system...


@Fugaziman:
PM ;)
Title: Error by clicking on Category
Post by: Gabi on May 15, 2003, 11:46:40 AM
Hy ,

i istalld this Mod now i get this errormassage wen i klick on a category in the new fields:
Parse error: parse error in /homepages/3/d75848838/htdocs/main/foto-place/search.php on line 396
It´s the closingtag af search.php  ?>

What can i do to fix it ??

lg
Gabi
Title: [Mod] New Images in Category v2
Post by: V@no on May 15, 2003, 12:08:42 PM
Quote from: Fugaziman
Be careful with this bit, make shure you have all the }'s in place

;)
Title: [Mod] New Images in Category v2
Post by: Gabi on May 15, 2003, 12:14:52 PM
Quote from: V@no
Quote from: Fugaziman
Be careful with this bit, make shure you have all the }'s in place

;)


yepp i saw that  :D but its all there....this is the part wher i includet code:

Code: [Select]
if (!empty($search_id['search_cat']) && $search_id['search_cat'] != 0) {
    $cat_id_sql = 0;
    $sub_cat_ids = get_subcat_ids($search_id['search_cat'], $search_id['search_cat'], $cat_parent_cache);
   if (check_permission("auth_viewcat", $search_id['search_cat'])) {  
      $cat_id_sql .= ", ".$search_id['search_cat'];  
      if ($sub_cat != "no") {             // Show New Image count in category Mod
          if (!empty($sub_cat_ids[$search_id['search_cat']])) {  
            foreach ($sub_cat_ids[$search_id['search_cat']] as $val) {  
                  if (check_permission("auth_viewcat", $val)) {  
                        $cat_id_sql .= ", ".$val;  
                  }  
            }  
          }  
     }                      // Show New Image count in category Mod
}
Title: [Mod] New Images in Category v2
Post by: V@no on May 15, 2003, 12:38:17 PM
Quote from: Gabi
yepp i saw that  :D but its all there....this is the part wher i includet code:
without putting your sample in my php editor I can see that u are missing one closing }
just add it near any of others closing }
Title: [Mod] New Images in Category v2
Post by: toto1 on May 15, 2003, 01:24:20 PM
good hack very thk
Title: Great support!
Post by: balu on May 17, 2003, 06:20:47 PM
:D  :D  :D  many thx to the author!!!
Title: [Mod] New Images in Category v2
Post by: bgmurphy on May 28, 2003, 09:44:12 PM
Fugaziman -

great mod !! - now for the question !!

any chance you can create an alternate mod so that rather than showing only the new images in a category - it display an (random) image from each category on the home page rather than just the random images that normally appear -

my goal is to present the home page with a quick foto of each of the events i cover and give the client the chance to do an at-a-glance of each new event (here is a site that does this ==> www.wireimage.com) and if the image rotates randomly within the event displayed ... that is good too ..

anyway .. all help is appreciated by all

thanx
bruce
Title: [Mod] New Images in Category v2
Post by: jengwen on May 29, 2003, 04:44:10 AM
Nice mod.  I did have one problem, though.  I have new images in a sub-subcategory (i.e. Zoo Events/Migratory Bird Day/Artwork).  It gives me the correct number of new images in each sub-subcategory, but when I click on the link, it shows me all new images in the subcategory (i.e. Migratory Bird Day instead of Artwork or Games or Birds).
Title: [Mod] New Images in Category v2
Post by: Fugaziman on May 29, 2003, 05:34:01 AM
You need to make sure you correctly edited the Search.php

I had this problem myself when creating this mod so I know that this is were your problem is.

Hope that helps
Fugaziman
Title: Re: [Mod] New Images in Category v2
Post by: Legendary on May 03, 2005, 08:37:29 PM
I have this mod installed, everything showed up fine!!  But I have a problem when clicking on the new images.  It doesn't take me directly to the cat_id, but instead it takes me to every new images that I have on my site.

I've try redoing the steps 4 or 5 times now...still can't figure out!!

My site is here, its on the right located under user login panel
http://www.idols-unlimited.com


Any help would be appreciated!
Title: Re: [Mod] New Images in Category v2
Post by: V@no on May 04, 2005, 01:06:41 AM
it should open the category page if u click on it's name, and search page if u click on the number ;)
Title: Re: [Mod] New Images in Category v2
Post by: Legendary on May 04, 2005, 07:01:02 AM
I know, it doesn't do that even when i clicked on the number.

When I clicked on the number, it showed me every new pictures that i've added.  I know its not suppose to work like that.  I tested on the link provided on the first post, and it only shows the new images added to that specific catogory.
Title: Re: [Mod] New Images in Category v2
Post by: artpics on May 05, 2005, 05:33:18 AM
I know, it doesn't do that even when i clicked on the number.

When I clicked on the number, it showed me every new pictures that i've added.  I know its not suppose to work like that.  I tested on the link provided on the first post, and it only shows the new images added to that specific catogory.

yes me too click on a number all new images appear from all catagorys ..
Title: Re: [Mod] New Images in Category v2
Post by: V@no on May 05, 2005, 06:15:26 AM
the only explanation to that is u didnt do properly the search.php modifications.
Title: Re: [Mod] New Images in Category v2
Post by: Legendary on May 05, 2005, 04:47:25 PM
Yup, you were right Veno!!

It turned out that I have one extra line of code floating around with no purpose.  Deteled that line, and it works like a charm..thx for all the help guys!!
Title: Re: [Mod] New Images in Category v2
Post by: Vincent on May 12, 2005, 10:24:20 AM
still nice mode  :)
but i changed the layout of my page know i would like to have this {new_image_cats} in 3 Rows - which code part do i have to change?

sincerly
vincent
Title: Re: [Mod] New Images in Category v2
Post by: Vincent on May 16, 2005, 12:34:01 AM
up
maybe somebody will read it!

vincent
Title: Re: [Mod] New Images in Category v2
Post by: IzyB on July 22, 2005, 09:28:17 PM
Does this work fine in 1.71?
Title: Re: [Mod] New Images in Category v2
Post by: TheOracle on July 30, 2005, 02:41:22 PM
Interesting MOD. However,

this line :

Quote

$new_image_category = "<table border=1 cellpadding=3 cellspacing=1 width=\"100%\">";


could be replaced with

this one :

Code: [Select]

$new_image_category = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";


and this part of the code :

Quote

$new_image_category .= "<tr><td>


could be replaced

with this one :

Code: [Select]

$new_image_category .= "<tr class=\"head1\"><td>


to maintain the user's presentation and to keep the user's table configuration settings from his ACP - > Settings page. ;)
Title: Re: [Mod] New Images in Category v2
Post by: IzyB on August 02, 2005, 10:38:42 PM
I cannot get this to work because my template's left side is located in my templates header.html because it was a PHPBB template converted to 4images. I have tried everything I can think of to get it to show on the left side in my header.html but nothing works. I can get it to show in home.html but only in the center areas (where categories, whos online, etc. are).

Is there a change I need to make somewhere in this mod so that it will work for me when I add {new_image_cats} to my header.html?
Title: Re: [Mod] New Images in Category v2
Post by: V@no on August 03, 2005, 12:11:31 AM
just move the code in page_header.php above
Code: [Select]
//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
Title: Re: [Mod] New Images in Category v2
Post by: IzyB on August 03, 2005, 12:16:22 AM
Thanks for the reply V@no! Just to clarify so I understand: Move that to my header.html? And then I would add the {new_image_cats} in header.html?

Thanks!
just move the code in page_header.php above
Code: [Select]
//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
Title: Re: [Mod] New Images in Category v2
Post by: V@no on August 03, 2005, 12:25:47 AM
Just to clarify so I understand: Move that to my header.html?
no, move the code you added in includes/page_header.php above
Code: [Select]
//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
and not in header.html template!
Then you should be able use {new_image_cats} tag in header.html template.

P.S. sorry for editing your post, I pressed a wrong button, thought I was writing a reply, when its turned out I edited yours...
Title: Re: [Mod] New Images in Category v2
Post by: IzyB on August 03, 2005, 06:21:15 AM
Thank you so very much V@no!!!! You truly are a life saver! :D At least a saver of my sanity! LOL

But I also have the same problems that everyone else posted about having trouble with the search results. If I click on the Category name, that category does show. But if I click on the number it brings up all new pictures. I double checked and even triple checked with the help of my husband and still nothing. I'll post my 2 bits of code that was told to be changed in the search.php with a few lines before and after to see if there was something like "whitespace" or something going on.

Code: [Select]

if (isset($HTTP_POST_VARS['search_fields'])) {
  $search_fields = trim($HTTP_POST_VARS['search_fields']);
}
else {
  $search_fields = "all";
}
//-----------------------------------------------------
//---Show New Image count in category Mod -------------
//-----------------------------------------------------

if (isset($HTTP_GET_VARS['sub_cat'])) {
 $sub_cat = trim($HTTP_GET_VARS['sub_cat']);
}

if (isset($HTTP_GET_VARS['cat_id'])) {
 $search_cat = intval($HTTP_GET_VARS['cat_id']);
}
else {
$search_cat = (isset($HTTP_POST_VARS['cat_id']) ) ? intval($HTTP_POST_VARS['cat_id']) : 0;
}
//----------------------------------------------------------------------------
//---End of Show New Image count in category Mod -----
//----------------------------------------------------------------------------

$search_cat = (isset($HTTP_POST_VARS['cat_id']) ) ? intval($HTTP_POST_VARS['cat_id']) : 0;





Code: [Select]

if (!empty($search_id['search_cat']) && $search_id['search_cat'] != 0) {
    $cat_id_sql = 0;
    $sub_cat_ids = get_subcat_ids($search_id['search_cat'], $search_id['search_cat'], $cat_parent_cache);
     if (check_permission("auth_viewcat", $search_id['search_cat'])) {
      $cat_id_sql .= ", ".$search_id['search_cat'];
      if ($sub_cat != "no") { // Show New Image count in category Mod
      if (!empty($sub_cat_ids[$search_id['search_cat']])) {
        foreach ($sub_cat_ids[$search_id['search_cat']] as $val) {
          if (check_permission("auth_viewcat", $val)) {
            $cat_id_sql .= ", ".$val;
          }
        }
      }
    }  // Show New Image count in category Mod
  }
}
  else {
    $cat_id_sql = get_auth_cat_sql("auth_viewcat");
  }




Also, (sorry  :oops:), how to I go about adding the Title (New Images Added, etc.) to the top like it is for Random Images (screen shot attached). And how do I make it so that the number of the new images stays where they are, but move back the category names so they are more to the left?

Thank you so much!!
Title: Re: [Mod] New Images in Category v2
Post by: IzyB on August 03, 2005, 11:05:52 PM
I was able to fix the search issue:) I'll share what I found specifically for those that may have trouble like I did. As "Legendary" mentioned, there was an extra line of code floating around. This is what you need to delete AFTER End of Show New Image count in category Mod.

Code: [Select]

$search_cat = (isset($HTTP_POST_VARS['cat_id']) ) ? intval($HTTP_POST_VARS['cat_id']) : 0;



I hope this helps others:)


But I still need help on adding the Title (New Images Added, etc.) to the top like it is for Random Images and how to make it so that the number of the new images stays where they are, but move back the category names so they are more to the left. Anyone?
Title: Re: [Mod] New Images in Category v2
Post by: IzyB on August 04, 2005, 03:59:48 AM
Nevermind:) I was able to figure out everything on my own :D
Title: Re: [Mod] New Images in Category v2
Post by: Nasser on October 31, 2005, 07:15:21 PM
what if I want the numbers of then new images to lead to only the user's new images not all new images ?
is it posible to do so ? how ?
Title: Re: [Mod] New Images in Category v2
Post by: V@no on November 01, 2005, 12:10:26 AM
User's new images? what does it have to do with this mod?
Title: Re: [Mod] New Images in Category v2
Post by: Nasser on November 01, 2005, 01:45:23 AM
I meant  for that category not for all category .. that's when I click the number
Title: Re: [Mod] New Images in Category v2
Post by: V@no on November 01, 2005, 02:07:23 AM
If you installed this mod properly, that's how it would be.
Title: Re: [Mod] New Images in Category v2
Post by: Nasser on November 01, 2005, 04:12:50 PM
If you installed this mod properly, that's how it would be.

yes .. I take this solution :
I was able to fix the search issue:) I'll share what I found specifically for those that may have trouble like I did. As "Legendary" mentioned, there was an extra line of code floating around. This is what you need to delete AFTER End of Show New Image count in category Mod.

Code: [Select]

$search_cat = (isset($HTTP_POST_VARS['cat_id']) ) ? intval($HTTP_POST_VARS['cat_id']) : 0;



I hope this helps others:)


But I still need help on adding the Title (New Images Added, etc.) to the top like it is for Random Images and how to make it so that the number of the new images stays where they are, but move back the category names so they are more to the left. Anyone?

thanks for both .. it's working now
Title: Re: [Mod] New Images in Category v2
Post by: Bear on November 01, 2005, 11:33:53 PM
SORTED 8)
[moved the script up on page_header seamed to work for me.]

just got to get the title heading to sorted now  :roll:
Title: Re: [Mod] New Images in Category v2
Post by: ivan on November 08, 2005, 11:56:59 AM
hello, has the problem that the categories are not sorted "a-z"!
how can I reach that?

example left side "Letzte 45 Tage" on http://www.bildergallery.com

Greetz ivan
Title: Re: [Mod] New Images in Category v2
Post by: Acidgod on November 08, 2005, 12:06:55 PM
Sorry ich antworte wieder in deutsch... (o:

Der zeigt dir nur die letzte xx Bilder an und diese halt nach upload datum sortiert und ein umsotieren ist hier nicht vorgesehen... (o:
Title: Re: [Mod] New Images in Category v2
Post by: ivan on November 08, 2005, 12:27:14 PM
danke für dein mail

hier meine gallery

(http://www.igraf.ch/catmy.gif)

foto kocher

(http://www.igraf.ch/catorig.gif)

wie kann man dies ändern? meinst du ist dies zufall?

gruss ivan


http://www.bildergallery.com
Title: Re: [Mod] New Images in Category v2
Post by: Acidgod on November 08, 2005, 12:31:56 PM
wie schon gesagt, das aktuellste Bild wird oben angezeigt, mehr gesagt die Kategorie in welches es hochgeladen wurde.

wirst du jetzt ein bild in eine andere kategorie uploaden wird diese ganz oben stehen und das lässt sich mit diesen Mod nicht ändern... )o:
Title: Re: [Mod] New Images in Category v2
Post by: ivan on November 08, 2005, 12:39:37 PM
hallo acidgod,

gehe mal auf diese seite http://www.foto-kocher.com/sitemap.php

scheinbar ist alles schön sortiert, habe die bilder angeklickt...

1. cat / bild 31.12.2005
2. cat / bild 27.10.2005
3. cat / bild 31.10.2005

gruss
Title: Re: [Mod] New Images in Category v2
Post by: Acidgod on November 08, 2005, 01:04:20 PM
öffne global.php und suche:

 $sql = "SELECT cat_id, COUNT(image_id) AS new_images
          FROM ".IMAGES_TABLE."
          WHERE image_active = 1 AND image_date >= $new_cutoff
          GROUP BY cat_id";
  $result = $site_db->query($sql);

 Und dort wird man die sortierung vornehmen müssen... Ist aber nur eine Vermutung und ich weiss nicht welche Auswirkungen es auf die restlichen Funktionen hat...

Frage Vincent doch am besten mal...
Title: Re: [Mod] New Images in Category v2
Post by: Vincent on November 08, 2005, 02:22:35 PM
@bildergallery

wie ich sehe ist deine Liste auf der linken seite auch sortiert alphabetisch.

gruss
vincent
Title: Re: [Mod] New Images in Category v2
Post by: Acidgod on November 08, 2005, 03:49:05 PM
@Vincent
Zähle mir mal bitte das alphabet auf...

A, N, S, C... *g*

Es ging nicht um die Kategorien sondern um die "letzte 45 tage" box.. (o:

Oder bin ich jetzt schon völlig durch und peile nichts mehr...
Title: Re: [Mod] New Images in Category v2
Post by: ivan on November 08, 2005, 08:54:11 PM
hallo vincent und acidgod,

sorry mit meinen komisch fehlern.... ist seid immer so lieb und hilft mir  :lol:
probiere meist selber rum aber wenn ich nicht mehr weiter weiss, bin ich froh um rat und tat!

das andere habe ich schon gelöst, kategorien werden schon sortiert, dass andere problem
ist "letzte 45 tage". komische sache, vielleicht wisst ihr weiter..

gruss ivan

Title: Re: [Mod] New Images in Category v2
Post by: Vincent on November 08, 2005, 10:21:56 PM
@acidgod
ok unterdessen hab auch ich verstanden worum es geht  :oops:
gruss
vincent

Title: Re: [Mod] New Images in Category v2
Post by: ivan on December 11, 2005, 05:03:29 PM
hallo, ich hätte noch einen kleinen wunsch für diesen mod.
wie kann ich die zahlen rechtsbündig machen (siehe bild)

danke für die hilfe
Title: Re: [Mod] New Images in Category v2
Post by: Acidgod on December 11, 2005, 05:09:44 PM
Code: [Select]
foreach ($new_image_cache as $key => $val) {
    if ($val && check_permission("auth_viewcat", $key)) {
    $category_link = "<a href=\"".$site_sess->url(ROOT_PATH."search.php?search_new_images=1&cat_id=".$key."&sub_cat=no")."\">".$val."</a>";
    $new_image_category .= "<tr><td><a href=\"".$site_sess->url(ROOT_PATH."categories.php?cat_id=".$cat_cache[$key]['cat_id'])."\">".$cat_cache[$key]['cat_name']."</a></td><td><b>".$category_link."</b></td></tr>";
  }
}

Dort in der page_header.php an dieser stelle (<td><b>".$category_link."</b></td>) dein align im TD Tag definieren...
Title: Re: [Mod] New Images in Category v2
Post by: ivan on December 11, 2005, 05:58:26 PM
falls dies jemand ab ändern möchte

so müsste es aussehen:

$new_image_category .= "<tr><td><a href=\"".$site_sess->url(ROOT_PATH."categories.php?cat_id=".$cat_cache[$key]['cat_id'])."\">".$cat_cache[$key]['cat_name']."
</a></td><td align=right><b>".$category_link."</b></td></tr>"
Title: Re: [Mod] New Images in Category v2
Post by: Loda on January 16, 2006, 03:12:03 PM
hallo!
ich hätte da auch einen wunsch:
ich möchte gerne ein kategorie-image angezeigt bekommen. hat jemand eine idee für mich?
Title: Re: [Mod] New Images in Category v2
Post by: Alanmelon on January 18, 2006, 03:37:41 PM
Is it possible to modify this to display the new category and its immediate parent category in the display box?  E.g. Family Photos > Dad. If so, can anyone recommend how?
Title: Re: [Mod] New Images in Category v2
Post by: ivan on December 27, 2006, 09:44:22 PM
hallo zusammen,
gibt es eine möglichkeit, wenn keine neuen bilder da sind,
eine entsprechende meldung wie

$lang['no_new_images']

ausgegeben wird?

gruss ivan


Title: Re: [Mod] New Images in Category v2
Post by: ivan on January 25, 2007, 07:32:37 PM
hallo zusammen,

Dieser Mod läuft bei mir "Letzte 45 Tage neu" auf der linken Navigations Seite.
Nun grundsätzlich funktioniert der Mod aber wenn ich die Zahl "Anzahl Bilder" Anklicke
wechselt es in den Suchmodus, anschliessen klicke ich auf 30 Bilder Anzeigen und
da wird lustiger weise "Die Suche ergab leider keine Treffer." angezeigt.

wie kann ich dies unterbinden, bei der normalen suche / auch erweiterter modus
wird dies korrekt angezeigt!



Title: Re: [Mod] New Images in Category v2
Post by: shadowhunter on February 21, 2008, 09:40:55 PM
Hallo!

Ich habe das selbe Problem wie Ivan. Ich finde es zwar nicht allzu schlimm, ist aber einen Fehler.
Quote
Nun grundsätzlich funktioniert der Mod aber wenn ich die Zahl "Anzahl Bilder" Anklicke
wechselt es in den Suchmodus, anschliessen klicke ich auf 30 Bilder Anzeigen und
da wird lustiger weise "Die Suche ergab leider keine Treffer." angezeigt.

Wie können die Kategorien anderst als cat_id sortiert werden?
Ich möchte gerne die Kategorie zu oberst haben mit den allerneusten Bilder (Sortierung wie bei den Bilder: image_date DESC).
Ist dies überhaupt möglich?

Vielen Dank im Voraus.
Grüsse Jones
Title: Re: [Mod] New Images in Category v2
Post by: nobby on February 21, 2008, 09:45:46 PM
Hallo,

kann das was für Dich sein  :arrow: http://www.4homepages.de/forum/index.php?topic=4312.0

nobby
Title: Re: [Mod] New Images in Category v2
Post by: shadowhunter on February 21, 2008, 10:05:53 PM
Hallo

Danke für deine prompte Antwort.

Ich glaube eher weniger, da ich nicht alle Kategorien anderst ordnen möchte, sondern nur bei dieser Anzeige der Kategorien von diesem MOD.
Demfall eher unwahrscheindlich, dass es gehen würde.

Gruss
Title: Re: [Mod] New Images in Category v2
Post by: nobby on February 21, 2008, 10:07:30 PM
Ja, hier war mal was mit Sortierung von Kategorien.

Schade das es Dir nicht Hilft.
Title: Re: [Mod] New Images in Category v2
Post by: praveen on May 02, 2009, 08:50:38 AM
Thanks for this nice mod. been looking for it.

one question, how do i get the recently updated category to the top. right now it shows in the bottom of the list.
Title: Re: [Mod] New Images in Category v2
Post by: 4ella on May 29, 2009, 10:24:38 PM
Do somebody know if it is  hard to set up this Mod for only 1 or 2 categories and their subcategories - not for all for them ? I want only to show the info  from one - two categories and their subcats . Like this I have 40cm long list in sidebar with many not very interesting cats , or if their is some possibility to reduce - days , number of cats etc . I didnt find anything for reduce - for example only for last 5 days . Thanks Daniel , otherwise easy to install and I think that also useful .
Title: Re: [Mod] New Images in Category v2
Post by: surferboy on April 23, 2010, 07:05:42 PM
Hi -

Using v1.7.7

Got this MOD installed and working great except for one issue: an error message on the second and additional search pages:

Notice: Undefined variable: sub_cat in /home1/glxxxx/public_html/ouragallery/search.php  on line 220

Here is line 220 from search.php file:

if ($sub_cat != "no") {          // Show New Image count in category Mod

which is directly from this MOD

How do I see this error?

I click on the number of new images in a given particular category. In this case, it was 48 images. The result is the search page that presents 48 images, and I have it set to show 18 images per page. First page is fine. However, if I click on page 2 or page 3, the above error displays above the header.

Here is the url that is associated with page 3:
http://www.gxxx.info/ouragallery/search.php?show_result=1&page=3

Anyone else experience this? Got any ideas how to fix this?

Thanks,

Brian
Title: Re: [Mod] New Images in Category v2
Post by: V@no on April 24, 2010, 02:08:57 AM
The code on first page is fixed now.

In search.php find:
if (isset($HTTP_GET_VARS['sub_cat'])) {
  $sub_cat = trim($HTTP_GET_VARS['sub_cat']);
}


Insert below:
else
{
  $sub_cat = isset($HTTP_POST_VARS['sub_cat']) ? trim($HTTP_POST_VARS['sub_cat']) : 1;
}
Title: Re: [Mod] New Images in Category v2
Post by: surferboy on April 25, 2010, 02:27:04 AM
Hi -

Thanks for the quick solution. Made the code changes and badda bing, everything is working perfectly.

Brian