function delete() { $id = $_POST['to_table_id']; if (intval($id) == 0) { exit('id?'); } else { global $cms_db_tables; $id = intval($_POST['to_table_id']); $real_table = $cms_db_tables[$_POST['to_table']]; $q = "delete from {$real_table} where id={$id} "; $q = CI::model('core')->dbQ($q); $table = $cms_db_tables['table_reports']; $q = "delete from {$table} where to_table='{$_POST['to_table']}' and to_table_id='{$_POST['to_table_id']}' "; $q = CI::model('core')->dbQ($q); CI::model('core')->cleanCacheGroup('reports'); switch ($_POST['to_table']) { case 'table_content': CI::model('core')->cleanCacheGroup('content'); break; case 'table_comments': CI::model('core')->cleanCacheGroup('comments'); break; default: CI::model('core')->cacheDeleteAll(); break; } //CI::model('comments')->commentsDeleteById ( $id ); } }
function get_visits_by_url($url, $start_time = false) { global $cms_db_tables; $idsite = $this->site_id(); $table = $cms_db_tables['table_log_action']; $cache_group = 'global/stats'; $q = "SELECT * FROM {$table} WHERE name = '{$url}' "; $q = CI::model('core')->dbQuery($q, __FUNCTION__ . md5($q), $cache_group, '- 5 minutes'); if (!empty($q)) { $q = $q[0]; $idaction = $q['idaction']; $table2 = $cms_db_tables['table_log_link_visit_action']; if ($start_time == false) { $start_time = strtotime("4 weeks ago"); $start_time = date("Y-m-d H:i:s", $start_time); } else { $start_time = strtotime($start_time); $start_time = date("Y-m-d H:i:s", $start_time); } $q = " SELECT idaction_name as id, \n COUNT(idlink_va) as views, \n COUNT(DISTINCT idvisitor) as visits, \n COUNT(IF(idaction_url_ref=0, 1, null)) as entry, \n log_action.name as page \n FROM {$table2}, {$table} \n WHERE {$table2}.idsite={$idsite} \n \n and idaction_url = {$idaction} \n \n AND {$table2}.idaction_name = {$table}.idaction \n AND server_time >='{$start_time}'\n \n "; $q = " SELECT idaction_name as id, \n COUNT(idlink_va) as views \n \n FROM {$table2} \n WHERE \n \n idaction_url = {$idaction} \n \n \n AND server_time >='{$start_time}'\n \n "; $q = CI::model('core')->dbQuery($q, __FUNCTION__ . md5($q), $cache_group, '- 5 minutes'); return intval($q[0]["views"]); } else { return 0; } }
function index() { header("Content-type: text/plain"); $segs = $this->uri->segment_array(); $cron_group = false; $force = false; $action = false; foreach ($segs as $segment) { if (stristr($segment, 'g:') == true) { $cron_group = substr($segment, 2, strlen($segment)); /// exit($cron_group); } if (stristr($segment, 'force:true') == true) { $force = true; } if (stristr($segment, 'a:') == true) { $action = substr($segment, 2, strlen($segment)); } } $job = CI::model('core')->cronjobGetOne($cron_group, $force, $action); if (!empty($job)) { print "\n\n" . 'Begin - ' . date("Y-m-d H:i:s") . ' - ' . $job['cronjob_name'] . "\n"; $to_exc = '$this->' . $job['model_name'] . '->' . $job['function_to_execute']; //print $to_exc; eval($to_exc . ';'); print "\n" . 'End - ' . date("Y-m-d H:i:s") . ' - ' . $job['cronjob_name'] . "\n\n"; } else { print "\n" . 'No jobs - ' . date("Y-m-d H:i:s") . "\n\n"; } //var_dump($job); //print 'cron-' . date("Y-m-d H:i:s"); }
function load() { $plugin_name = $this->uri->segment(4); $this->template['functionName'] = strtolower(__FUNCTION__); $this->template['pluginName'] = $plugin_name; $this->load->vars($this->template); $layout = CI::view('admin/layout', true, true); $primarycontent = ''; $secondarycontent = ''; $plugindata = CI::model('core')->plugins_getPluginConfig($plugin_name); // //print PLUGINS_DIRNAME . $dirname .$plugin_name.'/'.$plugindata['plugin_admin_dir']. '/controller.php' ; if (is_file(PLUGINS_DIRNAME . $dirname . $plugin_name . '/' . $plugindata['plugin_admin_dir'] . '/controller.php') == true) { $firecms = get_instance(); define('THIS_PLUGIN_URL', site_url('admin/plugins/load') . '/' . $plugin_name . '/'); define('THIS_PLUGIN_DIRNAME', PLUGINS_DIRNAME . $dirname . $plugin_name . '/'); define('THIS_PLUGIN_DIRNAME_ADMIN', PLUGINS_DIRNAME . $dirname . $plugin_name . '/' . $plugindata['plugin_admin_dir'] . '/'); require_once PLUGINS_DIRNAME . $dirname . $plugin_name . '/' . $plugindata['plugin_admin_dir'] . '/controller.php'; } //$primarycontent = CI::view ( 'admin/comments/index', true, true ); //$secondarycontent = CI::view ( 'admin/content/sidebar', true, true ); $layout = str_ireplace('{primarycontent}', $primarycontent, $layout); $layout = str_ireplace('{secondarycontent}', $secondarycontent, $layout); //CI::view('welcome_message'); CI::library('output')->set_output($layout); }
function mediaDelete() { $id = $_POST['id']; if (intval($id) != 0) { CI::model('core')->mediaDelete($id); } exit; }
function delete() { $id = $_POST['id']; if (intval($id) == 0) { exit('id'); } else { CI::model('comments')->commentsDeleteById($id); } }
function useremail_check($username) { $check = CI::model('users')->doUserExist('email', $username); if ($check == true) { $this->validation->set_message('useremail_check', "The email {$username} is already assigned to another user! Please choose new one!"); return FALSE; } else { return TRUE; } }
function ajax_delete_by_id() { $id = $_POST['id']; if (intval($id) == 0) { exit(0); } else { CI::model('core')->optionsDeleteById($id); exit(1); } }
function google_Analytics_getKeywordsForProfile($profile_id, $start_date = false, $end_date = false) { $email = CI::model('content')->optionsGetByKey('google_analytics_login'); $pass = CI::model('content')->optionsGetByKey('google_analytics_pass'); require_once "Zend/Loader.php"; Zend_Loader::loadClass('Zend_Gdata'); Zend_Loader::loadClass('Zend_Gdata_Query'); Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); $client = Zend_Gdata_ClientLogin::getHttpClient($email, $pass, "analytics"); $gdClient = new Zend_Gdata($client); if ($start_date == false) { $start_date = date("Y-m-d", mktime(0, 0, 0, date("m") - 1, date("d"), date("Y"))); } if ($end_date == false) { $end_date = date("Y-m-d", mktime(0, 0, 0, date("m") - 0, date("d"), date("Y"))); } try { $dimensions = array("ga:region", "ga:city", "ga:latitude", "ga:longitude"); $metrics = array("ga:visits", "ga:pageviews"); $dimensions = array("ga:keyword"); $metrics = array("ga:pageviews"); //dimensions=ga:country&metrics=ga:visitors $reportURL = "https://www.google.com/analytics/feeds/data?ids={$profile_id}&" . "dimensions=" . @implode(",", $dimensions) . "&" . "metrics=" . @implode(",", $metrics) . "&max-results=50" . '&sort=ga:pageviews' . "&" . "start-date={$start_date}&" . "end-date={$end_date}"; // var_dump($reportURL); $results = $gdClient->getFeed($reportURL); $titleRow = 1; // To output a row of column labels foreach ($results as $rep) { if ($titleRow) { foreach ($rep->extensionElements as $elem) { $titles[] = $elem->extensionAttributes["name"]["value"]; } // echo implode ( ",", $titles ) . "\n"; //echo "<hr>"; $titleRow = 0; } foreach ($rep->extensionElements as $elem) { //var_dump($elem); $the_item = $elem->extensionAttributes["value"]["value"]; var_dump($the_item); if (strlen($the_item) > 5) { print '<pre>'; $row[] = $the_item; print '</pre>'; } } //echo implode ( ",", $row ) . "\n"; //echo "<br>"; } } catch (Zend_Exception $e) { echo "Caught exception: " . get_class($e) . "\n"; echo "Message: " . $e->getMessage() . "\n"; } }
function edit() { //CI::library ( 'session' )->set_userdata ( 'editmode', false ); $is_admin = is_admin(); if ($is_admin == false) { $go = site_url('login'); safe_redirect($go); } $layout = CI::view('admin/iframe', true, true); $layout = CI::model('template')->parseMicrwoberTags($layout); //$layout = CI::model('template')->parseMicrwoberTags ( $layout ); CI::library('output')->set_output($layout); }
function login() { $back_to = CI::model('core')->getParamFromURL('back_to'); global $cms_db_tables; $table = $cms_db_tables['table_users']; $username = $this->input->post('username', TRUE); $password = $this->input->post('password', TRUE); $user_action = $this->input->post('user_action', TRUE); if ($user_action == 'register') { $q = "select username from " . $table . " where username='******' "; $query = CI::db()->query($q); $query = $query->row_array(); $query = array_values($query); $username = $query[0]; if ($username != '') { $this->template['message'] = 'This user exists, try another one!'; } else { $data = array('updated_on' => date("Y-m-d h:i:s"), 'is_active' => 0, 'username' => $username, 'password' => $password); $this->db->insert($table, $data); $this->template['message'] = 'Success, try login now!'; } } else { $q = "select * from " . $table . " where username='******' and password='******' and is_active=1"; $query = CI::db()->query($q); $query = $query->row_array(); if (empty($query)) { $this->template['message'] = 'Wrong username or password, or user is disabled!'; } else { CI::library('session')->set_userdata('user', $query); if ($back_to == false) { redirect('dashboard'); } else { redirect(base64_decode($back_to)); } } } $this->load->vars($this->template); $layout = CI::view('layout', true, true); $primarycontent = ''; $secondarycontent = ''; $primarycontent = CI::view('login', true, true); $layout = str_ireplace('{primarycontent}', $primarycontent, $layout); $layout = str_ireplace('{secondarycontent}', $secondarycontent, $layout); //CI::view('welcome_message'); //CI::library('output')->set_output ( $layout ); }
/** * Get statuses for given params and return as array * @param array $params * @param array $options * @return array array of ids */ function statusesByParams($params, $options = false) { if (empty($params)) { return false; } global $cms_db_tables; $table = $cms_db_tables['table_users_statuses']; //array (array ('user_id', $currentUser ['id'] ), array ('follower_id', $currentUser ['id'], '=', 'OR' ) ) ); //$params [] = array ('to_user', $user_id ); //$params [] = array ('is_read', 'n' ); //$params [] = array ('deleted_from_receiver', 'n' ); $defalut_options = array(); $defalut_options['get_count'] = false; $defalut_options['debug'] = false; $defalut_options['cache'] = true; $defalut_options['cache_group'] = 'users/statuses/'; foreach ($options as $k => $item) { $defalut_options[$k] = $item; } $data = CI::model('core')->fetchDbData($table, $params, $defalut_options); return $data; }
function id($id) { global $cms_db_tables; $data = array(); //parent::ajax_json_get_items_for_order_id(); if ($id) { $q = "SELECT * FROM {$cms_db_tables['table_cart_orders']} WHERE id={$id}"; $q = CI::model('core')->dbQuery($q); $array_buf = $q[0]; $array_buf2 = array(); foreach ($array_buf as $key => $val) { if ($key != 'cvv2') { if ($key == 'cardholdernumber') { $val = substr_replace($val, "######", 0, strlen($val) - 4); } $array_buf2[$key] = $val; } } $data['order_info'] = $array_buf2; } $primarycontent = CI::view('admin/popup', $data); }
function comments_list() { if (!$_POST) { exit("ERROR: you must send \$ POST array. Read the docs"); } //p($_POST); $comments = array(); if ($_POST['to_table'] == false) { $_POST['to_table'] = $_POST['for']; } if ($_POST['to_table_id'] == false) { $_POST['to_table_id'] = $_POST['id']; } if ($_POST['to_table_id'] == false) { $_POST['to_table_id'] = $_POST['content_id']; } $comments['to_table'] = CI::model('core')->securityDecryptString($_POST['to_table']); $comments['to_table_id'] = CI::model('core')->securityDecryptString($_POST['to_table_id']); $comments['display'] = CI::model('core')->securityDecryptString($_POST['display']); $comments['to_table'] = CI::model('core')->guessDbTable($comments['to_table']); //print_r ( $comments ); if ($comments['display'] == false) { $comments['display'] = 'default'; } comments_list($content_id = $comments['to_table_id'], $display = $comments['display'], $for = $comments['to_table'], $display_params = array()); /* $comments = CI::model('comments')->commentsGet ( $comments ); $this->template ['comments'] = $comments; $this->load->vars ( $this->template ); $layout = $this->load->file ( APPPATH . 'controllers/api/views/' . __FUNCTION__ . '.php', true ); $layout = CI::model('content')->applyGlobalTemplateReplaceables ( $layout ); CI::library('output')->set_output ( $layout );*/ //var_dump ($content_filename_pre, $files ); }
function index() { $this->template['functionName'] = strtolower(__FUNCTION__); if (CI::library('session')->userdata('user') == false) { //redirect ( 'index' ); } if ($_POST) { CI::model('users')->saveUser($_POST); } $users = CI::model('users')->getUsers(); $this->template['users'] = $users; $this->load->vars($this->template); $layout = CI::view('admin/layout', true, true); $primarycontent = ''; $secondarycontent = ''; $primarycontent = CI::view('admin/users/index', true, true); $secondarycontent = CI::view('admin/users/sidebar', true, true); $layout = str_ireplace('{primarycontent}', $primarycontent, $layout); $layout = str_ireplace('{secondarycontent}', $secondarycontent, $layout); //CI::view('welcome_message'); CI::library('output')->set_output($layout); }
function downloadRemoteVid($vid) { $table = TABLE_PREFIX . 'masterdebate_videos'; //$vid = 'asdasda'; @mkdir(BASEPATHSTATIC . 'videos/'); $savedir = BASEPATHSTATIC . 'videos/'; $filename1 = $vid . '.flv'; $filename2 = $vid . '.flv.meta'; $url = MASTER_DEBATE_RED5_SAVE_STREAMS_URL . $filename1; $url_meta = MASTER_DEBATE_RED5_SAVE_STREAMS_URL . $filename2; //print $url; if (@fopen($url, "r")) { $command = " wget -o /dev/null -c -q {$url} -O {$savedir}{$filename1}\t"; $command3 = " flvtool2 -U -c -a -v {$savedir}{$filename1} "; //print $command . " ; " . $command3 ; //exit; exec($command . " ; " . $command3); // exec ( $command3 ); //print $command; //exit; if (@fopen($url_meta, "r")) { $command2 = " wget -o /dev/null -c -b -q {$url_meta} -O {$savedir}{$filename2}\t"; exec($command2); } //exec ( $command3 ); $data_to_save = false; $data_to_save['vid'] = $vid; $data_to_save['saved_to_local'] = '1'; $data_to_save['is_active'] = '1'; $save = CI::model('core')->saveData($table, $data_to_save); exec($command3); return true; //print $command; //echo "File Exists"; } else { return false; } }
<? $author = CI::model('users')->getUserById( $data); ?> <? $thumb = CI::model('users')->getUserThumbnail( $author['id'], 70); ?> <li> <a href="<? print user_link($author['id']); ?>"> <span style="background-image: url('<? print $thumb; ?>');"></span> <strong><? print user_name($author['id']) ; ?></strong> </a> </li>
<?php $site_stats = md5(site_url()); $stats_setup = CACHEDIR_ROOT . '/db_tmp/stats_' . $site_stats . '.php'; if (is_file($stats_setup) == false) { CI::model('stats')->site_id(); touch($stats_setup); } /* $agent = $_SERVER ['HTTP_USER_AGENT']; $the_user = CI::library('session')->userdata ( 'the_user' ); if ($_POST and $_POST ['username'] and $_POST ['password']) { if (empty ( $the_user )) { if ($_POST ['username']) { if ($_POST ['password']) { $user = $_POST ['username']; $pass = $_POST ['password']; $data = array (); $data ['username'] = $user; $data ['password'] = $pass; $data ['is_active'] = 'y'; $data = CI::model('users')->getUsers ( $data ); $data = $data [0]; if (empty ( $data )) { CI::library('session')->unset_userdata ( 'the_user' ); } else {
<? $file_to_edit = ($params['layout_file']); $src = CI::model('template')->layoutGet($file_to_edit); ?> <? print $src ; ?>
function reportsGetCount($to_table, $to_table_id, $since_time = false) { if ($since_time == false) { $since_time = ' 1 year '; } if (($timestamp = strtotime($since_time)) === false) { return FALSE; } if (trim($to_table) != '' and trim($to_table_id) != '') { $cache_group = "reports/{$to_table}/{$to_table_id}"; } else { $cache_group = 'reports/global'; } $args = func_get_args(); foreach ($args as $k => $v) { $function_cache_id = $function_cache_id . serialize($k) . serialize($v); } $function_cache_id = __FUNCTION__ . md5($function_cache_id); $cache_content = CI::model('core')->cacheGetContentAndDecode($function_cache_id, $cache_group); if ($cache_content != false) { if ($cache_content == 'false') { return 0; } else { return $cache_content; } } global $cms_db_tables; $table = $cms_db_tables['table_reports']; $the_table = CI::model('core')->dbGetRealDbTableNameByAssocName($to_table); $check = CI::model('core')->dbCheckIfIdExistsInTable($the_table, $to_table_id); if ($check == false) { return FALSE; } else { //$yesterday = date ( 'Y-m-d H:i:s', mktime ( 0, 0, 0, date ( "m" ), date ( "d" ) - $since_days, date ( "Y" ) ) ); $voted = strtotime($since_time . ' ago'); //var_dump($voted); //$when = strtotime ( 'now') - $voted; //$when = strtotime ( 'now') - $when; $yesterday = date('Y-m-d H:i:s', $voted); $qty = " SELECT count(*) as qty\n\n from {$table}\n\n where to_table='{$to_table}' and to_table_id='{$to_table_id}'\n\n and created_on > '{$yesterday}'\n\n "; //var_dump($qty); $qty = CI::model('core')->dbQuery($qty, $cache_id = __FUNCTION__ . md5($qty), $cache_group); $qty = $qty[0]['qty']; $qty = intval($qty); if ($qty == 0) { CI::model('core')->cacheWriteAndEncode('false', $function_cache_id, $cache_group); } else { CI::model('core')->cacheWriteAndEncode($qty, $function_cache_id, $cache_group); } return $qty; } }
<? $data = array (); $ord = CI::model ( 'cart' )->ordersGet ( $data, $limit = false ); //p($ord); ?> <script language="javascript"> function edit_order( $id){ data1 = {} data1.module = 'admin/orders/edit_order'; if($id != undefined ){ data1.id = $id; } $.ajax({ url: '<? print site_url('api/module') ?>', type: "POST", data: data1, async:true, success: function(resp) { //$('#content_list').html(resp);
function sitemaps() { ob_clean(); header("Content-Type: text/xml; charset=UTF-8"); //header ( "Content-Type: application/rss+xml" ); global $cms_db_tables; $table = $cms_db_tables['table_content']; $sitemaps_count = false; $q = "select count(*) as qty from {$table} "; $q = CI::model('core')->dbQuery($q); $q = $q[0]['qty']; $q = intval($q); $maps_count = ceil($q / 200); $this->template['maps_count'] = $maps_count; $map_id = $this->uri->segment(3); $map_id = intval($map_id); if ($map_id == 0) { $this->template['the_index'] = true; $this->load->vars($this->template); $upperLimit = $maps_count; $lowerLimit = 1; $updates = array(); $sitemaps_urls = array(); while ($lowerLimit <= $upperLimit) { $some = ($upperLimit - $lowerLimit) * 200 + 0; $some2 = ($upperLimit - $lowerLimit) * 200 + 1; $q = "select updated_on from {$table} order by updated_on DESC limit 0,1 "; //var_dump($q); $q = CI::model('core')->dbQuery($q); $q = $q[0]['updated_on']; $updates[] = $q; $sitemaps_urls[] = urlencode(site_url('main/sitemaps/' . $lowerLimit)); $lowerLimit++; } $this->template['updates'] = $updates; $this->load->vars($this->template); foreach ($sitemaps_urls as $item1) { $ch = curl_init("http://www.google.com/webmasters/tools/ping?sitemap=" . $item1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); //echo $output; $ch = curl_init("http://search.yahooapis.com/SiteExplorerService/V1/ping?sitemap=" . $item1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); } } else { $some = 200 * ($map_id - 1); $some2 = 200 * ($map_id + 0); $q = "select id, updated_on from {$table} order by updated_on DESC limit {$some},{$some2} "; $q = CI::model('core')->dbQuery($q); $updates = $q; $this->template['updates'] = $updates; $this->load->vars($this->template); } //www.google.com/webmasters/tools/ping?sitemap=http%3A%2F%2Fwww.yoursite.com%2Fsitemap.gz $this->template['posts'] = $posts; $this->load->vars($this->template); $layout = CI::view('sitemap.php', true, true); CI::library('output')->set_output($layout); }
} </script> <div id="layout_config_module_placeholder"></div> <h3>Choose Layout</h3> <? $layouts = CI::model('template')->layoutsList(); ?> <? if(!empty($layouts)): ?> <select name="layoutsList"> <option>Inherit</option> <? foreach($layouts as $layout): ?> <? if($layout['screenshot']): ?> <!-- <a href="<? print $layout['screenshot'] ?>"> <img src="<? print $layout['screenshot'] ?>" height="100" /></a>--> <? endif; ?> <option onclick="set_layout(this.value, '<? print $layout['layout_name'] ?>')" value="<? print $layout['filename'] ?>"><? print $layout['layout_name'] ?></option> <? print $layout['name'] ?> <? print $layout['description'] ?> <? endforeach; ?>
<?php // p($data); $author = CI::model('users')->getUserById($data['user_id']); $thumb = CI::model('users')->getUserThumbnail($data['user_id'], 70); //$data = CI::model('core')->getById($data['to_table'],$data['to_table_id']); $addtinal_style = ''; if ($data['to_table'] == 'table_votes' and $data['to_table'] == 'table_followers') { $addtinal_style = "display:none;"; //CI::model('users')->dataDeleteById($data['id']); } if ($data['to_table'] == 'table_votes' and $data['to_table'] == 'table_comments') { $addtinal_style = "display:none;"; //CI::model('users')->dataDeleteById($data['id']); } if ($data['to_table'] == 'table_votes' and $data['to_table'] == 'table_users_statuses') { $addtinal_style = "display:none;"; // CI::model('users')->dataDeleteById($data['id']); } if ($data['to_table'] == 'table_votes' and $data['to_table'] == 'table_users') { $addtinal_style = "display:none;"; // CI::model('users')->dataDeleteById($data['id']); } if ($data['to_table'] == 'table_votes' and $data['to_table'] == 'table_votes') { $addtinal_style = "display:none;"; // CI::model('users')->dataDeleteById($data['id']); } if ($data['to_table'] == 'table_options') { $addtinal_style = "display:none;"; //CI::model('users')->dataDeleteById($data['id']); }
<?php //require (ACTIVE_TEMPLATE_DIR.'dashboard/messages/messages_nav.php') ?> <br /> <div class="bluebox" > <div class="blueboxcontent"> <?php $your_id = CI::model('users')->userId(); if (intval($your_id) == intval($messages[0]['from_user'])) { $between1 = 'you'; $contevsation_with = $messages[0]['to_user']; $between2 = CI::model('users')->getPrintableName(intval($messages[0]['to_user']), 'first'); } else { $contevsation_with = $messages[0]['from_user']; $between2 = 'you'; $between1 = CI::model('users')->getPrintableName(intval($messages[0]['to_user']), 'first'); } ?> <h2>Converstion between <?php print $between1; ?> and <?php print $between2; ?> </h2><br /> <?php if (!empty($messages)) { ?>
function index() { $url = url(); $cache_id = "js_api_" . md5($url); $cache_group = 'global/blocks'; $edit = $this->template['edit']; if (!$edit) { $edit = url_param('edit'); if ($edit) { $this->template['edit'] = true; } } $editmode = CI::library('session')->userdata('editmode'); if ($editmode == true) { $edit = true; } if ($edit == true) { $cache_group = 'global/blocks/edit'; } //$cache_content = CI::model ( 'core' )->cacheGetContentAndDecode ( $cache_id, $cache_group ); if ($cache_content != false) { //CI::library ( 'output' )->set_output ( $cache_content ); } else { //header ( 'Content-type: application/javascript' ); $load_extra_libs = false; $files = readDirIntoArray(APPPATH . 'controllers/api/js/', 'files'); //$layout = $layout . "\n\n\n // File: _php.default.min.js \n\n" . $this->load->file ( APPPATH . 'controllers/api/js/' . '_php.default.min.js', true ); $layout = $layout . "\n\n" . $this->load->file(APPPATH . 'controllers/api/js_dist/' . 'jquery.min.js', true); if (isset($_SERVER['HTTP_REFERER']) and $_SERVER['HTTP_REFERER'] != '') { $url = urldecode($_SERVER['HTTP_REFERER']); if (eregi("admin", $url)) { //preg_match ( "'(\?¦&)q=(.*?)(&¦$)'si", " $url ", $keywords ); $load_extra_libs = true; $in_admin = true; } } $and_ui = url_param('ui'); if ($and_ui) { } else { $and_ui = false; } $no_mw_edit = url_param('no_mw_edit'); if ($no_mw_edit) { } else { $no_mw_edit = false; } if ($editmode == true or $load_extra_libs == true or $and_ui == true) { $layout = $layout . "\n\n" . $this->load->file(APPPATH . 'controllers/api/js_dist/' . 'jquery-ui-1.8.12.custom.min.js', true); //$apicss = '<link rel="stylesheet" href="' . ADMIN_STATIC_FILES_URL . 'css/api.css" type="text/css" media="screen" />'; } $layout = $layout . "\n\n" . $this->load->file(APPPATH . 'controllers/api/js_dist/' . 'jquery.form.js', true); $layout = $layout . "\n\n" . $this->load->file(APPPATH . 'controllers/api/js_dist/' . 'jquery.embedly.min.js', true); $layout = $layout . "\n\n" . $this->load->file(APPPATH . 'controllers/api/js_dist/' . 'jquery_plugins.js', true); $layout = $layout . "\n\n" . $this->load->file(APPPATH . 'controllers/api/js_dist/' . 'rangy-core.js', true); $layout = $layout . "\n\n" . $this->load->file(APPPATH . 'controllers/api/js_dist/' . 'rangy-cssclassapplier.js', true); $layout = $layout . "\n\n" . $this->load->file(APPPATH . 'controllers/api/js_dist/' . 'jquery.cookie.js', true); $layout = $layout . "\n\n\n // File: _mw.js \n\n" . $this->load->file(APPPATH . 'controllers/api/js/' . '_mw.js', true); $ajax = isAjax(); if ($ajax == false) { if ($edit == true and $in_admin == false and $no_mw_edit == false) { $layout = $layout . "\n\n\n // File: _mw_edit.js \n\n" . $this->load->file(APPPATH . 'controllers/api/js/' . '_mw_edit.js', true); } if ($editmode == true or $load_extra_libs == true) { $layout = $layout . "\n\n" . $this->load->file(APPPATH . 'controllers/api/js/' . '_mw_extra.js', true); } } $layout = $layout . "\n\n\n // File: utils.js \n\n" . $this->load->file(APPPATH . 'controllers/api/js/' . 'utils.js', true); foreach ($files as $file) { if (substr($file, -2) == 'js') { if ($file != '_mw.js' and $file != 'utils.js' and $file != '_mw_edit.js') { $this->load->vars($this->template); $layout = $layout . "\n\n\n // File: {$file} \n\n" . $this->load->file(APPPATH . 'controllers/api/js/' . $file, true); } } } $layout = CI::model('content')->applyGlobalTemplateReplaceables($layout); //$layout = $layout . $apicss; CI::library('output')->set_output($layout); CI::model('core')->cacheWriteAndEncode($layout, $cache_id, $cache_group); } //var_dump ($content_filename_pre, $files ); }
<? else: ?> Send message to <? endif; ?> <span id="send-msg-to-name"> <?php $message_to_user['first_name'] ? print $message_to_user['first_name'] : (print $message_to_user['username']); ?> </span></h2> <form method="post" id="message-compose" class="form"> <input name="mk" type="hidden" value="<?php print CI::model('core')->securityEncryptString(user_id()); ?> " /> <input name="from_user" type="hidden" value="<?php print intval(user_id()); ?> " /> <? if($conversation): ?> <input name="parent_id" type="hidden" value="<?php print intval($conversation); ?> " /> <input name="receiver" id="message-compose-receiver" type="hidden" value="<?php print intval($message_to_user['id']);
Modules <? $modules_options = array(); //$modules_options['skip_admin'] = true; $modules_options['ui'] = true; $modules = CI::model('template')->getModules($modules_options ); // ?> <script type="text/javascript"> function uninstall_module($module_name){ $.ajax({ type: 'POST', url: '<? print site_url('api/template/uninstall_module'); ?>', data: ({module : $module_name }), success: function(resp3) { // alert(resp3); }, dataType: 'html' }); }
<meta name="description" content="{content_meta_description}" /> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php print site_url('main/rss'); ?> " /> <link rel="sitemap" type="application/rss+xml" title="Sitemap" href="<?php print site_url('main/sitemaps'); ?> " /> <meta name="reply-to" content="<?php print CI::model('core')->optionsGetByKey('creator_email'); ?> " /> <link rev="made" href="mailto:<?php print CI::model('core')->optionsGetByKey('creator_email'); ?> " /> <meta name="author" content="http://ooyes.net | Mass Media Group Ltd" /> <meta name="language" content="en" /> <meta name="distribution" content="global" /> <?php include ACTIVE_TEMPLATE_DIR . 'header_scripts_and_css.php'; ?> </head> <body> <div id="page"> <div id="header"> <h1>Microweber Documentation</h1> <!--<a href="javascript:;" id="newMessages">Messages<span>5</span></a> | <a href="javascript:;">Settings</a> | <a href="javascript:;">Logout</a>--> </div> <!-- #header -->
$this->template['user_id'] = CI::model('core')->userId(); $the_active_site_template = CI::model('core')->optionsGetByKey('curent_template'); $the_active_site_template_dir = TEMPLATEFILES . $the_active_site_template . '/'; if (defined('ACTIVE_TEMPLATE_DIR') == false) { define('ACTIVE_TEMPLATE_DIR', $the_active_site_template_dir); } if (defined('TEMPLATES_DIR') == false) { define('TEMPLATES_DIR', $the_active_site_template_dir); } if (defined('TEMPLATE_DIR') == false) { define('TEMPLATE_DIR', $the_active_site_template_dir); } if (defined('DEFAULT_TEMPLATE_DIR') == false) { define('DEFAULT_TEMPLATE_DIR', TEMPLATEFILES . 'default/'); } $the_active_site_template = CI::model('core')->optionsGetByKey('curent_template'); $the_active_site_template_dir = TEMPLATEFILES . $the_active_site_template . '/'; $the_template_url = site_url('userfiles/' . TEMPLATEFILES_DIRNAME . '/' . $the_active_site_template); $the_template_url = $the_template_url . '/'; if (defined('TEMPLATE_URL') == false) { define("TEMPLATE_URL", $the_template_url); } if (defined('USERFILES_URL') == false) { define("USERFILES_URL", site_url('userfiles/')); } if (defined('USERFILES_DIR') == false) { define("USERFILES_DIR", USERFILES); } if (defined('MODULES_DIR') == false) { define("MODULES_DIR", USERFILES . 'modules/'); }