admincp_seo.inc.php 5.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. /**
  3. * DZAPP Haodai SEO Settings
  4. *
  5. * @copyright (c) 2013 DZAPP. (http://www.dzapp.cn)
  6. * @author BranchZero <branchzero@gmail.com>
  7. */
  8. if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
  9. exit('Access Denied');
  10. }
  11. $lang = array_merge($lang, $scriptlang['dzapp_haodai']);
  12. if(empty($_GET['ac'])) {
  13. if(!submitcheck('seosubmit')) {
  14. echo '<script type="text/javascript">
  15. function insertContent(obj, text) {
  16. var obj = obj.parentNode.parentNode.firstChild.lastChild;
  17. selection = document.selection;
  18. obj.focus();
  19. if(!isUndefined(obj.selectionStart)) {
  20. var opn = obj.selectionStart + 0;
  21. obj.value = obj.value.substr(0, obj.selectionStart) + text + obj.value.substr(obj.selectionEnd);
  22. } else if(selection && selection.createRange) {
  23. var sel = selection.createRange();
  24. sel.text = text;
  25. sel.moveStart(\'character\', -strlen(text));
  26. } else {
  27. obj.value += text;
  28. }
  29. }
  30. </script>';
  31. $dzapp_haodai_seo = dunserialize($_G['setting']['dzapp_haodai_seo']);
  32. $codetypes['main'] = array('bbname');
  33. $codetypes['search'] = array('bbname', 'xd_type');
  34. $codetypes['view'] = array('bbname', 'xd_type', 'bank_name', 'xd_name');
  35. $codetypes['news'] = array('bbname', 'news_title');
  36. $codetypes['apply'] = array('bbname');
  37. $codetypes['calc'] = array('bbname', 'calc_type');
  38. $codenames['bbname'] = $lang['bbname'];
  39. $codenames['xd_type'] = $lang['xd_type'];
  40. $codenames['bank_name'] = $lang['bank_name'];
  41. $codenames['xd_name'] = $lang['xd_name'];
  42. $codenames['news_title'] = $lang['news_title'];
  43. $codenames['calc_type'] = $lang['calc_type'];
  44. foreach(array('main', 'search', 'view', 'news', 'apply', 'calc') as $page) {
  45. $codes[$page] = $lang['code'];
  46. foreach($codetypes[$page] as $type) {
  47. $codes[$page] .= '<a onclick="insertContent(this, \'{'.$type.'}\');return false;" href="javascript:;" title="'.$codenames[$type].'">{'.$codenames[$type].'}</a>';
  48. }
  49. }
  50. showformheader('plugins&operation=config&identifier=dzapp_haodai&pmod=admincp_seo');
  51. showtableheader();
  52. showtitle('dzapp_haodai_main');
  53. showsetting('seotitle', 'dzapp_haodai_seo[main][seotitle]', $dzapp_haodai_seo['main']['seotitle'], 'text', '', 0, $codes['main']);
  54. showsetting('seokeywords', 'dzapp_haodai_seo[main][seokeywords]', $dzapp_haodai_seo['main']['seokeywords'], 'text', '', 0, $codes['main']);
  55. showsetting('seodescription', 'dzapp_haodai_seo[main][seodescription]', $dzapp_haodai_seo['main']['seodescription'], 'text', '', 0, $codes['main']);
  56. showtitle('dzapp_haodai_search');
  57. showsetting('seotitle', 'dzapp_haodai_seo[search][seotitle]', $dzapp_haodai_seo['search']['seotitle'], 'text', '', 0, $codes['search']);
  58. showsetting('seokeywords', 'dzapp_haodai_seo[search][seokeywords]', $dzapp_haodai_seo['search']['seokeywords'], 'text', '', 0, $codes['search']);
  59. showsetting('seodescription', 'dzapp_haodai_seo[search][seodescription]', $dzapp_haodai_seo['search']['seodescription'], 'text', '', 0, $codes['search']);
  60. showtitle('dzapp_haodai_view');
  61. showsetting('seotitle', 'dzapp_haodai_seo[view][seotitle]', $dzapp_haodai_seo['view']['seotitle'], 'text', '', 0, $codes['view']);
  62. showsetting('seokeywords', 'dzapp_haodai_seo[view][seokeywords]', $dzapp_haodai_seo['view']['seokeywords'], 'text', '', 0, $codes['view']);
  63. showsetting('seodescription', 'dzapp_haodai_seo[view][seodescription]', $dzapp_haodai_seo['view']['seodescription'], 'text', '', 0, $codes['view']);
  64. showtitle('dzapp_haodai_news');
  65. showsetting('seotitle', 'dzapp_haodai_seo[news][seotitle]', $dzapp_haodai_seo['news']['seotitle'], 'text', '', 0, $codes['news']);
  66. showsetting('seokeywords', 'dzapp_haodai_seo[news][seokeywords]', $dzapp_haodai_seo['news']['seokeywords'], 'text', '', 0, $codes['news']);
  67. showsetting('seodescription', 'dzapp_haodai_seo[news][seodescription]', $dzapp_haodai_seo['news']['seodescription'], 'text', '', 0, $codes['news']);
  68. showtitle('dzapp_haodai_apply');
  69. showsetting('seotitle', 'dzapp_haodai_seo[apply][seotitle]', $dzapp_haodai_seo['apply']['seotitle'], 'text', '', 0, $codes['apply']);
  70. showsetting('seokeywords', 'dzapp_haodai_seo[apply][seokeywords]', $dzapp_haodai_seo['apply']['seokeywords'], 'text', '', 0, $codes['apply']);
  71. showsetting('seodescription', 'dzapp_haodai_seo[apply][seodescription]', $dzapp_haodai_seo['apply']['seodescription'], 'text', '', 0, $codes['apply']);
  72. showtitle('dzapp_haodai_calc');
  73. showsetting('seotitle', 'dzapp_haodai_seo[calc][seotitle]', $dzapp_haodai_seo['calc']['seotitle'], 'text', '', 0, $codes['calc']);
  74. showsetting('seokeywords', 'dzapp_haodai_seo[calc][seokeywords]', $dzapp_haodai_seo['calc']['seokeywords'], 'text', '', 0, $codes['calc']);
  75. showsetting('seodescription', 'dzapp_haodai_seo[calc][seodescription]', $dzapp_haodai_seo['calc']['seodescription'], 'text', '', 0, $codes['calc']);
  76. showsubmit('seosubmit');
  77. showtablefooter();
  78. showformfooter();
  79. } else {
  80. $dzapp_haodai_seo = serialize($_GET['dzapp_haodai_seo']);
  81. DB::query("REPLACE INTO ".DB::table('common_setting')." (skey, svalue) VALUES ('dzapp_haodai_seo', '$dzapp_haodai_seo')");
  82. updatecache('setting');
  83. cpmsg('seo_update_succeed', 'action=plugins&operation=config&identifier=dzapp_haodai&pmod=admincp_seo', 'succeed');
  84. }
  85. }
  86. ?>