Author Topic: [Mod] Verschiedene thumbnail_bit Templates  (Read 45421 times)

0 Members and 1 Guest are viewing this topic.

Offline 0711concept

  • Newbie
  • *
  • Posts: 22
    • View Profile
[Mod] Verschiedene thumbnail_bit Templates
« on: October 12, 2002, 03:03:23 PM »
Wie man verschiedene Templates für Kategorien verwendet hat Jan schon bestens in seinem Mod beschrieben :D :
http://www.4homepages.de/forum/viewtopic.php?t=1847
Mir war es wichtig die thumbnail_bit Datei in verschiedenen Kategorien anders darzustellen und habe das Mod erweitert: :wink:

This mod allows you to use different thumbnail templates. Templates will be inherited on subcategories.
----
Diese Modifikation erlaubt es, verschiedene Thumbnail-Templates für Kategorien zu verwenden. Dabei wird ein Template auf seine Unterkategorien vererbt.

Installation:

1. Open "includes/functions.php" and add after:
Code:
Code: [Select]
if (!defined('ROOT_PATH')) {
  die("Security violation");
}
this code:
Code:
Code: [Select]
function get_cat_template($tpl_name, $cat_id = 0) {
  global $cat_cache;
  if (!$cat_id) {
    $new_tpl_name = $tpl_name;
  }
  elseif (file_exists(TEMPLATE_PATH."/".$tpl_name."_".$cat_id.".html")) {
    $new_tpl_name = $tpl_name."_".$cat_id;
  }
  else {
    $new_tpl_name = get_cat_template($tpl_name, $cat_cache[$cat_id]['cat_parent_id']);
  }
  return $new_tpl_name;
}

2. Search in  "categories.php" :
Code: [Select]
$main_template = 'categories';
and insert below:
Code: [Select]
$thumb_art= 'thumbnail_bit';

3. Open "categories.php" and replace:
Code: [Select]
$thumbnails .= $site_template->parse_template("thumbnail_bit");
with this code:
Code:
Code: [Select]
$thumbnails_neu= get_cat_template($thumb_art, $cat_id);
$thumbnails .= $site_template->parse_template($thumbnails_neu);


4. Create a new thumbnail-template for a specific category (you may duplicate "thumbnail_bit" and modify it) and save it under this name:
Code:
Code: [Select]
thumbnail_bit_<cat_id>.html
Replace <cat_id> with id of the category.
This category and all subcategories will now use this template.

Hoffe ich habe nichts vergessen. Bitte um kurzes Feetback.

By the way: wirklich gutes script.

0711concept
« Last Edit: August 31, 2012, 04:53:58 PM by Rembrandt »

Offline k4nth

  • Newbie
  • *
  • Posts: 28
    • View Profile
[Mod] Verschiedene thumbnail_bit Templates
« Reply #1 on: February 05, 2003, 05:34:45 AM »
Template Error: Couldn't open Template ./templates/default/thumbnail_bit_8.html

2. Open "categories.php" and change on top:
Code:
$templates_used = 'categories,category_bit,thumbnail_bit,thumbnail_bit_8,home,whos_online';
$main_template = 'categories';
$thumb_art= 'thumbnail_bit';

change to

$templates_used = 'categories,category_bit,thumbnail_bit,home,whos_online';
$main_template = 'categories';
$thumb_art= 'thumbnail_bit';

when i remove the 'thumbnail_bit_8' it works properly. will it affect anything?

Offline ruudvroon

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AFTERTHEPARTY.NL
Re: [Mod] Verschiedene thumbnail_bit Templates
« Reply #2 on: April 05, 2005, 03:01:25 PM »
Is it also possible to show only one tumbnail on a row?
And make more rows per page.

I know I can change that in the admin panel, but I want it only for a few cats

Offline graficalicus

  • Full Member
  • ***
  • Posts: 235
    • View Profile
Re: [Mod] Verschiedene thumbnail_bit Templates
« Reply #3 on: May 05, 2005, 05:15:12 PM »
this works well - but I have a question -

I'd like to use this MOD on thumbnails wherever they appear in the site for certain categories - in random images, new images, top images, etc. - sort of like:

Code: [Select]
if this image is in this category or any sub-category, use this thumbnail_bit template;
if this image is in any other category, use the regular template

Basically, I'm trying to hide uploader's username for certain cats - - -

thanks in advance... :?

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] Verschiedene thumbnail_bit Templates
« Reply #4 on: July 02, 2005, 04:45:56 PM »
seems like u've installed another mod (the one that mentioned on top of this mod description) that also has get_cat_template function
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 Marion

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • Tubes'n Art 4you
Re: [Mod] Verschiedene thumbnail_bit Templates
« Reply #5 on: September 23, 2005, 11:39:12 AM »
Hallo :)

Gibt es eine Möglichkeit den Mod von Jan für die unterschiedlichen Kategorie-Templates mit den unterschiedlichen Thumbnail_bits zu kombinieren ?

Is there any possibilty to combine Jan's categorie templates mod with this thumbnail_bits mod ?

As soon as I insert respectively change this code
Sobald ich
Quote
with this code:

Code:
$thumbnails_neu= get_cat_template($thumb_art, $cat_id);
$thumbnails .= $site_template->parse_template("$thumbnails_neu");

to categories.php
in die categories.php einfüge bzw. den vorhandenen Code

Quote
$thumbnails .= $site_template->parse_template("thumbnail_bit");

ersetze, funktioniert die Zuweisung von unterschiedlichen Kategorie-Templates nicht mehr und alle Kategorien sehen wieder gleich aus   :?
Benutze 4images 1.7.1

all changes in categories.html's are gone and they look equal again.

Marion

Michael

  • Guest
Re: [Mod] Verschiedene thumbnail_bit Templates
« Reply #6 on: November 04, 2005, 10:30:06 PM »
Hallo,

ein super Mod aber wieso wird die veränderte thumbnail_bit nicht auch bei den neuen Bildern angezeigt,
dort wird immer noch die alte thumbnail_bit angezeigt, in der entsprechenden Kategorie wird es allerdings richtig angezeigt!

Gruß, Michael

Michael

  • Guest
Re: [Mod] Verschiedene thumbnail_bit Templates
« Reply #7 on: November 07, 2005, 08:03:26 PM »
hat keiner eine Antwort da drauf  :?:

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [Mod] Verschiedene thumbnail_bit Templates
« Reply #8 on: November 07, 2005, 09:19:16 PM »
Ich denke das dieser Mod nur für die Kategorien ist und nicht für die Startseite... (o:

Wenn Du das ändern willst dann ändere doch gleich die orginal thumbnail_bit...

Michael

  • Guest
Re: [Mod] Verschiedene thumbnail_bit Templates
« Reply #9 on: November 07, 2005, 10:32:45 PM »
Ich denke das dieser Mod nur für die Kategorien ist und nicht für die Startseite... (o:

Wenn Du das ändern willst dann ändere doch gleich die orginal thumbnail_bit...

Dann gilt das ja für alle Kategorien, ich möchte aber nur bestimmte Kategorien so eingestellt haben.
Sinn macht das ganze zum Beispiel bei einem Wettbewerb.

Gruß, Michael

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [Mod] Verschiedene thumbnail_bit Templates
« Reply #10 on: November 07, 2005, 10:34:31 PM »
Ich weiss ehrlich gesagt nicht 100% was dieser Mod macht, kann ich mir das mal bei Dir anschauen?

Michael

  • Guest
Re: [Mod] Verschiedene thumbnail_bit Templates
« Reply #11 on: November 07, 2005, 10:53:50 PM »
Den Mod habe ich eingebaut aber noch nicht aktiviert da es mit der Thumb_bit noch nicht hinhaut.

Das ganze arbeitet wie folgt:

Man erstellt eine oder auch mehrere zusätzliche details_(cat_id).html und thumbnail_bit_(cat_id).html.
Beim Aufruf eines Bildes wird dann bei mir weder ein Username noch eine Bewertung sowie Exif angezeigt, eben nur das was man braucht.
Das Thumbnail in der Kategorie wird dann genauso wenig anzeigen, Problem ist aber das auf der Hauptseite immer noch "alles" angezeigt wird.

Gruß, Michael

Offline Chicco

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • The Picture World
Re: [Mod] Verschiedene thumbnail_bit Templates
« Reply #12 on: January 23, 2006, 11:54:04 AM »
HI. Genau das gleiche Problem habe ich nu auch bei der Startseite. Hat dies nun jemand hinbekommen bzw. weiss wie man es auch auf der Startseite machen kann?


Wissen ist MACHT! Nix zu wissen macht aber auch nix! ;-)

Gruß
Ch¿cco

Offline atornaya

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [Mod] Verschiedene thumbnail_bit Templates
« Reply #13 on: May 19, 2006, 12:37:26 PM »
Wie man verschiedene Templates für (member_uploadform.html )
machen kann :?:

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: [Mod] Verschiedene thumbnail_bit Templates
« Reply #14 on: June 05, 2007, 09:51:27 PM »
How would you go about changing the thumbnail_bit for the new images on the home page?

I assume what i have to change is this in the index.php

Code: [Select]
$new_images .= $site_template->parse_template("thumbnail_bit");
but everything i have tried so far hasnt worked.

thanks for the help
« Last Edit: June 05, 2007, 10:01:30 PM by impss »