Пример #1
0
<?php

/**
 * @package Component codoPM for Joomla! 3.0
 * @author codologic
 * @copyright (C) 2013 - codologic
 * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 * */
defined('_JEXEC') or die;
require "../arg.php";
require "../../../configuration.php";
$jconfig = new JConfig();
codopm::$db_prefix = $jconfig->dbprefix;
try {
    codopm::$db = new PDO('mysql:host=' . $jconfig->host . ';dbname=' . $jconfig->db, $jconfig->user, $jconfig->password);
} catch (PDOException $e) {
    print "Error!: " . $e->getMessage() . "<br/>";
    die("CODO_PM SAYS: Error Connecting Through PDO");
}
codopm::$db->query('SET CHARACTER SET utf8');
codopm::$db->query("SET NAMES utf8");
Пример #2
0
require 'arg.php';
$adapter = new Adapter();
$adapter->setup_tables();
codopm::$path = $adapter->get_abs_path();
if ($myadapter == 'Joomla') {
    $jversion = new JVersion();
    $ver = $jversion->RELEASE;
    $list = explode(".", $ver);
    $version = (int) $list[0];
    if ($version < 3) {
        $adapter->add_js("http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js");
    }
    $row_class = '';
    codopm::$req_path = codopm::$path . 'server/codopm.php?';
} else {
    codopm::$db_prefix = PREFIX . 'codo_';
    codopm::$req_path = RURI . 'codopm&';
}
function codopm_add_assets()
{
    $adapter = new Adapter();
    $adapter->add_css(codopm::$path . "client/css/app.css");
    $adapter->add_css(codopm::$path . "client/css/flick/jquery-ui-1.10.3.custom.min.css");
    $adapter->add_js(codopm::$path . "client/js/jquery.form.min.js");
    $adapter->add_js(codopm::$path . "client/js/jquery-ui-1.10.3.custom.min.js");
    $adapter->add_js(codopm::$path . "client/js/jquery.autosize.min.js");
}
function codopm_load()
{
    $myadapter = codopm_get_adapter();
    $adapter = new Adapter();