[BBCode] jQ Username BBCode with Group Colours

jQ Username BBCode with Group Colours
features
This bbcode snippet adds an pulldown with usernames,
which can be inserted in an easy way logy to postbox.
It provides group-colours and a link to profile
screen
demo
posting.php?mode=reply&f=2&t=10
username: test / password: testuser
Instruction
open
posting.php
find
before add
open
styles/prosilver/template/posting_buttons.html
find
after add
clear all board- and browser-caches
features
This bbcode snippet adds an pulldown with usernames,
which can be inserted in an easy way logy to postbox.
It provides group-colours and a link to profile
screen
demo
posting.php?mode=reply&f=2&t=10
username: test / password: testuser
Instruction
open
posting.php
find
- Code: Select all
page_footer();
before add
- Code: Select all
// Username [BBCode] / (c) 4seven / 2011
$sql = "SELECT user_id, username, user_colour
FROM " . USERS_TABLE . "
WHERE user_type IN (" . USER_FOUNDER . ', ' . USER_NORMAL . ")
ORDER BY username_clean";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)){
$row['user_colour'] = (!empty($row['user_colour'])) ? $row['user_colour'] : '000000';
$style_bold = ($row['user_colour'] == '000000') ? 'normal' : 'bold';
$template->assign_block_vars('username_bb', array(
'USERNAME_BB_BOLD' => $style_bold,
'USERNAME_BB_VALUE' => '|#' . $row['user_colour'] . '|' . $style_bold . '|'. $row['user_id'],
'USERNAME_BB_USER' => $row['username']));}
$db->sql_freeresult($result);
// Username [BBCode] / (c) 4seven / 2011
open
styles/prosilver/template/posting_buttons.html
find
- Code: Select all
<!-- BEGIN custom_tags -->
<input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{custom_tags.BBCODE_HELPLINE}" />
<!-- END custom_tags -->
after add
- Code: Select all
<!-- IF not S_PRIVMSGS -->
<script type="text/javascript">
// <![CDATA[
!window.jQuery && document.write('<script type="text\/javascript" src="http:\/\/code.jquery.com\/jquery.min.js"><\/script>');
// ]]>
</script>
<!-- Username [BBCode] / (c) 4seven / 2011 -->
<select id="hide_username" style="font-size:11px;" title="Username [BBCode]">
<!-- BEGIN username_bb -->
<option value="{username_bb.USERNAME_BB_VALUE}">{username_bb.USERNAME_BB_USER}</option>
<!-- END username_bb -->
</select>
<input id="username_click" type="button" class="button2" onclick="username_copy();" value="Insert" />
<script type="text/javascript">
// <![CDATA[
function username_copy(){
var username_copy = '[username' + $('#hide_username').val() + ']'+ $('#hide_username option:selected').text() + '[/username]';
document.forms['postform'].message.value += username_copy;
document.forms['postform'].message.focus();
return false;}
// ]]>
</script>
<!-- Username [BBCode] / (c) 4seven / 2011 -->
<!-- ENDIF -->
make a bbcode
BBCode usage
- Code: Select all
[username|{COLOR}|{IDENTIFIER}|{NUMBER}]{TEXT}[/username]
HTML replacement
- Code: Select all
<a class="username-coloured" style="color:{COLOR};font-weight:{IDENTIFIER};" href="./memberlist.php?mode=viewprofile&u={NUMBER}">{TEXT}</a>
Help line
- Code: Select all
nothing
Display on posting page
- Code: Select all
no
clear all board- and browser-caches