当前位置: 首页 > news >正文

网站开发的关键技术与难点上海做网站站优云一一十七

网站开发的关键技术与难点,上海做网站站优云一一十七,wordpress添加新页面跳转,制作企业网站多少钱wordpress 焦点图插件-增删改查操作 2012-02-01 15:39:14分类#xff1a; 系统运维 该插件在wordpress-3.3.1-zh_CN版本下开发#xff0c;主要用于在后台管理首页焦点图#xff08;图片轮播#xff09;。存放焦点图信息的表 focusphoto(id,photourl,linkto,title,descripti…wordpress 焦点图插件-增删改查操作 2012-02-01 15:39:14 分类 系统运维   该插件在wordpress-3.3.1-zh_CN版本下开发主要用于在后台管理首页焦点图图片轮播。存放焦点图信息的表 focusphoto(id,photourl,linkto,title,description)该插件包括2个文件 focusphoto.php和focusphoto-admin.php效果如图具体代码如下focusphoto.php 包含以下函数focusphoto_install() 创建表focusphoto(id,photourl,linkto,title,description)focusphoto_uninstall() 删除表editfocusphoto_menu() focusphoto_admin_actions() 在后台添加“设置》焦点图管理”导航链接 ?php/*Plugin Name: 焦点图插件Plugin URI: http://hzm.blog.chinaunix.netDescription: 该插件在wordpress-3.3.1-zh_CN版本下开发主要用于在后台管理首页焦点图图片轮播Author: Henry PoterVersion: 1.0Author URI: http://hzm.blog.chinaunix.net*/ register_activation_hook(__FILE__ , focusphoto_install );register_deactivation_hook(__FILE__ , focusphoto_uninstall);function focusphoto_install() {    global $wpdb;    $table  $wpdb-prefix . focusphoto;    $sql  create table $table(                 id int auto_increment primary key,                 photourl varchar(200),                 linkto varchar(200),                 title varchar(255),                 description varchar(1000)                 ) CHARSETUTF8;    $wpdb-query($sql);}function focusphoto_uninstall(){    global $wpdb;    $table  $wpdb-prefix . focusphoto;    $sql  drop table $table;    $wpdb-query($sql);} function editfocusphoto_menu(){    global $wpdb;   include focusphoto-admin.php;} function focusphoto_admin_actions(){    add_options_page(焦点图管理, 焦点图管理, 1,Focus-photo, editfocusphoto_menu);} add_action(admin_menu, focusphoto_admin_actions);? focusphoto-admin.php 包含以下4个函数focusphoto_list() 焦点图列表focusphoto_delete($photoid) 删除指定$photoid的记录focusphoto_edit($photoid)  编辑指定$photoid的记录focusphoto_add() 添加焦点图 ?php /* * Created on Jan 31, 2012 * Author: Henry Poter */ function focusphoto_list() {    global $wpdb;    $addlink  site_url()./wp-admin/options-general.php?pageFocus-photoactaddfocusphoto;    $photos  $wpdb-get_results(SELECT * FROM  . $wpdb-prefix . focusphoto order by id desc limit 10);    //print_r($photos);    if (count($photos)  0) {?div idicon-edit classicon32 icon32-posts-postbr/divh2焦点图 a href?php echo $addlink; ? classadd-new-h2添加焦点图/a /h2?php        echo p stylecolor:red;暂时没有焦点图请a href$addlink点击添加/p;    } else {?div idicon-edit classicon32 icon32-posts-postbr/divh2焦点图 a href?php echo $addlink; ? classadd-new-h2添加焦点图/a /h2  table classwp-list-table widefat fixed posts cellspacing0    thead     tr        th scopecol classmanage-column column-cb check-column style        input typecheckbox        /th        th scopecol classmanage-column column-title style        span标题/spanspan classsorting-indicator/span        /th        th scopecol class manage-column column-title style        span图片地址/spanspan classsorting-indicator/span        /th        th scopecol classmanage-column column-title style链接到/th        /tr    /thead    tbody idthe-list?php foreach ($photos as $photo) {?            tr idpost-1 classpost-1 post type-post status-publish format-standard hentry category-uncategorized iedit author-self valigntop                th scoperow classcheck-columninput typecheckbox namepost[] value?php echo $photo-id;?/th                td classpost-title page-title column-title                 stronga classrow-title href?pageFocus-photoacteditfocusphotophotoid?php echo $photo-id;? title?php echo $photo-title;??php echo $photo-title;?/a/strong                 div classrow-actionsspan classedit                 a href?pageFocus-photoacteditfocusphotophotoid?php echo $photo-id;?编辑/a | /span                 span classinline hide-if-no-jsa href?pageFocus-photoactdeletefocusphotophotoid?php echo $photo-id;?删除/a | /span                 span classviewa href?php echo $photo-photourl;? relpermalink查看焦点图/a/span                 span classviewa href?php echo $photo-linkto;? relpermalink查看相关链接/a/span                 /div                /td              td classpost-title page-title column-title?php echo $photo-photourl;?/td             td classauthor column-author?php echo $photo-linkto;?/td            /tr?php }//end foreach }//end if?        /tbody/table?php     if (isset ($_GET[photoid])  $_GET[act]  editfocusphoto) {        $photoid  $_GET[photoid];        focusphoto_edit($photoid);    }     if (isset ($_GET[photoid])  $_GET[act]  deletefocusphoto) {        $photoid  $_GET[photoid];        focusphoto_delete($photoid);    }     if (isset ($_GET[act])  $_GET[act]  addfocusphoto) {        focusphoto_add();    } } //end focusphoto_list() function focusphoto_delete($photoid) {    global $wpdb;    if (!is_numeric($photoid)) {        die(p stylecolor:red;参数photoid错误/p);    }    $table  $wpdb-prefix . focusphoto;    $result  $wpdb-query(DELETE FROM $table WHERE id $photoid );    if ($result  1) {        echo script languejavascript alert(删除成功);/script;        header(location:  . $_SERVER[REQUEST_URI]);    }} function focusphoto_edit($photoid) {    global $wpdb;    if (!is_numeric($photoid)) {        die(p stylecolor:red;参数photoid错误/p);    }    if (isset ($_POST[editphoto])) {        $newphoto  array (            photourl  $_POST[photourl],            linkto  $_POST[linkto],            title  $_POST[title]        );        print_r($newphoto);         $result  $wpdb-update($wpdb-prefix . focusphoto, $newphoto, array (            id  $photoid        ), $format  null, $where_format  null);        //if($result 1){        echo script languejavascript alert(编辑成功);/script;        header(location:  . site_url()./wp-admin/options-general.php?pageFocus-photo);        //}    }    $photo  $wpdb-get_results(SELECT * FROM  .    $wpdb-prefix . focusphoto .  WHERE id$photoid);    // print_r($photo);?br/form action methodpost     table classwidefat cellspacing0      thead     tr        th scopecol classmanage-column column-title colspan4编辑焦点图        /th     /tr    /thead      tbody        trtd/tdtd/td/tr        trtd图片地址/tdtdinput size80 tabindex1 autocompleteoff typetext value?php echo $photo[0]-photourl ;? namephotourl  /td/tr        trtd链接到/tdtdinput size80 tabindex2 typetext value?php echo $photo[0]-linkto ;? namelinkto /td/tr        trtd标题/tdtdinput size80 tabindex3 typetext value?php echo $photo[0]-title ;? nametitle /td/tr        trtd/tdtdinput tabindex4 typesubmit nameeditphoto value保存 stylewidth:80px;/td/tr       /tbody     /table   /form ?php } //end focusphoto_edit() function focusphoto_add() {    global $wpdb;    if (isset ($_POST[addphoto])) {        $photo  array (            photourl  $_POST[photourl],            linkto  $_POST[linkto],            title  $_POST[title]        );        $wpdb-insert($wpdb-prefix . focusphoto, $photo);        header(location:  . $_SERVER[REQUEST_URI]);    }?br/   form action methodpost      table classwidefat cellspacing0     thead     tr        th scopecol classmanage-column column-title colspan4添加焦点图        /th     /tr    /thead      tbody       trtd/tdtd/td/tr        trtd图片地址/tdtdinput size80 tabindex1 typetext value namephotourl  /td/tr        trtd链接到/tdtdinput size80 tabindex2 typetext value namelinkto /td/tr        trtd标题/tdtdinput size80 tabindex3 typetext value nametitle /td/tr        trtd/tdtdinput tabindex4 typesubmit nameaddphoto value添加 stylewidth:80px;/td/tr      /tbody     /table   /form?php } //end focusphoto_add() focusphoto_list();? 转载于:https://www.cnblogs.com/qqyuhaitao/p/3291820.html
http://www.huolong8.cn/news/201629/

相关文章:

  • 深圳服务网站设计哪家公司好阿里云上的网站建设
  • 网站管理强化阵地建设网站培训机构
  • wordpress add_editor_style排名优化关键词
  • 双喜常州网站建设做面料哪个网站好
  • 靖州建设局网站wordpress 教育插件
  • 漂亮的网站底部代码高端网站建设哪家便宜
  • 学做宝宝衣服网站帮你做海报网站
  • 租房信息网站建设wordpress插件dflip
  • 重庆网站建设的培训机构博客集成wordpress
  • 沈阳建设银行网站大麦网建设网站的功能定位
  • 网站推广方案范文商务网站的推广方法有哪些
  • 做自动采集电影网站有什么处罚建设网站涉及的技术
  • 红酒网站页面设计总结平面设计素材网站有哪些
  • 江苏省建设工程地方标准网站机械加工王
  • 北京大厂网站建设长沙企业网站建设报价
  • 曲靖做网站网站建设网页制作教程
  • c#做的网站怎么上传图片畔游网站建设
  • 做家政在哪个网站找wordpress 免备案cdn
  • 沈阳模板建站方案沈阳项目
  • 网站建设网络公司深圳抖音推广
  • 毕业设计网站建设流程wordpress 支付宝 微信支付
  • 公众号自己做电影网站信息发布网站建设
  • 网站备案分为几种网站换空间 seo
  • 朝阳区网站建设君和外贸网站服务器推荐
  • 沈阳建站模板系统站酷网素材图库免费下载
  • 揭阳模板网站建站域名备案关闭网站吗
  • 福州短视频seo排行贵港网站seo
  • wordpress网站如何清理jswordpress error
  • 怎么用ftp备份网站wordpress 文章评论统计代码
  • html网站素材网会员管理系统单机免费