Changeset 383035
- Timestamp:
- 05/10/2011 05:56:35 AM (15 years ago)
- Location:
- mblog/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
mblog/trunk/BProc.php
r375977 r383035 34 34 $log = fopen($fname,"a+"); 35 35 $text = htmlspecialchars($_POST['msg']); 36 //avatar 37 $new_avt = str_replace("\'","",$_COOKIE['avatar']); 38 $new_avt = str_replace('alt=','',$new_avt); 39 36 40 if (filesize($fname) > 0){ 37 $ftext = '|'.$_POST['u'].':::'.$text.':::'.$ _COOKIE['avatar'];41 $ftext = '|'.$_POST['u'].':::'.$text.':::'.$new_avt; 38 42 } 39 43 else{ 40 $ftext = $_POST['u'].':::'.$text.':::'.$ _COOKIE['avatar'];44 $ftext = $_POST['u'].':::'.$text.':::'.$new_avt; 41 45 } 42 46 fwrite($log, $ftext); … … 60 64 file_put_contents($fname, $nrec); 61 65 } 62 63 66 ?> -
mblog/trunk/mblog.js
r379604 r383035 6 6 type:"POST", 7 7 url:'wp-content/plugins/mblog/BProc.php', 8 data:'m=0&msg=0&u=0 &a=0',8 data:'m=0&msg=0&u=0', 9 9 dataType: 'json', 10 10 success: function(rsp){ … … 23 23 var uname = Get_Cookie('user'); 24 24 var avatar = Get_Cookie('avatar'); 25 alert(uname);26 alert(avatar);27 25 avatar = avatar.replaceAll('+',' '); 28 26 avatar = avatar.replaceAll('&','&'); 29 27 30 28 var entries = $('.mblog-entry').length; 31 32 29 $.ajax({ 33 30 type:"POST", -
mblog/trunk/mblog.php
r379604 r383035 4 4 Plugin URI: http://code.google.com/p/wordpress-mblog/ 5 5 Description: The microblog widget, that allows blog authors/contributors to cooperate. Can be made invisible to unregistered users. 6 Version:0.3 16 Version:0.32 7 7 Author:Nordvind 8 8 Author URI: www.arttupeka.eu … … 51 51 wp_enqueue_script('mblog',plugins_url().'/mblog/mblog.js',false,null); 52 52 } 53 53 54 } 54 55 … … 96 97 function load_mblog(){ 97 98 register_widget('mblog'); 99 100 global $current_user; 101 get_currentuserinfo(); 102 $avatar = get_avatar($current_user->ID,$size='30'); 103 setcookie("user",$current_user->display_name, time()+60); 104 setcookie("avatar",$avatar,time()+60); 105 106 107 $new_avt = str_replace("\'","",$_COOKIE['avatar']); 108 $new_avt = str_replace('alt=','',$new_avt); 98 109 } 99 110 … … 114 125 } 115 126 function widget($args,$instance){ 127 116 128 $show = isset($instance['hide_wdg']) ? false : true; 117 129 $is_user = is_user_logged_in(); … … 121 133 //Post form 122 134 if ($is_user){ 123 124 135 global $current_user; 125 get_currentuserinfo(); 126 127 $avatar = get_avatar($current_user->ID,$size='30'); 128 if (empty($avatar)){ 129 echo '<p>Catch</p>'; 130 } 131 else echo '<p>'.$avatar.'</p>'; 132 echo'<div id="mblog-window">'.$current_user->ID.'</div>'; 133 setcookie("user",$current_user->display_name, time()+60); 134 setcookie("avatar",$avatar,time()+60); 136 echo'<div id="mblog-window"></div>'; 135 137 136 138 echo '<form method="post" action="" onsubmit="processInp(); return false;"> … … 156 158 } 157 159 } 158 159 160 ?> -
mblog/trunk/readme.txt
r379604 r383035 5 5 Requires at least: 2.8 6 6 Tested up to: 3.1.1 7 Stable tag: 1. 17 Stable tag: 1.2 8 8 9 9 A chatroom for blog authors … … 24 24 25 25 1. Widget in work 26 27 == Upgrade Notice == 28 29 = 0.32 = 30 31 Avatar bug fixed, now it should display just fine. 32 33 == Changelog == 34 35 = 0.32 = 36 37 Bugs fixed.
Note: See TracChangeset
for help on using the changeset viewer.