The following warnings occurred:
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/printthread.php 203 postParser->parse_message



GetSimple Support Forum
NewsManger / xml question - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Developer Discussions (http://get-simple.info/forums/forumdisplay.php?fid=8)
+--- Thread: NewsManger / xml question (/showthread.php?tid=2256)



NewsManger / xml question - rigor789 - 2011-10-02

Hey all!

I customized NewsManager for my needs (added read more function)!
And it works perfect, but i saw the xml writing part and im not sure where the: XMLsave and @getXML comes from!

Code:
if (!file_exists($file)) {
    $date = date('d. m. Y.');
  } else {
    $data = @getXML($file);
    $date = $data->date;
  }

  $xml = @new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><item></item>');
  $xml->addChild('title', $title);
  $xml->addChild('date', $date);
  $xml->addChild('short', $short);
  $xml->addChild('content', $content);
  
  
  XMLsave($xml, $file);

I need to know where that comes from, becasue i need it in one of my projects!


NewsManger / xml question - mvlcek - 2011-10-02

rigor789 Wrote:I customized NewsManager for my needs (added read more function)!
And it works perfect, but i saw the xml writing part and im not sure where the: XMLsave and @getXML comes from!

They are part of GetSimple: admin/inc/basic.php


NewsManger / xml question - rigor789 - 2011-10-02

mvlcek Wrote:
rigor789 Wrote:I customized NewsManager for my needs (added read more function)!
And it works perfect, but i saw the xml writing part and im not sure where the: XMLsave and @getXML comes from!

They are part of GetSimple: admin/inc/basic.php
That was quick! Big Grin thanks Wink


NewsManger / xml question - rigor789 - 2011-10-02

oh and could you please check my code? It gives no errors, but it dosent works.... im too tired to debug it Sad

Code:
<?php

$ip=$_SERVER['REMOTE_ADDR'];
$key=$_GET["securitykey"];
$status=$_GET["status"];


if ($key=="md5ior6xsomk485asegilsa"){
writeDetails();//change the key here and in your ServerIP config file!
}else{
echo "Fail";
}


function writeDetails()
{
if(isset($_GET["status"])&&isset($_GET["players"])&&isset($_GET["maxplayers"])&&isset($_GET["writeonlineplayers"])){

$ip=$_SERVER['REMOTE_ADDR'];
$status=$_GET["status"];
$players=$_GET["players"];
$maxplayers=$_GET["maxplayers"];
$function=$_GET["writeonlineplayers"];
$File = "status.xml";

    $xml = @new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><item></item>');
    if ($status=="Offline") $ip="-";
    $xml->addChild('ip', $ip);
    $xml->addChild('players', $players);
    $xml->addChild('maxplayers', $maxplayers);
    $xml->addChild('function', $function);
    XMLsave($xml, $file);
}else{
echo "Missing data!";
}
}
class SimpleXMLExtended extends SimpleXMLElement{  
  public function addCData($cdata_text){  
   $node= dom_import_simplexml($this);  
   $no = $node->ownerDocument;  
   $node->appendChild($no->createCDATASection($cdata_text));  
  }
}
function XMLsave($xml, $file) {
    $xml->asXML($file);
    
    if (defined('GSCHMOD')) {
        chmod($file, GSCHMOD);
    } else {
        chmod($file, 0755);
    }
}
function getXML($file) {
    $xml = @file_get_contents($file);
    $data = simplexml_load_string($xml, 'SimpleXMLExtended', LIBXML_NOCDATA);
    return $data;
}

?>