Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: LJ and LJR users shortcodes
- Description: adding lj and ljr-like style links on users/blogs LJ and LJR
- Version: 0.0.1
- Author: Tolik Punkoff & IDT
- Author URI: http://tolik-punkoff.com/
- License: any
- */
- function ljruser_shortcode($atts)
- {
- extract(shortcode_atts(array(
- 'user' => '',
- 'blank' => 0,
- ), $atts));
- $ret='';
- $target='';
- if ($blank==1) $target='target="_blank"';
- if ($user=='')
- {
- $ret="<b>[Bad username in LJ tag]</b>";
- }
- else
- {
- $ret = '<span class="ljruser" style="white-space: normal;">';
- $ret = $ret . '<a href="http://lj.rossia.org/userinfo.bml?user=';
- $ret = $ret . $user . '" ' . $target . '>';
- $ret = $ret . '<img src="' . content_url() . '/plugins/lj-ljr-users/img/userinfo-ljr.gif" alt="[info]" style="vertical-align: top; border: 0;" /></a>';
- $ret = $ret . '<a href="http://lj.rossia.org/users/' . $user . '/" ' . $target . '>';
- $ret = $ret . '<b>' . $user . '@ljr' . '</b></a></span>';
- }
- return $ret;
- }
- function ljuser_shortcode($atts)
- {
- extract(shortcode_atts(array(
- 'user' => '',
- 'blank' => 0,
- ), $atts));
- $ret='';
- $target='';
- if ($blank==1) $target='target="_blank"';
- if ($user=='')
- {
- $ret="<b>[Bad username in LJ tag]</b>";
- }
- else
- {
- $ret = '<span class="ljruser" style="white-space: normal;">';
- $ret = $ret . '<a href="http://livejournal.com/userinfo.bml?user=';
- $ret = $ret . $user . '" ' . $target . '>';
- $ret = $ret . '<img src="' . content_url() . '/plugins/lj-ljr-users/img/userinfo-lj.gif" alt="[info]" style="vertical-align: top; border: 0;" /></a>';
- $ret = $ret . '<a href="http://livejournal.com/users/' . $user . '/" ' . $target . '>';
- $ret = $ret . '<b>' . $user . '@lj' . '</b></a></span>';
- }
- return $ret;
- }
- add_shortcode ('lj','ljuser_shortcode');
- add_shortcode ('ljr','ljruser_shortcode');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement