Txhua ntu hauv txheej txheem Joomla nws muaj nws lub npe. Txhua tus lej code yog nyob hauv ob lub chaw cim nrog tus cim "com". Ua piv txwv, cia peb tsim cov kev tivthaiv uas txheeb xyuas cov chaw tsim kev lom zem hauv nroog hu ua "com_fun". Txhawm rau ua qhov no, koj yuav tsum tsim cov folders nrog cov npe tsim nyog hauv cov "khoom siv" thiab "cov tswj hwm" ntawm cov chaw. Tom qab ntawd hauv "componentscom_fun" nplaub tshev ua cov ntaub ntawv "fun.php", thiab hauv cov thawj coj nplaub tshev - "admin.fun.php".
Cov Lus Qhia
Kauj ruam 1
Txhawm rau cov feem ua kom pom qhov nplooj txais tos, koj yuav tsum qhib "fun.php" cov ntaub ntawv thiab sau cov cai uas yuav tsum muaj: <?
txhais tau tias ('_ JEXEC') lossis tuag ('Tsis kam');
echo 'Chaw Tsim Kev Lom Zem';
?> Nrog kev pab los ntawm txhais () peb txwv kev sau ntawv sau los ntawm sab nraud Joomla ib puag ncig. Nyob rau hauv cov ntaub ntawv "admin.fun.php" sau cov code zoo sib xws. Tam sim no ntaus rau hauv koj tus browser https://site/index.php? Kev xaiv = com_fun thiab koj yuav pom cov tivthaiv koj nyuam qhuav tsim.
Kauj ruam 2
Rau kev hloov yooj yim rau cov kev tivthaiv los ntawm cov neeg siv ntawm koj lub xaib, koj yuav tsum sau npe nws hauv lub chaw khaws ntaub ntawv. Siv phpMyAdmin lossis nws cov analogues siv los ua qhov MySQL cov lus nug ntawm koj lub hosting, ua txoj cai kom raug: INSERT INTO 'jos_components' ('npe', 'link', 'admin_menu_link', 'admin_menu_alt', 'option', 'admin_menu_img', ' params ') VALUES (' Fun ',' option = com_fun ',' option = 'com_fun', 'Fun', 'com_fun', 'js / ThemeOffice / component.png', '');
Kauj ruam 3
Mus rau koj Joomla admin vaj huam sib luag thiab tsim kev txuas rau cov khoom siv hauv cov ntawv qhia zaub mov tseem ceeb ntawm koj lub xaib. Mus rau "Txhua lub menus" - "Main menu" - "Tsim" khawm. Xaiv cov cim tsim, sau cov npe txuas thiab alias.
Kauj ruam 4
Txhawm rau tsim cov txheej txheem toolbar, tsim cov ntawv sau "toolbar.fun.html.php" hauv "cov thawj tswj / cheebtsam / com_fun /". Sau cov JS code tsim nyog rau hauv nws: <? Php
txhais tau tias ('_ JEXEC') lossis tuag ('Siv tsis pom zoo');
Chav TOOLBAR_fun {
muaj nuj nqi _NEW () {
JToolBarHelper:: tseg ();
JToolBarHelper:: thov ();
JToolBarHelper:: tso tseg (); }
muaj nuj nqi _DEFAULT () {
JToolBarHelper:: title (JText:: _ ('Lom Zem'), 'generic.png');
JToolBarHelper:: tshaj tawmList ();
JToolBarHelper:: unpublishList ();
JToolBarHelper:: editList ();
JToolBarHelper:: deleteList ();
JToolBarHelper:: addNew ();.}}
?>
Kauj ruam 5
Hauv tib lub nplaub tshev tsim cov ntawv toolbar.fun.php thiab ntxiv rau nws: <? Php txhais ('_ JEXEC') lossis tuag ('Kev siv yog txwv');
require_once (JApplicationHelper:: getPath ('toolbar_html'));
hloov ($ ua haujlwm) {
cov ntaub ntawv 'kho':
rooj plaub 'ntxiv':
TOOLBAR_fun:: _ TSHIAB (); tawg;
default: TOOLBAR_fun:: _ DEFAULT ();
tawg; }
?>