`

joomla > 笔记1

 
阅读更多

** 在TITLE 后加网站名字

在 <jdoc:include type="head" />之前加進:

 <?php$mydoc =& JFactory::getDocument();

$mytitle = $mydoc->getTitle(); 
$conf =& JFactory::getConfig();
$sitename = $conf->getValue('config.sitename'); //取得網站名稱 
$mydoc->setTitle($mytitle.' - '.$sitename);
?>

**  列表查询

 

$db->setQuery("SELECT * FROM  `jos_users` WHERE  `block` =0  AND  `gid` =24");

$q_user=$db->loadObjectList();

foreach($q_user as $q_user_list){

echo $q_user_list->name.'<BR>';

}

**  用户注册

 

$db =& JFactory::getDBO();

 

 

$reg_date = date("Y-m-d H:i:s");

$q_i_1=$db->setQuery("INSERT INTO `jos_users` (`id` ,`name` ,`username` ,`email` ,`password` ,`usertype` ,`block` ,`sendEmail` ,`gid` ,`registerDate` ,`lastvisitDate` ,`activation` ,`params`)VALUES (NULL , '".$post['name']."', '".$post['user_name']."', '".$post['email']."', MD5( '".$post['pwd']."' ) , 'Author', '0', '0', '19', '".$reg_date."', '0000-00-00 00:00:00', '', '');");

$f_i_1=$db->query($q_i_1);

$r_i_2_id = $db->insertid($f_i_1);

$q_i_3=$db->setQuery("INSERT INTO `jos_core_acl_aro` ( `id` , `section_value` , `value` , `order_value` , `name` , `hidden` ) VALUES (   NULL , 'users', '".$r_i_2_id."', '0', '".$post['name']."', '0' );");

$f_i_3=$db->query($q_i_3);

$r_i_5_id = $db->insertid($f_i_3);

$q_i_4=$db->setQuery("INSERT INTO `jos_core_acl_groups_aro_map` ( `group_id` , `section_value` , `aro_id` ) VALUES ( '19', '', '".$r_i_5_id."' );");

$f_i_4=$db->query($q_i_4);

 

 

 

** 获取 新 插入 ID

echo $db->insertid();

 

** $user = &JFactory::getUser();  $user->get('gid') 等于 jos_core_acl_aro_groups  表中的 id,   jos_users 中的gid 即 groups 的IP

**  组件开发 参考 这个地址 http://wenku.baidu.com/view/32cff33383c4bb4cf7ecd167.html

**   JOOMLA  弹出 BOX 

** module 读取 xml  在 module.php  , $params->get( 'custom_code' )

** 输出JOOMLA 跟目录 路径 的常量 JPATH_ROOT     JPATH_ADMINISTRATOR

** 库

$app = JFactory::getApplication();

$app->input->getCmd('Itemid', '');

 

$app = JFactory::getApplication();

$menu = $app->getMenu();

$mytitle = $menu->getActive();  //输出当前页相关属性

$menu->setActive(627); $menu->setActive($_REQUEST['Itemid']); //设置当前Item

$site_name = $app->getCfg('sitename');

 

** 跳转到登录 再 跳转

1
2
3
$app = JFactory::getApplication();
 
$app->redirect(JRoute::_('index.php?option=com_users&view=login&return='.base64_encode(JRoute::_('index.php?option=com_joomfaq&view=category')), false), '请先登录');

 

** 网站 主域名 JURI::base()

** 修改 configuation.php 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
$config = JFactory::getConfig();
$config->set('joom_faq_need_check''3333');
writeConfigFile($config);
function writeConfigFile(JRegistry $config)
{
    jimport('joomla.filesystem.path');
    jimport('joomla.filesystem.file');
 
    // Set the configuration file path.
    $file = JPATH_CONFIGURATION . '/configuration.php';
 
    // Get the new FTP credentials.
    $ftp = JClientHelper::getCredentials('ftp', true);
 
    // Attempt to make the file writeable if using FTP.
    if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file'0644'))
    {
    JError::raiseNotice('SOME_ERROR_CODE', JText::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTWRITABLE'));
    }
 
    // Attempt to write the configuration file as a PHP class named JConfig.
    $configuration $config->toString('PHP'array('class' => 'JConfig''closingtag' => false));
    if (!JFile::write($file$configuration))
    {
    $this->setError(JText::_('COM_CONFIG_ERROR_WRITE_FAILED'));
    return false;
    }
 
    // Attempt to make the file unwriteable if using FTP.
    if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file'0444'))
    {
        JError::raiseNotice('SOME_ERROR_CODE', JText::_('COM_CONFIG_ERROR_CONFIGURATION_PHP_NOTUNWRITABLE'));
    }
 
    return true;
}
分享到:
评论

相关推荐

    joomla资料 joomla开发 joomla教程

    您可以在这里免费获得joomla资料,您也可以分享您的joomla心得,方便发大家互相学习。聚集Joomla爱好者,彻底改变Joomla在中国发展的面貌。我们的目标是让全世界最优秀的CMS系统—Joomla真正的走向中国,为Joomla在...

    joomla表结构介绍

    joomla表结构介绍 joomla表结构介绍 joomla表结构介绍 joomla表结构介绍 joomla表结构介绍 joomla表结构介绍 joomla表结构介绍 joomla表结构介绍 joomla表结构介绍 joomla表结构介绍 joomla表结构介绍 joomla表结构...

    joomla and joomla

    joomla

    joomla七牛插件

    joomla七牛插件,加速网站的速度。系统会自动将你网站的静态内容同步到你的七牛空间,让你的Joomla网站飞起来!

    Joomla! 用户宝典

    Joomla! A User's Guide: Building a Successful Joomla! Powered Website中文版。 入门书籍。网友翻译。 关于本书 对于Joomla! 这个流行的、屡获大奖的开源CMS,本教程会教你用Joomla按你自己需求一步一步,最终...

    joomla1.5使用教程 - 中文手册

    Building.Websites.with.Joomla1.5 & joomla 1.5建站宝典 第一单元:术语,概念,和审议 joomla 1.5安装方法 第三单元 前台内容 第三单元 前台内容? 第三单元 后台 Joomla 管理配置! 帮助菜单 网站菜单 用户管理器...

    Joomla1.5升级为Joomla2.5(

    zmax程序人 将Joomla1.5版本的模板移植到Joomla2.5上的经验总结

    joomla模块用户列表

    提供Joomla展示用户列表的功能,已中文化

    joomla 2.5 空白模板

    joomla2.5空白的模板,只要有了这个模板就可以很快高效的制作joomla2.5的模板了

    joomla漏洞利用代码

    joomla漏洞利用代码,影响版本joomla1.5-3.4.最开始检测到利用该漏洞实施入侵的是 Securi 安全团队

    joomla3.1.1_chinese_v1__1.zip

    joomla 中文 joomla3.1.1_chinese_v1__1.zip

    joomla 1.515 留言本

    joomla建站系统 1.515 留言本插件

    Joomla! 3: Beginner’s Guide

    Joomla! is one of the most popular open source Content Management Systems, actively developed and supported by a world-wide user community. It’s a free, fun, and feature-rich tool for anyone who ...

    joomla使用模板 美观

    joomla使用模板 joomla使用模板

    Joomla! 宝典.pdf

    Chapter 1: Introducing the Joomla! Content Management System Discovering Open Source Content Management Discovering Joomla! The Joomla! architecture Summary Chapter 2: Obtaining and Installing Joomla!...

    joomla常用组件汇总

    joomla常用组件汇总

    Joomla媒体管理组件

    Joomla媒体管理组件扩展可以取代Joomla系统的媒体管理。上传文件和插入文件一步到位, 插入文件更加容易。 内置搜索功能,让你迅速定位你想要插入的资源, 改进系统不支持中文名称。 本扩展可以支持中文名称资源...

    Joomla 1.0 升级到 Joomla 1.5 用的组件

    Joomla 1.0 升级到 Joomla 1.5 用的组件 [migrator] 描述 默认joomla 35个表, 如果你装其他com.....则需要这个组件对应的插件! 在joomla 1.0里安装,生成sql 然后下载.... 在你安装 joomla 1.5的时候, 在安装示例...

    Joomla教程很好用的CMS

    Joomla,是一个人人都可以免费,的开源内容管理系统(CMS)。它是中小企业建站的理想选择。不要让价格来困扰你——Joomla!是强大且稳定的,并且被越来越多的机构选择作为解决方案。这样普遍的使用使得Joomla!作为一个...

    一款很好的Joomla2.5模板

    一款很好的Joomla2.5模板

Global site tag (gtag.js) - Google Analytics