Image-Rollover/Bilderwechsel - Hack

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
breitsch
Posts: 473
Joined: Sun 6. Mar 2005, 23:12
Location: bern switzerland

Image-Rollover/Bilderwechsel - Hack

Post 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>
http://www.youtube.com/watch?v=jqxENMKaeCU
because it's important!
breitsch
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Post 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!!!
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Post 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:
breitsch
Posts: 473
Joined: Sun 6. Mar 2005, 23:12
Location: bern switzerland

Post by breitsch »

strange

never had this problem

imagepath?
does the rollovereffect work without the hack?
http://www.youtube.com/watch?v=jqxENMKaeCU
because it's important!
breitsch
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Post by pepe »

Never tried.... :cry:
But will do in the next minutes!
Call back tomorrow, OK?
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Post 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:
User avatar
oeconom
Posts: 337
Joined: Fri 13. May 2005, 09:33
Location: Stuttgart
Contact:

Post 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
...alles wird gut!
still alive...
Experimenting with phpwcms and hoping to have time one day to get a site live... :wink:
One Site finished! :P
alois
Posts: 5
Joined: Wed 29. Mar 2006, 08:43

Re: Image-Rollover/Bilderwechsel - Hack

Post 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
alois
Posts: 5
Joined: Wed 29. Mar 2006, 08:43

Ziemlich alleine gelassen...

Post by alois »

Schade.. keine Antwort und keine Reaktion..
Ich nehme somit meine Bitte zurück.
Alois
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Post 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
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
alois
Posts: 5
Joined: Wed 29. Mar 2006, 08:43

Post 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
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Post 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
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
joscha
Posts: 19
Joined: Mon 22. Nov 2004, 13:32
Location: Magdeburg
Contact:

still works with 1.3.3

Post 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
Post Reply