1st commit for syncing own Jlog developments with master
This commit is contained in:
parent
2ae67af572
commit
517c58344d
54 changed files with 1784 additions and 1062 deletions
|
@ -52,7 +52,8 @@ class JlogUpdater
|
|||
$html .= $class->getForm($l);
|
||||
$version = $this->versions[$version];
|
||||
}
|
||||
$html .= '<p><button name="update" value="' . $l['admin']['update_start'] . '">' . htmlspecialchars($l['admin']['update_start']) . '</button></p>';
|
||||
$btnUpdate = htmlspecialchars($l['admin']['update_start']);
|
||||
$html .= '<p><button name="update" value="' . $btnUpdate . '">' . $btnUpdate . '</button></p>';
|
||||
$html .= '</form>';
|
||||
return $html;
|
||||
}
|
||||
|
|
|
@ -67,14 +67,17 @@ function do_bbcode_img ($action, $attributes, $content, $params, $node_object) {
|
|||
}
|
||||
$title = empty($attributes["title"]) ? "" : " title='".htmlspecialchars($attributes["title"])."'";
|
||||
|
||||
$class = '';
|
||||
|
||||
if (isset($attributes['class']) AND isset($attributes['caption'])) $class_caption = " class='img ".htmlspecialchars($attributes['class'])."'";
|
||||
elseif (isset($attributes['class'])) $class = " class='".htmlspecialchars($attributes['class'])."'";
|
||||
elseif (isset($attributes['caption'])) $class_caption = " class='img'"; // bugfix by Sebastian Kochendörfer #215
|
||||
|
||||
if (strpos($content, "http://") === 0) return "<img src='".htmlspecialchars($content)."'".$class." alt='".htmlspecialchars($attributes['alt'])."'".$title." />";
|
||||
if (strpos($content, 'http://') === 0 || strpos($content, 'https://') === 0)
|
||||
return "<img src='".htmlspecialchars($content)."'".$class." alt='".htmlspecialchars($attributes['alt'] ?? '')."'".$title." />";
|
||||
else {
|
||||
list($img_width, $img_height, $img_type, $img_attr) = @getimagesize(JLOG_BASEPATH.'/img'.DIRECTORY_SEPARATOR.htmlspecialchars($content));
|
||||
$img = "<img src='".JLOG_PATH."/img/".htmlspecialchars($content)."'".$class." alt='".htmlspecialchars($attributes['alt'])."' style='width: ".$img_width."px;'".$title." />";
|
||||
$img = "<img src='".JLOG_PATH."/img/".htmlspecialchars($content)."'".$class." alt='".htmlspecialchars($attributes['alt'] ?? '')."' style='width: ".$img_width."px;'".$title." />";
|
||||
}
|
||||
|
||||
if(isset($attributes['caption'])) {
|
||||
|
|
|
@ -6,7 +6,7 @@ class Categories {
|
|||
var $categories = array();
|
||||
var $l = array();
|
||||
|
||||
function Categories($l) {
|
||||
function __construct($l) {
|
||||
|
||||
$this->l = $l;
|
||||
|
||||
|
@ -66,8 +66,9 @@ class Categories {
|
|||
." <option value='no_categories'>".$this->l['admin']['no_categories']."</option>\n";
|
||||
|
||||
foreach($this->categories AS $id => $data) {
|
||||
$selected = '';
|
||||
if(is_array($catassign)) if(in_array($id, $catassign)) $selected = " selected='selected'";
|
||||
else unset($selected);
|
||||
else $selected = '';
|
||||
$output .= " <option".$selected." value='".$id."'>".$data['name']."</option>\n";
|
||||
}
|
||||
|
||||
|
@ -79,6 +80,8 @@ class Categories {
|
|||
|
||||
function output_rss($id) {
|
||||
$ids = $this->get_assigned_categories($id);
|
||||
$output = '';
|
||||
|
||||
if(is_array($ids)) {
|
||||
foreach($ids AS $i) {
|
||||
$output .= " <category>".$this->get($i, 'name')."</category>\n";
|
||||
|
@ -89,12 +92,13 @@ class Categories {
|
|||
|
||||
function output_assigned_links($ids) {
|
||||
if(!is_array($ids)) $ids = $this->get_assigned_categories($ids);
|
||||
$output = '';
|
||||
if(is_array($ids)) {
|
||||
foreach($ids as $id) {
|
||||
$output .= $this->link($id)." ";
|
||||
}
|
||||
}
|
||||
if(isset($output)) return " <span title='".$this->l['content_cat_linklist']."' class='catlinklist'>» ".$output."</span>";
|
||||
if(strlen($output) > 0) return " <span title='".$this->l['content_cat_linklist']."' class='catlinklist'>» ".$output."</span>";
|
||||
}
|
||||
|
||||
function output_whole_list($_before = " <ul id='categorieslist'>\n", $_after = " </ul>\n", $before = " <li>", $after = "</li>\n") {
|
||||
|
@ -137,7 +141,9 @@ class Categories {
|
|||
return $output;
|
||||
}
|
||||
|
||||
function output_form($form_input = "", $action = 'new', $legend) {
|
||||
function output_form($form_input = array(), $action = 'new', $legend) {
|
||||
array_contains($form_input, ['name', 'url', 'id', 'description']);
|
||||
|
||||
$output = "
|
||||
<form id='entryform' action='?action=".$action."' method='POST'>
|
||||
<fieldset><legend>".$legend."</legend>
|
||||
|
@ -247,4 +253,3 @@ class Categories {
|
|||
return $errors;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -2,20 +2,24 @@
|
|||
// call database class
|
||||
class Query {
|
||||
// Variablen
|
||||
var $_conn;
|
||||
var $_sql = "";
|
||||
var $_result = 0;
|
||||
var $_errno = 0;
|
||||
var $_error = "";
|
||||
|
||||
//Konstruktor
|
||||
function Query($sql)
|
||||
function __construct($sql)
|
||||
{
|
||||
global $connect;
|
||||
$this->_conn = $connect;
|
||||
|
||||
// Query in der Klasse speichern
|
||||
$this->_sql = trim($sql);
|
||||
$this->_result = mysql_query($this->_sql);
|
||||
$this->_result = $this->_conn->query($this->_sql);
|
||||
if(!$this->_result) {
|
||||
$this->_errno = mysql_errno();
|
||||
$this->_error = mysql_error();
|
||||
$this->_errno = $this->_conn->errno;
|
||||
$this->_error = $this->_conn->error;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,7 +54,7 @@
|
|||
echo "An Error has occurred, please check your MySQL-Query.";
|
||||
$return = null;
|
||||
}
|
||||
else $return = mysql_fetch_assoc($this->_result);
|
||||
else $return = $this->_result->fetch_assoc();
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@ -58,14 +62,13 @@
|
|||
if($this->error()) {
|
||||
$return = -1;
|
||||
}
|
||||
else $return = mysql_num_rows($this->_result);
|
||||
else $return = $this->_result->num_rows;
|
||||
return $return;
|
||||
}
|
||||
|
||||
function free() {
|
||||
// Speicher freimachen
|
||||
mysql_free_result($this->_result);
|
||||
#mysql_free_result($this->_result);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -54,7 +54,7 @@ if(defined('JLOG_ADMIN')) {
|
|||
|
||||
$_search = array (
|
||||
"<jlog:language />",
|
||||
"<jlog:html-language />",
|
||||
"<jlog:html-language />",
|
||||
"<jlog:website />",
|
||||
"<jlog:title />",
|
||||
"<jlog:aditional-header />",
|
||||
|
@ -82,7 +82,7 @@ $_search = array (
|
|||
|
||||
$_replace = array (
|
||||
$l['language'],
|
||||
$l['html_language'],
|
||||
$l['html_language'],
|
||||
htmlspecialchars(JLOG_WEBSITE, ENT_QUOTES),
|
||||
htmlspecialchars($c['meta']['title']),
|
||||
$c['meta']['aditionalheader'],
|
||||
|
|
|
@ -2,8 +2,15 @@
|
|||
// get weblog link
|
||||
function blog($date, $url, $section = 'weblog') {
|
||||
if($section == 'weblog' OR $section == 'comment') {
|
||||
$y = date("Y", $date);
|
||||
$m = date("m", $date);
|
||||
$matches = array();
|
||||
if (preg_match('/^(\d{4})-(\d{2})/', $date, $matches)) {
|
||||
$y = $matches[1];
|
||||
$m = $matches[2];
|
||||
}
|
||||
else {
|
||||
$y = date("Y", $date);
|
||||
$m = date("m", $date);
|
||||
}
|
||||
if(JLOG_CLEAN_URL === true) $permalink = JLOG_PATH."/".$y."/".$m."/".$url;
|
||||
else $permalink = JLOG_PATH."/log.php?y=".$y."&m=".$m."&url=".$url;
|
||||
}
|
||||
|
@ -27,12 +34,13 @@ function archive() {
|
|||
// get year links
|
||||
class Year_Links {
|
||||
|
||||
function Year_Links($get, $start, $page, $l, $cat="") {
|
||||
function __construct($get, $start, $page, $l, $cat="") {
|
||||
$date = getdate();
|
||||
$this->_now = $date['year'];
|
||||
$this->_start = $start;
|
||||
$this->_page = $page;
|
||||
$this->_l = $l;
|
||||
$this->cat = '';
|
||||
if(JLOG_CLEAN_URL === true) {
|
||||
if($cat != "") {
|
||||
list($tmp, $cat) = explode("=", $cat);
|
||||
|
@ -46,7 +54,7 @@ class Year_Links {
|
|||
}
|
||||
|
||||
function get_linklist() {
|
||||
|
||||
$years_links = '';
|
||||
for($y = $this->_start; $y <= $this->_now; $y++) {
|
||||
if($y != $this->_start) $years_links .= " | ";
|
||||
if($y == $this->year) $years_links .= " <strong>".$y."</strong>";
|
||||
|
@ -60,6 +68,7 @@ class Year_Links {
|
|||
}
|
||||
|
||||
function get_admin_linklist() {
|
||||
$years_links = '';
|
||||
|
||||
for($y = $this->_start; $y <= $this->_now; $y++) {
|
||||
if($y != $this->_start) $years_links .= " | ";
|
||||
|
@ -88,14 +97,11 @@ function strip($_data) {
|
|||
}
|
||||
// escape input for mysql
|
||||
function escape_for_mysql($_data) {
|
||||
if (is_array($_data))
|
||||
foreach($_data as $key => $val) $_data[$key] = escape_for_mysql($val);
|
||||
else
|
||||
$_data = mysql_real_escape_string($_data);
|
||||
// uses last opened MySQL link implicitly
|
||||
// assumption is valid because this function is never called
|
||||
// before mysql_connect
|
||||
global $connect;
|
||||
|
||||
if (is_array($_data)) foreach($_data as $key => $val) $_data[$key] = escape_for_mysql($val);
|
||||
// FIXME deprecated
|
||||
else $_data = $connect->real_escape_string($_data);
|
||||
return $_data;
|
||||
}
|
||||
// htmlspecialchars a whole array
|
||||
|
@ -140,7 +146,7 @@ global $l, $bbcode, $categories, $plugins;
|
|||
if(empty($data['date_url'])) $data['date_url'] = $data['date']; # fix for search.php
|
||||
|
||||
$output = "\n <div class='teaser'>\n";
|
||||
if($data['teaserpic'] != "") {
|
||||
if(isset($data['teaserpic']) && $data['teaserpic'] != "") {
|
||||
list($img_width, $img_height, $img_type, $img_attr) = @getimagesize(JLOG_BASEPATH.'img'.DIRECTORY_SEPARATOR.'t_'.$data['teaserpic']);
|
||||
$output .= " <a title='".$l['content_permalink']."' href='".blog($data['date_url'], $data['url'], $data['section'])."'><img class='teaserpic' src='".JLOG_PATH."/img/t_".$data['teaserpic']."' style='width: ".$img_width."px; height: ".$img_height."px;' alt='' /></a>\n";
|
||||
}
|
||||
|
@ -178,7 +184,11 @@ global $l, $bbcode, $categories, $plugins;
|
|||
|
||||
if($section == 'weblog' OR ($cat = $categories->output_assigned_links($data['id'])) != "") {
|
||||
$output .= " <p class='date meta'>";
|
||||
if($section == 'weblog') $output .= $l['content_posted']." ".strftime(JLOG_DATE, $data['date']);
|
||||
if($section == 'weblog') {
|
||||
$output .= $l['content_posted']." ";
|
||||
#$output .= is_int($data['date']) ? strftime(JLOG_DATE, $data['date']) : $data['date'];
|
||||
$output .= strftime(JLOG_DATE, $data['date']);
|
||||
}
|
||||
$output .= $categories->output_assigned_links($data['id'])."</p>";
|
||||
}
|
||||
|
||||
|
@ -186,8 +196,10 @@ global $l, $bbcode, $categories, $plugins;
|
|||
$path_parts = pathinfo($_SERVER['SCRIPT_NAME']);
|
||||
|
||||
if($data['section'] == 'weblog' AND $path_parts['basename'] != 'log.php') {
|
||||
if(isset($cc[$data['id']]) AND $cc[$data['id']] != 0) $tmp_comments = " <a title='".$l['content_comments_title']."' href='".blog($data['date'], $data['url'])."#comments'>".$l['content_comments']." (".$cc[$data['id']].")</a>";
|
||||
elseif($data['comments'] === '0') $tmp_comments = $l['comments_teaser_closed'];
|
||||
if(isset($cc[$data['id']]) AND $cc[$data['id']] != 0)
|
||||
$tmp_comments = " <a title='".$l['content_comments_title']."' href='".blog($data['date'], $data['url'])."#comments'>".$l['content_comments']." (".$cc[$data['id']].")</a>";
|
||||
elseif(isset($data['comments']) && $data['comments'] === '0')
|
||||
$tmp_comments = $l['comments_teaser_closed'];
|
||||
else $tmp_comments = "<a href='".blog($data['date'], $data['url'])."#comments'>".$l['content_comment_plz']."</a>";
|
||||
$output .=" <p class='meta'>".$tmp_comments."</p>";
|
||||
}
|
||||
|
@ -295,7 +307,7 @@ function my_serialize_cfg($arg) {
|
|||
class JLOG_Tags {
|
||||
var $tree = array();
|
||||
|
||||
function JLOG_Tags($body) {
|
||||
function __construct($body) {
|
||||
preg_match_all('/<jlog:([a-z]\w+)\s?([^>]*)\/?>(<\/(\1):(\2)>)?/ims', $body, $this->tree);
|
||||
}
|
||||
|
||||
|
@ -319,6 +331,16 @@ class JLOG_Tags {
|
|||
|
||||
// security functions
|
||||
function hashPassword($pw) {
|
||||
// TODO: see iusses/2 for details
|
||||
// TODO: see issues/2 for details
|
||||
return md5($pw);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function array_contains(&$arr, $fields) {
|
||||
foreach ($fields as $key) {
|
||||
if (!isset($arr[$key]))
|
||||
$arr[$key] = '';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
class IXR_Value {
|
||||
var $data;
|
||||
var $type;
|
||||
function IXR_Value ($data, $type = false) {
|
||||
function __construct ($data, $type = false) {
|
||||
$this->data = $data;
|
||||
if (!$type) {
|
||||
$type = $this->calculateType();
|
||||
|
@ -132,7 +132,7 @@ class IXR_Message {
|
|||
var $_currentTagContents;
|
||||
// The XML parser
|
||||
var $_parser;
|
||||
function IXR_Message ($message) {
|
||||
function __construct ($message) {
|
||||
$this->message = $message;
|
||||
}
|
||||
function parse() {
|
||||
|
@ -275,7 +275,7 @@ class IXR_Server {
|
|||
var $callbacks = array();
|
||||
var $message;
|
||||
var $capabilities;
|
||||
function IXR_Server($callbacks = false, $data = false) {
|
||||
function __construct($callbacks = false, $data = false) {
|
||||
$this->setCapabilities();
|
||||
if ($callbacks) {
|
||||
$this->callbacks = $callbacks;
|
||||
|
@ -328,7 +328,7 @@ EOD;
|
|||
}
|
||||
$method = $this->callbacks[$methodname];
|
||||
// Perform the callback and send the response
|
||||
if (count($args) == 1) {
|
||||
if ($args !== null && count($args) == 1) {
|
||||
// If only one paramater just send that instead of the whole array
|
||||
$args = $args[0];
|
||||
}
|
||||
|
@ -430,7 +430,7 @@ class IXR_Request {
|
|||
var $method;
|
||||
var $args;
|
||||
var $xml;
|
||||
function IXR_Request($method, $args) {
|
||||
function __construct($method, $args) {
|
||||
$this->method = $method;
|
||||
$this->args = $args;
|
||||
$this->xml = <<<EOD
|
||||
|
@ -467,7 +467,7 @@ class IXR_Client {
|
|||
var $debug = false;
|
||||
// Storage place for an error message
|
||||
var $error = false;
|
||||
function IXR_Client($server, $path = false, $port = 80) {
|
||||
function __construct($server, $path = false, $port = 80) {
|
||||
if (!$path) {
|
||||
// Assume we have been given a URL instead
|
||||
$bits = parse_url($server);
|
||||
|
@ -565,7 +565,7 @@ class IXR_Client {
|
|||
class IXR_Error {
|
||||
var $code;
|
||||
var $message;
|
||||
function IXR_Error($code, $message) {
|
||||
function __construct($code, $message) {
|
||||
$this->code = $code;
|
||||
$this->message = $message;
|
||||
}
|
||||
|
@ -601,7 +601,7 @@ class IXR_Date {
|
|||
var $hour;
|
||||
var $minute;
|
||||
var $second;
|
||||
function IXR_Date($time) {
|
||||
function __construct($time) {
|
||||
// $time can be a PHP timestamp or an ISO one
|
||||
if (is_numeric($time)) {
|
||||
$this->parseTimestamp($time);
|
||||
|
@ -639,7 +639,7 @@ class IXR_Date {
|
|||
|
||||
class IXR_Base64 {
|
||||
var $data;
|
||||
function IXR_Base64($data) {
|
||||
function __construct($data) {
|
||||
$this->data = $data;
|
||||
}
|
||||
function getXml() {
|
||||
|
@ -651,7 +651,7 @@ class IXR_Base64 {
|
|||
class IXR_IntrospectionServer extends IXR_Server {
|
||||
var $signatures;
|
||||
var $help;
|
||||
function IXR_IntrospectionServer() {
|
||||
function __construct() {
|
||||
$this->setCallbacks();
|
||||
$this->setCapabilities();
|
||||
$this->capabilities['introspection'] = array(
|
||||
|
@ -795,7 +795,7 @@ class IXR_IntrospectionServer extends IXR_Server {
|
|||
|
||||
class IXR_ClientMulticall extends IXR_Client {
|
||||
var $calls = array();
|
||||
function IXR_ClientMulticall($server, $path = false, $port = 80) {
|
||||
function __construct($server, $path = false, $port = 80) {
|
||||
parent::IXR_Client($server, $path, $port);
|
||||
$this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)';
|
||||
}
|
||||
|
@ -814,4 +814,3 @@ class IXR_ClientMulticall extends IXR_Client {
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,30 +1,34 @@
|
|||
<?php
|
||||
// FIXME Strict Standards
|
||||
|
||||
// hiervon werden die Plugins abgeleitet
|
||||
class JlogPlugin {
|
||||
|
||||
/* Hooks */
|
||||
function hook_body ($t) { return $t; } // string body
|
||||
function hook_commentForm ($t) { return $t; } // string with comment form output + array with form data
|
||||
function hook_commentForm ($t, $c) { return $t; } // string with comment form output + array with form data
|
||||
function hook_adminContent ($t) { return $t; } // string content
|
||||
function hook_newComment ($t) { return $t; } // array form data
|
||||
function hook_updateComment ($t) { return $t; } // array form data
|
||||
function hook_deleteComment ($t) { return $t; } // string comment id
|
||||
function hook_showComment ($t) { return $t; } // string comment output
|
||||
function hook_showComment($comment, $data, $nr) { return $comment; } // string comment output
|
||||
function hook_onUpdate ($t) { return $t; } // array with all rss feeds and sub
|
||||
function hook_doEntry ($t) { return $t; } // string with entry + array with data from database + string count comments + string section
|
||||
function hook_doEntry($output /* entry */,
|
||||
$dbData /* array with data from database */,
|
||||
$cc /* string count comments */,
|
||||
$section /* string section */) { return $output; }
|
||||
function hook_doTeaser ($t) { return $t; } // string with entry + array with data from database + string count comments + string pre + string post
|
||||
function hook_bbcode ($t) { return $t; } // bbcode object
|
||||
function hook_bbcomments ($t) { return $t; } // bbcomments object
|
||||
function hook_adminForm ($t) { return $t; } // admin formular
|
||||
function hook_insertEntry ($t) { return $t; } // int id + array with form data
|
||||
function hook_updateEntry ($t) { return $t; } // int id + array with form data
|
||||
function hook_adminForm($formHTML, $formData) { return $formHTML; } // admin formular
|
||||
function hook_insertEntry($id, $form /* bereits escaped */) {} // int id + array with form data
|
||||
function hook_updateEntry($id, $form) {} // int id + array with form data
|
||||
function hook_permalink ($t) { return $t; } // string permalink + string date + string url + string section
|
||||
function hook_xmlrpcPermalink ($t) { return $t; } // string url
|
||||
function hook_countComments ($t) { return $t; } // array with id and count
|
||||
function hook_adminMail ($t) { return $t; } // array with mail + array blogentry
|
||||
function hook_adminMail($mail, $blogentry, $id) { return $mail; } // array with mail + array blogentry
|
||||
function hook_commentorMail ($t) { return $t; } // array with mail + array blogentry
|
||||
function hook_commentAdminList($t) { return $t; } // string with actual tr + array with comment data
|
||||
function hook_commentAdminList($comment, $data) { return $comment; } // string with actual tr + array with comment data
|
||||
function hook_previewComment ($t) { return $t; } // same as newComment
|
||||
function hook_dispatchLogin ($t) { return $t; } //
|
||||
function hook_loginForm ($t) { return $t; } //
|
||||
|
@ -35,7 +39,7 @@ class JlogPlugin {
|
|||
class JlogPluginManager {
|
||||
var $plugins = array();
|
||||
|
||||
function JlogPluginManager($plugindirectory) {
|
||||
function __construct($plugindirectory) {
|
||||
$handle = "";
|
||||
$file = "";
|
||||
$this->get = strip($_GET);
|
||||
|
@ -72,7 +76,7 @@ class JlogPluginManager {
|
|||
foreach ($this->plugins as $plugin) {
|
||||
$parameters[0] = $hookresult;
|
||||
if($hook == 'hook_adminTitle' OR $hook == 'hook_adminContent') {
|
||||
if(strtolower($this->get['jplug']) === strtolower(get_class($plugin)))
|
||||
if(isset($this->get['jplug']) && strtolower($this->get['jplug']) === strtolower(get_class($plugin)))
|
||||
$hookresult = call_user_func_array(array($plugin, $hook), $parameters);
|
||||
}
|
||||
else $hookresult = call_user_func_array(array($plugin, $hook), $parameters);
|
||||
|
@ -80,4 +84,3 @@ class JlogPluginManager {
|
|||
return $hookresult;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
* $HeadURL: http://jeenaparadies.net/svn/jlog/trunk/scripts/prepend.inc.php $
|
||||
* $Rev: 1739 $
|
||||
* $Author: driehle $
|
||||
* $Date: 2008-09-03 15:53:30 +0200 (Ons, 03 Sep 2008) $
|
||||
* $Date: 2008-09-03 15:53:30 +0200 (Mi, 03. Sep 2008) $
|
||||
*/
|
||||
|
||||
// load settings and version information
|
||||
|
@ -51,6 +51,10 @@ define("JLOG_DB_CATASSIGN", JLOG_DB_PREFIX."catassign");
|
|||
define("JLOG_DB_CATEGORIES", JLOG_DB_PREFIX."categories");
|
||||
define("JLOG_DB_ATTRIBUTES", JLOG_DB_PREFIX."attributes");
|
||||
|
||||
if (!function_exists('get_magic_quotes_gpc')) {
|
||||
function get_magic_quotes_gpc() { return false; }
|
||||
}
|
||||
|
||||
// we need these files on every page
|
||||
require_once(JLOG_BASEPATH.'lang'.DIRECTORY_SEPARATOR.'lang.'.JLOG_LANGUAGE.'.inc.php');
|
||||
require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'database.class.php');
|
||||
|
@ -62,20 +66,21 @@ require_once(JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'comments.php');
|
|||
if(defined('JLOG_ADMIN')) require_once(JLOG_BASEPATH.'lang'.DIRECTORY_SEPARATOR.'lang-admin.'.JLOG_LANGUAGE.'.inc.php');
|
||||
|
||||
// connect to database
|
||||
$connect = @mysql_connect(JLOG_DB_URL, JLOG_DB_USER, JLOG_DB_PWD);
|
||||
$connect = new mysqli(JLOG_DB_URL, JLOG_DB_USER, JLOG_DB_PWD, JLOG_DB);
|
||||
if ($connect == FALSE) {
|
||||
mail(JLOG_EMAIL, $l['admin']['e_db'], $l['admin']['e_db_is']."\n".mysql_error());
|
||||
die("<strong>".$l['db_error']."</strong><br />".$l['plz_try_again'].".");
|
||||
}
|
||||
// select our database
|
||||
$select = @mysql_select_db(JLOG_DB);
|
||||
#$select = @mysql_select_db(JLOG_DB);
|
||||
if ($connect == FALSE) {
|
||||
mail(JLOG_EMAIL, $l['admin']['e_db'], $l['admin']['e_db_is']."\n".mysql_error());
|
||||
die("<strong>".$l['db_error']."</strong><br />".$l['plz_try_again'].".");
|
||||
}
|
||||
// do some settings
|
||||
@mysql_query("SET NAMES utf8");
|
||||
@mysql_query("SET sql_mode=''");
|
||||
$connect->set_charset('utf8');
|
||||
$connect->query("SET NAMES utf8");
|
||||
$connect->query("SET sql_mode=''");
|
||||
|
||||
// some more code that needs to run for every page - however, this
|
||||
// code requires an established connection to the database
|
||||
|
@ -88,4 +93,4 @@ $plugins = new JlogPluginManager(JLOG_BASEPATH.'plugins'.DIRECTORY_SEPARATOR);
|
|||
$bbcode = $plugins->callHook('bbcode', $bbcode);
|
||||
$bbcomments = $plugins->callHook('bbcomments', $bbcomments);
|
||||
|
||||
// eof
|
||||
// eof
|
||||
|
|
12
scripts/proto.inc.php
Normal file
12
scripts/proto.inc.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
|
||||
function proto() {
|
||||
if (isset($_SERVER['REQUEST_SCHEME']))
|
||||
return $_SERVER['REQUEST_SCHEME'];
|
||||
|
||||
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on')
|
||||
return 'https';
|
||||
|
||||
return 'http';
|
||||
}
|
||||
// eof
|
File diff suppressed because it is too large
Load diff
|
@ -199,7 +199,7 @@ class StringParser {
|
|||
*
|
||||
* @access public
|
||||
*/
|
||||
function StringParser () {
|
||||
function __construct () {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -459,7 +459,7 @@ class StringParser {
|
|||
// if yes, how should this be achieved? Another member of
|
||||
// StringParser_Node?
|
||||
$this->_setStatus (0);
|
||||
$res = $this->_appendText ($this->_text{$topelem->occurredAt});
|
||||
$res = $this->_appendText ($this->_text[$topelem->occurredAt]);
|
||||
if (!$res) {
|
||||
return false;
|
||||
}
|
||||
|
@ -568,7 +568,7 @@ class StringParser {
|
|||
return false;
|
||||
}
|
||||
if (!$res) {
|
||||
$res = $this->_appendText ($this->_text{$this->_cpos});
|
||||
$res = $this->_appendText ($this->_text[$this->_cpos]);
|
||||
if (!$res) {
|
||||
return false;
|
||||
}
|
||||
|
@ -910,7 +910,7 @@ class StringParser_Node {
|
|||
* occurred at. If not determinable, it is -1.
|
||||
* @global __STRINGPARSER_NODE_ID
|
||||
*/
|
||||
function StringParser_Node ($occurredAt = -1) {
|
||||
function __construct ($occurredAt = -1) {
|
||||
$this->_id = $GLOBALS['__STRINGPARSER_NODE_ID']++;
|
||||
$this->occurredAt = $occurredAt;
|
||||
}
|
||||
|
@ -1248,7 +1248,8 @@ class StringParser_Node {
|
|||
* @param object $node The node to destroy
|
||||
* @return bool True on success, else false.
|
||||
*/
|
||||
function destroyNode (&$node) {
|
||||
// FIXME static added due to Strict Standards
|
||||
static function destroyNode (&$node) {
|
||||
if ($node === null) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1486,8 +1487,8 @@ class StringParser_Node_Text extends StringParser_Node {
|
|||
* occurred at. If not determinable, it is -1.
|
||||
* @see StringParser_Node_Text::content
|
||||
*/
|
||||
function StringParser_Node_Text ($content, $occurredAt = -1) {
|
||||
parent::StringParser_Node ($occurredAt);
|
||||
function __construct ($content, $occurredAt = -1) {
|
||||
parent::__construct ($occurredAt);
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
|
|
|
@ -1053,12 +1053,12 @@ class StringParser_BBCode extends StringParser {
|
|||
$ol = strlen ($output);
|
||||
switch ($node->getFlag ('newlinemode.begin', 'integer', BBCODE_NEWLINE_PARSE)) {
|
||||
case BBCODE_NEWLINE_IGNORE:
|
||||
if ($ol && $output{0} == "\n") {
|
||||
if ($ol && $output[0] == "\n") {
|
||||
$before = "\n";
|
||||
}
|
||||
// don't break!
|
||||
case BBCODE_NEWLINE_DROP:
|
||||
if ($ol && $output{0} == "\n") {
|
||||
if ($ol && $output[0] == "\n") {
|
||||
$output = substr ($output, 1);
|
||||
$ol--;
|
||||
}
|
||||
|
@ -1066,12 +1066,12 @@ class StringParser_BBCode extends StringParser {
|
|||
}
|
||||
switch ($node->getFlag ('newlinemode.end', 'integer', BBCODE_NEWLINE_PARSE)) {
|
||||
case BBCODE_NEWLINE_IGNORE:
|
||||
if ($ol && $output{$ol-1} == "\n") {
|
||||
if ($ol && $output[$ol-1] == "\n") {
|
||||
$after = "\n";
|
||||
}
|
||||
// don't break!
|
||||
case BBCODE_NEWLINE_DROP:
|
||||
if ($ol && $output{$ol-1} == "\n") {
|
||||
if ($ol && $output[$ol-1] == "\n") {
|
||||
$output = substr ($output, 0, -1);
|
||||
$ol--;
|
||||
}
|
||||
|
@ -1449,10 +1449,13 @@ class StringParser_BBCode_Node_Paragraph extends StringParser_Node {
|
|||
$f_begin = $this->_children[0]->getFlag ('newlinemode.begin', 'integer', BBCODE_NEWLINE_PARSE);
|
||||
$f_end = $this->_children[0]->getFlag ('newlinemode.end', 'integer', BBCODE_NEWLINE_PARSE);
|
||||
$content = $this->_children[0]->content;
|
||||
if ($f_begin != BBCODE_NEWLINE_PARSE && $content{0} == "\n") {
|
||||
if ($f_begin != BBCODE_NEWLINE_PARSE && $content[0] == "\n") {
|
||||
$content = substr ($content, 1);
|
||||
}
|
||||
if ($f_end != BBCODE_NEWLINE_PARSE && $content{strlen($content)-1} == "\n") {
|
||||
if ($f_end != BBCODE_NEWLINE_PARSE &&
|
||||
strlen($content) > 0 &&
|
||||
$content[strlen($content)-1] == "\n")
|
||||
{
|
||||
$content = substr ($content, 0, -1);
|
||||
}
|
||||
if (!strlen ($content)) {
|
||||
|
|
|
@ -105,6 +105,7 @@ $file['sub'] = JLOG_BASEPATH.'personal'.DIRECTORY_SEPARATOR.'subcurrent.inc';
|
|||
}
|
||||
|
||||
$i = 0;
|
||||
$errors = array();
|
||||
|
||||
foreach($file AS $d => $filename) {
|
||||
if (is_writable($filename)) {
|
||||
|
|
6
scripts/version.inc.php
Normal file → Executable file
6
scripts/version.inc.php
Normal file → Executable file
|
@ -20,12 +20,12 @@
|
|||
* $HeadURL: http://jeenaparadies.net/svn/jlog/trunk/scripts/version.inc.php $
|
||||
* $Rev: 1785 $
|
||||
* $Author: driehle $
|
||||
* $Date: 2009-01-13 21:58:12 +0100 (Tis, 13 Jan 2009) $
|
||||
* $Date: 2009-01-13 21:58:12 +0100 (Di, 13. Jan 2009) $
|
||||
*/
|
||||
|
||||
define('JLOG_SOFTWARE_VERSION', '1.1.3');
|
||||
define('JLOG_SOFTWARE_URL', 'http://jeenaparadies.net/projects/jlog');
|
||||
define('JLOG_SOFTWARE_URL', 'https://github.com/jeena/jlog');
|
||||
define('JLOG_SOFTWARE_PHPV', '4.1.1');
|
||||
define('JLOG_SOFTWARE_MYSQLV', '4.1.0');
|
||||
|
||||
// eof
|
||||
// eof
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue