WordPress 多层菜单

下了个主题,发现只支持一级菜单…… 去网上,先找了一个Multi-level Navigation插件,但是主题不配合…… 继续找,找到那么一篇文章: WordPress Multi-Level Drop Down menu using jQuery | SEOAdsenseThemes.com 弄到WP里面去,竟然就好了…… 其实就是加: <script type=‘text/javascript’> jQuery(document).ready(function(){ jQuery(“#dropmenu ul”).css({display:”none”});// Opera Fix jQuery(“#dropmenu li”).hover( function(){ jQuery(this).find(‘ul:first’).css({visibility:”visible”,display:”none”}).show(268); }   ,function(){ jQuery(this).find(‘ul:first’).css({visibility:”hidden”}); } ); }); </script> <style type=“text/css”> #dropmenu, #dropmenu ul {list-style-type:none; list-style-position:outside; position:relative;z-index:300; width:100%;} </style> 到HTML页面的head部分里面,然后把原来的 <?phpwp_list_pages(‘title_li=&depth=10‘); ?> 换成 <ulid=“dropmenu”><?phpwp_list_pages(‘sort_column=menu_order&title_li=‘); ?></ul> 就行了……

gdb的出错消息

一直以来,运行gdb,之后输入 attach <PID>,会收到一些错误消息:> gdbGNU gdb 6.1.1 [FreeBSD]Copyright 2004 Free Software Foundation, Inc.GDB is free software, covered by the GNU General Public License, and you arewelcome to change it and/or distribute copies of it under certain conditions.Type “show copying” to see the conditions.There is absolutely no warranty for GDB.  Type “show warranty” for details.This GDB was …

Continue reading ‘gdb的出错消息’ »

Joomla 热门新闻的有效期

     热门文章上的内容,是完全按照新闻点击次数排的。虽然原来发布的时候有个失效时间,但是大部分人懒得写,导致很旧的但是点击量大的新闻会长时间排在顶上,违背了新闻和热门的意思。     因为这个原因,我想说不定能够设置一下,比如只显示两个月的新闻。但是看了一下那个热门新闻模块(mod_mostread),设置很简单,没这方面内容。     于是只好改代码了么…… 打开/joomla/modules/mod_mostread.php,看见如下代码: case 1: default: //Content Items only $query = “SELECT a.id, a.title, a.sectionid, a.catid” . “\n FROM #__content AS a” . “\n LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id” . “\n INNER JOIN #__categories AS cc ON cc.id = a.catid” . “\n INNER JOIN #__sections AS s ON s.id …

Continue reading ‘Joomla 热门新闻的有效期’ »

FireBoard的登录跳转

最近在一个Joomla上架论坛,用着FireBoard。这个东西有个毛病,就是登录之后跳转到主页,而不是到论坛,看着很不行。 为了解决这个问题,回去看代码。FireBoard那个登录链接在template/default/plugin/profilebox/profilebox.php里面生成的,原来是这样: $loginlink = sefRelToAbs(‘index.php?option=com_login&amp;Itemid=’ . $Itemid)); 我想先把返回地址传过去。于是改成: $loginlink = sefRelToAbs(‘index.php?option=com_login&amp;Itemid=’ . $Itemid . “&return=” . sefRelToAbs(‘index.php?option=com_fireboard’)); 接下来看看/joomla/components/com_login/login.html.php: $return = $params->get(‘login’); 以及: <form action=“<?php echo sefRelToAbs( ‘index.php?option=login’ ); ?>” method=“post” name=“login” id=“login”> 看来是转到index.php进行登录工作。再看看index.php: // frontend login & logout controls $return = strval( mosGetParam( $_POST, ‘return’)); $message = intval( mosGetParam( $_POST, ‘message’, 0 ) ); if …

Continue reading ‘FireBoard的登录跳转’ »