CMS

WEB DEVELOPMENT

Kami mengembangkan aplikasi CMS.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Membuat Komponen Sendiri dengan Joomla

Hal terpenting untuk suatu komponen di Joomla adalah memiliki file XML yang menentukan bagaimana komponen tersebut harus diintegrasikan ke dalam sang CMS. Sebagai contoh, anggaplah kita akan membuat sebuah komponen Joomla bernama “coba” yang berfungsi untuk menampilkan data user joomla.


 Untuk itu file XML-nya dapat dibuat seperti ini: 
file name coba.xml
"--->
<extension type="component" version="2.5.0" method="upgrade">
        <name>coba!</name>
        <!-- The following elements are optional and free of formatting constraints -->
        <creationDate>Oktober 2013</creationDate>
        <author>syaifullah</author>
        <authorEmail>singkawangonline@gmail.com</authorEmail>
        <authorUrl>http://www.bni2strore.com</authorUrl>
        <copyright>Copyright Info</copyright>
        <license>License Info</license>
        <!--  The version string is recorded in the components table -->
        <version>0.0.1</version>
        <!-- The description is optional and defaults to the name -->
        <description>Menampilkan data user ...</description>
        <update> <!-- Runs on update; New in 2.5 -->
                <schemas>
                        <schemapath type="mysql">sql/updates/mysql</schemapath>
                </schemas>
        </update>
        <!-- Site Main File Copy Section -->
        <!-- Note the folder attribute: This attribute describes the folder
                to copy FROM in the package to install therefore files copied
                in this section are copied from /site/ in the package -->
        <files folder="site">
                <filename>index.html</filename>
                <filename>coba.php</filename>
<filename>localdata.php</filename>
                <filename>controller.php</filename>
                <folder>views</folder>
        </files>
        <administration>
                <!-- Administration Menu Section -->
                <menu>coba!</menu>
                <!-- Administration Main File Copy Section -->
                <!-- Note the folder attribute: This attribute describes the folder
                        to copy FROM in the package to install therefore files copied
                        in this section are copied from /admin/ in the package -->
                <files folder="admin">
                        <!-- Admin Main File Copy Section -->
                        <filename>index.html</filename>
                        <filename>coba.php</filename>
<filename>localdata.php</filename>
                        <!-- SQL files section -->
                        <folder>sql</folder>
                </files>
        </administration>
</extension>
Buatlah file coba.php (saya menggunakan dreamwever untuk membuat file coba.php)
<?php 
defined('_JEXEC') or die('Restricted access');
require_once('localdata.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
  $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_localdata, $localdata);
$query_Recordset1 = "SELECT * FROM syi7k_users";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $localdata) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
  $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
  $all_Recordset1 = mysql_query($query_Recordset1);
  $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_Recordset1") == false && 
        stristr($param, "totalRows_Recordset1") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);
?><html>
<table border="1" align="center">
  <tr>
    <td>id</td>
    <td>name</td>
    <td>username</td>
    <td>email</td>
    <td>usertype</td>
    <td>sendEmail</td>
    <td>registerDate</td>
    <td>lastvisitDate</td>
    <td>activation</td>
    <td>params</td>
  </tr>
  <?php do { ?>
    <tr>
      <td><a href="/test.php?recordID=<?php echo $row_Recordset1['id']; ?>"> <?php echo $row_Recordset1['id']; ?>&nbsp; </a> </td>
      <td><?php echo $row_Recordset1['name']; ?>&nbsp; </td>
      <td><?php echo $row_Recordset1['username']; ?>&nbsp; </td>
      <td><?php echo $row_Recordset1['email']; ?>&nbsp; </td>
      <td><?php echo $row_Recordset1['usertype']; ?>&nbsp; </td>
      <td><?php echo $row_Recordset1['sendEmail']; ?>&nbsp; </td>
      <td><?php echo $row_Recordset1['registerDate']; ?>&nbsp; </td>
      <td><?php echo $row_Recordset1['lastvisitDate']; ?>&nbsp; </td>
      <td><?php echo $row_Recordset1['activation']; ?>&nbsp; </td>
      <td><?php echo $row_Recordset1['params']; ?>&nbsp; </td>
    </tr>
    <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<br>
<table border="0" width="50%" align="center">
  <tr>
    <td width="23%" align="center"><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
          <a href="/<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>">First</a>
          <?php } // Show if not first page ?>
    </td>
    <td width="31%" align="center"><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
          <a href="/<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>">Previous</a>
          <?php } // Show if not first page ?>
    </td>
    <td width="23%" align="center"><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
          <a href="/<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>">Next</a>
          <?php } // Show if not last page ?>
    </td>
    <td width="23%" align="center"><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
          <a href="/<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>">Last</a>
          <?php } // Show if not last page ?>
    </td>
  </tr>
</table>
Records <?php echo ($startRow_Recordset1 + 1) ?> to <?php echo min($startRow_Recordset1 + $maxRows_Recordset1, $totalRows_Recordset1) ?> of <?php echo $totalRows_Recordset1 ?>
</html>
<?php
mysql_free_result($Recordset1);
?>
selanjutnya melakukan penyesuaian pada baris paling atas yaitu :
<?php 
defined('_JEXEC') or die('Restricted access');
require_once('localdata.php'); ?>
Membuat file koneksi berupa file localdata.php sebagai berikut :
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_localdata = "localhost"; //sesuaikan dengan kondisi data masing
$database_localdata = "joomdle"; //sesuaikan dengan kondisi data masing
$username_localdata = "root";//sesuaikan dengan kondisi data masing
$password_localdata = "";
$localdata = mysql_pconnect($hostname_localdata, $username_localdata, $password_localdata) or trigger_error(mysql_error(),E_USER_ERROR); 
?>
Buat file index.html :
<html><body bgcolor="#FFFFFF"></body></html>
Buat file default.php :
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<h1><?php echo $this->msg; ?></h1>
Buat file controller.php
isinya blank
Buat file view.html.php
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<h1><?php echo $this->msg; ?></h1>
Buat file default.xml
<?xml version="1.0" encoding="utf-8"?>
<metadata>
        <layout title="COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_TITLE">
                <message>
                        <![CDATA[COM_HELLOWORLD_HELLOWORLD_VIEW_DEFAULT_DESC]]>
                </message>
        </layout>
</metadata>
(silahkan sesuai dengan hasil yang anda inginkan)
Buat file 0.0.1.sql
isinya blank
Share:

Cron Job


Cron Jobs adalah software yang bertugas untuk penjadwalan yang memungkinkan mengatur tugas secara terjadwal. jadi kita bisa mensetting tugas secara terjadwal seperti download file, download email dan lain sebagainya
file konfigurasi yang khusus menangani command agar berjalan secara periodik pada jangka waktu yang sudah ditentukan. File crontab disimpan dimana daftar tugas dan instruksi lainnya tersimpan. Pengguna bisa membuat file crontab nya sendiri.
Contoh :

Ganti command menjadi :

rm -rf find /home/user cpanel/mail/new/*.txt

maka seluruh file yang berada di folder new akan dihapus semua termasuk sub folder jika ada, dan proses tersebut akan dilakukan terus menuru setiap 5 menit

USER Cpanel = user yang diberikan pada saat anda mendaftar hosting seperti abu31987
                            rm -rf find /home/abu31987/mail/new/*.txt




Share:

Good News

Powered by Blogger.