Wishlist 0 ¥0.00

给Joomla/WordPress网站添加百度统计代码

百度统计是目前免费而且比较好用的网站流量统计平台了。如果用Joomla或者Wordpress建站的同学,想要使用百度统计的话,要怎么操作呢?(其他的统计代码使用方法类似)

有一些模板或主题,会在内部设置好了插入Javascript统计代码的地方,这样的话,只需要把Javascript统计代码复制上去即可。但是大部分的模板并没有这个设置。这时候就只能自己添加了。

 

给Joomla/Wordpress网站添加百度统计代码

对于Joomla:

在Joomla 3.x上,可以通过直接修改模板目录下的index.php来实现添加统计代码。比如把代码写入到 templates/beez3/index.php 里面的</body>标记(接近页面尾部的地方)之前就行了。

可以直接登录ftp后台,用编辑器在线修改。当然,对于新手,比较保险的方式是先用ftp把对应的index.php文件下载到本地并备份,然后修改好再上传覆盖。即使出错了,也方便恢复。

对于Wordpress:

具体操作方法与Joomla类似,不过不是插入到index.php文件,而是footer.php文件。

首先在百度统计获取安装代码,在后台文件中查找 wp-content/themes/footer.php 文件,然后打开,将百度统计代码复制粘贴到页尾<body>的前面,保存并更新文件。

代码插入后,大概等二十分钟左右,即可生效。

如何在Joomla中删除组件菜单链接

有时,Joomla用户已删除组件,但仍在其管理区域中看到该组件的菜单项。

在本教程中,您将学习如何摆脱不必要的菜单项。Akeeba订阅将用作示例组件。

您可以在下图中看到以语言字符串形式渲染的不需要的菜单项:

deleted-components-menu-01.png

要彻底删除它,请打开您站点的数据库。

找到#__menu表,其中#__是您的数据库前缀。单击此数据库表。

deleted-components-menu-02.png

浏览表记录,直到找到由不需要的组件创建的记录。

单击删除。

deleted-components-menu-03.png

您将看到“确认”框,提示您确认您确实要删除数据库表记录。

单击确定。

deleted-components-menu-04.png

您将看到您的组件记录不再在表中列出:

deleted-components-menu-05.png

在您的Joomla控制面板中,转到“组件”菜单。您将看到那里也没有列出不需要的菜单项:

deleted-components-menu-06.png

 

Save failed with the following error: MenusTableMenu: :_getNode Failed –

  • i can’t edit new menu items. this is the message displayed when i try to save:
    Save failed with the following error: MenusTableMenu: :_getNode Failed –

     Ninja Lead Moderator
    #491456

    This is problem from menu table on database of your site, you can fix it as follows

    Seems that in your menu table, it’s already have menu with ID=1. So, if you can go directly to row with ID=1 to update value and make sure that it ‘s the same with: ( ‘1’,”,’Menu_Item_Root’, ‘root’,”,”,”,”,’1′,’0′, ‘0’, ‘0’, ‘0’, ‘0’,’0000-00-00 00:00:00′,’0′,’0′,”,’0′,”,’0′,’0′,’0′,’*’,’0′)

    acusticambiente Friend
    #491469

    <em>@Ninja Lead 371010 wrote:</em><blockquote>This is problem from menu table on database of your site, you can fix it as follows

    Seems that in your menu table, it’s already have menu with ID=1. So, if you can go directly to row with ID=1 to update value and make sure that it ‘s the same with: ( ‘1’,”,’Menu_Item_Root’, ‘root’,”,”,”,”,’1′,’0′, ‘0’, ‘0’, ‘0’, ‘0’,’0000-00-00 00:00:00′,’0′,’0′,”,’0′,”,’0′,’0′,’0′,’*’,’0′)</blockquote>
    where? how?? please help me!!!! :((

     Ninja Lead Moderator
    #491502

    To solve this problem please do the following two steps.

    1. Add the missing record to the database
    Log in to phpmyadmin and execute the following statement
    INSERT INTO `DATABASE_NAME`.`prefix_menu` (`id` ,`menutype` ,`title` ,`alias` ,`note` ,`path` ,`link` ,`type` ,`published` ,`parent_id` ,`level` ,`component_id` ,`ordering` ,`checked_out` ,`checked_out_time` ,`browserNav` ,`access` ,`img` ,`template_style_id` ,`params` ,`lft` ,`rgt` ,`home` ,`language` ,`client_id` ) VALUES ( ‘1’, ”, ‘Menu_Item_Root’, ‘root’, ”, ”, ”, ”, ‘1’, ‘0’, ‘0’, ‘0’, ‘0’, ‘0’, ‘0000-00-00 00:00:00’, ‘0’, ‘0’, ”, ‘0’, ”, ‘0’, ‘0’, ‘0’, ‘*’, ‘0’)

    2. Rebuilding menus
    Go to the administrator panel of joomla.
    Menus –> MenuManager
    Select all menus
    Click on the button ‘Rebuild’
    (By doing step two, the field ‘rgt’ in the just added record (step one) will get the appropriate value.)

    I’ve tested this solution several times and each time with positive results.

    acusticambiente Friend
    #491708

    it works!!!! thanx a lot!!!:)

Solved: Save failed MenusTableMenu getNode Failed problem

If you are seeing a "Save failed with the following error: MenusTableMenu::_getNode(1, ) failed." message when creating a new menu item or edit an existing menu item in Joomla, it usually means there is a record missing from your menu table. Here's how to fix that.

Note: before you make any edits, it's always a good idea to have a verified backup available.

Access your database using PhpMyAdmin or whatever database tool you like. Next, add the record back in using the following statement. Change the database table name prefix to match your own.

INSERT INTO prefix_menu (`id` ,`menutype` ,`title` ,`alias` ,`note` ,`path` ,`link` ,`type` ,`published` ,`parent_id` ,`level` ,`component_id` ,`checked_out` ,`checked_out_time` ,`browserNav` ,`access` ,`img` ,`template_style_id` ,`params` ,`lft` ,`rgt` ,`home` ,`language` ,`client_id` ) 
VALUES ( "1", "", "Menu_Item_Root", "root", "", "", "", "", "1", "0", "0", "0", "0", "0000-00-00 00:00:00", "0", "0", "", "0", "", "0", "0", "0", "*", "0")

 Next, we need to rebuild the menus. To do that, in the administrator panel of your Joomla website, navigate to Menus > Menu Manager. On the Menu Manager screen, select all menus and click on the buttton 'Rebuild'. This step fixes the positioning of the menu record you added in step one.

评论:出现这样错误提示:MenusTableMenu::getRootId。

这个方法也可以。

About Us

Since 1996, our company has been focusing on domain name registration, web hosting, server hosting, website construction, e-commerce and other Internet services, and constantly practicing the concept of "providing enterprise-level solutions and providing personalized service support". As a Dell Authorized Solution Provider, we also provide hardware product solutions associated with the company's services.
 

Contact Us

Address: No. 2, Jingwu Road, Zhengzhou City, Henan Province

Phone: 0086-371-63520088 

QQ:76257322

Website: 800188.com

E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.