Page 1 of 1

Image-Rollover/Bilderwechsel - Hack

Posted: Tue 1. Aug 2006, 17:32
by breitsch
Hi

for one of my clients I had to change the image-rollover contentpart
the requirements where:

- fix the thumbnail size (so it won't be automatically sized depending on how many image you place in)
- make the thumbs square-sized - to avoid the portrait/landscape sizes
- have a possibility to decide in backend in how many columns the thumbs are placed

I hacked the code (1.2.6) and added a new function who cuts the tumbs in squares. The thumbs are placed in a new folder on the web server.

Example: http://www.forum-a.ch/index.php?id=39,60,0,0,1,0
or http://www.loosli-kuechen.ch/index.php?zubehoer


That's what you have to do:

Step 1
Download the hacked files from: http://web.casa-loca.com/index.php?downloadexdata
user: image
pwd: phpwcms

the zip contains 3 files:
include/inc_front/content/cnt50.article.inc.php
include/inc_lib/content/cnt50.readform.inc.php
include/inc_lib/content/cnt50.makesquare.inc.php (that one is new)

unzip the files to your installation (always BACKUP the old files!!!)

Step 2
Make a new folder: ROOT/content/reference
chmod 777

Step 3
In Backend, content-part: image rollover

section: small reference images (close to the bottom):

- alignment: must be 'horizontal'
- block w x h: w = number of columns, h = size of the thumbnails (squared so width and height is the same)

Note:
the hack is applied to all image-rollover-contentparts on the site!
to create the squared thumbs (for existing cp's) you have to update the content-part in backend article!

Just in case: the template for the first example is:

Code: Select all

<table border="0" cellpadding="0" cellspacing="0" width="570">
  <tr>
    <td width="400" align="left" valign="top">
      [TITLE]<h3>{TITLE}</h3>[/TITLE]<br />
      [TEXT]{TEXT}[/TEXT]<br /><br /></td>
    <td rowspan="2">{SPACER:47x1}</td>
    <td></td>
  </tr>
  <tr>  
    <td width="400">
      <table border="0" cellpadding="0" cellspacing="0" width="400" height="300">
        <tr>
          <td style="background:#eeeeee;" align="center" valign="middle">[REF]{REF}[/REF]</td>
        </tr>
      </table>
    </td>
    <td align="left" valign="top" style="background:#eeeeee;padding:0px 0px 3px 3px;">{SPACER:1x1}<br />[LIST]{LIST}[/LIST]</td>
  </tr>
</table>

Posted: Tue 1. Aug 2006, 18:25
by pepe
Hi breitsch,

great works.... hope you'll make it fit for 1.2.7 too :wink:

if (phpwcms == 1.2.7) then .....


http://www.forum-a.ch/picture/flash_standbild/3.jpg is broken!!!

Posted: Wed 2. Aug 2006, 00:33
by pepe
Hi breitsch,

now i've tried it in the 1.2.6 too.... no success!

What's the trick? I have done all, what's in the installation. Prooved it 3 times.

All looks good, but: There is no mouseover-effect. The Image on the left always shows the very first image of the list :cry:

Posted: Wed 2. Aug 2006, 01:05
by breitsch
strange

never had this problem

imagepath?
does the rollovereffect work without the hack?

Posted: Wed 2. Aug 2006, 01:22
by pepe
Never tried.... :cry:
But will do in the next minutes!
Call back tomorrow, OK?

Posted: Wed 2. Aug 2006, 12:08
by pepe
breitsch wrote:strange

never had this problem

imagepath?
does the rollovereffect work without the hack?
Verdammte Hacke, da hätte ich jetzt nicht mit gerechnet...

In der 1.2.6, die ich - frisch, kein update - installiert auf meinem lokalen Rechner habe, funktioniert schon die Standard-Version nicht :roll:

Kein Wunder, daß deine Modifikation dann auch nicht läuft!!!

Aber wer sagt mir denn nun, welche Datei defekt sein könnte???
Habe schon das Download 3 mal drübergebügelt :cry:


PS
Bei der Gelegenheit.
Ich drücke mir virtuell immer die Nase platt an den Musterhäusern von Forum A... Nicht nur wegen der sauberen Sitegestaltung!
Traumhaft geradlinige Sachen diese Häuser...
Leider bekommt man für Vieles in Deutschland nicht die Baugenehmigung :cry: (Treppen ohne Handlauf...)

Werde doch wohl in die Alpen ziehen müssen, oder?

[SOLVED]
Habs gefunden... da kamen sich 2 MODs in die Quere... jetzt klappts genau so, wie es soll :lol:

Posted: Fri 30. Mar 2007, 15:53
by oeconom
Hi folks,
can someone assist me with my similar problem?!
I 'only' want to set a fiexed width to my preview/thumbnail images, but I can't figure out where to do so.

I just want to define these thumbs to have a size of 100px, heigth may vary.
Thumbs shall line up vertically in one colum, sized to fit for as many thumbs as there will be.

Thanks for your help!

FELIX

Re: Image-Rollover/Bilderwechsel - Hack

Posted: Tue 12. Jun 2007, 11:35
by alois
Hallo breitsch



Example: http://www.forum-a.ch/index.php?id=39,60,0,0,1,0
or http://www.loosli-kuechen.ch/index.php?zubehoer


Have tried your square-rollover. Thanks. that is what I am searching...

But I loose so much quality on the thumb. http://sidbu.de/thumb.phtml

Can you give any advise?

Alois

Ziemlich alleine gelassen...

Posted: Sun 8. Jul 2007, 16:00
by alois
Schade.. keine Antwort und keine Reaktion..
Ich nehme somit meine Bitte zurück.
Alois

Posted: Sun 8. Jul 2007, 16:45
by flip-flop
Hallo alois,
Schade.. keine Antwort und keine Reaktion..
Ich nehme somit meine Bitte zurück.
Das ist nun ziemlicher Quatsch in meinen Augen. Vielleicht ist "breitsch" im Moment anderweitig beschäftigt oder gar nicht zugegen.

Die Qualität der Thumbs ist von mehreren Faktoren abhängig.
1. Qualität des Ursprungs. (Auf den Seiten von breitsch ist diese recht hoch 290x290px verpackt in 65-70KB)
2. Welches Verfahren wird für die Erzeugung der Thumbs verwendet, ImageMagick oder GD2?
Vermutlich verwendet breitsch ImageMagick, hier gibt es zumindest einige Einstellungsmöglichkeiten. Ist aber nicht auf jedem Server verfügbar.

Knut

Posted: Tue 10. Jul 2007, 06:58
by alois
guten tag Knut

Ja, Du hast sicher recht..
Danke für Deinen Hinweis und auch Deinen Verweis btr. Quatsch. Werde niemals mehr innerhalb von 4 Wochen eine Reaktion oder Hilfe erwarten.

Alois

Posted: Tue 10. Jul 2007, 07:10
by flip-flop
Hallo Alois,

Wenn es eilig ist, dann würde ich den tread nach 2-3 tagen pushen.

Eine Reaktion hast du von mir bekommen, jedoch ist es eigentlich viel Spekulation, denn der einzige der deine Frage wirklich zu 100% beantworten kann ist halt breitsch.
Er hat das letzte Mal am "Sa Jun 16" gepostet ist also im Moment nicht aktiv.
So etwas kann passieren, aus welchen Gründen auch immer.

Knut

still works with 1.3.3

Posted: Fri 26. Oct 2007, 21:36
by joscha
Hi @ll,

i tried the hack with version 1.3.3 and it still works great!!! Thanks for the good work.

Joscha

//----------

Hallo in die Runde,

Ich habe den Hack eben mit der Version 1.3.3 getestet und er funktioniert ohne Probleme.

Joscha