Jump to content

oc1ober

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by oc1ober

  1. I use the Code to get the name of the User to login: function show_loggedin_function( $atts ) { global $current_user, $user_login; get_currentuserinfo(); add_filter('widget_text', 'do_shortcode'); if ($user_login) return 'Welcome ' . $current_user->display_name . '!'; else return '<a href="' . wp_login_url() . ' ">Login</a>'; } add_shortcode( 'show_loggedin_as', 'show_loggedin_function' ); - It works well when inserting into widgets or posts in the form [show_loggedin_as] - But when I insert it into Input in the Form, it doesn't work: <input name="user" id="u1" type="text" class="field-long" value="[show_loggedin_as]" autocomplete="off" required=""> Thanks for watching for me with…Thank you.
  2. Hello ... Please ask how to get the member information (Username) is logged in into an input of the Form, Can you help me with ... Thank you
  3. I'm Shortcode wordpress but it doesn't work, the purpose is to show the content to designated members... For example: in a post or page, Only allow members id1, id7, id25...Visit, And other members cannot view the content, Please edit it for me... Thank you. add_shortcode( 'userid', 'check_user_id' ); function check_user_id($atts, $content = null) { if(current_user_id) {return '<p>' . $content . '</p>';} else {return "";} } [userid_logged_in id = "id1","id7","id25","id27"] Content displayed [/userid_logged_in]
  4. Hi guys, I am having problems using dynamic data list, It doesn't work when I insert a form into Blogspot, how should I fix it? <html> <head> </head> <body contenteditable="false"> <script> function populate(Ts7, Ts8){ var Ts7 = document.getElementById(Ts7); var Ts8 = document.getElementById(Ts8); Ts8.innerHTML = ""; if(Ts7.value == "Phòng kế hoạch"){ var optionArray = ["|","|Phòng kế hoạch"]; } else if(Ts7.value == "Bản"){ var optionArray = ["|","|Bản1","|Bản2","|Bản3"]; } else if(Ts7.value == "Huyện"){ var optionArray = ["|","|Huyện1","|Huyện2"]; } else if(Ts7.value == "Tỉnh"){ var optionArray = ["|","|Tỉnh1","|Tỉnh2"]; } else if(Ts7.value == "Trung ương"){ var optionArray = ["|","|Trung ương1","|Trung ương2"]; } for(var option in optionArray){ var pair = optionArray[option].split("|"); var newOption = document.createElement("option"); newOption.value = pair[0]; newOption.innerHTML = pair[1]; Ts8.options.add(newOption); } } </script> <p>1. Cấp</p> <select name="entry.694698089" id="Ts7" required="" onchange="populate(this.id,'Ts8')"> <option value="">Chọn</option> <option value="Phòng kế hoạch">Phòng kế hoạch</option> <option value="Bản">Bản</option> <option value="Huyện">Huyện</option> <option value="Tỉnh">Tỉnh</option> <option value="Trung ương">Trung ương</option> </select> <p>2. Nội dung</p> <select id="Ts8" name="entry.1049020395" required=""></select> </body> </html> bandicam 2021-03-03 16-25-54-648.mp4
  5. I need to edit the above code, Encrypt only, no need to create password?
  6. Thanks for your help, can you guide me on another encoding?
  7. I found the HTML encoding code, It works the way is encoding plus set password, It works very well ... But what I need is only HTML encoding, not password setting. I edited the above code myself but it doesn't work and need your help? And here is the code: https://www.w3schools.com/code/tryit.asp?filename=GO520MFBKDUJ
  8. I found a snippet of code to get data from a cell in a Google sheet into an HTML input ... It works fine, but not met ... My requirement is that it should work. after I press the button, do not automatically run when opening or loading the Web page as it is now ... Can you please fix it according to my mind, Thank you very much in advance. <html> <body> <input name="form1_1" id="f1_1" type="text" /> <button name="submit_form1" id="submit_form1" type="button" onclick="">Click here to get data</button> </body> <script> const onDataLoaded = (data) => { const e20Content = data.feed.entry.find((entry) => entry.title.$t == 'E20').content.$t document.getElementById('f1_1').value = e20Content } </script> <script src="https://spreadsheets.google.com/feeds/cells/1TbMrtJl01i-Q5YudlhdAB_E1LTYkkLswnql5LHyiIuk/1/public/basic?alt=json-in-script&callback=onDataLoaded"></script> </html>
×
×
  • Create New...