kunzite (kunzite1) wrote in component_help,
kunzite
kunzite1
component_help

  • Music:

m\b\t comps (v 5.0)

###################################
#     MUSIC\BOOK\TV COMPONENT     #
# kunzite1, component-help/927083 #
# add to print_free_text(Page p)  #
###################################

########################################
# SETUP                                #
# ONLY FOR FIRST M\B\T COMP            #
var string   k1Mheader   = "";         #
var string   k1Mheight   = "";         #
var Color    k1Mborder   = "";         #
var Color    k1Mbg1      = null Color; #
var Color    k1Mfg1      = null Color; #
var Color    k1Mbg2      = null Color; #
var Color    k1Mfg2      = null Color; #
var string[] k1Msrc      = [];         #
var string[] k1Malt      = [];         #
var string[] k1Mtitle    = [];         #
var string[] k1Msubtitle = [];         #
var string[] k1Murl      = [];         #
var int      k1Mindex    = 0;          #
########################################

########################
# SETTINGS             #
# FOR EVERY M\B\T COMP #
########################
$k1Mheader = "Music";            # title of component
$k1Mheight = "175px";            # height of component
$k1Mborder = "#000000";          # bordercolor for images
$k1Mbg1    = "$*comp_bgcolor";   # background color for odd items
$k1Mfg1    = "$*header_fgcolor"; # foreground color for odd items
$k1Mbg2    = "$*main_bgcolor";   # background color for even items
$k1Mfg2    = "$*comp_fgcolor";   # foreground color for even items

############################
# INITIALIZATION           #
# FOR EVERY M\B\T COMP     #
$k1Mbg       = null Color; #
$k1Mfg       = null Color; #
$k1Msrc      = [];         #
$k1Malt      = [];         #
$k1Mtitle    = [];         #
$k1Msubtitle = [];         #
$k1Murl      = [];         #
$k1Mindex    = 0;          #
############################

########################
# DATA SETS            #
# FOR EVERY M\B\T COMP #
########################

# set one
$k1Msrc[$k1Mindex]      = ""; # image url
$k1Malt[$k1Mindex]      = ""; # image alt text
$k1Mtitle[$k1Mindex]    = ""; # bolded title
$k1Msubtitle[$k1Mindex] = ""; # italicized subtitle
$k1Murl[$k1Mindex]      = ""; # optional image linking url
$k1Mindex++;

# set two
$k1Msrc[$k1Mindex]      = ""; # image url
$k1Malt[$k1Mindex]      = ""; # image alt text
$k1Mtitle[$k1Mindex]    = ""; # bolded title
$k1Msubtitle[$k1Mindex] = ""; # italicized subtitle
$k1Murl[$k1Mindex]      = ""; # optional image linking url
$k1Mindex++;

########################
# CORE LOGIC           #
# FOR EVERY M\B\T COMP #
########################
print_comp_header($k1Mheader);
"""
<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 k1Mi (0 .. (size($k1Msrc) - 1)){
  $k1Mbg = ($k1Mi % 2) ? $k1Mbg1 : $k1Mbg2;
  $k1Mfg = ($k1Mi % 2) ? $k1Mfg1 : $k1Mfg2;
  """
  <tr style="background-color:$k1Mbg;">
  <td style="text-align:left;">""";
if($k1Murl[$k1Mi] != "") { """<a href="$k1Murl[$k1Mi]">"""; }
  """<img src="$k1Msrc[$k1Mi]" border="0" style="border: 1px solid $k1Mborder" alt="$k1Malt[$k1Mi]" title="$k1Malt[$k1Mi]" />""";
if($k1Murl[$k1Mi] != "") { """</a>"""; }
  """</td>
  <td style="color: $k1Mfg;">
    <b>$k1Mtitle[$k1Mi]</b><br />
    <i>$k1Msubtitle[$k1Mi]</i>
  </td>
  </tr>
  """;
}
"""
</table>
</div>
""";
print_comp_footer();
Tags: admin: deprecated, user: kunzite1
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic
  • 23 comments