「雫羅」 dara (sashwizzled) wrote in component_help,
「雫羅」 dara
sashwizzled
component_help

  • Mood:

Music/Book/TV components... again

An edit to kunzite1's MBTV component - this will allow you to add a second line detailing, say, album names and such. (This is already in use on my own journal)
All credit to kunzite1 - I'm only leeching from his brain power, after all.


(My alterations are in red)


var string k1Mheader = "XXXXXX";   # title of component

var string k1Mheight = "XXXpx";   # height of component

var Color  k1Mborder = "#000000"; # bordercolor for images



var Color    k1Mbg;

var string[] k1Msrc;

var string[] k1Malt;

var string[] k1Mtitle;

var string[] k1Melse;

var string[] k1Murl;





# set one

$k1Msrc[0]   = "IMAGE SRC";

$k1Malt[0]   = "ALTERNATE TEXT FOR PICTURE";

$k1Mtitle[0] = "ENBOLDENED TITLE";

$k1Melse[0]  = "OPTIONAL ITALICISED SUBTITLE";

$k1Murl[0]   = "OPTIONAL URL";



# set two

$k1Msrc[1]   = "IMAGE SRC";

$k1Malt[1]   = "ALTERNATE TEXT FOR PICTURE";

$k1Mtitle[1] = "ENBOLDENED TITLE";

$k1Melse[1]  = "OPTIONAL ITALICISED SUBTITLE";

$k1Murl[1]   = "OPTIONAL URL";



$k1Msrc[2]   = "IMAGE SRC";

$k1Malt[2]   = "ALTERNATE TEXT FOR PICTURE";

$k1Mtitle[2] = "ENBOLDENED TITLE";

$k1Melse[2]  = "OPTIONAL ITALICISED SUBTITLE";

$k1Murl[2]   = "OPTIONAL URL";









# copy sets as necessary

# make sure that the index numbers (bolded numbers) are the same in each group

# this program will step thru them in numerical order



# comment this section if this is in the non-print_free_text section of the page_layout function when using the components on both sides tutorial


print_comp_header($k1Mheader);



# decomment this section if this is in the non-print_free_text section of the page_layout function when using the components on both sides tutorial

# print $comp_header_open; print $k1Mheader; print $comp_header_close;

"""

<div id="Layer1" style="position:relative; width:100%; height:$k1Mheight; z-index:1; overflow: auto; overflow-x: hidden;">

<table width="100%" cellpadding="3" cellspacing="0">

""";



foreach var int i (0 .. (size($k1Msrc) - 1)){

  $k1Mbg = ($i % 2 == 0) ? $*comp_bgcolor  :  $*header_bgcolor;

  """

  <tr style="background-color:$k1Mbg;">

  <td style="text-align:center;">""";

if($k1Murl[$i] != "") { """<a href="$k1Murl[$i]">"""; }

  """<img src="$k1Msrc[$i]" border="0" style="border: 1px solid $k1Mborder" alt="$k1Malt[$i]" title="$k1Malt[$i]" />""";

if($k1Murl[$i] != "") { """</a>"""; }

  """</td>

  <td style="text-align:left; text-size:1;" ><B>$k1Mtitle[$i]</B>""";

if($k1Melse[$i] != "") {"""<br><nbsp><I>$k1Melse[$i]</I>""";}

"""</td>

  </tr>

  """;

}



"""

</table>

</div>

""";

# comment this section if this is in the non-print_free_text section of the page_layout function when using the components on both sides tutorial

print_comp_footer();


# decomment this section if this is in the non-print_free_text section of the page_layout function when using the components on both sides tutorial

# print $comp_footer;

Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 15 comments