Commit 25eb7179 authored by damosoft's avatar damosoft

Merge from BRANCH-1-8 to HEAD, will need testing

parent 4dccef1b
......@@ -148,6 +148,7 @@ _jscalendar/calendar.js -text
_jscalendar/calendar.php -text
_jscalendar/calendar_stripped.js -text
_jscalendar/img.gif -text
_jscalendar/index.php -text
_jscalendar/lang/calendar-af.js -text
_jscalendar/lang/calendar-br-utf8.js -text
_jscalendar/lang/calendar-br.js -text
......@@ -184,6 +185,7 @@ _jscalendar/lang/calendar-sp.js -text
_jscalendar/lang/calendar-sv.js -text
_jscalendar/lang/calendar-tr.js -text
_jscalendar/lang/calendar-zh.js -text
_jscalendar/lang/index.php -text
_jscalendar/menuarrow.gif -text
_jscalendar/menuarrow2.gif -text
_mods/README -text
......@@ -534,11 +536,13 @@ _smarty/NEWS -text
_smarty/README -text
_smarty/RELEASE_NOTES -text
_smarty/TODO -text
_smarty/core/index.php -text
_smarty/demo/configs/test.conf -text
_smarty/demo/index.php -text
_smarty/demo/templates/footer.tpl -text
_smarty/demo/templates/header.tpl -text
_smarty/demo/templates/index.tpl -text
_smarty/index.php -text
_smarty/libs/Config_File.class.php -text
_smarty/libs/Smarty.class.php -text
_smarty/libs/Smarty_Compiler.class.php -text
......@@ -618,6 +622,7 @@ _smarty/plugins/block.strip.php -text
_smarty/plugins/function.fetch.php.diff -text
_smarty/plugins/function.html_select_date.php.diff -text
_smarty/plugins/function.html_select_time.php.diff -text
_smarty/plugins/index.php -text
tiki/.cvsignore -text
tiki/INSTALL -text
tiki/README -text
......@@ -3442,6 +3447,7 @@ tiki/templates/modules/mod-whats_related.tpl -text
tiki/templates/modules/mod-who_is_there.tpl -text
tiki/templates/modules/mod-who_is_there.tpl.nocache -text
tiki/templates/modules/mod-wiki_last_comments.tpl -text
tiki/templates/modules/mod-wiki_last_comments.tpl.nocache -text
tiki/templates/modules/user_module.tpl -text
tiki/templates/structures.tpl -text svneol=unset#application/octet-stream
tiki/templates/structures_toc-endul.tpl -text
......
<?php
// $Header: /cvsroot/tikiwiki/_jscalendar/index.php,v 1.2 2004-06-06 08:42:49 damosoft Exp $
// Copyright (c) 2002-2004, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// This redirects to the sites root to prevent directory browsing
header ("location: ../index.php");
die;
?>
<?php
// $Header: /cvsroot/tikiwiki/_jscalendar/lang/index.php,v 1.2 2004-06-06 08:42:49 damosoft Exp $
// Copyright (c) 2002-2004, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// This redirects to the sites root to prevent directory browsing
header ("location: ../index.php");
die;
?>
<?php
// $Header: /cvsroot/tikiwiki/_smarty/core/index.php,v 1.2 2004-06-06 08:42:51 damosoft Exp $
// Copyright (c) 2002-2004, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// This redirects to the sites root to prevent directory browsing
header ("location: ../index.php");
die;
?>
<?php
// $Header: /cvsroot/tikiwiki/_smarty/index.php,v 1.2 2004-06-06 08:42:50 damosoft Exp $
// Copyright (c) 2002-2004, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// This redirects to the sites root to prevent directory browsing
header ("location: ../index.php");
die;
?>
<?php
// $Header: /cvsroot/tikiwiki/_smarty/plugins/index.php,v 1.2 2004-06-06 08:42:51 damosoft Exp $
// Copyright (c) 2002-2004, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// This redirects to the sites root to prevent directory browsing
header ("location: ../index.php");
die;
?>
Tikiwiki Changelog
------------------
$Header: /cvsroot/tikiwiki/tiki/changelog.txt,v 1.156 2004-05-08 20:06:42 troworld Exp $
$Header: /cvsroot/tikiwiki/tiki/changelog.txt,v 1.157 2004-06-06 08:42:45 damosoft Exp $
All developers are invited to add relevant changes to this file as they
apply them to the CVS source. You can optionally indicate an identifier
......@@ -36,6 +36,8 @@ Version 1.8.3 - Polaris -
* [FIX] error message on tiki-faq_questions was reporting no menu
* [MOD] phplayers horizontal menu support added
* [FIX] tiki-modules cannot be called directly
* [MOD] Objects with set permissions show a green key icon instead
of ( ) around the yellow key icon.
Version 1.8.2 - Polaris -
<http://tikiwiki.org/ReleaseProcess182>
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/get_strings.php,v 1.36 2004-04-12 17:16:00 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/get_strings.php,v 1.37 2004-06-06 08:42:45 damosoft Exp $
// Copyright (c) 2002-2004, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -476,25 +476,21 @@ foreach ($languages as $sel) {
$closeText = "";
$moduleText = "";
if ($close) {
$closeTrans= leven($key, $dictionary, &$closeEnglish);
if ($closeTrans) {
$closeText = ' // ## CLOSE: "' . addphpslashes ($closeEnglish) . '" => "' . addphpslashes ($closeTrans) . '",';
} else if (strstr($key, "{\$")) { // perhaps a merge betwwen different strings
$parts = preg_split("/( *\{\\\$[^\}]+\} *)/", $key, -1, PREG_SPLIT_DELIM_CAPTURE| PREG_SPLIT_NO_EMPTY);
$line = "";
foreach ($parts as $part) {
if (strstr($part, "{\$"))
$line .= $part;
else if ($dictionary[$part])
$line .= $dictionary[$part];
else if ($closeTrans = leven($part, $dictionary, &$closeEnglish))
$line .= "CLOSE:".$closeTrans;
else
$line .= $part;
}
if ($line != $key)
$closeText = ' // ## CLOSE: "' . $line. '",';
}
$dist = 256;
foreach ($dictionary as $english=>$trans) {
$d = levenshtein (strtolower (substr ($key, 0, 255)),
strtolower (substr ($english, 0, 255)));
if ($d < $dist) {
$dist = $d;
$closeTrans = $trans;
$closeEnglish = $english;
}
}
if ($dist < 1 + strlen ($key)/5) {
$closeText = ' // ## CLOSE: "' . addphpslashes ($closeEnglish) .
'" => "' . addphpslashes ($closeTrans) . '",';
}
}
if ($module) {
......@@ -570,4 +566,4 @@ foreach ($languages as $sel) {
umask($old_umask); // Reset umask back to original value
}
}
?>
\ No newline at end of file
?>
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -23,7 +23,7 @@ $langmapping = array(
'hr' => array( 'Hrvatski', tra("Croatian") ),
'it' => array( 'Italiano', tra("Italian") ),
'ja' => array( '日本語', tra("Japanese") ),
'nl' => array( 'Dutch', tra("Dutch") ),
'nl' => array( 'Nederlands', tra("Dutch") ),
'no' => array( 'Norwegian', tra("Norwegian") ),
'pl' => array( 'Polish', tra("Polish") ),
'pt' => array( 'Portuguese', tra("Português") ),
......
This diff is collapsed.
......@@ -77,7 +77,7 @@ if (!function_exists('galaxia_execute_activity')) {
$parsed = parse_url($_SERVER["REQUEST_URI"]);
$URI = httpPrefix().$parsed["path"];
$parts = explode('/',$URI);
$parts[count($parts)-1] = "tiki-g-run_activity.php?activityId=$activityId&amp;iid=$iid&amp;auto=$auto";
$parts[count($parts)-1] = "tiki-g-run_activity.php?activityId=$activityId&amp;iid=$iid&auto=$auto";
$URI = implode('/',$parts);
$fp = fopen($URI,"r");
$data = '';
......
......@@ -77,7 +77,7 @@ if (!function_exists('galaxia_execute_activity')) {
$parsed = parse_url($_SERVER["REQUEST_URI"]);
$URI = httpPrefix().$parsed["path"];
$parts = explode('/',$URI);
$parts[count($parts)-1] = "tiki-g-run_activity.php?activityId=$activityId&amp;iid=$iid&amp;auto=$auto";
$parts[count($parts)-1] = "tiki-g-run_activity.php?activityId=$activityId&amp;iid=$iid&auto=$auto";
$URI = implode('/',$parts);
$fp = fopen($URI,"r");
$data = '';
......
<?php
/** \file
* $Header: /cvsroot/tikiwiki/tiki/lib/categories/categlib.php,v 1.31 2004-03-29 21:26:31 mose Exp $
* $Header: /cvsroot/tikiwiki/tiki/lib/categories/categlib.php,v 1.32 2004-06-06 08:42:48 damosoft Exp $
*
* \brief Categiries support class
*
......@@ -11,7 +11,7 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
}
class CategLib extends TikiLib {
class CategLib extends TikiDB {
function CategLib($db) {
# this is probably unneeded now
......@@ -324,13 +324,14 @@ class CategLib extends TikiLib {
// FUNCTIONS TO CATEGORIZE SPECIFIC OBJECTS ////
function categorize_page($pageName, $categId) {
global $tikilib;
// Check if we already have this object in the tiki_categorized_objects page
$catObjectId = $this->is_categorized('wiki page', $pageName);
if (!$catObjectId) {
// The page is not cateorized
$info = $this->get_page_info($pageName);
$info = $tikilib->get_page_info($pageName);
$href = 'tiki-index.php?page=' . urlencode($pageName);
$catObjectId = $this->add_categorized_object('wiki page', $pageName, substr($info["description"], 0, 200), $pageName, $href);
......@@ -340,13 +341,14 @@ class CategLib extends TikiLib {
}
function categorize_tracker($trackerId, $categId) {
global $tikilib;
// Check if we already have this object in the tiki_categorized_objects page
$catObjectId = $this->is_categorized('tracker', $trackerId);
if (!$catObjectId) {
// The page is not cateorized
$info = $this->get_tracker($trackerId);
$info = $tikilib->get_tracker($trackerId);
$href = 'tiki-view_tracker.php?trackerId=' . $trackerId;
$catObjectId = $this->add_categorized_object('tracker', $trackerId, substr($info["description"], 0, 200),$info["name"] , $href);
......@@ -356,12 +358,13 @@ class CategLib extends TikiLib {
}
function categorize_quiz($quizId, $categId) {
global $tikilib;
// Check if we already have this object in the tiki_categorized_objects page
$catObjectId = $this->is_categorized('quiz', $quizId);
if (!$catObjectId) {
// The page is not cateorized
$info = $this->get_quiz($quizId);
$info = $tikilib->get_quiz($quizId);
$href = 'tiki-take_quiz.php?quizId=' . $quizId;
$catObjectId
......@@ -372,12 +375,13 @@ class CategLib extends TikiLib {
}
function categorize_article($articleId, $categId) {
global $tikilib;
// Check if we already have this object in the tiki_categorized_objects page
$catObjectId = $this->is_categorized('article', $articleId);
if (!$catObjectId) {
// The page is not cateorized
$info = $this->get_article($articleId);
$info = $tikilib->get_article($articleId);
$href = 'tiki-read_article.php?articleId=' . $articleId;
$catObjectId = $this->add_categorized_object('article', $articleId, $info["heading"], $info["title"], $href);
......@@ -387,12 +391,13 @@ class CategLib extends TikiLib {
}
function categorize_faq($faqId, $categId) {
global $tikilib;
// Check if we already have this object in the tiki_categorized_objects page
$catObjectId = $this->is_categorized('faq', $faqId);
if (!$catObjectId) {
// The page is not cateorized
$info = $this->get_faq($faqId);
$info = $tikilib->get_faq($faqId);
$href = 'tiki-view_faq.php?faqId=' . $faqId;
$catObjectId = $this->add_categorized_object('faq', $faqId, $info["description"], $info["title"], $href);
......@@ -402,12 +407,13 @@ class CategLib extends TikiLib {
}
function categorize_blog($blogId, $categId) {
global $tikilib;
// Check if we already have this object in the tiki_categorized_objects page
$catObjectId = $this->is_categorized('blog', $blogId);
if (!$catObjectId) {
// The page is not cateorized
$info = $this->get_blog($blogId);
$info = $tikilib->get_blog($blogId);
$href = 'tiki-view_blog.php?blogId=' . $blogId;
$catObjectId = $this->add_categorized_object('blog', $blogId, $info["description"], $info["title"], $href);
......@@ -417,12 +423,13 @@ class CategLib extends TikiLib {
}
function categorize_directory($directoryId, $categId) {
global $tikilib;
// Check if we already have this object in the tiki_categorized_objects page
$catObjectId = $this->is_categorized('directory', $directoryId);
if (!$catObjectId) {
// The page is not cateorized
$info = $this->get_directory($directoryId);
$info = $tikilib->get_directory($directoryId);
$href = 'tiki-directory_browse.php?parent=' . $directoryId;
$catObjectId = $this->add_categorized_object('directory', $directoryId, $info["description"], $info["name"], $href);
......@@ -432,12 +439,13 @@ class CategLib extends TikiLib {
}
function categorize_gallery($galleryId, $categId) {
global $tikilib;
// Check if we already have this object in the tiki_categorized_objects page
$catObjectId = $this->is_categorized('image gallery', $galleryId);
if (!$catObjectId) {
// The page is not cateorized
$info = $this->get_gallery($galleryId);
$info = $tikilib->get_gallery($galleryId);
$href = 'tiki-browse_gallery.php?galleryId=' . $galleryId;
$catObjectId = $this->add_categorized_object('image gallery', $galleryId, $info["description"], $info["name"], $href);
......@@ -447,12 +455,13 @@ class CategLib extends TikiLib {
}
function categorize_file_gallery($galleryId, $categId) {
global $tikilib;
// Check if we already have this object in the tiki_categorized_objects page
$catObjectId = $this->is_categorized('file gallery', $galleryId);
if (!$catObjectId) {
// The page is not cateorized
$info = $this->get_file_gallery($galleryId);
$info = $tikilib->get_file_gallery($galleryId);
$href = 'tiki-list_file_gallery.php?galleryId=' . $galleryId;
$catObjectId = $this->add_categorized_object('file gallery', $galleryId, $info["description"], $info["name"], $href);
......@@ -462,12 +471,13 @@ class CategLib extends TikiLib {
}
function categorize_forum($forumId, $categId) {
global $tikilib;
// Check if we already have this object in the tiki_categorized_objects page
$catObjectId = $this->is_categorized('forum', $forumId);
if (!$catObjectId) {
// The page is not cateorized
$info = $this->get_forum($forumId);
$info = $tikilib->get_forum($forumId);
$href = 'tiki-view_forum.php?forumId=' . $forumId;
$catObjectId = $this->add_categorized_object('forum', $forumId, $info["description"], $info["name"], $href);
......@@ -477,12 +487,13 @@ class CategLib extends TikiLib {
}
function categorize_poll($pollId, $categId) {
global $tikilib;
// Check if we already have this object in the tiki_categorized_objects page
$catObjectId = $this->is_categorized('poll', $pollId);
if (!$catObjectId) {
// The page is not cateorized
$info = $this->get_poll($pollId);
$info = $tikilib->get_poll($pollId);
$href = 'tiki-poll_form.php?pollId=' . $pollId;
$catObjectId = $this->add_categorized_object('poll', $pollId, $info["title"], $info["title"], $href);
......
......@@ -319,6 +319,22 @@ class FileGalLib extends TikiLib {
return $result;
}
function convert_error_to_string($error) {
switch($error) {
case 0: //no error; possible file attack!
return tra("There was a problem with your upload.");
case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini
case 2: //uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form
return tra("The file you are trying to upload is too big.");
case 3: //uploaded file was only partially uploaded
return tra("The file you are trying to upload was only partially uploaded.");
case 4: //no file was uploaded
return tra("You must select a file for upload.");
default: //a default error, just in case! :)
return tra("There was a problem with your upload.");
}
}
}
$filegallib = new FileGalLib($dbTiki);
......
......@@ -18,7 +18,7 @@ class HotwordsLib extends TikiLib {
function list_hotwords($offset = 0, $maxRecords = -1, $sort_mode = 'word_desc', $find = '') {
if ($find) {
$findesc = $this->qstr('%' . $find . '%');
$findesc = '%' . $find . '%';
$mid = " where `word` like ?";
$bindvars = array($findesc);
} else {
......
<?php
class LsAdminlib extends Tikilib {
class LsAdminlib extends TikiLib {
function LsAdminlib($db) {
if (!$db) {
die ("Invalid db object passed to LsAdminlib constructor");
......
<?php
class Lslib extends TikiLib {
class Lslib extends TikiDB {
function Lslib($db) {
if (!$db) {
die ("Invalid db object passed to Lslib constructor");
......
......@@ -5,7 +5,7 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
}
class Messu extends Tikilib {
class Messu extends TikiLib {
var $db;
function Messu($db) {
......
......@@ -7,7 +7,7 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
require_once "lib/pear/NNTP.php";
class Newslib extends Tikilib {
class Newslib extends TikiLib {
var $db;
var $nntp;
......
......@@ -17,7 +17,7 @@
// | |
// +----------------------------------------------------------------------+
//
// $Id: TimeZone.php,v 1.1 2003-08-07 01:53:07 rossta Exp $
// $Id: TimeZone.php,v 1.2 2004-06-06 08:42:50 damosoft Exp $
//
// Date_TimeZone Class
//
......@@ -253,9 +253,20 @@ class Date_TimeZone
if(getenv("TZ")) {
$env_tz = getenv("TZ");
}
putenv("TZ=".$this->id);
$protected_vars=explode(',',ini_get('safe_mode_protected_env_vars'));
$changeable_vars=explode(',',ini_get('safe_mode_allowed_env_vars'));
$changeable=true;
if (ini_get('safe_mode') && (in_array('TZ',$protected_vars) ||
(!in_array('T',$changeable_vars) || !in_array('TZ',$changeable_vars)))) {
$changeable=false;
}
if($changeable){
putenv("TZ=".$this->id);
}
$ltime = localtime($date->getTime(), true);
putenv("TZ=".$env_tz);
if($changeable){
putenv("TZ=".$env_tz);
}
return $ltime['tm_isdst'];
}
......
......@@ -112,7 +112,9 @@ class RankLib extends TikiLib {
$aux["name"] = $res["name"] . ': ' . $res["title"];
$aux["hits"] = $this->get_long_datetime($res["commentDate"]);
$aux["href"] = 'tiki-view_forum_thread.php?forumId=' . $res["forumId"] . '&amp;comments_parentId=' . $res["threadId"];
$tmp = $res["parentId"];
if ($tmp == 0) $tmp = $res["threadId"];
$aux["href"] = 'tiki-view_forum_thread.php?forumId=' . $res["forumId"] . '&amp;comments_parentId=' . $tmp;
$ret[] = $aux;
}
......
......@@ -5,7 +5,7 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
}
class RSSLib extends TikiLib {
class RSSLib extends TikiDB {
function RSSLib($db) {
# this is probably uneeded now
if (!$db) {
......@@ -170,9 +170,10 @@ class RSSLib extends TikiLib {
}
function refresh_rss_module($rssId) {
global $tikilib;
$info = $this->get_rss_module($rssId);
if ($info) {
$data = $this->rss_iconv($this->httpRequest($info['url']));
$data = $this->rss_iconv($tikilib->httpRequest($info['url']));
$now = date("U");
$query = "update `tiki_rss_modules` set `content`=?, `lastUpdated`=? where `rssId`=?";
$result = $this->query($query,array((string)$data,(int) $now, (int) $rssId));
......
......@@ -18,8 +18,8 @@ function smarty_function_gallery($params, &$smarty)
print('<td align=center>');
print('<a href="tiki-browse_image.php?galleryId='.$img['galleryId'].'&amp;imageId='.$img['imageId'].'"><img alt="thumbnail" class="athumb" src="show_image.php?id='.$img['imageId'].'&amp;thumb=1" /></a><br/>');
print('<b>'.$img['name'].'</b><br>');
if ($showgalleryname == 1) {
print('<small>From <a href="tiki-browse_gallery.php?galleryId='.$img['galleryId'].'">'.$img['gallery'].'</a></small>');
if ($showgalleryname == 1) {
print('<small>'. tra("From").' <a href="tiki-browse_gallery.php?galleryId='.$img['galleryId'].'">'.$img['gallery'].'</a></small>');
}
print('</td></tr></table></center>');
}
......
......@@ -31,8 +31,7 @@
// Pull out the script blocks
preg_match_all("!<script[^>]+>.*?</script>!is", $source, $match);
$_script_blocks = $match[0];
$source = preg_replace("!<script[^>]+>.*?</script>!is",
'@@@SMARTY:TRIM:SCRIPT@@@', $source);
$source = preg_replace("!<script[^>]+>.*?</script>!is", '@@@SMARTY:TRIM:SCRIPT@@@', $source);
// pull out all html tags
preg_match_all("'<[\/\!]*?[^<>]*?>'si", $source, $match);
......@@ -47,7 +46,8 @@
$wordArr = split(" ",addslashes($words));
$i = 0;
foreach($wordArr as $word) {
$source = preg_replace("'($word)'si", '<span style="color:black;background-color:'.$colorArr[$i].';">$1</span>', $source);
$word = preg_quote($word);
$source = preg_replace('~('.$word.')~si', '<span style="color:black;background-color:'.$colorArr[$i].';">$1</span>', $source);
$i++;
}
......
......@@ -5,7 +5,7 @@ if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
}
class StructLib extends TikiLib {
class StructLib extends TikiDB {
function StructLib($db) {
# this is probably uneeded now
if (!$db) {
......@@ -71,6 +71,7 @@ class StructLib extends TikiLib {
}
function s_remove_page($page_ref_id, $delete) {
global $tikilib;
// Now recursively remove
$query = "select `page_ref_id`, ts.`page_id`, `pageName` ";
......@@ -89,7 +90,7 @@ class StructLib extends TikiLib {
$query = "select count(*) from `tiki_structures` where `page_id`=?";
$count = $this->getOne($query, array((int)$page_info["page_id"]));
if ($count = 1) {
$this->remove_all_versions($page_info["pageName"]);
$tikilib->remove_all_versions($page_info["pageName"]);
}
}
......@@ -171,10 +172,11 @@ class StructLib extends TikiLib {
\return the new entries page_ref_id or null if not created.
*/
function s_create_page($parent_id, $after_ref_id, $name, $alias='') {
global $tikilib;
$ret = null;
// If the page doesn't exist then create a new wiki page!
$now = date("U");
$created = $this->create_page($name, 0, '', $now, tra('created from structure'), 'system', '0.0.0.0', '');
$created = $tikilib->create_page($name, 0, '', $now, tra('created from structure'), 'system', '0.0.0.0', '');
// if were not trying to add a duplicate structure head
if ($created or isset($parent_id)) {
//Get the page Id
......@@ -655,6 +657,7 @@ function list_structures($offset, $maxRecords, $sort_mode, $find) {
//the base.
function structure_to_webhelp($page_ref_id, $dir, $top) {
global $style_base;
global $tikilib;
//The first task is to convert the structure into an array with the
//proper format to produce a WebHelp project.
......@@ -689,7 +692,7 @@ function list_structures($offset, $maxRecords, $sort_mode, $find) {
$docs[] = $res["pageName"];
if(empty($res["description"])) $res["description"]=$res["pageName"];
$pageName=$res["pageName"].'|'.$res["description"];
$dat = $this->parse_data($res['data']);
$dat = $tikilib->parse_data($res['data']);
//Now dump the page
$dat = preg_replace("/tiki-index.php\?page=([^\'\" ]+)/","$1.html",$dat);
......
......@@ -1025,6 +1025,18 @@ class TikiLib extends TikiDB {
return $ret;
}
function add_pageview() {
$dayzero = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
$cant = $this->getOne("select count(*) from `tiki_pageviews` where `day`=?",array((int)$dayzero));
if ($cant) {
$query = "update `tiki_pageviews` set `pageviews`=`pageviews`+1 where `day`=?";
} else {
$query = "insert into `tiki_pageviews`(`day`,`pageviews`) values(?,1)";
}
$result = $this->query($query,array((int)$dayzero),-1,-1,false);
}
function get_usage_chart_data() {
$this->compute_quiz_stats();
$data[] = array( "wiki", $this->getOne("select sum(`hits`) from `tiki_pages`",array()));
......@@ -2178,9 +2190,9 @@ class TikiLib extends TikiDB {
return $topicId;
}
/*shared*/
function list_articles($offset = 0, $maxRecords = -1, $sort_mode = 'publishDate_desc', $find = '', $date = '', $user, $type = '', $topicId = '', $visible_only = '') {
global $userlib;
/*shared*/
function list_articles($offset = 0, $maxRecords = -1, $sort_mode = 'publishDate_desc', $find = '', $date = '', $user, $type = '', $topicId = '', $visible_only = 'y') {
global $userlib;
$mid = " where `tiki_articles`.`type` = `tiki_article_types`.`type` and `tiki_articles`.`author` = `users_users`.`login` ";
$bindvars=array();
......@@ -2208,17 +2220,17 @@ class TikiLib extends TikiDB {
}
if ($visible_only) {