javascript inside php variable for coppermine default theme
-> Coppermine

#1: javascript inside php variable for coppermine default theme Author: dusmanLocation: Maryland PostPosted: Sat Jan 19, 2008 3:42 am
    ----
Hello all, I am trying to put some java script in the default theme.inc file for coppermine. I am looking a the very last function all the way at the bottom. Line 555 of theme.inc. I am trying to add a new <tr> for a bookmark link, however either you can't put javascript code into a php variable or I just have the syntax wrong. Can anyone point me in the right direction? Thanks, code attached

Default code:
Code::
function theme_html_picinfo(&$info)
{
       $html = '<tr><td colspan="2" class="tableh2_compact"><b>'.PIC_INF_TITLE.'</b></td></tr>';
        $template ="        <tr><td class=\"tableb_compact\" valign=\"top\" nowrap=\"nowrap\">%s:</td><td class=\"tableb_compact\">%s</td></tr>\n";
        foreach ($info as $key => $value) $html .= sprintf($template, $key, $value);
        return $html;
}

What I am trying to add:

[code]$html = '<tr><td colspan="2" class="tableh2_compact"><b>'.PIC_INF_TITLE.'</b></td></tr><tr><td>
<!-- AddThis Bookmark Button BEGIN -->
<script type="text/javascript">
addthis_url = location.href;
addthis_title = document.title;
addthis_pub = 'dusman';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
<!-- AddThis Bookmark Button END -->
</tr></td>';[/
code]

#2: Re: javascript inside php variable for coppermine default theme Author: dusmanLocation: Maryland PostPosted: Sat Jan 19, 2008 3:46 am
    ----
fyi, I don't get an error or anything, it just displays a blank page

#3: Re: javascript inside php variable for coppermine default theme Author: greenday2kLocation: CO PostPosted: Sat Jan 19, 2008 5:41 pm
    ----
change:

addthis_pub = 'dusman';

to

addthis_pub = "dusman";

maybe it helps

#4: Re: javascript inside php variable for coppermine default theme Author: dusmanLocation: Maryland PostPosted: Sat Jan 19, 2008 6:48 pm
    ----
hahaha, thanks, thats exactly what it was, sometimes it just takes another set of eyes on it! much appreciated!



-> Coppermine

All times are GMT

Page 1 of 1