/**
  * getPreview
  *
  * @param   object  &$feed  Params
  *
  * @return	object
  */
 public function getPreview(&$feed)
 {
     if (isset($feed->params)) {
         $feed->xtform = EForm::paramsToRegistry($feed);
     }
     $import_limit = $feed->xtform->get('import_limit');
     $feed->xtform->set('import_limit', 3);
     $check_existing = $feed->xtform->get('check_existing');
     $feed->xtform->set('check_existing', 0);
     $loadResult = null;
     try {
         $start_time = time();
         $feedImporterHelper = new FeedImporterHelper();
         $feedProcessorHelper = new FeedProcessorHelper();
         $feedGeneratorHelper = new FeedGeneratorHelper();
         $loadResult = $feedImporterHelper->import($feed);
         $contents = $feedProcessorHelper->process($feed, $loadResult);
         $feedGeneratorHelper->execute($contents, $feed->xtform, true);
         $loadResult->processed_time = time() - $start_time;
         $loadResult->preview = $contents;
     } catch (Exception $e) {
         ELog::showMessage($e->getMessage(), JLog::ERROR);
     }
     $feed->xtform->set('import_limit', $import_limit);
     $feed->xtform->set('check_existing', $check_existing);
     return $loadResult;
 }
Exemple #2
0
 /**
  * Used to set config absolute file path.
  * Leave constructor empty and use this.
  */
 public function set_abs_file($filename)
 {
     $this->name = $filename;
     if (!file_exists($this->name)) {
         ELog::error('Config file not existent: ' . $this->name);
     } else {
         $this->data = EConfig::parse_file($this->name);
     }
 }
 public function set_table_search($tbl)
 {
     //assuring $data is safe to be executed on a db query
     EDatabase::safe($data);
     //setting internal attribute
     if (EDatabase::table_exists($tbl)) {
         $this->table = $tbl;
         $this->datatable = new EData($this->table);
     } else {
         ELog::error("{$tbl} does not exists on database.");
     }
 }
Exemple #4
0
 public static function load()
 {
     //treat url erasing extra parts
     $current_uri = $_SERVER['REQUEST_URI'];
     //keeping a local copy
     ERewriter::$oldurl = $current_uri;
     $matches = array();
     foreach (EConfig::$data['rewrite'] as $key => $value) {
         if (!is_array($value)) {
             ELog::warning("You need to specify a second value as a rewrite rule in rewrite.conf.php");
             return;
         }
         //handle with normal rewrite that
         //permits to have parameters
         if ($value[1] == "normal") {
             $pos = strpos($current_uri, $key);
             //if we found a rewrite rule that can be applied
             if ($pos !== false) {
                 //rewrite only at the very start of the string
                 if ($pos == 0) {
                     //record the allowed key
                     $matches[strlen($key)] = array($key, $value[0]);
                 }
             }
         } else {
             if ($value[1] == "exact") {
                 $current_uri_t = explode("?", $current_uri)[0];
                 if ($current_uri_t == $key) {
                     if (ERewriter::$rewritable) {
                         $rewritten = str_replace($key, $value[0], $current_uri);
                         //TODO FIX HERE
                         //$rewritten = preg_replace("$key", $value, $current_uri, 1);
                         $_SERVER['REQUEST_URI'] = $rewritten;
                         //setting rewritable to false
                         ERewriter::$rewritable = false;
                         break;
                     }
                 }
             }
         }
     }
     if (ERewriter::$rewritable) {
         ksort($matches);
         $matches = array_reverse(array_values($matches));
         if (isset($matches[0])) {
             $rule = $matches[0];
             $rewritten = str_replace($rule[0], $rule[1], $current_uri);
             //TODO FIX HERE FIRST OCCURRENCE
             //$rewritten = preg_replace("$key", $value, $current_uri, 1);
             $_SERVER['REQUEST_URI'] = $rewritten;
         }
     }
 }
Exemple #5
0
 public function make_thumbnail($from, $to, $maxwidth, $maxheight)
 {
     $ext = EFileSystem::get_file_extension($from);
     if (!(list($width, $height, $type, $attr) = getimagesize($from))) {
         ELog::error("{$from} |");
     }
     if ($width > $height) {
         $x = $width / $maxwidth;
         $fwidth = floor($width / $x);
         $fheight = floor($height / $x);
     }
     if ($width < $height) {
         $x = $height / $maxheight;
         $fheight = floor($height / $x);
         $fwidth = floor($width / $x);
     }
     if ($width == $height) {
         if ($maxwidth > $maxheight) {
             $max = $maxheight;
         } else {
             $max = $maxwidth;
         }
         $x = $height / $max;
         $fheight = floor($height / $x);
         $fwidth = floor($width / $x);
     }
     $thumb = imagecreatetruecolor($fwidth, $fheight);
     if ($ext == "jpg" or $ext == "jpeg") {
         $source = imagecreatefromjpeg($from);
     }
     if ($ext == "png") {
         $source = imagecreatefrompng($from);
     }
     imagecopyresized($thumb, $source, 0, 0, 0, 0, $fwidth, $fheight, $width, $height);
     if ($ext == "jpg" or $ext == "jpeg") {
         imagejpeg($thumb, $to, 100);
     }
     if ($ext == "png") {
         imagepng($thumb, $to, 1);
     }
     if ($ext != "jpg" or $ext != "jpeg" or $ext != "png") {
         return false;
     } else {
         return true;
     }
 }
Exemple #6
0
 public static function warning($r)
 {
     ELog::$mode = EConfig::$data['generic']['errormode'];
     switch (ELog::$mode) {
         case 'normal':
             echo "GFX WARNING: {$r}<br>";
             break;
         case 'formatted':
             echo "<p style=\"color:#CDD500;font-size:20px;\">GFX WARNING:</p>\n\t\t\t\t\t<p style=\"color:#D58600;font-size:15px;font-style:italic;\">{$r}</p>";
         case 'file':
             $stream = fopen(ELog::$warning_file, 'a+');
             fwrite($stream, "GFX WARNING: {$r}\n\n");
             fclose($stream);
         case 'suppressed':
             //ignore error
             break;
     }
 }
Exemple #7
0
 public function edit($args)
 {
     $id = $args;
     $name = EHeaderDataParser::secure_post("inputTitle");
     $type = EHeaderDataParser::secure_post("type");
     $downloadname1 = EHeaderDataParser::secure_post("inputDownloadName");
     $downloadlink1 = EHeaderDataParser::secure_post("inputDownloadLink");
     $description = EHeaderDataParser::secure_post("inputDescription");
     $summary = EHeaderDataParser::secure_post("inputSummary");
     $version = EHeaderDataParser::secure_post("inputVersion");
     $changelog = EHeaderDataParser::secure_post("inputChangelog");
     $personid = OCSUser::login();
     $postdata = array("name" => $name, "type" => $type, "downloadname1" => $downloadname1, "downloadlink1" => $downloadlink1, "description" => $description, "summary" => $summary, "version" => $version, "changelog" => $changelog, "personid" => $personid);
     $client = new OCSClient(EConfig::$data["ocs"]["host"]);
     $client->set_auth_info($personid, EHeaderDataParser::get_cookie("password"));
     $check = $client->post("v1/content/edit/{$id}", $postdata);
     if ($check["ocs"]["meta"]["statuscode"] == "100") {
         $client = new OCSClient(EConfig::$data["ocs"]["host"]);
         $client->set_auth_info($personid, EHeaderDataParser::get_cookie("password"));
         if (!empty($_FILES['inputDownloadFile'])) {
             $client->set_upload_file($_FILES['inputDownloadFile']['tmp_name']);
             $result = $client->post("v1/content/uploaddownload/{$id}");
         }
         if (!empty($_FILES['inputScreenshot1'])) {
             $client->set_upload_file($_FILES['inputScreenshot1']['tmp_name']);
             $result = $client->post("v1/content/uploadpreview/{$id}/1");
             ELog::pd($result);
             if (!empty($_FILES['inputScreenshot2'])) {
                 $client->set_upload_file($_FILES['inputScreenshot2']['tmp_name']);
                 $result = $client->post("v1/content/uploadpreview/{$id}/2");
                 if (!empty($_FILES['inputScreenshot3'])) {
                     $client->set_upload_file($_FILES['inputScreenshot3']['tmp_name']);
                     $result = $client->post("v1/content/uploadpreview/{$id}/3");
                     if ($result["ocs"]["meta"]["statuscode"] == "100") {
                         //ELog::pd($check); //cosa fare se va a buon fine
                     }
                 }
             }
         }
         //else {ELog::pd($result);}
         //cosa fare se va a buon fine
         header("Location: /plasmastore/app_description/show/{$id}");
     }
 }
Exemple #8
0
 /**
  * import.
  *
  * @return	void
  */
 public function import()
 {
     // CSRF prevention
     if ($this->csrfProtection) {
         $this->_csrfProtection();
     }
     $cid = $this->input->get('cid', array(), 'ARRAY');
     if (empty($cid)) {
         $id = $this->input->getInt('id', 0);
         if ($id) {
             $cid = array($id);
         }
     }
     $helper = FeedLoaderHelper::getInstance();
     $helper->importFeeds($cid);
     // Redirect
     if ($customURL = $this->input->get('returnurl', '', 'string')) {
         $customURL = base64_decode($customURL);
     }
     $url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . F0FInflector::pluralize($this->view);
     $this->setRedirect($url);
     ELog::showMessage('COM_AUTOTWEET_VIEW_FEEDS_IMPORT_SUCCESS', JLog::INFO);
 }
Exemple #9
0
 public static function unload()
 {
     if (EDatabase::$opened == true) {
         // TODO: strange behaviour under root. Inspect.
         // mysql_close(EDatabase::db_link);
         EDatabase::$db_link = 0;
         EDatabase::$opened = false;
     } else {
         if (EDatabase::$debug == false) {
             ELog::error("TRT GFX ISSUE: unable to close mysql session because no one was already opened.");
         }
     }
 }
Exemple #10
0
 public static function parse_file($filename)
 {
     //initializing empty array
     $result = array();
     //mapping file line per line
     //$cache = new ECacheFile($filename);
     //$file = $cache->get();
     //$file = explode("\n",$file);
     $file = file($filename);
     $file = EConfig::erase_php_code($file);
     foreach ($file as $line) {
         if (!empty($line)) {
             $chunks = explode("|", $line);
             //gives correct key and correct value, erasing line break.
             //control if is set more than once
             if (isset($result[$chunks[0]])) {
                 //ELog::warning("<b>".$chunks[0]."</b> property is set more than once in ".$filename." config file!");
             } else {
                 //control if is set to empty value
                 if (count($chunks) < 2) {
                     ELog::warning("<b>" . $chunks[0] . "</b> property has empty value in " . $filename . " config file!");
                 } else {
                     //load 1:1 data and gives a simple value
                     if (count($chunks) == 2) {
                         $result[$chunks[0]] = rtrim($chunks[1], "\n");
                     } else {
                         //load 1:n data and gives an array
                         if (count($chunks) > 2) {
                             $data = array();
                             for ($i = 1; $i < count($chunks); $i++) {
                                 $data[] = rtrim($chunks[$i], "\n");
                             }
                             $result[$chunks[0]] = $data;
                         } else {
                             ELog::error("unknown error in EConfig loading");
                         }
                     }
                 }
             }
         }
     }
     return $result;
 }
Exemple #11
0
 public function set_data($data)
 {
     // assuring those are not evil data to be used as SQL injections
     EDatabase::safe($data);
     //data validations
     if (!isset($data['type'])) {
         ELog::error("OCSContent: type not defined. Mandatory field.");
     } else {
         $this->type = $data['type'];
     }
     if (!isset($data['name'])) {
         ELog::error("OCSContent: name not defined. Mandatory field.");
     } else {
         $this->name = $data['name'];
     }
     if (!isset($data['personid'])) {
         ELog::error("OCSContent: personid not defined. Mandatory field.");
     } else {
         $this->personid = $data['personid'];
     }
     if (!isset($data['downloadname1'])) {
         $this->downloadname1 = "";
     } else {
         $this->downloadname1 = $data['downloadname1'];
     }
     if (!isset($data['downloadlink1'])) {
         $this->downloadlink1 = "";
     } else {
         $this->downloadlink1 = $data['downloadlink1'];
     }
     if (!isset($data['description'])) {
         $this->description = "";
     } else {
         $this->description = $data['description'];
     }
     if (!isset($data['summary'])) {
         $this->summary = "";
     } else {
         $this->summary = $data['summary'];
     }
     if (!isset($data['version'])) {
         $this->version = "";
     } else {
         $this->version = $data['version'];
     }
     if (!isset($data['changelog'])) {
         $this->changelog = "";
     } else {
         $this->changelog = $data['changelog'];
     }
     if (!isset($data['preview1'])) {
         $this->preview1 = "";
     } else {
         $this->preview1 = $data['preview1'];
     }
     if (!isset($data['preview2'])) {
         $this->preview2 = "";
     } else {
         $this->preview2 = $data['preview2'];
     }
     if (!isset($data['preview3'])) {
         $this->preview3 = "";
     } else {
         $this->preview3 = $data['preview3'];
     }
     if (!isset($data['license'])) {
         $this->license = "";
     } else {
         $this->license = $data['license'];
     }
 }
Exemple #12
0
<?php

include "gfx3/lib.php";
$prevpage = EPageProperties::get_previous_page();
$idcontent = EHeaderDataParser::db_post("idcontent");
if (!empty($_FILES['localfile'])) {
    $tmp_name = $_FILES['localfile']['tmp_name'];
    $name = $_FILES['localfile']['name'];
    $client = new OCSClient();
    $client->set_auth_info(EUser::nick(), EUser::password());
    $abs_name = EFileSystem::rename_file($tmp_name, "/tmp/" . $name);
    $client->set_upload_file("/tmp/" . $name);
    $result = $client->post("v1/content/uploaddownload/{$idcontent}");
    if ($result["ocs"]["meta"]["statuscode"] == "100") {
        header("Location: {$prevpage}");
    } else {
        //echo $client->get_last_raw_result();
        ELog::error("something went wrong");
    }
}
Exemple #13
0
 /**	 
  * upload a preview picture of a content
  * @param string $format
  * @param string $contentid
  * @param string $previewid
  * @return string xml/json
  */
 private function contentpreviewupload($format, $contentid, $previewid)
 {
     $user = $this->checkpassword(true);
     $this->checktrafficlimit($user);
     $content = addslashes($contentid);
     $preview = addslashes($previewid);
     // fetch data
     $con = new OCSContent();
     if ($preview == 1 or $preview == 2 or $preview == 3) {
         if ($con->load($content) and $con->is_owned(OCSUser::id())) {
             if (isset($_FILES['localfile']['name']) and isset($_FILES['localfile']['name']) and ($_FILES['localfile']['name'] != '' and $_FILES['localfile']['name'] != 'none' and $_FILES['localfile']['tmp_name'] != '' and $_FILES['localfile']['tmp_name'] != 'none')) {
                 if ($con->previewadd($content, 'localfile', $preview)) {
                     $txt = $this->generatexml($format, 'ok', 100, '');
                 } else {
                     ELog::error("previewadd crashed lol!");
                 }
             } else {
                 $txt = $this->generatexml($format, 'failed', 101, 'localfile not found');
             }
         } else {
             $txt = $this->generatexml($format, 'failed', 102, 'no permission to change content');
         }
     } else {
         $txt = $this->generatexml($format, 'failed', 103, 'preview must be 1, 2 or 3');
     }
     echo $txt;
 }
Exemple #14
0
 private function _statuscode_test($data, $client)
 {
     ob_start();
     var_dump($data);
     $a = ob_get_contents();
     ob_end_clean();
     if (isset($data["ocs"]["meta"]["statuscode"])) {
         echo '<span style="color:green">ok!</span>(statuscode:' . $data["ocs"]["meta"]["statuscode"] . ')';
         echo '<a onclick="alert(\'';
         echo str_replace("lkjjjnnh", "\\n", addslashes(htmlspecialchars(str_replace("\n", "lkjjjnnh", $a))));
         echo '\')">[show full response]</a></p>';
     } else {
         echo '<span style="color:red">failed!</span></p>';
         ELog::pd($client->get_last_raw_result());
     }
 }
Exemple #15
0
 public function get_last_raw_result()
 {
     if (!empty($this->last_raw_result)) {
         return $this->last_raw_result;
     } else {
         ELog::warning("no request performed");
         return false;
     }
 }
Exemple #16
0
 public static function loadAllModules()
 {
     ELoader::$root_path = $_SERVER["HTTP_HOST"];
     ELoader::$prev_path = getcwd();
     //handle eventual subsites, changes directory and leaves unchanged
     //the engine will later check for gfx presence in an upper folder
     ELoader::checkForSubsites();
     ELoader::$abs_path = ELoader::getLibInstallPath();
     //include source
     if (chdir(ELoader::$abs_path)) {
         foreach (glob("*.class.php") as $filename) {
             include_once $filename;
         }
     } else {
         ELog::error("critical error including gfx source. Path: " . ELoader::$abs_path);
     }
     //include controllers
     if (chdir(ELoader::$controllers_path)) {
         foreach (glob("*.controller.php") as $filename) {
             include_once $filename;
         }
     } else {
         ELog::error("critical error including controllers. Path: " . ELoader::$controllers_path);
     }
     //include models
     if (chdir(ELoader::$models_path)) {
         foreach (glob("*.model.php") as $filename) {
             include_once $filename;
         }
     } else {
         ELog::error("critical error including models. Path: " . ELoader::$models_path);
     }
     //include local external libraries
     //this is optional, if not found nothing happens
     if (file_exists(ELoader::$locallibs_path)) {
         if (chdir(ELoader::$locallibs_path)) {
             foreach (glob("*.class.php") as $filename) {
                 include_once $filename;
             }
         } else {
             ELog::error("critical error including controllers. Path: " . ELoader::$locallibs_path);
         }
     }
     //include global external libraries
     if (file_exists(ELoader::$libs_path)) {
         if (chdir(ELoader::$libs_path)) {
             foreach (glob("*.class.php") as $filename) {
                 include_once $filename;
             }
         } else {
             ELog::error("critical error including external libs. Path: " . ELoader::$libs_path);
         }
     }
     chdir(ELoader::$prev_path);
 }
Exemple #17
0
 public static function gallow($g)
 {
     $allowedgroups = explode("|", $g);
     $groups = explode("|", EUser::$group);
     foreach ($groups as $thGroup) {
         foreach ($allowedgroups as $alGroup) {
             if ($thGroup == $alGroup) {
                 return true;
             }
         }
     }
     ELog::error("You're not allowed to be here.");
     return false;
 }
Exemple #18
0
defined('_JEXEC') or die('Restricted access');
$this->loadHelper('select');
JHtml::_('behavior.formvalidation');
$preview = null;
if ($this->item->id) {
    $url = $this->item->xtform->get('url');
    if (filter_var($url, FILTER_VALIDATE_URL) !== false) {
        $feedLoaderHelper = FeedLoaderHelper::getInstance();
        $previewResult = $feedLoaderHelper->getPreview($this->item);
        if (isset($previewResult->preview) && count($previewResult->preview)) {
            $preview = $previewResult->preview[0];
        } else {
            ELog::showMessage('COM_AUTOTWEET_VIEW_FEEDS_PREVIEW_UNAVAILABLE', JLog::ERROR);
        }
    } else {
        ELog::showMessage('COM_AUTOTWEET_FEED_INVALID_URL', JLog::ERROR);
    }
}
?>

<div class="extly">
	<div class="extly-body">

		<?php 
if ($this->get('ajax_import')) {
    include_once JPATH_AUTOTWEET . '/views/feeds/tmpl/import_progress.php';
}
echo Extly::showInvalidFormAlert();
?>

		<form name="adminForm" id="adminForm" action="index.php" method="post" class="form form-horizontal form-validate">
Exemple #19
0
 public function insert($allowed_fields = array())
 {
     if (!$this->is_ready_test()) {
         return;
     }
     //accepting eventual data as valid
     if (!empty($allowed_fields)) {
         foreach ($this->fields as $field) {
             if (EHeaderDataParser::exists_post($field['field']) and in_array($field['field'], $allowed_fields)) {
                 $entries[] = array("field" => $field['field'], "value" => EHeaderDataParser::db_post($field['field']), "type" => $field['type']);
             }
         }
     } else {
         foreach ($this->fields as $field) {
             if (EHeaderDataParser::exists_post($field['field'])) {
                 $entries[] = array("field" => $field['field'], "value" => EHeaderDataParser::db_post($field['field']), "type" => $field['type']);
             }
         }
     }
     if (!empty($entries)) {
         $sql = "INSERT INTO " . $this->table . " (";
         //starting query
         foreach ($entries as $entry) {
             $sql = $sql . $entry['field'] . ",";
         }
         //insert in queries all the fields we're going to accept
         $sql = rtrim($sql, ",") . ") VALUES (";
         foreach ($entries as $entry) {
             //type check against type field found with describe
             if ($field['type'] == "varchar" or $field['type'] == "text") {
                 $sql = $sql . "'" . $entry['value'] . "',";
             } else {
                 if ($field['type'] == "int") {
                     if (preg_match("/[^0-9]/", $entry['value'])) {
                         ELog::error("EData Object Error: wrong data passed for <i><big>`" . $field['field'] . "`</big></i> with type `INT`! freezing...");
                     }
                     $sql = $sql . $entry['value'] . ",";
                 }
             }
         }
         $sql = rtrim($sql, ",") . ")";
         // cleaning and ending query
         //outputting or executing
         if ($this->noquery == false) {
             EDatabase::q($sql);
         } else {
             echo $sql;
         }
     }
 }
Exemple #20
0
<?php

include "gfx3/lib.php";
$prevpage = EPageProperties::get_previous_page();
$type = EHeaderDataParser::db_post("type");
$content = EHeaderDataParser::db_post("content");
$content2 = EHeaderDataParser::db_post("content2");
$parent = EHeaderDataParser::db_post("parent");
$subject = EHeaderDataParser::db_post("subject");
$message = EHeaderDataParser::db_post("message");
$postdata = array("type" => $type, "content" => $content, "content2" => $content2, "parent" => $parent, "subject" => $subject, "message" => $message);
$client = new OCSClient();
$client->set_auth_info(EUser::nick(), EUser::password());
$client->set_post_data($postdata);
$res = $client->post("v1/comments/add");
if ($res["ocs"]["meta"]["statuscode"] == "100") {
    header("Location: game.php/id/{$content}");
} else {
    ELog::pd($res);
}
Exemple #21
0
<?php

include "gfx3/lib.php";
$prevpage = EPageProperties::get_previous_page();
$contentid = EHeaderDataParser::db_get("id");
$client = new OCSClient();
$client->set_auth_info(EUser::nick(), EUser::password());
$addfan = $client->post("v1/fan/remove/{$contentid}");
ELog::pd($client->get_last_raw_result());
if ($addfan["ocs"]["meta"]["statuscode"] == "100") {
    header("Location: {$prevpage}");
} else {
    ELog::pd($addfan);
}
Exemple #22
0
<?php

include "gfx3/lib.php";
$gameid = EHeaderDataParser::db_get("id");
$client = new OCSClient();
$data = $client->get("v1/content/data/{$gameid}/");
if (EUser::nick() != $data["ocs"]["data"]["content"]["personid"]) {
    ELog::error("You are not authorized to view this page!");
}
echo "<div class=\"modal-header\">\n    <button type=\"button\" class=\"close\" data-dismiss=\"modal\">×</button>\n    <h3>Modify your game</h3>\n    </div>\n    \n    <form class=\"form-horizontal\" action=\"/editGameAction.php\" target=\"_self\" method=\"post\">\n    <div class=\"modal-body\">\n    <fieldset>\n    \n    <div class=\"control-group\">\n    <label class=\"control-label\" for=\"name\">Title</label>\n    <div class=\"controls\">\n    <input type=\"text\" name=\"name\" class=\"input-xlarge\" id=\"name\" value=\"" . EUtility::stripslashes($data["ocs"]["data"]["content"]["name"]) . "\">\n    <input type=\"hidden\" name=\"idcontent\" class=\"input-xlarge\" id=\"idcontent\" value=\"{$gameid}\">\n    </div>\n    </div>\n    \n    <div class=\"control-group\">\n    <label class=\"control-label\" for=\"downloadname1\">Download name</label>\n    <div class=\"controls\">\n    <input type=\"text\" name=\"downloadname1\" class=\"input-xlarge\" id=\"downloadname1\" \nvalue=\"" . EUtility::stripslashes($data["ocs"]["data"]["content"]["downloadname1"]) . "\">\n    <p class=\"help-block\">- this is the label that will be shown to download your game</p>\n    </div>\n    </div>\n    \n    <div class=\"control-group\">\n    <label class=\"control-label\" for=\"downloadlink1\">Download link</label>\n    <div class=\"controls\">\n    <input type=\"text\" name=\"downloadlink1\" class=\"input-xlarge\" id=\"downloadlink1\" \nvalue=\"" . EUtility::stripslashes($data["ocs"]["data"]["content"]["downloadlink1"]) . "\">\n    <p class=\"help-block\">- this is the direct link to your game. If you want to host it on gamingfreedom server, you can do it uploading\n    it after having created this skeleton</p>\n    </div>\n    </div>\n    \n    <div class=\"control-group\">\n    <label class=\"control-label\" for=\"description\">Summary</label>\n    <div class=\"controls\">\n    <textarea cols=\"60\" rows=\"3\" name=\"summary\" class=\"input-xlarge\" \nid=\"summary\">" . EUtility::br2nl(EUtility::stripslashes($data["ocs"]["data"]["content"]["summary"])) . "</textarea>\n    <p class=\"help-block\">- A short description to your game</p>\n    </div>\n    </div>\n    \n    <div class=\"control-group\">\n    <label class=\"control-label\" for=\"description\">Features</label>\n    <div class=\"controls\">\n    <textarea cols=\"60\" rows=\"3\" name=\"description\" class=\"input-xlarge\" \nid=\"description\">" . EUtility::br2nl(EUtility::stripslashes($data["ocs"]["data"]["content"]["description"])) . "</textarea>\n    <p class=\"help-block\">- A more in depth description and a list of features.</p>\n    </div>\n    </div>\n    \n    <div class=\"control-group\">\n    <label class=\"control-label\" for=\"version\">Version</label>\n    <div class=\"controls\">\n    <input type=\"text\" name=\"version\" class=\"input-xlarge\" id=\"version\" \nvalue=\"" . EUtility::stripslashes($data["ocs"]["data"]["content"]["version"]) . "\">\n    <p class=\"help-block\">- set here the version of your application</p>\n    </div>\n    </div>\n    \n    <div class=\"control-group\">\n    <label class=\"control-label\" for=\"changelog\">Changelog</label>\n    <div class=\"controls\">\n    <textarea cols=\"60\" rows=\"3\" name=\"changelog\" class=\"input-xlarge\" \nid=\"changelog\">" . EUtility::stripslashes(EUtility::br2nl($data["ocs"]["data"]["content"]["changelog"])) . "</textarea>\n    <p class=\"help-block\">- putting changelog helps your fans to know what is changed and what improvements\n    have you put</p>\n    </div>\n    </div>\n    \n    </fieldset>\n    \n    </div>\n    <div class=\"modal-footer\" style=\"background-color:#FFFFFF;\">\n    <input type=\"submit\" class=\"btn btn-primary\" value=\"Next\">\n    </div>\n    \n    </form>\n    ";
Exemple #23
0
 public static function view($url)
 {
     $numargs = func_num_args();
     $arg_list = func_get_args();
     $data = array();
     for ($i = 1; $i < $numargs; $i++) {
         $data[] = $arg_list[$i];
     }
     $filepath = ELoader::$views_path . "/{$url}.views.php";
     if (file_exists($filepath)) {
         include ELoader::$views_path . "/{$url}.views.php";
     } else {
         ELog::error("non-existent view included. Please define {$filepath} !");
     }
 }
Exemple #24
0
<?php

include "gfx3/lib.php";
$prevpage = EPageProperties::get_previous_page();
$id = EHeaderDataParser::db_post("idcontent");
$name = EHeaderDataParser::db_post("name");
$downloadname1 = EHeaderDataParser::db_post("downloadname1");
$downloadlink1 = EHeaderDataParser::db_post("downloadlink1");
$description = EUtility::nl2br(EHeaderDataParser::db_post("description"));
$version = EHeaderDataParser::db_post("version");
$summary = EHeaderDataParser::db_post("summary");
$changelog = nl2br(EHeaderDataParser::db_post("changelog"));
$postdata = array("name" => $name, "summary" => $summary, "downloadname1" => $downloadname1, "downloadlink1" => $downloadlink1, "description" => $description, "version" => $version, "changelog" => $changelog);
$client = new OCSClient();
$client->set_auth_info(EUser::nick(), EUser::password());
$mod = $client->post("v1/content/edit/{$id}", $postdata);
if ($mod["ocs"]["meta"]["statuscode"] == "100") {
    header("Location: {$prevpage}");
} else {
    ELog::pd($mod);
    die;
    header("Location: {$prevpage}");
}