Commit 8e4a2af4 authored by lrargerich's avatar lrargerich

Changes for verrsion 1.2

parent d7daaec0
This diff is collapsed.
<?php
function smarty_function_menu($params, &$smarty)
{
global $tikilib;
extract($params);
// Param = zone
if (empty($id)) {
$smarty->trigger_error("assign: missing id");
return;
}
$menu_info = $tikilib->get_menu($id);
$channels = $tikilib->list_menu_options($id,0,-1,'position_asc','');
$smarty->assign('menu_info',$menu_info);
$smarty->assign('channels',$channels["data"]);
$smarty->display('tiki-user_menu.tpl');
}
/* vim: set expandtab: */
?>
<?php
function smarty_function_poll($params, &$smarty)
{
global $tikilib;
extract($params);
// Param = zone
if (empty($id)) {
$id = $tikilib->get_random_active_poll();
}
if($id) {
$menu_info = $tikilib->get_poll($id);
$channels = $tikilib->list_poll_options($id,0,-1,'title_asc','');
$smarty->assign('ownurl','http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]);
$smarty->assign('menu_info',$menu_info);
$smarty->assign('channels',$channels["data"]);
$smarty->display('tiki-poll.tpl');
}
}
/* vim: set expandtab: */
?>
<?php
function smarty_function_rcontent($params, &$smarty)
{
global $tikilib;
extract($params);
// Param = zone
if (empty($id)) {
$smarty->trigger_error("assign: missing 'zone' parameter");
return;
}
$data = $tikilib->get_random_content($id);
print($data);
}
/* vim: set expandtab: */
?>
<?php
function smarty_function_rss($params, &$smarty)
{
global $tikilib;
extract($params);
// Param = zone
if(empty($id)) {
$smarty->trigger_error("assign: missing id parameter");
return;
}
if(empty($max)) {
$max = 99;
}
$data = $tikilib->get_rss_module_content($id);
$items = $tikilib->parse_rss_data($data);
//print('<ul class="rss">');
for($i=0;$i<count($items) && $i<$max;$i++) {
print('<li><a target="_blank" href="'.$items[$i]["link"].'" class="linkmenu">'.$items[$i]["title"].'</a></li>');
}
//print('</ul>');
}
/* vim: set expandtab: */
?>
Version 1.2 -Antares-
* [THANKS] Special thanks to AlBrown,MarcLaporte,Yakumo,Ramiro,Tom,Tesla2k and others ! for submitting many bugs
that are now fixed and for suggesting many features that are now implemented. If some feature is not yet
included don't worry it will be addressed in a future version. Thanks!
* [NEW] Added a find feature to the lastchanges section in the Wiki (Ramiro)
* [NEW] Categories: You can create categories and subcategories building a category tree, objects (pages, forums,
blogs, image galleries, file galleries, etc) can be assigned to one/many categories, the user can browse
categories finding objects for each specific category.
* [NEW] Communication center: Now you can send/receive Wiki pages from/to other Tiki-enabled sites using a simple
XMLRPC API, received pages are stored in an "ibox" where an admin can view,edit,remove,accept the pages.
This new feature can be used to send a Tiki page from one site to another one!
* [NEW] Consolidated CSS file, there're two CSS files in this distribution: subSilver and default2, if you want
to produce a new theme you can change any of these, subSilver is longer and uses an individual style for every
element in Tiki while default2 applies the same style to multiple elements (ie: tables) and thus is a faster
way to get a theme ready.
* [FIXED] Fixed bugs in the registration screen and now the username is validated.
* [NEW] Forums!, now you can set-up mesage forums, forums are organized by topics and topics by threads, users
can post, reply and quote messages in forums, messages can be voted using the same karma system used in
comments. Many features are "copied" from phpBB since it is the best forum software for PHP, we copied those
features and integrated the forums with the Tiki permission system, rankings, modules and search engine.
There's a lot about forums so I guess it's best to stop the description here, the documentation will introduce
all the features in forums.
* [NEW] Now you can upload th thumbnail of an image when uploading an image, this will prevent automatic
thumbnail generation. Some users wanted this feature because thumbnail generation didn't work or they
wanted to upload their own thumbnails. Maybe you want to have a thumbnail that is not the same as the
full image so you can use this feature. Thumbnails will be displayed using the size assignated for thumbnails
to the image gallery.
* [NEW] Now you can set up how old must a version be at least to be removed from the history, this can prevent
a user from saving a page "n" times destroying a previous version. (Thanks to tesla2k for the tip)
* [NEW] Links to help including objects in user modules where added to the admin_modules screen.
* [NEW] Next and prev buttons where added to view the next/prev image when browsing images from a gallery
* [NEW] Now you can control which groups can view image galleries and filegalleries
* [NEW] Individual permissions for image galleries, as an admin you can control which groups can view,
admin, upload to a specific gallery overriding global permissions.
* [NEW] Individual permissions for file galleries, as an admin you can control which groups can view,
admin, upload and download to a specific gallery overriding global permissions.
* [NEW] Individual permissions can be set up by admins to weblogs, so you can control which groups can read,
admin and post to specific weblogs.
* [NEW] Module: last blog posts listing the last "n" posts to any weblog.
* [NEW] From the page-permissions screen admins can set up email addresses that will receive an email when
the page changes. If you want to remotely monitor some page this is for you.
* [NEW] Chatrooms feature (experimental), you can create chatrooms and the users can enter chatrooms and chat,
the refreshing time for each chatroom can be configured and the page is not reloaded, only an invisible frame
with size 0 is reloaded to get fresh chat messages.
* [NEW] RSS modules, create RSS modules to display news/events from other sites, you can display RSS feeds in
user modules using {rss id=n}, you can set up which feeds can be displayed and the refreshing time for each feed.
RSS 0.91 and 1.0 are supported.
* [NEW] Polls, you can create polls, set polls to be "active,closed,current". Polls can be displayed in modules
using {poll id=n} or {poll} to select a random poll from the "current" polls. There's a page to view poll results
and old poll results and old polls not closed can be voted. A mechanism to prevent a user from voting many times is
also included.
* [NEW] Menu builder section, you can build menus using sections and options, menus can be static (no javascript) or
dynamic. Menus can be displayed in user modules using {menu id=n}
* [NEW] If you give a group the tiki_p_edit_comments permission then the group can edit comments (useful for admins
to fix bad comments or if you want someone to censor comments)
* [NEW] Comments can now be filtered by threshold
* [NEW] Comments for weblogs and you can enable/disable weblog comments from the admin screen
* [NEW] Comments for articles, you can enable/disable article commenting from the admin screen
* [NEW] Comments for image galleries you can enable/disable comments for image galleries from the admin screen
* [NEW] Comments for file galleries you can enable/disable comments for file galleries from the admin screen
* [NEW] A selected file gallery can be used as the home page for the site
* [NEW] Now you can enable/disble RSS feeds from the admin screen and limit the maximum number of items
for any feed
* [NEW] RSS feed for individual file galleries listing the last images uploaded to a given gallery
* [NEW] RSS feed for individual image galleries listing the last images uploaded to a given gallery
* [NEW] RSS feed for weblogs listing last posts to any weblog
* [NEW] RSS feed for file galleries listing last files uploaded
* [NEW] RSS feed for image galleries listing last images uploaded
* [NEW] Random pages module
* [NEW] Now you can include dynamic content blocks in wiki pages using {content id=n} or {rcontent id=n}
* [NEW] Now you can use {rcontent id=n} to select a random content from a dynamic block content, the {content id=3}
syntax can also be used to select the last current content for a block
* [FIX] Fixed typos in the editing rules for Wiki pages
* [NEW] New Wiki element: ^some^ will render "some" inside a simple box
* [NEW] The layout can be configured from the admin screen you can enable disable the columns, top bar and footer
* [NEW] Added a new theme: classic based on white-blue simple colors similar to Kuro5hin.org
* [FIX] Fixed a wrong link in the weblogs
* [FIX] Fixed wrong links for images in the image galleries
* [FIX] Fixed a bug that broke image uploads
Version 1.1 -Capella-
* [NEW FEATURE] The edit button now shows on red if someone may be editing the page, this helps preventing
......
......@@ -72,9 +72,17 @@ if(strstr($comments_complete_father,"?")) {
$smarty->assign('comments_father',$comments_father);
$smarty->assign('comments_complete_father',$comments_complete_father);
// Include the library for comments (if not included)
if(!isset($_REQUEST["comments_threadId"])) {
$_REQUEST["comments_threadId"]=0;
}
$smarty->assign("comments_threadId",$_REQUEST["comments_threadId"]);
include_once("lib/commentslib.php");
$commentslib = new Comments($dbTiki);
// Include the library for comments (if not included)
if(!isset($comments_prefix_var)) {
$comments_prefix_var='';
}
......@@ -92,10 +100,13 @@ if($tiki_p_post_comments == 'y') {
}
//Replace things between square brackets by links
$_REQUEST["comments_data"]=strip_tags($_REQUEST["comments_data"]);
$_REQUEST["comments_data"] = preg_replace("/\[([^\|]+)\|([^\]]+)\]/","<a class='commentslink' href='$1'>$2</a>",$_REQUEST["comments_data"]);
// Segundo intento reemplazar los [link] comunes
$_REQUEST["comments_data"] = preg_replace("/\[([^\]]+)\]/","<a class='commentslink' href='$1'>$1</a>",$_REQUEST["comments_data"]);
$commentslib->post_new_comment($comments_objectId, $_REQUEST["comments_parentId"], $user, $_REQUEST["comments_title"], nl2br($_REQUEST["comments_data"]));
if($_REQUEST["comments_threadId"]==0) {
$commentslib->post_new_comment($comments_objectId, $_REQUEST["comments_parentId"], $user, $_REQUEST["comments_title"], nl2br($_REQUEST["comments_data"]));
} else {
if($tiki_p_edit_comments == 'y') {
$commentslib->update_comment($_REQUEST["comments_threadId"], $_REQUEST["comments_title"], nl2br($_REQUEST["comments_data"]));
}
}
}
}
}
......@@ -108,9 +119,22 @@ if($tiki_p_vote_comments == 'y') {
$commentslib->vote_comment($_REQUEST["comments_threadId"],$user,$_REQUEST["comments_vote"]);
$tikilib->register_user_vote($user,'comment'.$_REQUEST["comments_threadId"]);
}
$_REQUEST["comments_threadId"]=0;
$smarty->assign('comments_threadId',0);
}
}
if($_REQUEST["comments_threadId"]>0) {
$comment_info = $commentslib->get_comment($_REQUEST["comments_threadId"]);
$smarty->assign('comment_title',$comment_info["title"]);
$smarty->assign('comment_data',$comment_info["data"]);
} else {
$smarty->assign('comment_title','');
$smarty->assign('comment_data','');
}
if($tiki_p_remove_comments == 'y') {
if(isset($_REQUEST["comments_remove"])&&isset($_REQUEST["comments_threadId"])) {
$comments_show='y';
......
<?
include_once('db/tiki-db.php');
include_once('lib/tikilib.php');
include_once('lib/userslib.php');
include_once("lib/xmlrpc.inc");
include_once("lib/xmlrpcs.inc");
$tikilib = new Tikilib($dbTiki);
$userlib = new Userslib($dbTiki);
if($tikilib->get_preference("feature_comm",'n') != 'y') {
die;
}
$map = array (
"sendPage" => array( "function" => "sendPage")
);
$s=new xmlrpc_server( $map );
/* Validates the user and returns user information */
function sendPage($params) {
// Get the page and store it in received_pages
global $tikilib,$userlib;
$pp=$params->getParam(0); $site=$pp->scalarval();
$pp=$params->getParam(1); $username=$pp->scalarval();
$pp=$params->getParam(2); $password=$pp->scalarval();
$pp=$params->getParam(3); $pageName=$pp->scalarval();
$pp=$params->getParam(4); $data=$pp->scalarval();
$pp=$params->getParam(5); $comment=$pp->scalarval();
//
if(!$userlib->validate_user($username,$password)) {
return new xmlrpcresp(0, 101, "Invalid username or password");
}
// Verify if the user has tiki_p_sendme_pages
if(!$userlib->user_has_permission($username,'tiki_p_sendme_pages')) {
return new xmlrpcresp(0, 101, "Permissions denied user $username cannot send pages to this site");
}
// Store the page in the tiki_received_pages_table
$data = base64_decode($data);
$tikilib->receive_page($pageName,$data,$comment,$site,$username);
/*
if () {
return new xmlrpcresp(new xmlrpcval(1,"boolean"));
} else {
return new xmlrpcresp(0, 101, "Invalid username or password");
}
*/
return new xmlrpcresp(new xmlrpcval(1,"boolean"));
}
?>
\ No newline at end of file
......@@ -45,7 +45,7 @@ DROP TABLE IF EXISTS tiki_user_modules;
CREATE TABLE tiki_user_modules (
name varchar(200) not null,
title varchar(40),
data text,
data longblob,
primary key(name)
);
......@@ -59,6 +59,7 @@ CREATE TABLE tiki_galleries (
description text,
created integer(14),
lastModif integer(14),
visible char(1),
theme varchar(60),
user varchar(200),
hits integer(14),
......@@ -115,7 +116,7 @@ CREATE TABLE tiki_tags (
tagName varchar(80) not null,
pageName varchar(40) not null,
hits integer(8),
data text,
data longblob,
lastModif integer(14),
comment varchar(200),
version integer(8) not null,
......@@ -130,7 +131,7 @@ DROP TABLE IF EXISTS tiki_pages;
CREATE TABLE tiki_pages (
pageName varchar(40) not null,
hits integer(8),
data text,
data longblob,
lastModif integer(14),
comment varchar(200),
version integer(8) not null,
......@@ -151,7 +152,7 @@ CREATE TABLE tiki_history (
user varchar(200),
ip varchar(15),
comment varchar(200),
data text,
data longblob,
primary key(pageName,version)
);
......@@ -201,8 +202,8 @@ create table users_groups(
insert into users_groups(groupName,groupDesc) values('Anonymous','Public users not logged');
insert into users_groups(groupName,groupDesc) values('Registered','Users logged into the system');
DROP TABLE IF EXISTS users_userGroups;
create table users_userGroups(
DROP TABLE IF EXISTS users_usergroups;
create table users_usergroups(
userId integer(8) not null,
groupName varchar(30) not null,
primary key(userId,groupName)
......@@ -216,8 +217,8 @@ create table users_permissions(
primary key(permName)
);
DROP TABLE IF EXISTS users_groupPermissions;
create table users_groupPermissions(
DROP TABLE IF EXISTS users_grouppermissions;
create table users_grouppermissions(
groupName varchar(30) not null,
permName varchar(30) not null,
value varchar(1) not null,
......@@ -229,8 +230,8 @@ create table users_groupPermissions(
## is used to determine the type of object, types should be
## unique among several systems and objectIds should be uique
## for a given type
DROP TABLE IF EXISTS users_objectPermissions;
create table users_objectPermissions(
DROP TABLE IF EXISTS users_objectpermissions;
create table users_objectpermissions(
groupName varchar(30) not null,
permName varchar(30) not null,
objectType varchar(20) not null,
......@@ -491,6 +492,7 @@ CREATE TABLE tiki_file_galleries (
name varchar(80) not null,
description text,
created integer(14),
visible char(1),
lastModif integer(14),
user varchar(200),
hits integer(14),
......@@ -540,6 +542,8 @@ object char(32) not null,
parentId integer(14),
userName varchar(200),
commentDate integer(14),
hits integer(8),
type char(1),
points decimal(8,2),
votes integer(8),
average decimal(8,4),
......@@ -556,4 +560,219 @@ points decimal(8,2),
voted integer(8)
);
### End 1.1 versions
\ No newline at end of file
### End 1.1 versions
### CHANGES FOR VERSION 1.2
update tiki_galleries set visible='y';
update tiki_file_galleries set visible='y';
insert into users_permissions(permName,type,permDesc) values('tiki_p_admin_wiki','wiki','Can admin the wiki');
insert into users_permissions(permName,type,permDesc) values('tiki_p_admin_cms','cms','Can admin the cms');
### CATEGORIES
insert into users_permissions(permName,type,permDesc) values('tiki_p_admin_categories','tiki','Can admin categories');
DROP TABLE IF EXISTS tiki_categories;
create table tiki_categories (
categId integer(12) not null auto_increment,
name varchar(100),
description varchar(250),
parentId integer(12),
hits integer(8),
primary key(categId)
);
DROP TABLE IF EXISTS tiki_category_objects;
create table tiki_category_objects (
catObjectId integer(12) not null,
categId integer(12) not null,
primary key(catObjectId,categId)
);
DROP TABLE IF EXISTS tiki_categorized_objects;
create table tiki_categorized_objects (
catObjectId integer(12) not null auto_increment,
type varchar(50),
objId varchar(50),
description text,
created integer(14),
name varchar(200),
href varchar(200),
hits integer(8),
primary key(catObjectId)
);
### CTEGORIES END
### COMMUNICATION CENTER
DROP TABLE IF EXISTS tiki_received_pages;
CREATE TABLE tiki_received_pages (
receivedPageId integer(14) not null auto_increment,
pageName varchar(40) not null,
data longblob,
comment varchar(200),
receivedFromSite varchar(200),
receivedFromUser varchar(200),
receivedDate integer(14),
primary key(receivedPageId)
);
insert into users_permissions(permName,type,permDesc) values('tiki_p_send_pages','comm','Can send pages to other sites');
insert into users_permissions(permName,type,permDesc) values('tiki_p_sendme_pages','comm','Can send pages to this site');
insert into users_permissions(permName,type,permDesc) values('tiki_p_admin_received_pages','comm','Can admin received pages');
### COMMUNICATION CENTER END
### FORUMS BEGIN
insert into users_permissions(permName,type,permDesc) values('tiki_p_admin_forum','forums','Can admin forums');
insert into users_permissions(permName,type,permDesc) values('tiki_p_forum_post','forums','Can post in forums');
insert into users_permissions(permName,type,permDesc) values('tiki_p_forum_post_topic','forums','Can start threads in forums');
insert into users_permissions(permName,type,permDesc) values('tiki_p_forum_read','forums','Can read forums');
insert into users_permissions(permName,type,permDesc) values('tiki_p_forum_vote','forums','Can vote comments in forums');
drop table if exists tiki_forums;
create table tiki_forums(
forumId integer(8) not null auto_increment,
name varchar(200),
description text,
created integer(14),
lastPost integer(14),
threads integer(8),
comments integer(8),
controlFlood char(1),
floodInterval integer(8),
moderator varchar(200),
hits integer(8),
mail varchar(200),
useMail char(1),
usePruneUnreplied char(1),
pruneUnrepliedAge integer(8),
usePruneOld char(1),
pruneMaxAge integer(8),
topicsPerPage integer(6),
topicOrdering varchar(100),
threadOrdering varchar(100),
primary key(forumId)
);
### FORUMS END
### POLLS ####
insert into users_permissions(permName,type,permDesc) values('tiki_p_read_blog','blogs','Can read blogs');
insert into users_permissions(permName,type,permDesc) values('tiki_p_view_image_gallery','image galleries','Can view image galleries');
insert into users_permissions(permName,type,permDesc) values('tiki_p_view_file_gallery','file galleries','Can view file galleries');
INSERT INTO users_permissions(permName,type,permDesc) VALUES ('tiki_p_edit_comments','comments','Can edit all comments');
insert into users_permissions(permName,type,permDesc) values('tiki_p_vote_poll','tiki','Can vote polls');
DROP TABLE IF EXISTS tiki_polls;
create table tiki_polls(
pollId integer(8) not null auto_increment,
title varchar(200),
votes integer(8),
active char(1),
publishDate integer(14),
primary key(pollId)
);
DROP TABLE IF EXISTS tiki_poll_options;
create table tiki_poll_options (
pollId integer(8) not null,
optionId integer(8) not null auto_increment,
title varchar(200),
votes integer(8),
primary key(optionId)
);
### POLLS ###
### EMail notification ###
DROP TABLE IF EXISTS tiki_mail_events;
create table tiki_mail_events(
event varchar(200),
object varchar(200),
email varchar(200)
);
### RSS MODULES ###
DROP TABLE IF EXISTS tiki_rss_modules;
create table tiki_rss_modules(
rssId integer(8) not null auto_increment,
name varchar(30) not null,
description text,
url varchar(255) not null,
refresh integer(8),
lastUpdated integer(14),
content longblob,
primary key(rssId)
);
### /RSS MODULES ###
### MENU BUILDER ###
DROP TABLE IF EXISTS tiki_menu_languages;
create table tiki_menu_languages (
menuId integer(8) not null auto_increment,
language char(2) not null,
primary key(menuId,language)
);
DROP TABLE IF EXISTS tiki_menus;
create table tiki_menus (
menuId integer(8) not null auto_increment,
name varchar(20) not null,
description text,
type char(1),
primary key(menuId)
);
DROP TABLE IF EXISTS tiki_menu_options;
create table tiki_menu_options (
optionId integer(8) not null auto_increment,
menuId integer(8),
type char(1),
name varchar(20),
url varchar(255),
position integer(4),
primary key(optionId)
);
### /MENU BUILDER ###
#### CHAT SYSTEM #####
insert into users_permissions(permName,type,permDesc) values('tiki_p_admin_chat','chat','Administrator, can create channels remove channels etc');
insert into users_permissions(permName,type,permDesc) values('tiki_p_chat','chat','Can use the chat system');
DROP TABLE IF EXISTS tiki_chat_channels;
CREATE TABLE tiki_chat_channels (
channelId int(8) NOT NULL auto_increment,
name varchar(30) default NULL,
description varchar(250) default NULL,