SHOW:
|
|
- or go back to the newest paste.
1 | <?php | |
2 | function load_onhover_js() { | |
3 | ?> | |
4 | ||
5 | <script type="text/javascript"> | |
6 | function MouseChange( Img , imageSrc ) | |
7 | //img will be the tag name, and imageSrc will be the URL of the image | |
8 | { | |
9 | document[Img].src = imageSrc; | |
10 | } | |
11 | </script> | |
12 | ||
13 | <?php } | |
14 | add_action('wp_head', 'load_onhover_js'); | |
15 | function screenshotcomments () { | |
16 | global $comment; | |
17 | $commenturl = get_comment_author_url(); | |
18 | $author = get_comment_author(); | |
19 | $urlnohttp = str_replace(array('http://','https://'), '', $commenturl); | |
20 | if ( empty( $commenturl ) || 'http://' == $url ) | |
21 | $return = $author; | |
22 | else | |
23 | ||
24 | ?> | |
25 | ||
26 | <script type="text/javascript"><!-- | |
27 | - | var Img<?php echo $urlnohttp;?>On = new Image(); |
27 | + | var Img<?php the_ID(); ?>On = new Image(); |
28 | - | Img<?php echo $urlnohttp;?>On.src = "http://thirdpart.com/<?php echo $urlnohttp;?>"; |
28 | + | Img<?php the_ID(); ?>On.src = "http://thirdpart.com/<?php echo $urlnohttp;?>"; |
29 | - | var Img<?php echo $urlnohttp;?>Off = new Image(); |
29 | + | var Img<?php the_ID(); ?>Off = new Image(); |
30 | - | Img<?php echo $urlnohttp;?>Off.src = "<?php bloginfo('url');?>/wp-content/plugins/pluginame/control_play.png"; |
30 | + | Img<?php the_ID(); ?>Off.src = "<?php bloginfo('url');?>/wp-content/plugins/pluginame/control_play.png"; |
31 | </script> | |
32 | ||
33 | - | <a href="<?php echo $commenturl ?>" onMouseOver="MouseChange( 'Img<?php echo $urlnohttp;?>' , Img<?php echo $urlnohttp;?>On.src )" onMouseOut = "MouseChange( 'Img<?php echo $urlnohttp;?>' , Img<?php echo $urlnohttp;?>Off.src )" ><?php echo $author ?> |
33 | + | <a href="<?php echo $commenturl ?>" onMouseOver="MouseChange( 'Img<?php the_ID(); ?>' , Img<?php the_ID(); ?>On.src )" onMouseOut = "MouseChange( 'Img<?php the_ID(); ?>' , Im<?php the_ID(); ?>Off.src )" ><?php echo $author ?> |
34 | - | <img src="<?php bloginfo('url');?>/wp-content/plugins/pluginname/control_play.png" border="0" name="Img<?= $blogPostID ?>" /> |
34 | + | <img src="<?php bloginfo('url');?>/wp-content/plugins/pluginname/control_play.png" border="0" name="Img<?php the_ID(); ?>" /> |
35 | </a> | |
36 | ||
37 | <?php | |
38 | } | |
39 | add_filter('get_comment_author_link', 'screenshotcomments'); | |
40 | ||
41 | ?> | |
42 |