网站其它


5
八 11

wordpress模板修改-自定义侧边栏(小工具)插件显示位置

先下载了一个模板挺漂亮,可惜不支持侧边栏(小工具)插件,研究了下模板代码,自己给他添加个

第一步 : 找到 模板下面的 functions.php 文件 增加下面代码:<!–more–>

add_action('widgets_init', 'my_register_sidebars');
function my_register_sidebars() {
    register_sidebar(
        array(
            'id' => 'primary',
            'name' => __( 'Sidebar' ),
            'description' => __('Right sidebar.'),
            'before_widget' => '<div id="%1$s" class="widget %2$s">',
            'after_widget' => '</div>',
            'before_title' => '<h3>',
            'after_title' => '</h3>'
        )
    );
}

第二步 : 在模板文件相应位置插入:

<?php if ( is_active_sidebar( 'secondary-widget-area' ) ) : ?>
<?php dynamic_sidebar( 'secondary-widget-area' ); ?>
<?php endif; ?>

1
八 11

我的 WP 要装的插件

1, Widget Logic

//作用:控制小工具栏的显示隐藏

is_home() 主页
is_single() 文章页
is_page() 页面
is_category() 文章分类页
is_tag() 文章标签页
is_archive() 归档页
is_404() 404页
is_search() 搜索结果页
is_feed() 订阅页

2, Google XML Sitemaps

//作用:自动生成站点地图,并PING GOOGLE


31
七 11

Cpanel11.30 文件管理器右边不显示文件 解决办法

WopusIDC部分美国CPanel主机最近出现文件管理器不显示文件的问题。

这是因为CPanel版本有11.28升级到11.30,虽然Cpanel官方说11.30已经是稳定版,但是在中文语言下依然出现了这种Bug。

解决办法:

1,登陆Cpanel。(如何登陆CPanel?

2,在 偏好 模块,找到 更改语言。

12

3,默认的是中文,修改成英文或者中文,不要选那个“中文(中国)”也行。

3,再次点击 进入文件管理器,就可以看到文件了。


9
十二 10

DATAlife 常规设置 不断更新

要关闭游客评论

到后台设置用户组,编辑GUEST用户属性,找到评论,选择不允许评论,就OK


8
十二 10

一个小问题足以把我折腾死

今天服务器上调试一个程序,需要伪静态

服务器是win环境,使用ISAPI_Rewrite3运行伪静态

程序上传后伪静态老是不成功,以为是ISAPI_Rewrite3对阿帕奇的.htaccess不兼容,花了N小时重写规则,还不成功

继续花了N小时做调试修改,还是不成功

我的ISAPI_Rewrite3是破解版的,我以为不稳定,重启动IIS N多遍,还是不成功

以上描述的相当平和,其实当时的我,想砸显示器,想甩键盘

后来常看服务器上其它伪静态规则,才想起要把.htaccess文件给予everyone权限才能运行。

哭死我~~~


14
十 10

WordPress 代码中单引号双引号问题解决方法

WordPress 单引号问题困扰了我很久,即无论在什么语言版本的 WordPress 中’(英文半角引号)总是显示成'(中文全角单引号),英文的三个句号(…)都会被转换为中文的半个省略号(…),双引号也有同样的问题,中文的一对双引号(“”)在 WordPress 中显示出来是(““)。

在用英文写 BLOG 或博文中有代码片断的时候,不但影响显示美观,复制下来的代码基本无法直接使用。原因据说是因为 WordPress 为了避免某些字符在 MySQL 中二义性而改用全角显示和储存这种字符。解决方法如下:

修改源文件:wp-includes/formatting.php

找到以下代码并注释掉:

// static strings

$curl = str_replace($static_characters, $static_replacements, $curl);
// regular expressions
$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);

即:

// static strings
//屏蔽转换为中文标点符号
//$curl = str_replace($static_characters, $static_replacements, $curl);
// regular expressions
//屏蔽转换为中文标点符号
//$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);

保存即可。


10
十 10

解决li 跑DIV外面的CSS问题

当您的li需要用一行显示的时候,发现 li 使用 float:left 会跑到div的外面,把他改成 :display: inline; 解决了


14
八 10

我的使用的Datalife8.5安装说明

版本说明:

采用DataLife_Engine_v.8.5_FULL_English_by_DLEVIET_UTF-8.rar,做为原始版本,

另外我在版本中安装插件有:

pingationMod 2.01 English for 8.5

DLE Search Cloud Module

Category Tree 1.3

3news v2.0

安装说明:

1:建个数据库,运行根目录 /install.php 按步骤说明安装

2,打开phpmyadmin,打开我们的主数据库,选择顶部 SQL,输入(注:这个是插入pingationMod 2.01 English for 8.5 插件的数据库)

INSERT INTO `dle_admin_sections` VALUES (”, ‘ping’, ‘pingationMod’, ‘Module send notifications to the ping services known about the changes on your site’, ‘pingationmod.png’, ’1′);

3,完毕后,再次运行SQL,输入:(注:这个是插入DLE Search Cloud Module 插件的数据库)

CREATE TABLE IF NOT EXISTS `dle_search` (
`id` int(11) NOT NULL auto_increment,
`ip_address` varchar(20) NOT NULL,
`tag` varchar(100) NOT NULL default ”,
PRIMARY KEY (`id`),
UNIQUE KEY `tag` (`tag`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

4,修改engine\modules\connect.php 里面关于数据库的设置,里面的数据库名,就是我们DATALIFE的数据库

插件调用说明:

1,DLE Search Cloud Module

在main.tpl模板空白位置插入:

{include file=”engine/modules/searchcloud.php”}

2, 3news v2.0

{top_news}

//排名

{last_news}

//最后

{rand_news}

//随机


14
八 10

Datalife RssPING module – (pingationMod 2.01 English for 8.5)

里面有安装说明
Installation
  1. If you are using DLE 8.5
  1. Delete file Uploads/engine/inc/ping.php
  2. Rename file Uploads/engine/inc/ping_8.5.php to Uploads/engine/inc/ping.php
  • Copy all folder Uploads to your site, in the root folder.
  • For files:
    1. /engine/data/pingdata.php
    2. /engine/data/pinglist.txt
    3. /engine/data/pinglog.txt

    Put the right to write (CHMOD 777)

  • Open file engine/inc/addnews.php
    1. FIND:
      clear_cache();<br /> msg( “info”, $lang['addnews_ok'], $lang['addnews_ok_1'] . ” \”" . stripslashes( stripslashes( $title ) ) . “\” ” . $lang['addnews_ok_2']);ABOVE add:
      // pingationMod<br /> include ENGINE_DIR.’/inc/include/pingpost.php’;
  • Open file engine/inc/editnews.php
    1. FIND:
      <td><div mce_tmp=”1″><input type=”checkbox” name=”approve” value=”1″ {$ifapp}> {$lang['addnews_mod']}</div> <div mce_tmp=”1″>
    2. Replace to:
      <td><input type=”checkbox” name=”approve” value=”1″ {$ifapp}> {$lang['addnews_mod']}<br /><br /> <input type=”checkbox” name=”ping” value=”1″> {$lang['ping_editpost']}</div> <div mce_tmp=”1″>
    3. FIND:
      if( $no_permission ) {<br /> msg( “error”, $lang['addnews_error'], $lang['edit_denied'], $_SESSION['admin_referrer'] );<br /> } elseif( $okdeleted ) {<br /> msg( “info”, $lang['edit_delok'], $lang['edit_delok_1'], $_SESSION['admin_referrer'] );<br /> } elseif( $okchanges ) {<br /> msg( “info”, $lang['edit_alleok'], $lang['edit_alleok_1'], $_SESSION['admin_referrer'] );<br /> } else {<br /> msg( “error”, $lang['addnews_error'], $lang['edit_allerr'], $_SESSION['admin_referrer'] );<br /> }
    4. And ABOVE add:// pingationMod<br /> if(isset( $_POST['ping']) AND isset( $_POST['approve']) AND $newsdate < $added_time){<br /> include ENGINE_DIR.’/inc/include/pingedit.php’;<br /> }
  • Open file language/English/adminpanel.lng
    1. After:
      $lang = array (</div> <div mce_tmp=”1″>’charset’ => “windows-1251″,<br /> ‘admin_logo’ => “engine/skins/images/nav.jpg”,<br /> ‘wysiwyg_language’ => “ru”,
    2. Add:
      // pingationMod 2.0.1</div> <div mce_tmp=”1″>’ping_module’ => “pingationMod”,<br /> ‘ping_gomain’ => “Back to Home”,<br /> ‘ping_settingsmain’ => “Main settings”,<br /> ‘ping_log’ => “Log events”,<br /> ‘ping_settingsaveok’ => “Module settings successfully saved”,<br /> ‘ping_sht’ => “item”,<br /> ‘ping_wait’ => “Please wait …”,<br /> ‘ping_afterea’ => “Notification successfully sent”,<br /> ‘ping_activate’ => “Activate module”,<br /> ‘ping_keyinfo’ => “To activate the module, enter <a href=”\” mce_href=”\”"http://dleviet.com\” target=\”blank\”><b>DLEVIET</b></a>”,<br /> ‘ping_activbutton’ => “Activate Module”,</div> <div mce_tmp=”1″>’ping_moduledescr’ => “Module \”pingationMod\” provides for timely notification ping service changes on your site. Services for the ping – a service that informs search engines that your site appeared the next publication. As a result, the search engine robots quickly learn that you have written a new article and come to your site to its index.”,<br /> ‘ping_razrab’ => “Developer: g-prime<br />Author: <b>TOPY</b><br />Translate: <b>DLEVIET</b> (<a href=”\” mce_href=”\”"http://dleviet.com/\”>DLEVIET.COM</a>)”,<br /> ‘ping_clear’ => “Do you really want to clear list of ping services?”,<br /> ‘ping_clearlog’ => “Do you really want to clear contents of the log events?”,<br /> ‘ping_clearok’ => “You have successfully cleared the contents of the list of ping services”,<br /> ‘ping_clearlogok’ => “You have successfully cleared the contents of the log events”,<br /> ‘ping_version’ => “Module version: 2.0.1″,<br /> ‘ping_nav’ => “Navigation on pages:”,<br /> ‘ping_logcol’ => “Number of records:”,<br /> ‘ping_lognoentire’ => “Log events is empty”,</div> <div mce_tmp=”1″>’ping_senddata’ => “Following data will be sent to ping services:”,<br /> ‘ping_siteurl’ => “Website address:”,<br /> ‘ping_rss’ => “RSS feed URL:”,<br /> ‘ping_sitename’ => “Website name:”,<br /> ‘ping_sitenamechange’ => “If you want to change Website name, modify it at <a href=”\” mce_href=”\”"?mod=options&action=syscon\”>System Settings</a>”,</div> <div mce_tmp=”1″>’ping_sendbutton’ => “Send notices to Ping Services”,<br /> ‘ping_savebutton’ => “Save module settings”,<br /> ‘ping_sendsitemap’ => “Send notices to search engines”,<br /> ‘ping_updatebutton’ => “Check for new versions”,</div> <div mce_tmp=”1″>’ping_pingsendgo’ => “Please wait for sending notifications to ping services…”,<br /> ‘ping_pingsitemapdgo’ => “Please wait for sending notifications to search engines…”,</div> <div mce_tmp=”1″>’ping_noserviceadd’ => “To send notifications, you must add at least one service in <a href=”\” mce_href=”\”"?mod=ping&action=settings\”>Module Settings</a>”,</div> <div mce_tmp=”1″>’ping_simdescr’ => “This module is used to manually send notifications to search engines, the availability of a new version of site map </div> <div mce_tmp=”1″> supported search engines: </div> <div mce_tmp=”1″> Google, Bing, Ask, MoreOver and Yahoo (To send notifications to Yahoo, you must enter Yahoo App ID in <a href=”\” mce_href=”\”"$PHP_SELF?mod=ping&action=settings\”>Module Settings</a>)”,</div> <div mce_tmp=”1″>’ping_editpost’ => “Send notices to Ping Services”,</div> <div mce_tmp=”1″>’ping_settings’ => “Module Settings”,<br /> ‘ping_settingsdescr’ => “Configure common parameters of module”,</div> <div mce_tmp=”1″>’ping_ping’ => “Send notification”,<br /> ‘ping_pingdescr’ => “Manual sending notifications to ping services”,</div> <div mce_tmp=”1″>’ping_about’ => “Information about module”,<br /> ‘ping_aboutdescr’ => “All information you must read for our support”,</div> <div mce_tmp=”1″>’ping_sitemap’ => “Submit Site Map”,<br /> ‘ping_sitemapdescr’ => “Manual sending sitemap to search engines”,</div> <div mce_tmp=”1″>’ping_opt’ => “Module send notifications to the ping services known about the changes on your site”,</div> <div mce_tmp=”1″>’ping_nositemap’ => “Site Map is not created, <a href=”\” mce_href=”\”"?mod=googlemap\”>Create</a> to send notifications”,</div> <div mce_tmp=”1″>’ping_pingpost’ => “Send notification to ping services after publish news:”,<br /> ‘ping_pingpostdescr’ => “Enable / Disable function. If disable – when you publish news, send notifications to ping services will not be carried”, // Think before disable – dleviet.com<br /> ‘ping_pingpostyes’ => “Send notifications”,<br /> ‘ping_pingpostno’ => “Do not send notification”,</div> <div mce_tmp=”1″>’ping_logonoff’ => “Enable Log events:”,</div> <div mce_tmp=”1″>’ping_logonoffdescr’ => “Enable / Disable function. If disable – Log events will not display on main page of module and record events”,<br /> ‘ping_logonoffyes’ => “Enable”,<br /> ‘ping_logonoffno’ => “Disable”,</div> <div mce_tmp=”1″>’ping_service’ => “Number of services in one time:”,<br /> ‘ping_servicedescr’ => “When you want to disable this feature, set this field to ’0′, in this case the delay function for sending notifications of ping services – will not work”,</div> <div mce_tmp=”1″>’ping_zaderjka’ => “The interval in seconds between sending notifications:”,<br /> ‘ping_zaderjkadescr’ => “Specify the interval in seconds between sending notifications”,</div> <div mce_tmp=”1″>’ping_logpp’ => “Records per page:”,<br /> ‘ping_logppdescr’ => “Specify how many records per page to show log”,</div> <div mce_tmp=”1″>’ping_sitemaprecreate’ => “Rebuild Site Map and send notification after publish news:”,<br /> ‘ping_sitemaprecreatedescr’ => “Enable / Disable function. If disable – when you publish a news, DO NOT rebuild and and send notifications about new version of site map”,<br /> ‘ping_sitemaprecreateyes’ => “Rebuild Site Map and send notification”,<br /> ‘ping_sitemaprecreateno’ => “DO NOT rebuild Site Map and send notification”,</div> <div mce_tmp=”1″>’ping_static’ => “Static pages priority:”,<br /> ‘ping_staticpre’ => “The Priority exported URL comparatively other URL on your put. The Possible range of importances from 0.0 before 1.0. This importance does not influence upon comparison of your pages with page on other site.”,<br /> ‘ping_news’ => “News priority:”,<br /> ‘ping_category’ => “Category priority:”,<br /> ‘ping_prior’ => “Will be used in the construction of site maps after publish news (if enabled)”,<br /> ‘ping_yahoo’ => “Yahoo App ID:”,<br /> ‘ping_yahoopre’ => “To send site map to Yahoo, you must enter the App ID, you can get it <a href=”http://developer.yahoo.com/dashboard” mce_href=”http://developer.yahoo.com/dashboard”></a>HERE</a>”,</div> <div mce_tmp=”1″>’ping_sitemapp’ => “Site Map”,</div> <div mce_tmp=”1″>’ping_setpingserv’ => “List of Ping Services”,<br /> ‘ping_setpingservdescr’ => “Each new service with a new line, duplicate services are removed”,<br /> ‘ping_setpingservcount’ => “Number of ping services: “,<br /> ‘ping_servdelete’ => “Clear list of Ping services”,<br /> ‘ping_logdelete’ => “Clear Log events”,</div> <div mce_tmp=”1″>// pingationMod 2.0.1
  • Run the installation file on your server. (http://domain.com/install_ping.php). If for some reason did not work, then do the SQL query in phpmyadmin.
    <br /> INSERT INTO `dle_admin_sections` VALUES (”, ‘ping’, ‘pingationMod’, ‘Module send notifications to the ping services known about the changes on your site’, ‘pingationmod.png’, ’1′);
  • Installation Complete, delete file install_ping.php and continue to work with the module.


    13
    八 10

    翻山越岭找到DLE Search Cloud Module 插件

    1. First, open connect.php in modules folder and enter database info.

    <?php
    $dbhost = ‘localhost‘; /* ENTER YOUR SERVER ADDRESS HERE ITS IS GENERALLY LOCALHOST. */

    $dbuser = ‘user‘; /* ENTER YOUR DATABASE USERNAME HERE. */

    $dbpass = ‘password‘; /* ENTER YOUR DATABASE PASSWORD HERE. */

    $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (‘Error connecting to mysql’);

    $dbname = ‘dle db‘; /* ENTER YOUR DATABASE NAME HERE. */
    mysql_select_db($dbname);
    ?>

    2. copy the engine folder of the zip pack you got into your root directory.

    3. Then import the IMPORT.sql into your DLE database using PhpMyAdmin.

    4. Then paste this code in your template’s main.tpl file using the DLE admin Panel where you want to display the Recent Searches section.

    {include file=”engine/modules/searchcloud.php”}

    5. Open /engine/engine.php and find.

    include ENGINE_DIR . ‘/modules/deletenews.php’;
    break;


    and after that copy and paste the following code.

    case “searchcloud” :
    include ENGINE_DIR . ‘/modules/search2.php’;
    break;

    6. Copy the following code to your .htaccess file.

    RewriteRule ^search/(.*).html?$ /index.php?do=searchcloud&subaction=search&story=$1&x=$4&y=$5 [L]

    that`s all you must do.
    good luck.
    tested and working.