php ナインパレスグリッドログ

WBOY
リリース: 2016-07-25 09:01:08
オリジナル
1095 人が閲覧しました
要件に応じて、9つの表にテキストを記述し、タイトルを編集し、天気、背景、表現を選択することができます。最後に、画像が生成され、共有したり、結果をデータベースに保存したりできます。 github アドレス: 9Diary GitHub
  1. /**
  2. * ログを追加
  3. * bgid 背景画像
  4. * title ログタイトル
  5. * テーブルのタイトルと内容は '-|*dt*|-' で 1、2、3、4、6、7、8、9 のテーブルに分割されます。
  6. * 表 5 関連:mid_title、絵文字
  7. *テンプレート ID:tempid、開発予定
  8. *オープン:プライバシー
  9. */
  10. //dump($_POST);
  11. $bgid = intval(htmlspecialchars($_REQUEST['bgid']));
  12. $title = htmlspecialchars($_POST[' title']);
  13. $cnt = str_replace(PHP_EOL, '',$_POST['cnt']);
  14. //タイトルとコンテンツを空にすることはできません
  15. if (!isset($title) || !isset($cnt )){
  16. echo 'タイトルとコンテンツを空にすることはできません!';
  17. }
  18. $imgid = intval($_POST['imgId']);
  19. $weatherId = intval($_POST['weatherId']);
  20. $mid_title = htmlspecialchars($_POST['mid_title']);
  21. $cnt_titles = $_POST['cnt_titles'];
  22. $tempId = intval($_POST['tempId']);
  23. $open = intval($_POST['open ']);
  24. //画像を書き込みます
  25. require_once('AppDiary.class.php');
  26. $image = new AppDiary();
  27. $path = dirname(__FILE__);
  28. $backimage = $path.'/ 画像/preview/'.$bgid.'.jpg';
  29. $weatherimg = $path.'/images/weather/'.$weatherId.'.gif';
  30. $emoticons_img = $path.'/images/emoticons/ ' .$imgid.'.gif';
  31. $contents =explode('-|*dt*|-',$cnt);
  32. $contents_title =explode('-|*dt*|-', $cnt_titles); $str = array(
  33. array($w​​eatherimg,528,1,61,62),//Weather
  34. array($contents_title[0],35,83,146,28,'cnt'),//表 1 title
  35. array ($contents[0],35,111,160,100,'cnt_titles'),//表 1 content
  36. array($contents_title[1],222,83,146,28,'cnt'),//表 2 title
  37. array($contents [ 1],222,111,160,100,'cnt_titles'),//表 2 content
  38. array($contents_title[2],407,83,146,28,'cnt'),//表 3 title
  39. array($contents[2], 407,111,160,100 ,'cnt_titles'),//表 3 content
  40. array($contents_title[3],35,244,146,28,'cnt'),//表 4 title
  41. array($contents[3],35,273,160,100,'cnt_titles') , //表 4 の内容
  42. array($mid_title,240,235,146,38,'mid_title'),//表 5 タイトル
  43. array($emoticons_img,261,283,80,80),//表 5 の内容
  44. array($contents_title[ 4 ],407,244,146,28,'cnt'),//表 6 title
  45. array($contents[4],407,273,160,100,'cnt_titles'),//表 6 content
  46. array($contents_title[5],35,409,146,28 , 'cnt'),//表 7 title
  47. array($contents[5],35,436,160,100,'cnt_titles'),//表 7 content
  48. array($contents_title[6],221,409,146,28,'cnt'), / /表 8 title
  49. array($contents[6],221,436,160,100,'cnt_titles'),//表 8 content
  50. array($contents_title[7],407,409,146,28,'cnt'),//表 9 title
  51. array ($contents[7],407,436,160,100,'cnt_titles'),//表 9 の内容
  52. );
  53. //var_dump($str);
  54. $pic = $image->topaste($backimage,$str);
  55. $filename = $path.'/upfile/'.$pic;
  56. //主に同じファイル名を防ぐために time() を追加しました
  57. $newname = $title.'_'.time().strrchr($ pic, '.');
  58. $newfile = $path.'/upfile/'.$newname;
  59. //主に中国語のタイトルに使用されます
  60. $newfile = iconv( 'UTF-8', 'GB18030', $newfile ) ;
  61. if (file_exists($filename)){
  62. //ファイル名が正常に変更されました
  63. if (rename($filename,$newfile)){
  64. $pic = $newname;
  65. }
  66. echo json_encode(array('info' = >$pic,'status'=>1));
  67. }else{
  68. //ファイルの生成に失敗しました
  69. echo json_encode(array('info'=>'Error'.$pic,'status'=>) ;0));
  70. }
コードをコピー
php ナインパレスグリッドログ php ナインパレスグリッドログphp ナインパレスグリッドログ

関連ラベル:
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!