4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: alvaro0022 on January 30, 2011, 08:58:21 AM

Title: [Mod] Display Images from the subcategory in the main category
Post by: alvaro0022 on January 30, 2011, 08:58:21 AM
Hello;

View images the subcategory in the Main category?

how to do this?
Title: Re: Display Images from the subcategory in the main category
Post by: Rembrandt on January 30, 2011, 10:39:10 AM
Hi!

1.) search in categories.php:
$additional_sql .= ", i.".$key;
  }
}
insert below:
if(!empty($cat_parent_cache[$cat_id])){
$sub_cat_numbers = "AND i.cat_id in($cat_id,".implode(',', $cat_parent_cache[$cat_id]).")";
}else{
$sub_cat_numbers = "AND i.cat_id = $cat_id";
}


2.) search:
AND i.cat_id = $cat_id
and replace:
$sub_cat_numbers

3.) search:

"msg" => $msg,

insert above:

"cat_name" => format_text($cat_cache[$cat_id]['cat_name'], 2),


mfg Andi
Title: Re: Display Images from the subcategory in the main category
Post by: alvaro0022 on January 31, 2011, 12:36:26 AM
Thanks for responding

does not work!

not find

AND i.cat_id = $cat_id

WHERE i.image_active = 1 AND i.cat_id = $cat_id AND c.cat_id = i.cat_id

That must change?
Title: Re: Display Images from the subcategory in the main category
Post by: Rembrandt on January 31, 2011, 04:30:21 AM
that:
WHERE i.image_active = 1 AND i.cat_id = $cat_id AND c.cat_id = i.cat_id
Title: Re: Display Images from the subcategory in the main category
Post by: alvaro0022 on January 31, 2011, 05:12:06 AM
I change this so?

$sub_cat_numbers
Title: Re: Display Images from the subcategory in the main category
Post by: Rembrandt on January 31, 2011, 05:14:38 AM
I change this so?

$sub_cat_numbers

??? yes...
Title: Re: Display Images from the subcategory in the main category
Post by: alvaro0022 on January 31, 2011, 05:19:31 AM
this error :

Parse error: syntax error, unexpected $end in /home/jueggaco/public_html/juegga/categories.php on line 215
Title: Re: Display Images from the subcategory in the main category
Post by: Rembrandt on January 31, 2011, 05:25:23 AM
sry, i forgot a "}"

this is the correct code:
if(!empty($cat_parent_cache[$cat_id])){
$sub_cat_numbers = "AND i.cat_id in($cat_id,".implode(',', $cat_parent_cache[$cat_id]).")";
}else{
$sub_cat_numbers = "AND i.cat_id = $cat_id";
}
Title: Re: Display Images from the subcategory in the main category
Post by: alvaro0022 on January 31, 2011, 05:41:23 AM
GENIUS!!!!!!

THANKS!!!!!!
Title: Re: Display Images from the subcategory in the main category
Post by: dmitrijjuy on April 01, 2012, 03:04:21 AM
Hello, Rembrandt!

Can you tell me how to do that in the main category {cat_name} display its name, but not the name subcategory of image at the bottom of the page?
For example, if the name of the main category "Nature"... is displayed "Landscapes" (the name of subcategory of the lower image at the bottom of the page).

Can anyone help me?
I am using version 1.7.10

And since this mod is very-very good!
Title: Re: Display Images from the subcategory in the main category
Post by: Rembrandt on April 01, 2012, 10:36:13 AM
Welcome to the Forum!

...For example, if the name of the main category "Nature"... is displayed "Landscapes" (the name of subcategory of the lower image at the bottom of the page).
...

search in categories.php:

"msg" => $msg,

insert above:

"cat_name" => format_text($cat_cache[$cat_id]['cat_name'], 2),


mfg Andi
Title: Re: Display Images from the subcategory in the main category
Post by: dmitrijjuy on April 01, 2012, 05:05:04 PM
Thank you so much!  :D
Title: Re: [Mod] Display Images from the subcategory in the main category
Post by: benef4u on July 19, 2012, 10:11:48 AM
i use this mod with [Mod] Same Image in multiple Categories http://www.4homepages.de/forum/index.php?topic=27570.0 (http://www.4homepages.de/forum/index.php?topic=27570.0)
and now images are not displayed when Multi Cat is active  (original cat = images displayed)
if you can do something for , that will be awesome !
Title: Re: [Mod] Display Images from the subcategory in the main category
Post by: Rembrandt on July 19, 2012, 02:49:05 PM
...
it works for me, but "multicat" images in  subcategories  not displayed in a main categories, only Original Images from subcategories displayed in a main categories.

mfg Andi
Title: Re: [Mod] Display Images from the subcategory in the main category
Post by: JoBi on December 13, 2012, 08:41:36 PM
Hallo Andi! Danke erstmal für den genialen MOD. Hab's heute installiert! Ich hab zwei Fragen dazu

1. So wie ich das sehe wird nur eine Kategorie unter der hauptkategorie angezeigt (z.B Hauptkategorie ist Sport und die erste Unterkategorie ist Fußball ). wenn ich also Sagen wir in Fußball noch eine Unterkategorie für die jeweilige Spielpaarung (z. B. Austria Wien - Rapid Wien)  anlegen würde, würde es die Bilder erst nach Klick auf Fußball anzeigen und nicht schon nach Klick auf Sport ! Stimmt ja oder???

Meine Kategoriestruktur sieht so aus: Hauptkategorie Sport ----> Unterkategorie Fussball ----> Unterunterkategorie Bundesliga ----> Unterunterunterkategorie Rapid Wien - Austria Wien

Also quasi 3 Unterkategorien unter der Hauptkategorie. Könnte man also die Bilder der 3 Spielpaarung auch schon nach Klick auf die Hauptkategorie oder die Unterkategorie (in meinem Fall Fußball) anzeigen lassen.

2. Wäre es möglich nicht die einzelnen Bilder darzustellen sondern wie in deinem Mod Neueste Kategorien auf der Startseite auch die ganze. Kategorien zu zeigen

Hoffe ich hab's halbwegs verständlich geschrieben !!!

Über eine Antwort wùrde ich mich sehr freuen

VG
Josef
Title: Re: [Mod] Display Images from the subcategory in the main category
Post by: Rembrandt on December 20, 2012, 07:15:02 AM
Hi!
.... Könnte man also die Bilder der 3 Spielpaarung auch schon nach Klick auf die Hauptkategorie ...anzeigen lassen.
...

Schritt 1.) in diesen Mod ersetze mit diesem:

if(!empty($cat_parent_cache[$cat_id])){
  $subcat_ids = array();
  get_subcat_ids($cat_id, $cat_id, $cat_parent_cache);
  $sub_cat_numbers = "AND i.cat_id in(".implode(',', $subcat_ids[$cat_id]).")";
}else{
  $sub_cat_numbers = "AND i.cat_id = $cat_id";
}


mfg Andi
Title: Re: [Mod] Display Images from the subcategory in the main category
Post by: Allround on December 22, 2012, 11:50:13 AM
Hallo Rembrand

Kannst du auch die Seitenauswahl "{paging}" dazu fügen? Es zeigt nur die Anzahl an die man als Anzahl der Bilder pro Seite in den Kategorien eingestellt hat.
Und über den Bilder hätte ich gern Platzhalter für Text. Zum beispiel:  Top Bilder aus den aus den Unterkategorien oder wenn {paging} dazugefügt ist etc. damit die Leute wissen warum unter den Sub Kategorien die Bilder sind.
Title: Re: [Mod] Display Images from the subcategory in the main category
Post by: Rembrandt on December 22, 2012, 03:28:51 PM
jetzt wirds kompliziert :)

1.) entferne schritt 1.) aus diesen Mod

2.) suche in der categories.php:

$num_rows_all = (isset($cat_cache[$cat_id]['num_images'])) ? $cat_cache[$cat_id]['num_images'] : 0;

füge darüber ein:

$sum_images = 0;
if(!empty($cat_parent_cache[$cat_id])){
  $subcat_ids = array();
  get_subcat_ids($cat_id, $cat_id, $cat_parent_cache);
  
  foreach($subcat_ids[$cat_id] as $val){
    $sum_images += $cat_cache[$val]['num_images'];
  }
  
  $sub_cat_numbers = "AND i.cat_id in(".implode(',', $subcat_ids[$cat_id]).")";
}else{
  $sub_cat_numbers = "AND i.cat_id = $cat_id";
}

suche:

$num_rows_all = (isset($cat_cache[$cat_id]['num_images'])) ? $cat_cache[$cat_id]['num_images'] : 0;

und ersetze es mit:

$num_rows_all = (isset($cat_cache[$cat_id]['num_images'])) ? $cat_cache[$cat_id]['num_images'] + $sum_images : 0;


mfg Andi
Title: Re: [Mod] Display Images from the subcategory in the main category
Post by: Allround on December 22, 2012, 04:37:58 PM
Danke :-)

Fehlt nur noch der Platzhalter für die Überschrift. Zum Beispiel: Alle Bilder im Überblick..
Kann man den in die PHP einbauen