Skip to content

Instantly share code, notes, and snippets.

@inazt
Created July 20, 2010 06:36
Show Gist options
  • Save inazt/482614 to your computer and use it in GitHub Desktop.
Save inazt/482614 to your computer and use it in GitHub Desktop.
siamensis_logoutblock.php #
<?php
?>
<script type="text/javascript">
function test() {
var selected = $("#shortcut-menu-id option:selected");
var output = "";
if(selected.val() != 0){
output = "You Selected " + selected.text();
url=selected.val();
alert(url);
$("#edit-submit-webboard").click();
}
}
$(document).ready(
function(){
$("#shortcut-menu-id").change(test);
//$('#edit-tid option')[0].innerHTML = "All Catagory";
}
);
</script>
<span class="private-message">
<?php
global $user;
profile_load_profile($user);
$count = privatemsg_unread_count();
$text_options = array();
if($count>0) {
$text_options = array(
'attributes' => array( 'class' => 'pm-message have-new-mesage')
);
$text = format_plural((int)$count, '1 new message',
'@count new messages',
array('@count' => $count));
} else {
$text_options = array('attributes' => array('class' => 'pm-message zero-message'));
$text = "$count new message";
}
$name = $user->profile_name;
if($name == '') {
$name = $user->name;
}
print t('Welcome ') . l($name,'user/'. $user->uid) . ' | ';
print l($text,'messages', $text_options); ?> </span> | <?php $menu = theme('nice_menus', 0, 'menu-user-special-menu', NULL, 'down'); print $menu['content']; ?> | <span class="logout"><?php print l('logout','logout'); ?> </span>
<!-- <span class="edit-profile"><?php print l('edit profile','user/'.$GLOBALS['user']->uid.'/edit'); ?> </span> -->
<?php
/* if(user_access('admin see shortcut menu')) { ?> <select id="shortcut-menu-id" class="shortcut-menu" name="shortcut-menu">
<option selected="selected" value="All">เลือกเมนูจัดการ</option>
<option value="5">จัดการสมาชิก</option>
<option value="6">อนุมัติบทความใหม่</option>
</select>
<?php }
*/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment