Inheritance: extends Admin_Controller
Ejemplo n.º 1
0
 function httpResponseContentIs(content $content)
 {
     $response = clone $this;
     $response->content = $content;
     $content->recipientOfStringLengthIs($response);
     return self::blackholeContentLengthHttpHeaderShouldBeUsedBy($response->httpHeaderIs($response->contentLength));
 }
Ejemplo n.º 2
0
 public function addaction()
 {
     $c = new content();
     if ($this->input->post("id") !== FALSE) {
         $c->get_by_id($this->input->post("id"));
     } else {
         if ($this->input->post("id") === FALSE) {
             $c->user = $this->ion_auth->get_user();
             $c->user = $c->user->id;
         }
     }
     $c->parent_section = $this->input->post("parent_section");
     $c->parent_content = $this->input->post("parent_content");
     $c->title = $this->input->post("title");
     $c->cell = $this->input->post("cell");
     $c->sort = $this->input->post("sort");
     $c->path = $this->input->post("path");
     $c->type = $this->input->post("type");
     $c->subsection = $this->input->post("subsection") == FALSE ? FALSE : TRUE;
     $c->view = $this->input->post("view");
     $c->info = $this->input->post("info");
     $c->filter = $this->input->post("filter");
     // this is a workaround, cuz it makes 2 newline characters
     // and i don't know what the hell is wrong with it.
     $c->filter = str_replace("\n\n", "\n", $c->filter);
     $p = new Content($c->parent_content);
     if ($this->input->post("id") === FALSE) {
         $this->add_info(lang('system_content_added'));
     } else {
         $this->ajax = TRUE;
         $this->print_text(lang('system_content_edited'));
     }
     $c->save();
 }
Ejemplo n.º 3
0
function get_rss()
{
    global $aa;
    require_once e_PLUGIN . "content/handlers/content_class.php";
    $aa = new content();
    $rss = array();
    $array = $aa->getCategoryTree('', '', FALSE);
    foreach ($array as $k => $v) {
        $name = '';
        for ($i = 0; $i < count($array[$k]); $i++) {
            $name .= $array[$k][$i + 1] . " > ";
            $i++;
        }
        $name = substr($name, 0, -3);
        $feed['name'] = $name;
        $feed['url'] = 'content';
        //the identifier for the rss feed url
        $feed['topic_id'] = $k;
        //the topic_id, empty on default (to select a certain category)
        $feed['path'] = 'content';
        //this is the plugin path location
        $feed['text'] = 'this is the rss feed for content category : ' . $name;
        $feed['class'] = '0';
        $feed['limit'] = '9';
        $rss[] = $feed;
    }
    return $rss;
}
Ejemplo n.º 4
0
 function build($action = 'TopStories', $mode = 'rss')
 {
     require_once PATH_CORE . '/classes/content.class.php';
     $cObj = new content($this->db);
     // if $mode is rss, then echo the output
     // if $mode is api, then return the query
     switch ($action) {
         default:
             // do nothing
             break;
         case 'TopStories':
             $this->feedTitle = SITE_TITLE . ' Top Stories';
             $this->feedDescription = ' Top rated stories from ' . SITE_TITLE;
             $this->feedUrl = $this->baseUrl;
             $this->feedRssUrl = $this->baseUrl . '?p=rss&action=TopStories';
             $query = $cObj->fetchUpcomingStories('', RSS_NUMBER_STORIES);
             break;
     }
     // output the xml feed
     if ($mode == 'rss') {
         $code = $this->createXML($this->feedTitle, $this->feedUrl, $this->feedRssUrl, $this->feedDescription, $query);
         return $code;
     } else {
         return $query;
     }
 }
 function postNextTopStory()
 {
     // only post one story every three hours
     $tstamp = $this->statusObj->getState('lastTwitterPost');
     if (!isset($_GET['test']) and time() - $tstamp < 60 * TWITTER_INTERVAL_MINUTES) {
         return;
     }
     //echo 'continuing';
     require_once PATH_CORE . '/classes/content.class.php';
     $cObj = new content($this->db);
     require_once PATH_CORE . '/classes/log.class.php';
     $logObj = new log($this->db);
     $topStories = $cObj->fetchUpcomingStories();
     $uid = 1;
     while ($data = $this->db->readQ($topStories)) {
         if (!$this->checkLog($uid, $data->siteContentId) and $data->score >= TWITTER_SCORE_THRESHOLD) {
             // post to twitter
             $result = $this->update($data->siteContentId, $data->title);
             if ($result) {
                 $logItem = $logObj->serialize(0, $uid, 'postTwitter', $data->siteContentId);
                 $logObj->add($logItem);
                 $this->statusObj->setState('lastTwitterPost', time());
             }
             // only do one at a time
             return;
         }
     }
 }
Ejemplo n.º 6
0
 function create()
 {
     $avatar = $this->attachlib->get_avatar($this->user['user_id']);
     $content = $this->input['thread'];
     $topic_id = $this->input['tid'];
     $pcd = intval($this->input['pcd']);
     $aid = urldecode($this->input['aid']);
     if ($aid) {
         $aid_array = array_filter(explode(',', $aid));
         $aid = $this->attachlib->tmp2att($aid_array);
     }
     if ($pcd) {
         $c = new content();
         $article = $c->get_published_content_byid($pcd);
         if ($article) {
             $extend_arc = array('title' => $article['title'], 'brief' => $article['brief'], 'href' => $article['content_url'], 'bundle_id' => $article['bundle_id'], 'module_id' => $article['module_id']);
             $article = is_array($article['indexpic']) ? array('host' => $article['indexpic']['host'], 'dir' => $article['indexpic']['dir'], 'filepath' => $article['indexpic']['filepath'], 'filename' => $article['indexpic']['filename']) : array();
             $aid .= ',' . $this->attachlib->attach($article, 'publish', 'attach', $extend_arc);
         }
     }
     if (!$topic_id) {
         $this->errorOutput("请选择一个话题");
     }
     $short_link = $this->attachlib->outlink(urldecode($this->input['outlink']));
     if ($short_link) {
         $aid .= ',' . $short_link;
     }
     $location = array('lat' => $this->input['lat'], 'lon' => $this->input['lon'], 'address' => urldecode($this->input['address']), 'gpsx' => $this->input['gpsx'], 'gpsy' => $this->input['gpsy']);
     if ($location['lat'] && $location['lon']) {
         $loc = FromBaiduToGpsXY($location['lon'], $location['lat']);
         $location['gpsx'] = $loc['x'];
         $location['gpsy'] = $loc['y'];
     } elseif ($location['gpsx'] && $location['gpsy']) {
         $loc = FromGpsToBaiduXY($location['gpsx'], $location['gpsy']);
         $location['lon'] = $loc['x'];
         $location['lat'] = $loc['y'];
     }
     if ($map = $this->attachlib->map($location)) {
         $aid .= ',' . $map;
     }
     if (!$content && !$aid) {
         $this->errorOutput("内容不能为空");
     }
     $aid = $aid ? trim($aid, ',') : '';
     $data = array('tid' => $topic_id, 'content' => $content, 'aid' => $aid, 'client' => $this->input['client'] ? $this->input['client'] : $this->user['user_name'], 'status' => 0, 'create_time' => TIMENOW, 'user_id' => $this->user['user_id'], 'avatar' => $avatar ? addslashes(serialize($avatar)) : '', 'user_name' => $this->user['user_name'], 'pcd' => $pcd, 'ip' => hg_getip());
     $sql = 'INSERT INTO ' . DB_PREFIX . 'thread SET ';
     foreach ($data as $key => $val) {
         $sql .= "`{$key}` = \"{$val}\",";
     }
     $sql = trim($sql, ',');
     $this->db->query($sql);
     $data['id'] = $this->db->insert_id();
     $data['format_create_time'] = hg_tran_time($data['create_time']);
     $data['materail'] = $this->attachlib->get_attach_by_aid($aid);
     $this->attachlib->delete_attach(urldecode($this->input['aid']));
     $this->addItem($data);
     $this->output();
 }
Ejemplo n.º 7
0
 function site()
 {
     $c = new content();
     $data = $c->get_site();
     if ($data) {
         foreach ($data as $val) {
             $this->addItem($val);
         }
     }
     $this->output();
 }
 /**
  * @param Request $request
  * @param Request $securekey
  * @param Request $redirect
  * @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
  */
 public function submitAction(Request $request, $securekey, $redirect)
 {
     $locale = $request->getLocale();
     $mode = "module-submission";
     $em = $this->getDoctrine()->getManager();
     $cs = $this->get('ssone.cms.content');
     $fieldsRepository = $this->getFieldsRepository();
     $blockService = $this->get('ssone.cms.block');
     $contentType = $this->getDoctrine()->getRepository('SSoneCMSBundle:ContentType')->findBySecurekey($securekey);
     $content = new content();
     $content->setContentType($contentType);
     $blockService->contentBlockManager($content);
     $form = $this->createForm(new ContentTYPE($mode, $fieldsRepository, $cs, $locale), $content);
     $form->handleRequest($request);
     print $contentType->getName();
     print $form->isValid();
     if ($form->isValid()) {
         $auditor = $this->get('ssone.cms.recordauditor');
         $auditor->auditRecord($content);
         //Audit blocks and fields
         foreach ($content->getBlocks() as $block) {
             $auditor->auditRecord($block);
             foreach ($block->getBlockFields() as $blockField) {
                 $auditor->auditRecord($blockField);
             }
         }
         //handle file uploads
         $uploader = $this->get('ssone.cms.fileuploader');
         foreach ($form['blocks'] as $block) {
             foreach ($block['blockFields'] as $blockField) {
                 foreach ($blockField['fieldContent'] as $input) {
                     if (strpos($input->getName(), '_fileupload') !== false) {
                         $params = explode("_", $input->getName());
                         $fieldSettings = $fieldsRepository->findBySecurekey($params[2])->getFieldTypeSettings();
                         if ($fp = $uploader->contentFileUpload($input->getData(), $fieldSettings['fileupload']['fileuploadfolder'])) {
                             //Get current field content
                             $blockFieldObj = $blockField->getData();
                             $blockFieldContents = $blockFieldObj->getFieldContent();
                             $blockFieldContents[$params[0]] = $fp;
                             unset($blockFieldContents[$input->getName()]);
                             $blockFieldObj->setFieldContent($blockFieldContents);
                         }
                     }
                 }
             }
         }
         $em->persist($content);
         $em->flush();
         $storedContent = $cs->findSecureKeyById($content->getId());
         $this->cacheContent($content->getId(), $cs, $em);
         return $this->redirect($this->generateUrl('ssone_cms_frontend', array('uri' => $redirect)));
     }
     return $this->render('SSoneCMSBundle:Content:crud.html.twig', array('form' => $form->createView(), 'contentTitle' => $content->getName(), 'mode' => $mode, 'locale' => $locale));
 }
Ejemplo n.º 9
0
 function __construct()
 {
     // Init variables
     self::$db = DBCxn::Get();
     $this->tabs = [];
     $this->entities = [];
 }
Ejemplo n.º 10
0
 function get_campaigns()
 {
     $campaigns = content::get_all_campaigns();
     foreach ($campaigns as $campaign) {
         if ($campaign['force_deactivated'] == 'no' && strtotime($campaign['end']) > time()) {
             $get = content::fetch_tweets_from_twitter($campaign['campaign_hash']);
         }
     }
 }
Ejemplo n.º 11
0
 static function loadFile($file, $vars = array(), $return = false)
 {
     if (!file_exists($file)) {
         return false;
     }
     @extract(self::$vars);
     @extract($vars);
     content::start();
     require $file;
     return content::end($return);
 }
Ejemplo n.º 12
0
 function status()
 {
     $sql = e107::getDb();
     $aa = new content();
     if ($maincat = $sql->retrieve("pcontent", "content_id, content_heading", " WHERE  content_parent  = '0' ORDER BY content_heading", true)) {
         $i = 0;
         foreach ($maincat as $row) {
             $count = 0;
             $array = $aa->getCategoryTree("", $row['content_id'], TRUE);
             $validparent = implode(",", array_keys($array));
             $qrycat = " content_parent REGEXP '" . $aa->CONTENTREGEXP($validparent) . "' ";
             $count = $sql->count("pcontent", "(*)", "WHERE " . $qrycat . "  AND content_refer != 'sa' ");
             $var[$i]['icon'] = "<img src='" . e_PLUGIN_ABS . "content/images/content_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' /> ";
             $var[$i]['title'] = $row['content_heading'];
             $var[$i]['url'] = e_PLUGIN . "content/admin_content_config.php?content." . $row['content_id'];
             $var[$i]['total'] = $count;
             $i = $i + 1;
         }
     }
     return $var;
 }
Ejemplo n.º 13
0
 function load($template = 'default', $vars = array(), $return = false)
 {
     $file = c::get('tpl.root') . '/' . $template . '.php';
     if (!file_exists($file)) {
         return false;
     }
     @extract(self::$vars);
     @extract($vars);
     content::start();
     require $file;
     return content::end($return);
 }
 function createTempContent($userinfo = NULL, $wireid = 0)
 {
     require_once PATH_CORE . '/classes/content.class.php';
     $cObj = new content($this->db);
     $info = $this->getWireStory($wireid);
     require_once PATH_CORE . '/classes/parseStory.class.php';
     $psObj = new parseStory();
     require_once PATH_CORE . '/classes/utilities.class.php';
     $this->utilObj = new utilities($this->db);
     $info->title = stripslashes($info->title);
     $info->caption = stripslashes($this->utilObj->shorten($info->caption));
     // to do - replace proxy feed urls with final redirect
     $info->title = $psObj->cleanTitle($info->title);
     // create permalink
     $info->permalink = $cObj->buildPermalink($info->title);
     // serialize the content
     $info->title = mysql_real_escape_string($info->title);
     $info->caption = mysql_real_escape_string($info->caption);
     $story = $cObj->serialize(0, $info->title, $info->caption, $info->source, $info->url, $info->permalink, $userinfo->ncUid, $userinfo->name, $userinfo->userid, '', $userinfo->votePower, 0, 0);
     // post wire story to content
     $siteContentId = $cObj->add($story);
     return $siteContentId;
 }
Ejemplo n.º 15
0
function home()
{
    $out = "there is actually no content. enable content module to manage this page";
    if (module_manager::is_enabled("content")) {
        $out = "";
        $nodes = content_database::node_load_all();
        $b = false;
        if (count($nodes) > 0) {
            page::title("Home");
            foreach ($nodes as $node) {
                if (content::node_access_read($node->nid)) {
                    $b = true;
                    $out .= "<div class='post'>";
                    if ($node->title != null) {
                        $out .= "<div class='title'>";
                        $out .= page::link("node/" . $node->nid, $node->title);
                        $out .= "</div>";
                    }
                    if ($node->description != null) {
                        $out .= "<div class='content'>";
                        $node->description = utf8_decode($node->description);
                        if (strlen($node->description) > 200) {
                            $out .= substr($node->description, 0, 200) . "... " . page::link("node/" . $node->nid, t("+ read more"));
                        } else {
                            $out .= $node->description;
                        }
                        $out .= "</div>";
                    }
                    $out .= "<div class='author'>";
                    $out .= "<hr/>";
                    $out .= content_page::post_author_date($node->uid, $node->author, $node->date);
                    $out .= "<hr/>";
                    $out .= "</div>";
                    $out .= "</div>";
                }
            }
        } else {
            $out .= "there is no content, please add a content first.";
        }
    }
    return $b ? $out : "there is no content.";
}
Ejemplo n.º 16
0
if (!empty($_GET['delete']) && $_GET['delete'] == 1) {
    $content_id = $_GET['header_id'];
    $result = content::delete($content_id);
    if ($result == 1) {
        echo 'Comment is deleted!';
    } else {
        return false;
    }
}
?>
 </div></div>

<div id="json_drop_column">
 <?php 
if (!empty($_GET['delete']) && $_GET['delete'] == 1) {
    $content_name = $_GET['content_name'];
    $field_name = $_GET['field_name'];
    $result = content::drop_column($content_name, $field_name);
    if ($result == 1) {
        echo 'Comment is deleted!';
    } else {
        return false;
    }
}
?>
</div>



<?php 
include_template('footer.inc');
Ejemplo n.º 17
0
/**
* 
* @param
* @return
*/
function getRelatedSeriesJson($sid)
{
    $seriesvideos = content::getCompleteSeries($sid);
    $count = count($seriesvideos);
    $json = array();
    for ($i = 0; $i < $count; $i++) {
        $obj = new video($seriesvideos[$i]);
        array_push($json, array('cid' => $obj->getContentId(), 'title' => $obj->getTitle(), 'viewcount' => $obj->getViewCount(), 'poster' => $obj->getPoster(), 'timestamp' => $obj->getTimestamp(), 'uid' => $obj->getUserId(), 'uname' => user::getFullNameS($obj->getUserId())));
    }
    return json_encode($json);
}
Ejemplo n.º 18
0
Archivo: cron.php Proyecto: sa2ryu/news
//include_once(dirname(__FILE__).'/lib/Curl.class.inc');
$source = parse_ini_file(dirname(__FILE__) . '/source.ini', true);
$fbapi = 'http://graph.facebook.com/?id=';
//$twapi    = 'http://urls.api.twitter.com/1/urls/count.json?url=';
$blogs = array();
$unique = array();
// データの取得
foreach ($source as $v) {
    $url = $v['url'];
    $rss = fetch_rss($url);
    if (!$rss) {
        var_dump($v);
        continue;
    }
    foreach ($rss->items as $content) {
        $cc = new content($content);
        // 24時間以内のデータのみ
        if ($cc->getDate() < time() - 24 * 60 * 60) {
            continue;
        }
        // urlの重複を避ける
        if (!$cc->getLink() || in_array($cc->getLink(), $unique)) {
            continue;
        }
        $unique[] = $cc->getLink();
        $tmp = $cc->getAll();
        if (isset($v['tag'])) {
            $tmp['tag'] = $v['tag'];
        }
        $blogs[] = $tmp;
    }
Ejemplo n.º 19
0
        $content = new content();
        $content_data = $content->get($dbs, $path);
        if ($content_data) {
            $page_title = $content_data['Title'];
            echo $content_data['Content'];
            unset($content_data);
        } else {
            header("location:index.php");
        }
    }
} else {
    $metadata = '<meta name="robots" content="index, follow">';
    // homepage header info
    if (!isset($_GET['p'])) {
        if (!isset($_GET['keywords']) and !isset($_GET['page']) and !isset($_GET['title']) and !isset($_GET['author']) and !isset($_GET['subject']) and !isset($_GET['location'])) {
            // get content data from database
            include LIB_DIR . 'content.inc.php';
            $content = new content();
            $content_data = $content->get($dbs, 'headerinfo');
            if ($content_data) {
                //$header_info .= '<div id="headerInfo">'.$content_data['Content'].'</div>';
                unset($content_data);
            }
        }
    }
    include LIB_DIR . 'contents/default.inc.php';
}
// main content grab
$main_content = ob_get_clean();
// template output
require $sysconf['template']['dir'] . '/' . $sysconf['template']['theme'] . '/index_template.inc.php';
Ejemplo n.º 20
0
 static function delete($reid)
 {
     //限制权限
     return content::delete($reid);
 }
Ejemplo n.º 21
0
<?php

if (!defined('e107_INIT')) {
    exit;
}
if (!isset($pref['plug_installed']['content'])) {
    return;
}
require_once e_PLUGIN . 'content/handlers/content_class.php';
$aa = new content();
$datequery = " AND content_datestamp < " . time() . " AND (content_enddate=0 || content_enddate>" . time() . ") ";
global $contentmode;
//contentmode : content_144 (content_ + idvalue)
if ($contentmode) {
    $headingquery = " AND content_id = '" . substr($contentmode, 8) . "' ";
} else {
    $headingquery = "";
}
//get main parent types
$sqlm = new db();
if (!($mainparents = $sqlm->db_Select("pcontent", "*", "content_class REGEXP '" . e_CLASS_REGEXP . "' AND content_parent = '0' " . $datequery . " " . $headingquery . " ORDER BY content_heading"))) {
    $LIST_DATA = "no valid content category";
    return;
}
while ($rowm = $sqlm->db_Fetch()) {
    $ICON = "";
    $HEADING = "";
    $AUTHOR = "";
    $CATEGORY = "";
    $DATE = "";
    $INFO = "";
Ejemplo n.º 22
0
             }
             break;
         case 'stuffSetVisibility':
             if (isset($_GET['id'])) {
                 $id = $_GET['id'];
                 $newVis = $_GET['newVis'];
                 require_once PATH_FACEBOOK . "/classes/stuff.class.php";
                 $sObj = new stuff($db);
                 $code = $sObj->ajaxSetVisibility($id, $newVis);
             }
             break;
         case 'banStoryPoster':
             if (isset($_GET['cid']) and is_numeric($_GET['cid'])) {
                 $cid = $_GET['cid'];
                 require_once PATH_CORE . "/classes/content.class.php";
                 $cObj = new content($db);
                 $code = $cObj->ajaxBanStoryPoster($app, $cid, $userid);
             }
             break;
         case 'chooseHood':
             if (isset($_GET['hood'])) {
                 $hood = $_GET['hood'];
                 require_once PATH_FACEBOOK . "/classes/local.class.php";
                 $lObj = new local($db);
                 $code = $lObj->ajaxUpdateHood($hood, $userid);
             }
             break;
     }
 } else {
     // session is NOT valid
     $code = fetchSessionAlert();
Ejemplo n.º 23
0
 private function __construct()
 {
     /**
      * если не установлен билд, то сначала грузим главный конфиг. в нем читаем билд,
      * устанавливаем и далее вычитываем конфиг конкретного билда.
      */
     $mainpath = "configs" . DIRECTORY_SEPARATOR . "configs.php";
     if (file_exists($mainpath)) {
         require_once $mainpath;
     } else {
         die("main cfg error!");
     }
     if (empty($_SESSION["mwcbuild"])) {
         $_SESSION["mwcbuild"] = $cfg["defaultbuild"];
     }
     define("tbuild", $_SESSION["mwcbuild"]);
     $globalcfg = Configs::readCfg("main", $_SESSION["mwcbuild"]);
     if (empty($_SESSION["mwcserver"])) {
         //сервер
         $_SESSION["mwcserver"] = 0;
     }
     if (empty($_SESSION["mwcbuild"])) {
         //сервер
         $_SESSION["mwcbuild"] = $globalcfg["tbuild"];
     }
     if (empty($_SESSION["mwclang"])) {
         //язык
         $_SESSION["mwclang"] = $globalcfg["dlang"];
     }
     if (empty($_SESSION["mwcpoints"])) {
         //группа
         $_SESSION["mwcpoints"] = $globalcfg["defgrp"];
     }
     $adres = $globalcfg["address"];
     try {
         $content = new content($adres, $globalcfg["theme"], $_SESSION["mwclang"]);
     } catch (Exception $e) {
         echo $e->getMessage();
         die;
     }
     $isBackground = isset($_GET["bg"]) ? 1 : NULL;
     //если идет обращение к серверу
     try {
         $db = connect::start();
         if (empty($_SESSION["mwcuid"])) {
             $uid = 0;
         } else {
             $uid = $_SESSION["mwcuid"];
         }
         $builder = new builder(tbuild, $_SESSION["mwclang"], $_SESSION["mwcserver"]);
         // проверяем наличие списка модулей и плагинов
         //region плагины
         $plugin = "";
         require_once "build" . DIRECTORY_SEPARATOR . tbuild . DIRECTORY_SEPARATOR . "_dat" . DIRECTORY_SEPARATOR . $_SESSION["mwcserver"] . "_" . $_SESSION["mwclang"] . "_plugins.php";
         if (is_array($plugin) && is_null($isBackground)) {
             foreach ($plugin as $name => $param) {
                 if ($param["pstate"] == 1) {
                     $contoller_path = "build" . DIRECTORY_SEPARATOR . tbuild . DIRECTORY_SEPARATOR . "plugins" . DIRECTORY_SEPARATOR . "controller" . DIRECTORY_SEPARATOR . $name . ".php";
                     //region проверка на пользователя (если есть)
                     $ccfg = Configs::readCfg("plugin_" . $name, $_SESSION["mwcbuild"]);
                     if (!empty($ccfg["allowedUsrs"])) {
                         $usrs = explode(",", $ccfg["allowedUsrs"]);
                         if (!in_array($uid, $usrs)) {
                             $err = 2;
                         } else {
                             $err = 0;
                         }
                     } else {
                         $err = 2;
                     }
                     //endregion
                     if (file_exists($contoller_path) && (!empty($param["groups"]) || $err == 0)) {
                         if (empty($param["groups"])) {
                             $paccess = array();
                         } else {
                             $paccess = explode(",", $param["groups"]);
                         }
                         try {
                             if (!empty($param["mname"])) {
                                 $model_path = "build" . DIRECTORY_SEPARATOR . tbuild . DIRECTORY_SEPARATOR . "plugins" . DIRECTORY_SEPARATOR . "model" . DIRECTORY_SEPARATOR . $param["mname"] . ".php";
                                 if (file_exists($model_path)) {
                                     require $model_path;
                                 }
                                 require $contoller_path;
                                 if ((in_array($_SESSION["mwcpoints"], $paccess) || in_array(4, $paccess) || $err == 0) && class_exists($param["mname"])) {
                                     $tmp = $param["mname"];
                                     $model = new $tmp();
                                     $pcontoller = new $name($model, $content, $plugin, $_SESSION["mwcserver"]);
                                     if (method_exists($name, "action_index")) {
                                         $pcontoller->init();
                                         $pcontoller->action_index();
                                         $pcontoller->parentOut();
                                     }
                                 }
                             } else {
                                 if (in_array($_SESSION["mwcpoints"], $paccess) || in_array(4, $paccess)) {
                                     $model = new $globalcfg["defModel"]();
                                     $pcontoller = new PController($model, $content, $plugin, $_SESSION["mwcserver"]);
                                     $pcontoller->genNonMVC($contoller_path);
                                     $pcontoller->parentOut($name);
                                 }
                             }
                         } catch (Exception $e) {
                             $content->error(1);
                             $content->setFContainer("plugin_{$name}", true);
                         }
                     }
                 }
             }
         }
         //endregion
         //region страницы
         //region получение контроллера и экшена
         $action_name = "action_index";
         if (!isset($_GET["p"])) {
             $controller = $globalcfg["defpage"];
         } else {
             $controller = htmlspecialchars($_GET["p"], ENT_QUOTES);
             if ($controller == "index") {
                 $controller = $globalcfg["defpage"];
             }
         }
         if (isset($_GET["a"])) {
             $action_name = "action_" . $_GET["a"];
         }
         //endregion
         require_once "build" . DIRECTORY_SEPARATOR . tbuild . DIRECTORY_SEPARATOR . "_dat" . DIRECTORY_SEPARATOR . $_SESSION["mwcserver"] . "_" . $_SESSION["mwclang"] . "_pages.php";
         if (isset($page[$controller])) {
             $path = "build" . DIRECTORY_SEPARATOR . tbuild . DIRECTORY_SEPARATOR . $page[$controller]["ppath"] . DIRECTORY_SEPARATOR . $controller . ".php";
             if (file_exists($path)) {
                 $access = explode(",", $page[$controller]["groups"]);
                 //region проверка на пользователя (если есть)
                 $ccfg = Configs::readCfg($controller, $_SESSION["mwcbuild"]);
                 if (!empty($ccfg["allowedUsrs"])) {
                     $usrs = explode(",", $ccfg["allowedUsrs"]);
                     if (!in_array($uid, $usrs)) {
                         $err = 2;
                     } else {
                         $err = 0;
                     }
                 } else {
                     $err = 2;
                 }
                 //endregion
                 try {
                     if (in_array($_SESSION["mwcpoints"], $access) || in_array(4, $access) || $err == 0) {
                         if (!empty($page[$controller]["mname"]) && !empty($page[$controller]["mpath"])) {
                             $modelpath = "build" . DIRECTORY_SEPARATOR . tbuild . DIRECTORY_SEPARATOR . $page[$controller]["mpath"] . DIRECTORY_SEPARATOR . $page[$controller]["mname"] . ".php";
                             require_once $path;
                             if (file_exists($modelpath)) {
                                 require_once $modelpath;
                                 $modelname = $page[$controller]["mname"];
                             } else {
                                 $modelname = "Model";
                                 $action_name = "showError";
                                 $db->SQLog("model {$modelpath} wasn't found", "router", 2);
                             }
                             $model = new $modelname($db);
                             $contolinst = new $controller($model, $content, $page, $_SESSION["mwcserver"]);
                             $contolinst->init();
                             if (method_exists($controller, $action_name)) {
                                 $contolinst->{$action_name}();
                             } else {
                                 $contolinst->action_index();
                                 $db->SQLog("{$controller} hasn't action {$action_name}", "router", 3);
                             }
                             $contolinst->parentOut($isBackground);
                         } else {
                             $model = new $globalcfg["defModel"]();
                             $contolinst = new $globalcfg["defController"]($model, $content, $page, $_SESSION["mwcserver"]);
                             $contolinst->genNonMVC($path);
                             $contolinst->parentOut($isBackground);
                         }
                     } else {
                         $model = new Model($db);
                         $contolinst = new Controller($model, $content, $page, $_SESSION["mwcserver"]);
                         $contolinst->init();
                         $contolinst->showError(2);
                         $contolinst->parentOut($isBackground);
                         if (!empty($_SESSION["mwcuid"])) {
                             $theGuy = $_SESSION["mwcuid"];
                         } else {
                             $theGuy = "?";
                         }
                         $db->SQLog("user({$theGuy}) try access to {$controller} but he hasn't access", "router", 6);
                     }
                 } catch (Exception $e) {
                     $model = new Model($db);
                     $contolinst = new Controller($model, $content, $page, $_SESSION["mwcserver"]);
                     $contolinst->init();
                     $contolinst->showErrorText($e->getMessage());
                     $contolinst->parentOut($isBackground);
                 }
             } else {
                 $model = new Model($db);
                 $contolinst = new Controller($model, $content, $page, $_SESSION["mwcserver"]);
                 $contolinst->init();
                 $contolinst->showError(3);
                 $contolinst->parentOut($isBackground);
                 $db->SQLog("controller {$path} ({$controller}) wasn't found", "router", 1, true);
             }
         } else {
             $model = new Model($db);
             $contolinst = new Controller($model, $content, $page, $_SESSION["mwcserver"]);
             $contolinst->init();
             $contolinst->showError(3);
             $contolinst->parentOut($isBackground);
             $db->SQLog("controller {$controller} wasn't register", "router", 1);
         }
         //endregion
     } catch (Exception $ex) {
         $stack = $ex->getTrace();
         $msg = $ex->getMessage() . " in file: " . basename($stack[3]["file"]) . " line: " . $stack[3]["line"];
         self::addlog(tbuild . "_error", $msg, "log");
         content::showError("Something went wrong", "please, check logs.");
     }
 }
Ejemplo n.º 24
0
 function insert_default_prefs($id)
 {
     global $sql, $aa, $plugintable;
     $plugintable = "pcontent";
     $plugindir = e_PLUGIN . "content/";
     unset($content_pref, $tmp);
     if (!is_object($aa)) {
         require_once $plugindir . "handlers/content_class.php";
         $aa = new content();
     }
     $content_pref = $aa->ContentDefaultPrefs($id);
     $tmp = e107::serialize($content_pref, true);
     //$tmp = $eArrayStorage->WritexxxArray($content_pref);
     $sql->db_Update($plugintable, "content_pref='{$tmp}' WHERE content_id='{$id}' ");
 }
Ejemplo n.º 25
0
{
    echo "<form accept-charset='utf-8' action = 'api_add.php?character={$character_get}'; method = 'POST'>";
    ?>
     
            <span class="input-group-addon">API Key <a href = "https://community.eveonline.com/support/api-key/CreatePredefined?accessMask=82317323" target="_blank">(generate</a>)</span>
            <input type="number" name="api" class="form-control" placeholder="access mask: 82317323" required = "required">
            
            <span class="input-group-addon">verification code</span>
            <input type="text" name="vcode" class="form-control" placeholder="this should be in your Eve API Management page" required = "required">
            
            <br><input type ="Submit" name="Send" value ="Submit" class="btn btn-lg btn-success btn-block" />
        </form>
<?php 
}
$title = "Add API Keys/Characters";
$content = new content();
$content->drawMeta($title);
?>
    <div id="wrapper">
<?php 
$content->drawNav($accountBalance, $networth, $sellOrders, $escrow, $username, $character_get, $getCharacterList);
?>
    <div id="page-wrapper">
 <?php 
$content->drawHeader($getCharacterPortrait, $username, "API Management (add)");
?>
    <div class="row">
<?php 
$content->columns_def();
?>
    <!-- /.row -->
Ejemplo n.º 26
0
function print_item_pdf($id)
{
    global $tp, $pref, $content_shortcodes;
    global $CONTENT_PRINT_IMAGES, $row, $content_image_path, $content_pref, $mainparent;
    //in this section you decide what to needs to be output to the pdf file
    $con = new convert();
    require_once e_PLUGIN . "content/content_shortcodes.php";
    require_once e_PLUGIN . "content/handlers/content_class.php";
    $aa = new content();
    if (!is_object($sql)) {
        $sql = new db();
    }
    $sql->db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_image, content_author, content_parent, content_datestamp, content_class, content_pref", "content_id='" . intval($id) . "' ");
    $row = $sql->db_Fetch();
    if (!check_class($row['content_class'])) {
        header("location:" . e_PLUGIN . "content/content.php");
        exit;
    }
    $authordetails = $aa->getAuthor($row['content_author']);
    $row['content_datestamp'] = $con->convert_date($row['content_datestamp'], "long");
    $img = $tp->parseTemplate('{CONTENT_PRINT_IMAGES}', FALSE, $content_shortcodes);
    $mainparent = $aa->getMainParent(intval($id));
    $content_pref = $aa->getContentPref($mainparent);
    $content_icon_path = $tp->replaceConstants($content_pref["content_icon_path"]);
    $content_image_path = $tp->replaceConstants($content_pref["content_image_path"]);
    $img = $tp->parseTemplate('{CONTENT_PDF_IMAGES}', FALSE, $content_shortcodes);
    //add custom and preset tags if present
    $custom = e107::unserialize($row['content_pref']);
    //$custom						= $eArrayStorage->ReadxxxArray($row['content_pref']);
    $months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11);
    $CONTENT_CONTENT_TABLE_CUSTOM_TAGS = "";
    if (!empty($custom)) {
        foreach ($custom as $k => $v) {
            if ($k == "content_custom_presettags") {
                if (isset($content_pref["content_content_presettags"]) && $content_pref["content_content_presettags"]) {
                    foreach ($v as $ck => $cv) {
                        if (is_array($cv)) {
                            //date
                            if (!($cv['day'] == "" && $cv['month'] == "" && $cv['year'] == "")) {
                                $vv = $cv['day'] . " " . $months[$cv['month'] - 1] . " " . $cv['year'];
                            }
                        } else {
                            $vv = $cv;
                        }
                        if (isset($ck) && $ck != "" && isset($vv) && $vv != "") {
                            $CUSTOM_TAGS = TRUE;
                            $CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($ck, true);
                            $CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($vv, true);
                            $CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY . " : " . $CONTENT_CONTENT_TABLE_CUSTOM_VALUE . "<br />";
                        }
                    }
                }
            } else {
                if (isset($content_pref["content_content_customtags"]) && $content_pref["content_content_customtags"]) {
                    $key = substr($k, 15);
                    if (isset($key) && $key != "" && isset($v) && $v != "") {
                        $CUSTOM_TAGS = TRUE;
                        $CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($key, true);
                        $CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($v, true);
                        $CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY . " : " . $CONTENT_CONTENT_TABLE_CUSTOM_VALUE . "<br />";
                    }
                }
            }
        }
    }
    $text = "\n\t<b>" . $row['content_heading'] . "</b><br />\n\t" . $row['content_subheading'] . "<br />\n\t" . $authordetails[1] . ", " . $row['content_datestamp'] . "<br />\n\t<br />\n\t" . $row['content_text'] . "<br />\n\t" . ($CONTENT_CONTENT_TABLE_CUSTOM_TAGS ? $CONTENT_CONTENT_TABLE_CUSTOM_TAGS : "") . "\n\t<div style='float:left; padding-left:10px;'>" . $img . "</div>\n\t";
    //the following defines are processed in the document properties of the pdf file
    //Do NOT add parser function to the variables, leave them as raw data !
    //as the pdf methods will handle this !
    $text = $text;
    //define text
    $creator = SITENAME;
    //define creator
    $author = $authordetails[1];
    //define author
    $title = $row['content_heading'];
    //define title
    $subject = $row['content_subheading'];
    //define subject
    $keywords = "";
    //define keywords
    //define url to use in the header of the pdf file
    $url = SITEURLBASE . e_PLUGIN_ABS . "content/content.php?content." . $row['content_id'];
    //always return an array with the following data:
    return array($text, $creator, $author, $title, $subject, $keywords, $url);
}
Ejemplo n.º 27
0
<?php

$ci =& get_instance();
$ci->load->library('gui');
$c = new content();
if ($ci->input->post("id")) {
    $c->get_by_id($ci->input->post("id"));
}
$c->parent_section = $ci->input->post("parent_section");
$c->parent_content = $ci->input->post("parent_content");
$c->cell = $ci->input->post("cell");
$c->sort = $ci->input->post("sort");
$c->path = $ci->input->post("path");
$c->type = $ci->input->post("type");
$c->subsection = $ci->input->post("subsection") == NULL ? FALSE : TRUE;
$c->view = $ci->input->post("view");
$c->addin = $ci->input->post("addin");
$old_edit = $c->can_edit();
$c->edit = $ci->input->post("edit");
$c->del = $ci->input->post("del");
$c->info = $ci->input->post("info");
if (!$ci->input->post("id")) {
    $p = new content();
    $p->get_by_id($c->parent_content);
    $c->attach($ci->vunsy->section, $p, $c->cell, $c->sort);
}
$p = new Section();
$p->get_by_id($c->parent_section);
if ($p->can_addin() and !$ci->input->post("id") or $ci->input->post("id") and $old_edit) {
    $c->save();
    if ($ci->input->post("id")) {
    if ($user->insert()) {
        // inserted ok
        if ($userInfo->createFromUser($user, 0)) {
            require_once PATH_CORE . '/classes/subscriptions.class.php';
            $subTable = new SubscriptionsTable($db);
            $sub = $subTable->getRowObject();
            $sub->userid = $user->userid;
            $sub->rxFeatures = 1;
            $sub->rxMode = 'notification';
            $sub->insert();
        }
    }
}
// Add stories
require_once PATH_CORE . '/classes/content.class.php';
$cObj = new content($db);
// load admin
$q = $db->queryC("SELECT * FROM User,UserInfo WHERE User.userid=UserInfo.userid AND isAdmin=1 LIMIT 1;");
if ($q !== false) {
    $ui = $db->readQ($q);
    $ui->u->name = $ui->name;
    $fData = new stdClass();
    $fData->body = '';
    $fData->tags = '';
    $fData->videoEmbed = '';
    $fData->isFeatureCandidate = 0;
    $fData->mediatype = 'text';
    $fData->url = mysql_real_escape_string('http://www.wired.com/vanish/2009/09/how-evan-ratliff-was-caught/');
    $fData->imageUrl = mysql_real_escape_string('http://www.wired.com/vanish/wp-content/uploads/2009/09/evanbald.jpg');
    $fData->title = mysql_real_escape_string('How Evan Ratliff Was Caught');
    $fData->caption = mysql_real_escape_string('Naked Pizza snagged Evan. But the legwork was done by Jeff Reifman, who was using twitter under @vanishteam. He has just put up an <a href="http://blog.newscloud.com/2009/09/how-we-caught-evan-ratliff.html">amazing post</a> detailing exactly what he did and how he did it. The post should be read in full.');
Ejemplo n.º 29
0
			</tr>
			<tr>
				<td>' . $p->t('news/text') . '</td>
				<td><textarea name="text_' . $lang . '" rows="15" cols="80">' . $text . '</textarea></td>
			</tr>
			<tr>
				<td>' . $p->t('news/veroeffentlichen') . '</td>
				<td><input type="checkbox" name="sichtbar_' . $lang . '" ' . ($sichtbar == true ? 'checked' : '') . '></td>
			</tr>
		</table>';
    echo '</div>';
}
//Anlegen von Uebersetzungen
if ($news->content_id != '') {
    echo '<div id="add">';
    $content = new content();
    if (!($vorhandene_sprachen = $content->getLanguages($news->content_id))) {
        die($content->errormsg);
    }
    $sprache_obj = new sprache();
    $sprache_obj->getAll(true);
    //Wenn noch nicht alle Uebersetzungen vorhanden sind,
    //wird ein Link zum Erstellen der Uebersetzung angezeigt.
    if (count($vorhandene_sprachen) < count($sprache_obj->result)) {
        echo $p->t('news/uebersetzunganlegen');
        foreach ($sprache_obj->result as $row) {
            if (!in_array($row->sprache, $vorhandene_sprachen)) {
                echo '<br /><a style="color:#008381" href="' . $_SERVER['PHP_SELF'] . '?news_id=' . $news_id . '&action=add_uebersetzung&lang=' . $row->sprache . '">' . $row->bezeichnung_arr[$sprache] . '</a>';
            }
        }
    } else {
Ejemplo n.º 30
0
?>
<!DOCTYPE html>
    <html lang="en">
    <link href="../bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Custom CSS -->
    <link href="../dist/css/sb-admin-2.css" rel="stylesheet">
    <!-- Custom Fonts -->
    <link href="../bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!-- DataTables CSS -->
    <link href="../bower_components/datatables-plugins/integration/bootstrap/3/dataTables.bootstrap.css" rel="stylesheet">
    <!-- DataTables Responsive CSS -->
    <link href="../bower_components/datatables-responsive/css/dataTables.responsive.css" rel="stylesheet">

<?php 
$title = "Logout";
$content = new content($title);
$content->drawMeta($title);
?>
</head>
<body>
    
<?php 
$message = "Logout";
$content->form_container($message);
session_destroy();
unset($_COOKIE['user']);
setcookie('user', '', time() - 3600, '/');
unset($_COOKIE['password']);
setcookie('password', '', time() - 3600, '/');
echo "You have logged out";
echo "<meta http-equiv='refresh' content='1; url=../index.php'>";