General Community > Off-Topic

PHP help!!!!

<< < (3/3)

mr-fan:
hi,
is a kind of lightbox for the logo's a poissibility?

you want such logos like on this site http://www.wijnhandel-peeters.com/peeters/nederlands/assortiment/champagne.php

for all producers? right...you've these logos right?

so i think you must "link" this producers with the logos in every way.... :roll:

so you can use a lightbox script set a link on every producer to the picture and ready - or use the .txt file from pcwacht to reorder the whole content together with pics

regards martin

pcwacht:
hmmm,
I am thinking of a droplet wich creates the link (javascript like the code for henc.nl)

Something like:
scan for producer name -> change producer name wicth appropriete javascript code
so in a droplet:


--- Code: ---// Need some wb variables, make them available
global $wb;    

// $wb_page_data holds the output of the current page
// Search for producername and replace it
$producer_name[1] = 'name_of_producer1';
$producer_picture[1] = 'picture_of_producer1.jpg';
$producer_name[2] = 'name_of_producer2';
$producer_picture[2] = 'picture_of_producer2.jpg';

// Here the code starts:
$arr_size=count($producer_name);
for($i=1;$i<$arr_size;$i++) {
    $js_picture ='<a href="javascript:popUp('.$width.','.$height.',';
    $js_picture .= WB_URL."/media/producers/'$producer_picture[$i]'";
    $js_picture .= ')" ><img src="'.WB_URL."/media/producers/'$producer_picture[$i]'".'" width=80 heigth=60 border=0 alt="'.$producer_name[$i].'"></a>';
    $wb_page_data = str_replace("producer_name[$i]", $js_picture, $wb_page_data);
}
// Since the output was directly altered we don't have something to return
// But we must return at least TRUE!
return TRUE;

--- End code ---

Mind you, I didn't tested the code so don't know if I made a typo somewhere, but I am sure it will give you enough to get you started.

Allso the useage of droplets to manipulate the page output is once again good demonstrated.

Have fun,
John

D. Peeters:
Thanks!

pcwacht:
And here the javascript wich I used:


--- Code: ---<script language="JavaScript">
<!--
function popUp(w,h,site) {
  x = screen.availWidth/2-w/2;
  y = screen.availHeight/2-h/2;
  newWin=void(window.open(site,'','resizable=1,width='+w+',height='+h+',top='+y+',left='+x));
}
//-->
</script>
--- End code ---

Put this somewhere in your header ;)

John

Navigation

[0] Message Index

[*] Previous page

Go to full version