Joomla 二次开发 学习笔记,joomla学习笔记
- Joomla目录结构
/administrator 管理后台的路径
/cache 是缓存目录
/components 是组件(component)目录
/includes 是一个重要的目录,里面都是Joomla运行所需的各种脚本、函数等等。
/language 即网站语言目录。
/plugins即扩展(触发器)目录。
/modules 目录是存储模块(module)程序的地方,Joomla已经定义了十多个模块位置,如header、footer、left、right、debug、user1、advert2等等。
/templates 模板目录,里面每个子目录对应一个模板
/libraries 类包目录,都是重要的类文件
/logs 日志目录,存放生成的日志脚本文件
/images 图片目录
/media 目录是存放各种媒体文件的地方。
/xmlrpc xml远程方法调用,采用xml作为调用远程方法的媒介
/tmp 临时目录
- Joomla!组件结构
Joomla!的所有组件都遵循特定的命名方案。每个系统组件都有唯一的名字,名字不能包括空格。
代码分成两个文件夹,文件夹以com_开头,紧接着就是组件的名字。eg:组件名叫books。因此,你要创建两个相同名字的com_books文件夹
当组件在前台加载的时候,Joomla!将会查找文件组件名.php
前台components下,目录com_books,文件books.php。
放到后台administrator/components,目录com_books,文件admin.books.php。
- Joomla!接口介绍
数据库操作:连接数据库——执行SQL语句——查询数据
1)数据库操作连接数据库
$db=& JFactory::getDBO();
2)执行SQL语句
$sql="select * from #_tags";
$db->execute($sql);
3)查询数据
$sql="select * from #_tags";
$db->setQuery($sql);
$rows=$db->loadObjectList();
foreach($rows as $row){
echo $row->tag;
}
会话操作:调用Session
1)获取Session的值
$session=&JFactory::getSession();
$name="session_name";
$sValue=$session->get($name);
2)设置Session的值
$session=JApplication::_createSession();
$name="session_name";
$value="alex";
$session->set($name,$value);
Joomla!数据库常用表
文章分类
jos_categories
jos_sections
Joomla!组件、模块、插件
jos_components
jos_modules
jos_plugins
文章
jos_content
菜单
jos_menu
用户以及登陆
jos_groups
jos_session
jos_users

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver CS6
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)
