You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(16) |
Sep
(38) |
Oct
(7) |
Nov
|
Dec
|
|---|
|
From: <and...@us...> - 2007-10-14 16:01:00
|
Revision: 74
http://thevr.svn.sourceforge.net/thevr/?rev=74&view=rev
Author: andrewbelcher
Date: 2007-10-14 09:01:00 -0700 (Sun, 14 Oct 2007)
Log Message:
-----------
Added language variables I forgot about...
Modified Paths:
--------------
mods/pms/branches/permissions/includes/ucp/info/ucp_sites.php
mods/pms/branches/permissions/language/en/ucp.php
Modified: mods/pms/branches/permissions/includes/ucp/info/ucp_sites.php
===================================================================
--- mods/pms/branches/permissions/includes/ucp/info/ucp_sites.php 2007-10-14 15:53:41 UTC (rev 73)
+++ mods/pms/branches/permissions/includes/ucp/info/ucp_sites.php 2007-10-14 16:01:00 UTC (rev 74)
@@ -20,7 +20,7 @@
'title' => 'UCP_SITES',
'version' => '1.0.0',
'modes' => array(
- 'main' => array('title' => 'UCP_SITES_MAIN', 'auth' => '', 'cat' => array('UCP_SITES')),
+ 'main' => array('title' => 'UCP_SITES_REG', 'auth' => '', 'cat' => array('USCP_SITES_CAT')),
),
);
}
Modified: mods/pms/branches/permissions/language/en/ucp.php
===================================================================
--- mods/pms/branches/permissions/language/en/ucp.php 2007-10-14 15:53:41 UTC (rev 73)
+++ mods/pms/branches/permissions/language/en/ucp.php 2007-10-14 16:01:00 UTC (rev 74)
@@ -427,6 +427,9 @@
'UCP_PROFILE_REG_DETAILS' => 'Edit account settings',
'UCP_PROFILE_SIGNATURE' => 'Edit signature',
+ 'UCP_SITES_CAT' => 'Sites',
+ 'UCP_SITES_REG' => 'Site Registration',
+
'UCP_USERGROUPS' => 'Usergroups',
'UCP_USERGROUPS_MEMBER' => 'Edit memberships',
'UCP_USERGROUPS_MANAGE' => 'Manage groups',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2007-10-14 15:53:39
|
Revision: 73
http://thevr.svn.sourceforge.net/thevr/?rev=73&view=rev
Author: andrewbelcher
Date: 2007-10-14 08:53:41 -0700 (Sun, 14 Oct 2007)
Log Message:
-----------
Added files for the UCP Module controlling site registration.
Added Paths:
-----------
mods/pms/branches/permissions/includes/ucp/info/ucp_sites.php
mods/pms/branches/permissions/includes/ucp/ucp_sites.php
mods/pms/branches/permissions/language/en/sites.php
mods/pms/branches/permissions/styles/prosilver/template/ucp_sites.html
Added: mods/pms/branches/permissions/includes/ucp/info/ucp_sites.php
===================================================================
--- mods/pms/branches/permissions/includes/ucp/info/ucp_sites.php (rev 0)
+++ mods/pms/branches/permissions/includes/ucp/info/ucp_sites.php 2007-10-14 15:53:41 UTC (rev 73)
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* @package ucp
+* @version $Id: ucp_groups.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class ucp_sites_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'ucp_sites',
+ 'title' => 'UCP_SITES',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'main' => array('title' => 'UCP_SITES_MAIN', 'auth' => '', 'cat' => array('UCP_SITES')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/pms/branches/permissions/includes/ucp/ucp_sites.php
===================================================================
--- mods/pms/branches/permissions/includes/ucp/ucp_sites.php (rev 0)
+++ mods/pms/branches/permissions/includes/ucp/ucp_sites.php 2007-10-14 15:53:41 UTC (rev 73)
@@ -0,0 +1,117 @@
+<?php
+/**
+*
+* @package ucp
+* @version $Id: ucp_groups.php,v 1.63 2007/07/22 20:10:09 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* ucp_groups
+* @package ucp
+*/
+class ucp_sites
+{
+ var $u_action;
+
+ function main($id, $mode)
+ {
+ global $config, $phpbb_root_path, $phpEx;
+ global $db, $user, $auth, $cache, $template;
+
+ $user->add_lang('sites');
+
+ $return_page = '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '">', '</a>');
+
+ $action = request_var('action', '');
+
+ switch ($mode)
+ {
+ case 'main':
+
+ $site_id = request_var('selected', '');
+ if (isset($_POST['submit']) && $site_id <> '')
+ {
+ $user_sites = array();
+ if ($user->data['user_sites'] <> '')
+ {
+ $user_sites = explode(',', $user->data['user_sites']);
+ }
+
+ switch ($action)
+ {
+ case 'join':
+ if (!in_array($site_id, $user_sites))
+ {
+ $user_sites[] = $site_id;
+ }
+ break;
+
+ case 'leave':
+ $leave_key = array_search($site_id, $user_sites);
+ if ($leave_key !== false)
+ {
+ unset($user_sites[$leave_key]);
+ }
+ break;
+ }
+
+ $user_sites_new = implode(',', $user_sites);
+
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_sites = '$user_sites_new'
+ WHERE user_id = 2
+ LIMIT 1";
+ $result = $db->sql_query($sql);
+
+ trigger_error((($action == 'join') ? $user->lang['MSG_JOIN_SUCCESS']: $user->lang['MSG_LEAVE_SUCCESS']) . $return_page);
+ }
+
+
+ // Build List of Sites
+ $member_sites = explode(',', $user->data['user_sites']);
+
+ $sql = 'SELECT s.site_id, s.name, s.description, s.home, s.site_all, su.domain
+ FROM ' . SITES_TABLE . ' AS s, ' . SITE_URL_TABLE . ' AS su
+ WHERE s.site_id = su.site_id
+ AND s.default_url = su.id
+ ORDER BY s.name ASC';
+ $result = $db->sql_query($sql);
+
+ $row_count_m = 0;
+ $row_count_nm = 0;
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if (in_array($row['site_id'], $member_sites))
+ {
+ $block_name = 'member';
+ $row_count = $row_count_m++;
+ }
+ else
+ {
+ $block_name = 'nonmember';
+ $row_count = $row_count_nm++;
+ }
+
+ $template->assign_block_vars($block_name, array(
+ 'NAME' => $row['name'],
+ 'DESC' => $row['description'],
+ 'ID' => $row['site_id'],
+ 'URL' => append_sid($row['domain'] . $phpbb_root_path . $row['home']),
+ 'ALL' => $row['site_all'],
+
+ 'S_ROW_COUNT' => $row_count)
+ );
+ }
+
+ break;
+ }
+
+ $this->tpl_name = 'ucp_sites';
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/pms/branches/permissions/language/en/sites.php
===================================================================
--- mods/pms/branches/permissions/language/en/sites.php (rev 0)
+++ mods/pms/branches/permissions/language/en/sites.php 2007-10-14 15:53:41 UTC (rev 73)
@@ -0,0 +1,45 @@
+<?php
+/**
+*
+* ucp [English]
+*
+* @package language
+* @version $Id: ucp.php,v 1.134 2007/08/21 15:09:52 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'JOIN_SELECTED' => 'Join Selected Site',
+ 'LEAVE_SELECTED' => 'Leave Selected Site',
+ 'MANAGE_SITES' => 'Manage Site Membership',
+ 'SITES_EXPLAIN' => 'This site is one of a number of sites sharing the same system. Below you can manage which of these sites you are registered with. These sites will appear on any \'all\' sites.',
+ 'SITES_MEMBER' => 'Member Sites',
+ 'SITES_NONMEMBER' => 'Non-member Sites',
+
+ 'MSG_JOIN_SUCCESS' => 'Site joined succesfully.',
+ 'MSG_LEAVE_SUCCESS' => 'Site left successfully.',
+));
+
+?>
\ No newline at end of file
Added: mods/pms/branches/permissions/styles/prosilver/template/ucp_sites.html
===================================================================
--- mods/pms/branches/permissions/styles/prosilver/template/ucp_sites.html (rev 0)
+++ mods/pms/branches/permissions/styles/prosilver/template/ucp_sites.html 2007-10-14 15:53:41 UTC (rev 73)
@@ -0,0 +1,84 @@
+<!-- INCLUDE ucp_header.html -->
+
+<h2>{L_MANAGE_SITES}</h2>
+
+<form id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
+
+<div class="panel">
+ <div class="inner"><span class="corners-top"><span></span></span>
+
+ <p>{L_SITES_EXPLAIN}</p>
+ <!-- IF .member -->
+ <ul class="topiclist">
+ <li class="header">
+ <dl>
+ <dt>{L_SITES_MEMBER}</dt>
+ <dd class="mark">{L_SELECT}</dd>
+ </dl>
+ </li>
+ </ul>
+ <ul class="topiclist cplist">
+
+ <!-- BEGIN member -->
+ <li class="row<!-- IF member.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
+ <dl>
+ <dt>
+ <a href="{member.URL}" class="forumtitle">{member.NAME}</a>
+ <!-- IF member.DESC --><br />{member.DESC}<!-- ENDIF -->
+ </dt>
+ <dd class="mark"><input type="radio" name="selected" value="{member.ID}" /></dd>
+ </dl>
+ </li>
+ <!-- END member -->
+ </ul>
+ <!-- ENDIF -->
+ <span class="corners-bottom"><span></span></span></div>
+</div>
+
+
+<!-- IF .nonmember -->
+<div class="panel">
+ <div class="inner"><span class="corners-top"><span></span></span>
+ <ul class="topiclist">
+ <li class="header">
+ <dl>
+ <dt>{L_SITES_NONMEMBER}</dt>
+ <dd class="mark">{L_SELECT}</dd>
+ </dl>
+ </li>
+ </ul>
+ <ul class="topiclist cplist">
+
+ <!-- BEGIN nonmember -->
+ <li class="row<!-- IF nonmember.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
+ <dl>
+ <dt>
+ <a href="{nonmember.URL}" class="forumtitle">{nonmember.NAME}</a>
+ <!-- IF nonmember.DESC --><br />{nonmember.DESC}<!-- ENDIF -->
+ </dt>
+ <dd class="mark"><input type="radio" name="selected" value="{nonmember.ID}" /></dd>
+ </dl>
+ </li>
+ <!-- END nonmember -->
+ </ul>
+ <span class="corners-bottom"><span></span></span></div>
+ </div>
+<!-- ENDIF -->
+
+
+ <fieldset>
+ <div class="right-box">
+ <label for="action">{L_SELECT}:</label>
+ <select name="action" id="action">
+ <option value="join">{L_JOIN_SELECTED}</option>
+ <option value="leave">{L_LEAVE_SELECTED}</option>
+ </select>
+ <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
+ </div>
+ </fieldset>
+
+
+
+</form>
+
+<!-- INCLUDE ucp_footer.html -->
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2007-10-14 15:52:36
|
Revision: 72
http://thevr.svn.sourceforge.net/thevr/?rev=72&view=rev
Author: andrewbelcher
Date: 2007-10-14 08:52:37 -0700 (Sun, 14 Oct 2007)
Log Message:
-----------
Updated to include two new fields, 'user_sites' on `users_table` and 'default_url' on `sites` table.
Also cleaned up the code, lots of ' and " not used according to the coding guidelines.
Modified Paths:
--------------
mods/pms/branches/permissions/thevr_pms_install.php
Modified: mods/pms/branches/permissions/thevr_pms_install.php
===================================================================
--- mods/pms/branches/permissions/thevr_pms_install.php 2007-10-14 15:27:34 UTC (rev 71)
+++ mods/pms/branches/permissions/thevr_pms_install.php 2007-10-14 15:52:37 UTC (rev 72)
@@ -29,13 +29,13 @@
* Create New Tables
**/
/* _site_config */
- $sql = "CREATE TABLE `" . $table_prefix . "site_config` (
+ $sql = 'CREATE TABLE `' . $table_prefix . 'site_config` (
`config_name` varchar(255) character set latin1 collate latin1_general_ci NOT NULL,
`config_value` varchar(255) character set latin1 collate latin1_general_ci NOT NULL,
`is_dynamic` tinyint(1) NOT NULL,
`site_id` mediumint(4) NOT NULL,
`overide` tinyint(1) NOT NULL,
- )";
+ )';
if($db->sql_query($sql))
{
@@ -47,12 +47,12 @@
}
/* _site_urls */
- $sql = "CREATE TABLE `" . $table_prefix . "site_urls` (
+ $sql = 'CREATE TABLE `' . $table_prefix . 'site_urls` (
`id` mediumint(8) NOT NULL auto_increment,
`site_id` mediumint(4) NOT NULL,
`domain` varchar(255) character set utf8 collate utf8_bin NOT NULL,
PRIMARY KEY (`id`)
- )";
+ )';
if($db->sql_query($sql))
{
@@ -65,7 +65,7 @@
/* _sites */
- $sql = "CREATE TABLE `" . $table_prefix . "sites` (
+ $sql = 'CREATE TABLE `' . $table_prefix . "sites` (
`site_id` mediumint(4) NOT NULL auto_increment,
`name` varchar(255) character set utf8 collate utf8_bin NOT NULL,
`description` varchar(255) character set utf8 collate utf8_bin NOT NULL,
@@ -73,6 +73,7 @@
`home` varchar(255) character set utf8 collate utf8_bin NOT NULL default 'index.php',
`default_style` tinyint(4) NOT NULL default '1',
`site_all` tinyint(1) NOT NULL default '0',
+ `default_url` mediumint(8) NOT NULL,
PRIMARY KEY (`site_id`)
)";
@@ -85,12 +86,11 @@
define('ERROR',true);
}
-
if(defined('ERROR'))
{
foreach($success as $i => $table)
{
- $sql = "DROP TABLE " . $table_prefix . $table . " ";
+ $sql = 'DROP TABLE `' . $table_prefix . $table . '`';
@$db->sql_query($sql);
}
@@ -100,7 +100,7 @@
/***
* Insert Permissions
**/
- $sql = "INSERT INTO " . ACL_OPTIONS_TABLE . " ( `auth_option_id` , `auth_option` , `is_global` , `is_local` , `founder_only` )
+ $sql = 'INSERT INTO ' . ACL_OPTIONS_TABLE . " ( `auth_option_id` , `auth_option` , `is_global` , `is_local` , `founder_only` )
VALUES ( NULL , 'a_sites_a', '1', '0', '0' ),
( NULL , 'a_sites_e', '1', '0', '0' ),
( NULL , 'a_sites_d', '1', '0', '0' ),
@@ -111,7 +111,7 @@
{
foreach($success as $i => $table)
{
- $sql = "DROP TABLE " . $table_prefix . $table . " ";
+ $sql = 'DROP TABLE `' . $table_prefix . $table . '`';
@$db->sql_query($sql);
}
@@ -121,13 +121,13 @@
/***
* Update forums table
**/
- $sql = "ALTER TABLE `phpbb_forums` ADD `site_id` MEDIUMINT( 4 ) NOT NULL DEFAULT '0';";
+ $sql = 'ALTER TABLE `' . FORUMS_TABLE . "` ADD `site_id` MEDIUMINT( 4 ) NOT NULL DEFAULT '0'";
if(!$db->sql_query($sql))
{
foreach($success as $i => $table)
{
- $sql = "DROP TABLE " . $table_prefix . $table . " ";
+ $sql = 'DROP TABLE `' . $table_prefix . $table . '`';
@$db->sql_query($sql);
}
$sql = "DELETE
@@ -139,12 +139,35 @@
}
/***
+ * Update users table
+ **/
+ $sql = 'ALTER TABLE `' . USERS_TABLE . '` ADD `user_sites` VARCHAR(255) NOT NULL';
+
+ if(!$db->sql_query($sql))
+ {
+ foreach($success as $i => $table)
+ {
+ $sql = 'DROP TABLE `' . $table_prefix . $table . '`';
+ @$db->sql_query($sql);
+ }
+ $sql = "DELETE
+ FROM " . ACL_OPTIONS_TABLE . "
+ WHERE auth_option_id LIKE 'a_sites_%'";
+ @$db->sql_query($sql);
+
+ $sql = 'ALTER TABLE `' . FORUMS_TABLE . '` DROP `site_id`';
+ @$db->sql_query($sql);
+
+ trigger_error('TheVR Mod :: Failed to alter users table');
+ }
+
+ /***
* Set Up admin Panel Module
**/
$sql = 'SELECT right_id
- FROM ' . MODULES_TABLE . '
- WHERE module_class = \'acp\'
- ORDER BY right_id DESC';
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'acp'
+ ORDER BY right_id DESC";
$result = $db->sql_query($sql);
$posnum = $db->sql_fetchfield('right_id',0,$result) + 1;
@@ -165,17 +188,20 @@
{
foreach($success as $i => $table)
{
- $sql = "DROP TABLE " . $table_prefix . $table . " ";
+ $sql = 'DROP TABLE `' . $table_prefix . $table . '`';
@$db->sql_query($sql);
}
- $sql = "DELETE
- FROM " . ACL_OPTIONS_TABLE . "
+ $sql = 'DELETE
+ FROM ' . ACL_OPTIONS_TABLE . "
WHERE auth_option_id LIKE 'a_sites_%'";
@$db->sql_query($sql);
- $sql = 'ALTER TABLE ' . FORUMS_TABLE . ' DROP COLUMN `site_id`';
+ $sql = 'ALTER TABLE `' . FORUMS_TABLE . '` DROP `site_id`';
@$db->sql_query($sql);
+
+ $sql = 'ALTER TABLE `' . USERS_TABLE . '` DROP `user_sites`';
+ @$db->sql_query($sql);
trigger_error('TheVR Mod :: Failed to add sites category');
}
@@ -242,17 +268,20 @@
{
foreach($success as $i => $table)
{
- $sql = "DROP TABLE " . $table_prefix . $table . " ";
+ $sql = 'DROP TABLE `' . $table_prefix . $table . '`';
@$db->sql_query($sql);
}
$sql = 'DELETE
- FROM ' . ACL_OPTIONS_TABLE . '
- WHERE auth_option_id LIKE \'a_sites_%\'';
+ FROM ' . ACL_OPTIONS_TABLE . "
+ WHERE auth_option_id LIKE 'a_sites_%'";
@$db->sql_query($sql);
$sql = 'ALTER TABLE ' . FORUMS_TABLE . ' DROP COLUMN `site_id`';
@$db->sql_query($sql);
+
+ $sql = 'ALTER TABLE `' . USERS_TABLE . '` DROP `user_sites`';
+ @$db->sql_query($sql);
$sql = 'DELETE
FROM ' . MODULES_TABLE . '
@@ -331,7 +360,7 @@
{
foreach($success as $i => $table)
{
- $sql = "DROP TABLE " . $table_prefix . $table . " ";
+ $sql = 'DROP TABLE ' . $table_prefix . $table . " ";
@$db->sql_query($sql);
}
@@ -343,6 +372,9 @@
$sql = 'ALTER TABLE ' . FORUMS_TABLE . ' DROP COLUMN `site_id`';
@$db->sql_query($sql);
+ $sql = 'ALTER TABLE `' . USERS_TABLE . '` DROP `user_sites`';
+ @$db->sql_query($sql);
+
$sql = 'DELETE
FROM ' . MODULES_TABLE . '
WHERE module_id = ' . $topid;
@@ -400,22 +432,22 @@
}
break;
case 'view':
- echo "<h1>View Changes</h1><br />";
- echo "CREATE TABLE `" . $table_prefix . "site_config` (
+ echo '<h1>View Changes</h1><br />';
+ echo 'CREATE TABLE `' . $table_prefix . "site_config` (
<br /> `config_name` varchar(255) character set latin1 collate latin1_general_ci NOT NULL,
<br /> `config_value` varchar(255) character set latin1 collate latin1_general_ci NOT NULL,
<br /> `is_dynamic` tinyint(1) NOT NULL,
<br /> `site_id` mediumint(4) NOT NULL,
<br /> `overide` tinyint(1) NOT NULL
<br />)";
- echo " <br /><br /> ";
- echo "CREATE TABLE `" . $table_prefix . "site_urls` (
+ echo ' <br /><br /> ';
+ echo 'CREATE TABLE `' . $table_prefix . "site_urls` (
<br /> `id` mediumint(8) NOT NULL auto_increment,
<br /> `site_id` mediumint(4) NOT NULL,
<br /> `domain` varchar(255) character set utf8 collate utf8_bin NOT NULL,
<br />PRIMARY KEY (`id`))";
- echo " <br /><br /> ";
- echo " CREATE TABLE `" . $table_prefix . "sites` (
+ echo ' <br /><br /> ';
+ echo ' CREATE TABLE `' . $table_prefix . "sites` (
<br /> `site_id` mediumint(4) NOT NULL auto_increment,
<br /> `name` varchar(255) character set utf8 collate utf8_bin NOT NULL,
<br /> `description` varchar(255) character set utf8 collate utf8_bin NOT NULL,
@@ -423,18 +455,20 @@
<br /> `home` varchar(255) character set utf8 collate utf8_bin NOT NULL default 'index.php',
<br /> `default_style` tinyint(4) NOT NULL default '1',
<br />PRIMARY KEY (`site_id`))";
- echo " <br /><br /> ";
- echo " INSERT INTO `phpbb_acl_options` ( `auth_option_id` , `auth_option` , `is_global` , `is_local` , `founder_only` ) VALUES ( NULL , 'a_sites_a', '1', '0', '0' );<br />
+ echo ' <br /><br /> ';
+ echo ' INSERT INTO `' . $table_prefix . "acl_options` ( `auth_option_id` , `auth_option` , `is_global` , `is_local` , `founder_only` ) VALUES ( NULL , 'a_sites_a', '1', '0', '0' );<br />
<br />INSERT INTO `phpbb_acl_options` ( `auth_option_id` , `auth_option` , `is_global` , `is_local` , `founder_only` ) VALUES ( NULL , 'a_sites_e', '1', '0', '0' );<br />
<br />INSERT INTO `phpbb_acl_options` ( `auth_option_id` , `auth_option` , `is_global` , `is_local` , `founder_only` ) VALUES ( NULL , 'a_sites_d', '1', '0', '0' );<br />
<br />INSERT INTO `phpbb_acl_options` ( `auth_option_id` , `auth_option` , `is_global` , `is_local` , `founder_only` ) VALUES ( NULL , 'a_sites_ug', '1', '0', '0' );<br />
<br />INSERT INTO `phpbb_acl_options` ( `auth_option_id` , `auth_option` , `is_global` , `is_local` , `founder_only` ) VALUES ( NULL , 'a_sites_f', '1', '0', '0' );";
- echo " <br /><br /> ";
- echo " ALTER TABLE `phpbb_forums` ADD `site_id` MEDIUMINT( 4 ) NOT NULL DEFAULT '0';";
+ echo ' <br /><br /> ';
+ echo " ALTER TABLE `' . $table_prefix . 'forums` ADD `site_id` MEDIUMINT( 4 ) NOT NULL DEFAULT '0';";
+ echo ' <br /><br /> ';
+ echo ' ALTER TABLE `' . $table_prefix . 'users` ADD `user_sites` VARCHAR(255) NOT NULL;';
break;
default:
- echo "<h1>TheVR Pseudo Multi-Site (PMS) Mod </h1><br />";
- echo "<a href=\"thevr_pms_install.php?mode=install\">Fresh Install</a>
+ echo '<h1>TheVR Pseudo Multi-Site (PMS) Mod </h1><br />';
+ echo '<a href="thevr_pms_install.php?mode=install">Fresh Install</a>
<br />
<br />
<b>Upgrade From:</b>
@@ -443,7 +477,7 @@
<li>...</li>
</ul>
<br />
- <a href=\"thevr_pms_install.php?mode=view\">View Changes</a>";
+ <a href="thevr_pms_install.php?mode=view">View Changes</a>';
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2007-10-14 15:27:32
|
Revision: 71
http://thevr.svn.sourceforge.net/thevr/?rev=71&view=rev
Author: andrewbelcher
Date: 2007-10-14 08:27:34 -0700 (Sun, 14 Oct 2007)
Log Message:
-----------
Fixed a couple errors in the site forums setup.
Modified Paths:
--------------
mods/pms/branches/permissions/includes/session.php
Modified: mods/pms/branches/permissions/includes/session.php
===================================================================
--- mods/pms/branches/permissions/includes/session.php 2007-10-13 20:13:33 UTC (rev 70)
+++ mods/pms/branches/permissions/includes/session.php 2007-10-14 15:27:34 UTC (rev 71)
@@ -1568,7 +1568,8 @@
}
// Set up the user's site/forum access
- if ($config['site_all'] == true && isset($this->data['user_sites']))
+ $this->data['site_forums'] = array();
+ if ($config['site_all'] == true && $this->data['user_sites'] <> '')
{
$sql_site_list = '(0,' . $config['site_id'] . ',' . $this->data['user_sites'] . ')';
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dac...@us...> - 2007-10-13 20:13:29
|
Revision: 70
http://thevr.svn.sourceforge.net/thevr/?rev=70&view=rev
Author: dachebodt
Date: 2007-10-13 13:13:33 -0700 (Sat, 13 Oct 2007)
Log Message:
-----------
removed mod module and replaced with core module
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dac...@us...> - 2007-10-13 20:12:03
|
Revision: 69
http://thevr.svn.sourceforge.net/thevr/?rev=69&view=rev
Author: dachebodt
Date: 2007-10-13 13:11:58 -0700 (Sat, 13 Oct 2007)
Log Message:
-----------
Quite a few changes to cs module
Modified Paths:
--------------
mods/cms/trunk/cms_install.php
mods/cms/trunk/common.php
mods/cms/trunk/modules/core/acp_core.php
mods/cms/trunk/modules/cs/custom_style.php
mods/cms/trunk/modules/cs/functions_blocks_admin.php
mods/cms/trunk/modules/cs/functions_style_generator.php
mods/cms/trunk/modules/cs/js/stylegenerator.js
mods/cms/trunk/modules/cs/style.php
mods/cms/trunk/modules/cs/template/cs.css
mods/cms/trunk/modules/cs/template/stylegenerator.css
mods/cms/trunk/modules/zebra/template/pro_zebra.html
mods/cms/trunk/styles/prosilver/template/cs_generator.html
mods/cms/trunk/styles/prosilver/template/custom_style_view.html
Modified: mods/cms/trunk/cms_install.php
===================================================================
--- mods/cms/trunk/cms_install.php 2007-10-13 15:03:02 UTC (rev 68)
+++ mods/cms/trunk/cms_install.php 2007-10-13 20:11:58 UTC (rev 69)
@@ -58,7 +58,7 @@
include($phpbb_root_path . "modules/core/acp_core.$phpEx");
- if($mod == 'mods')
+ if($mod == 'core')
{
$sql = 'ALTER TABLE `' . MODULES_TABLE . '` ADD `module_dir` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL';
$db->sql_query($sql);
@@ -164,6 +164,7 @@
{
// install example data here
set_config('cms_enabled', '1');
+ $cache->purge();
$content = '<p>CMS successfully installed!</p><br />';
$content.= '<p><b>*NOTE*: Please be sure to delete this file before you continue...</b></p><br />';
Modified: mods/cms/trunk/common.php
===================================================================
--- mods/cms/trunk/common.php 2007-10-13 15:03:02 UTC (rev 68)
+++ mods/cms/trunk/common.php 2007-10-13 20:11:58 UTC (rev 69)
@@ -202,6 +202,12 @@
{
$user->add_mod_lang(array($module => 'common'));
}
+
+ //include jquery
+ $template->assign_block_vars('header', array(
+ 'TYPE' => 'javascript',
+ 'LINK' => $phpbb_root_path . 'includes/js/jquery.js'
+ ));
}
?>
\ No newline at end of file
Modified: mods/cms/trunk/modules/core/acp_core.php
===================================================================
--- mods/cms/trunk/modules/core/acp_core.php 2007-10-13 15:03:02 UTC (rev 68)
+++ mods/cms/trunk/modules/core/acp_core.php 2007-10-13 20:11:58 UTC (rev 69)
@@ -200,6 +200,7 @@
$message = sprintf($user->lang['MOD_INSTALLED'], $mod, implode(', ', array_unique($affected_classes)));
set_config($mod . '_version', $dir_mods[$mod]['mod_vers']);
+ $cache->destroy('cms_modules');
}
$template->assign_vars(array(
@@ -327,6 +328,7 @@
unset($db_mods[array_search($mod, $db_mods)]);
$message = (sizeof($errors) > 0) ? $error : sprintf($user->lang['MOD_UNINSTALLED'], $mod, implode(', ', $affected_classes));
+ $cache->destroy('cms_modules');
}
else
{
Modified: mods/cms/trunk/modules/cs/custom_style.php
===================================================================
--- mods/cms/trunk/modules/cs/custom_style.php 2007-10-13 15:03:02 UTC (rev 68)
+++ mods/cms/trunk/modules/cs/custom_style.php 2007-10-13 20:11:58 UTC (rev 69)
@@ -2,7 +2,7 @@
/**
*
* @package custom style mod
-* @version $Id: custom_style.php,v 1.68 2006/08/12 13:12:19 blitze Exp $
+* @version $Id: custom_style.php,v 1.68 2006/08/12 13:12:19 Blitze Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -89,17 +89,17 @@
// show permission preview box as long as it is profile owner or admin
$template->assign_vars(array('PREVIEW_OPTIONS' => $blocks_admin->get_auth_options($this->auth_levels_data)));
- }
- // get user blocks
- $sql = 'SELECT side, max(pos) as max FROM ' . UG_BLOCKS_TABLE . " WHERE $this->ug_type = $this->ug_id GROUP BY side";
- $result = $db->sql_query($sql);
+ // get user blocks
+ $sql = 'SELECT side, max(pos) as max FROM ' . UG_BLOCKS_TABLE . " WHERE $this->ug_type = $this->ug_id GROUP BY side";
+ $result = $db->sql_query($sql);
- while($row = $db->sql_fetchrow($result))
- {
- ${$row['side'] . '_max'} = $row['max'];
- }
-
+ while($row = $db->sql_fetchrow($result))
+ {
+ ${$row['side'] . '_max'} = $row['max'];
+ }
+ }
+
$l_ary = array();
$c_ary = array();
$r_ary = array();
@@ -171,9 +171,6 @@
foreach($col as $blocks => $block)
{
- //$block_data_ary = array();
- //$block_config_ary = array();
-
@include_once($blocks_dir . $block['module'] . '/blocks/' . $block['name'] . '.' . $phpEx);
$block_data_ary = $block['name']($block);
Modified: mods/cms/trunk/modules/cs/functions_blocks_admin.php
===================================================================
--- mods/cms/trunk/modules/cs/functions_blocks_admin.php 2007-10-13 15:03:02 UTC (rev 68)
+++ mods/cms/trunk/modules/cs/functions_blocks_admin.php 2007-10-13 20:11:58 UTC (rev 69)
@@ -284,7 +284,6 @@
$content_ary = utf8_normalize_nfc(request_var('content', array(''=>''), true));
$ex = ( $ex ) ? '1' : '0';
- //$content_ary = array_map('addslashes', $content_ary);
$content = implode('~', $content_ary);
$enable_smilies = ($config['allow_smilies'] && $user->optionget('smilies')) ? true : false;
Modified: mods/cms/trunk/modules/cs/functions_style_generator.php
===================================================================
--- mods/cms/trunk/modules/cs/functions_style_generator.php 2007-10-13 15:03:02 UTC (rev 68)
+++ mods/cms/trunk/modules/cs/functions_style_generator.php 2007-10-13 20:11:58 UTC (rev 69)
@@ -20,7 +20,7 @@
function display_generator($ug_type, $ug_id, $data, $u_action)
{
- global $user, $template;
+ global $user, $template, $phpbb_root_path;
$this->ug_type = $ug_type;
$this->ug_id = $ug_id;
@@ -43,8 +43,25 @@
redirect(append_sid($u_action));
}
+ //generate background images popup
+ $bg_img_options = '';
+ $directory = 'modules/cs/images/bg/';
+
+ $dh = @opendir($phpbb_root_path . $directory);
+
+ if ($dh)
+ {
+ $board_url = generate_board_url();
+ while (($file = readdir($dh)) !== false)
+ {
+ if(preg_match('/^(.*)\.(gif|png|jpe?g)$/', $file))
+ {
+ $bg_img_options .= '<option value="' . $board_url . '/' . $directory . $file . '">' . $file . '</option>';
+ }
+ }
+ }
+
$header_include = array(
- "includes/js/jquery.js" => 'javascript',
"includes/js/iutil.js" => 'javascript',
"includes/js/ifx.js" => 'javascript',
"includes/js/ifxfold.js" => 'javascript',
@@ -64,7 +81,7 @@
{
$template->assign_block_vars('header', array(
'TYPE' => $type,
- 'LINK' => $src
+ 'LINK' => $phpbb_root_path . $src
));
}
@@ -86,9 +103,8 @@
$hide_bottom = ($data['drop_shadow_option'] == '3') ? true : false;
$template->assign_vars(array(
- 'U_CUSTOMIZE' => true,
+ 'U_CUSTOMIZE' => true,
-
// GENERAL
'BORDER' => $data['border'],
'BORDER_STYLE' => $data['border_style'],
@@ -99,6 +115,7 @@
'BG_OPACITY' => $data['bg_opacity'],
'BG_ATTACHMENT' => $data['bg_attachment'],
'BG_POSITION' => $data['position'],
+ 'BG_IMG_OPTIONS' => $bg_img_options,
'DROP_SHADOW_COLOR' => $data['drop_shadow_color'],
// BLOCK HEADER
@@ -113,10 +130,10 @@
'HDR_BORDER_BOTTOM' => ($hide_bottom) ? '0' : $data['hdr_border'],
'HDR_BORDER_STYLE' => $data['hdr_border_style'],
'HDR_BORDER_COLOR' => $data['hdr_border_color'],
- 'HDR_BG_COLOR' => ($data['hdr_bg_color']) ? $data['hdr_bg_color'] : 'transparent',
+ 'HDR_BG_COLOR' => $data['hdr_bg_color'],
'HDR_BG_IMG' => $data['hdr_bg_img'],
'HDR_BG_STYLE' => $data['hdr_bg_style'],
- //'HDR_BG_OPACITY' => $data['hdr_bg_opacity'],
+ //'HDR_BG_OPACITY' => $data['hdr_bg_opacity'],
'HDR_BG_POSITION' => $data['hdr_position'],
// BLOCK BODY
@@ -131,7 +148,7 @@
'BLK_BORDER_TOP' => ($hide_bottom) ? '0' : $data['blk_border'],
'BLK_BORDER_STYLE' => $data['blk_border_style'],
'BLK_BORDER_COLOR' => $data['blk_border_color'],
- 'BLK_BG_COLOR' => ($data['blk_bg_color']) ? $data['blk_bg_color'] : 'transparent',
+ 'BLK_BG_COLOR' => $data['blk_bg_color'],
'BLK_BG_IMG' => $data['blk_bg_img'],
'BLK_BG_STYLE' => $data['blk_bg_style'],
'BLK_BG_OPACITY' => $data['blk_bg_opacity'],
Modified: mods/cms/trunk/modules/cs/js/stylegenerator.js
===================================================================
--- mods/cms/trunk/modules/cs/js/stylegenerator.js 2007-10-13 15:03:02 UTC (rev 68)
+++ mods/cms/trunk/modules/cs/js/stylegenerator.js 2007-10-13 20:11:58 UTC (rev 69)
@@ -2,8 +2,8 @@
{
serial = $.SortSerialize();
alert(serial.hash);
- //$('form')[0].submit();
- document.form['generator'].submit();
+ $('#generator')[0].submit();
+ //document.form['generator'].submit();
}
function pickcolor(field, chngCss, cssAtr, link){
@@ -16,6 +16,27 @@
$('#colorpicker').show();
}
+function pickbg(field, chngCss){
+ fieldId = '#'+field;
+ v = $(fieldId).val();
+ $('#bg_options').val(v);
+ reconBoxPos(field+'_link', '#bgpicker');
+ $('#bgpicker').show();
+ $('#selectBg').bind('click', function() {
+ img = $('#bg_options').val();
+ $(fieldId).val(img);
+ closeBgPicker();
+ });
+ $('#bg_options').change(function() {
+ img = $('#bg_options').val();
+ $(chngCss).css('backgroundImage', 'url('+img+')');
+ });
+ $('#closeBgPicker').click(function() {
+ $(chngCss).css('backgroundImage', 'url('+v+')');
+ closeBgPicker();
+ });
+}
+
function changecss(element, chngCss, val) {
$(element).css(chngCss,val);
}
@@ -26,21 +47,20 @@
$('#colorpicker').hide();
}
-function closePicker() {
+function closeColorPicker() {
var f = $.farbtastic('#picker');
var val = $(f.fieldId).get(0).value;
changecss(f.selected, f.chngCss, val);
$('#colorpicker').hide();
}
-/*
-function toggle(obj)
-{
- obj.style.display = (obj.style.display != 'none' ? 'none' : 'block');
- return true;
+
+function closeBgPicker() {
+ $('#selectBg').unbind();
+ $('#bg_options').unbind();
+ $('#closeBgPicker').unbind();
+ $('#bgpicker').hide();
}
-*/
-/*################################*/
function toggleBgStyle(obj, v, e)
{
if(v == 'no-repeat')
@@ -54,6 +74,7 @@
changecss(obj, 'backgroundRepeat', 'repeat');
}
}
+
function point_prev(val, el)
{
el = '#' + el;
@@ -61,6 +82,7 @@
if(val){ if(val == 'pointer;cursor:hand' ){ val = 'hand'; } $(el).html('<img src="modules/cs/images/pointers/cursor-'+val+'.gif" valign="baseline" alt="">'); $(el).fadeIn(); }
else { $(el).fadeOut(); }
}
+
function toggle_shadow(val)
{
var hb = $('#hdr_border').val();
@@ -85,44 +107,6 @@
}
}
-function album_popup(previewId,element, link, box)
-{
- cats('', '', '', 'cats');
- reconBoxPos(link, box);
- new Effect.Appear('bg_select');
- document.album_browser.field.value = element;
- document.album_browser.previewId.value = previewId;
-}
-
-function cats(val,type,parent,mode)
-{
- var url = 'custom_profile_ajax.php';
- var pars = 'm='+mode+'&c='+val+'&t='+type+'&p='+parent;
- var target = mode;
-
- var myAjax = new Ajax.Updater(target, url, { asynchronous:true, evalScripts:true, /*onCreate: function() { loadingRequest(loader, target); },*/ onComplete: function() { completedRequest(loader, target); }, parameters: pars, method: 'get' });
-}
-
-function img_preview(val)
-{
- if(val)
- {
- id = 'img_preview';
- url = 'album_thumbnail.php?pic_id='+val;
- $(id).style.background = 'white url('+url+') no-repeat scroll center center';
- document.album_browser.selImg.value = val;
- }
-}
-
-function album_popup_close()
-{
- var field = document.album_browser.field.value;
- var previewId = document.album_browser.previewId.value;
- var imgUrl = 'album_pic.php?pic_id=' + document.album_browser.selImg.value;
- document.custom_profile.elements[field].value = imgUrl;
- changecss(previewId, 'backgroundImage', 'url('+imgUrl+')', '', false, '');
- Effect.Fade('bg_select');
-}
function reconBoxPos(link, box)
{
var left = 0;
Modified: mods/cms/trunk/modules/cs/style.php
===================================================================
--- mods/cms/trunk/modules/cs/style.php 2007-10-13 15:03:02 UTC (rev 68)
+++ mods/cms/trunk/modules/cs/style.php 2007-10-13 20:11:58 UTC (rev 69)
@@ -209,21 +209,40 @@
'{LINK_POINTER}' => $cprofiledata['link_pointer'],
);
- if($cprofiledata['bg_opacity'])
+ $gen_opacity_comment_open = '';
+ $gen_opacity_comment_close = '';
+ $hdr_img_comment_open = '';
+ $hdr_img_comment_close = '';
+ $blk_img_comment_open = '';
+ $blk_img_comment_close = '';
+
+ if(!$cprofiledata['bg_opacity'])
{
- $comment = array(
- '{GEN_OPACITY_COMMENT_OPEN}' => '',
- '{GEN_OPACITY_COMMENT_CLOSE}' => '',
- );
+ $gen_opacity_comment_open = '/*';
+ $gen_opacity_comment_close = '*/';
}
- else
+
+ if(!$cprofiledata['hdr_bg_img'])
{
- $comment = array(
- '{GEN_OPACITY_COMMENT_OPEN}' => '/*',
- '{GEN_OPACITY_COMMENT_CLOSE}' => '*/',
- );
+ $hdr_img_comment_open = '/*';
+ $hdr_img_comment_close = '*/';
}
+ if(!$cprofiledata['blk_bg_img'])
+ {
+ $blk_img_comment_open = '/*';
+ $blk_img_comment_close = '*/';
+ }
+
+ $comment = array(
+ '{GEN_OPACITY_COMMENT_OPEN}' => $gen_opacity_comment_open,
+ '{GEN_OPACITY_COMMENT_CLOSE}' => $gen_opacity_comment_close,
+ '{HDR_IMG_COMMENT_OPEN}' => $hdr_img_comment_open,
+ '{HDR_IMG_COMMENT_CLOSE}' => $hdr_img_comment_close,
+ '{BLK_IMG_COMMENT_OPEN}' => $blk_img_comment_open,
+ '{BLK_IMG_COMMENT_CLOSE}' => $blk_img_comment_close,
+ );
+
$replace = array_merge($replace, $comment);
$css_data = str_replace(array_keys($replace), array_values($replace), $css_data);
@@ -238,4 +257,4 @@
exit;
-?>
+?>
\ No newline at end of file
Modified: mods/cms/trunk/modules/cs/template/cs.css
===================================================================
--- mods/cms/trunk/modules/cs/template/cs.css 2007-10-13 15:03:02 UTC (rev 68)
+++ mods/cms/trunk/modules/cs/template/cs.css 2007-10-13 20:11:58 UTC (rev 69)
@@ -35,9 +35,11 @@
font-size: {HDR_FONT_SIZE}px;
color: {HDR_FONT_COLOR};
background-color: {HDR_BG_COLOR};
+{HDR_IMG_COMMENT_OPEN}
background-image:url({HDR_BG_IMG});
background-repeat: {HDR_BG_STYLE};
background-position: {HDR_BG_POSITION};
+{HDR_IMG_COMMENT_CLOSE}
font-weight:bold;
margin-bottom: 4px;
padding: 0 10px;
@@ -51,9 +53,11 @@
font-size: {BLK_FONT_SIZE}px;
color: {BLK_FONT_COLOR};
background-color: {BLK_BG_COLOR};
+{BLK_IMG_COMMENT_OPEN}
background-image:url({BLK_BG_IMG});
background-repeat: {BLK_BG_STYLE};
background-position: {BLK_BG_POSITION};
+{BLK_IMG_COMMENT_CLOSE}
margin-bottom: .8%;
padding: 0 10px;
}
@@ -72,10 +76,11 @@
-khtml-opacity: 0.{GEN_BG_OPACITY};
-moz-opacity: 0.{GEN_BG_OPACITY};
{GEN_OPACITY_COMMENT_CLOSE}
+ zoom: 1;
}
.no-drop { margin-top:-1px; }
-.bhdr a {
+.bhdr a:link {
color:{HDR_LINK_COLOR};
text-decoration:{HDR_TXT_DECOR};
}
@@ -83,7 +88,7 @@
color:{HDR_HOV_COLOR};
text-decoration:{HDR_HOV_DECOR};
}
-.bbody a {
+.bbody a:link {
color:{BLK_LINK_COLOR};
text-decoration:{BLK_TXT_DECOR};
}
@@ -96,11 +101,11 @@
.bbody hr {color:{BLK_BORDER_COLOR};}
img {position:relative;}
#signature {text-align:center;}
-#left {margin-right:.8%;}
-#right {margin-left:.8%;}
-#center {margin:0px}
+#left {margin-right:.7%; display: inline-block;}
+#right {margin-left:.7%; display: inline-block;}
+#center {margin:0px; zoom: 1;}
#left,#right,#center {height:100%;min-height:25px;width:100%;};
-h4 {float:left;}
+h4 {float:left; min-width:90%;}
form {display:inline;}
#cs_nav_menu {float:right;margin:0px;margin-top:-2px;width:100%;display:block;white-space:nowrap;}
.row1 {background-color:{BLK_BG_COLOR};color:{BLK_FONT_COLOR};border:{GEN_BORDER}px solid {GEN_BORDER_COLOR};}
Modified: mods/cms/trunk/modules/cs/template/stylegenerator.css
===================================================================
--- mods/cms/trunk/modules/cs/template/stylegenerator.css 2007-10-13 15:03:02 UTC (rev 68)
+++ mods/cms/trunk/modules/cs/template/stylegenerator.css 2007-10-13 20:11:58 UTC (rev 69)
@@ -15,11 +15,11 @@
cursor:auto;
z-index:2500;
}
-#ifxElement input {width:60px;font-style:uppercase;}
#list1 {width:100%;max-width:100%;height:auto;position:relative;}
#list1 .title {line-height:100%;border:1px solid #CCCCCC;background-color:B5EF59;margin-top:0.5em; padding:0.1em;cursor:pointer;}
#list1 .content { display:inset;height:auto;background-color:#B5CEFE; padding:0.1em; padding-top:10px; border:1px solid #b5c;margin:0;position:relative; }
-#colorpicker {display:none;width:300px;}
+#colorpicker {display:none;width:305px;}
+#bgpicker {display:none;background-color:#344;border: 2px solid #000000; z-index:2500;}
#picker {float:left;padding:5px;width:200px;}
#pickertitle {padding:4px;margin:0px;color:#fff;text-align:right;background-color:#667;width:292px;}
#pickeroptions {float:left;display:block;margin:0px;padding:3px;width:75px;height:100%;border:1px solid #534;}
@@ -51,9 +51,8 @@
}
#myAccordion{
width: 100%;
+ height: 100%;
border: 1px solid #6CAF00;
- position: relative;
- z-index: 45;
}
#myAccordion dt{
line-height: 20px;
Modified: mods/cms/trunk/modules/zebra/template/pro_zebra.html
===================================================================
--- mods/cms/trunk/modules/zebra/template/pro_zebra.html 2007-10-13 15:03:02 UTC (rev 68)
+++ mods/cms/trunk/modules/zebra/template/pro_zebra.html 2007-10-13 20:11:58 UTC (rev 69)
@@ -1,3 +1,4 @@
+<div style="display:block; margin-left:auto; margin-right:auto; text-align: center;">
<!-- BEGIN friends -->
<div class="connection">
<a href="{friends.U_PROFILE}"><span<!-- IF friends.USERNAME_COLOR --> {friends.USERNAME_COLOR}<!-- ENDIF -->>{friends.USERNAME}</span></a>
@@ -10,6 +11,7 @@
</div>
</div>
<!-- BEGINELSE -->
- <div style="text-align:center">{L_NO_FRIENDS}</div>
+ {L_NO_FRIENDS}
<!-- END friends -->
+</div>
<br clear="all" />
Modified: mods/cms/trunk/styles/prosilver/template/cs_generator.html
===================================================================
--- mods/cms/trunk/styles/prosilver/template/cs_generator.html 2007-10-13 15:03:02 UTC (rev 68)
+++ mods/cms/trunk/styles/prosilver/template/cs_generator.html 2007-10-13 20:11:58 UTC (rev 69)
@@ -1,3 +1,39 @@
+ <div class="panel bg2">
+ <div class="inner"><span class="corners-top"><span></span></span>
+
+ <!-- IF PREVIEW_OPTIONS -->
+ <form method="post">
+ <fieldset class="submit-buttons right-box">
+ {L_PREVIEW_AS}: <select name="user_perm">{PREVIEW_OPTIONS}</select>
+ {HIDDEN_FIELDS}<input type="submit" name="preview" id="preview" value="{L_SUBMIT}" class="button1" />
+ </fieldset>
+ </form>
+ <!-- ENDIF -->
+
+ <hr clear="both">
+
+ <!-- IF BLOCK_OPTIONS -->
+ <form method="post"{S_MAX_BLOCKS}>
+ <fieldset class="submit-buttons left-box">
+ <select name="block">{BLOCK_OPTIONS}</select>
+ <select name="side">
+ <!-- IF S_LEFT --><option value="l">{L_LEFT}</option><!-- ENDIF -->
+ <option value="c">{L_CENTER}</option>
+ <!-- IF S_RIGHT --><option value="r">{L_RIGHT}</option><!-- ENDIF -->
+ </select>
+ {HIDDEN_FIELDS}<input type="submit" name="add_block" id="add_block" value="{L_SUBMIT}" class="button1" />
+ </fieldset>
+ <input type="hidden" name="action" value="add">
+ </form>
+ <!-- ENDIF -->
+
+ <fieldset class="submit-buttons right-box">
+ <input type="button" name="customize" id="customize" onClick="$('#ifxElement').FoldToggle(500, 20);" value="{L_CUSTOMIZE}" class="button1" />
+ <input type="button" name="save" id="save" style="display:none;" value="{L_SAVE_CHANGES}" class="button1" />
+ </fieldset>
+ <span class="corners-bottom"><span></span></span></div>
+ </div>
+
<div id="ifxElement">
<form method="post" name="generator" id="generator">
<input type="hidden" name="action" value="save_changes" />
@@ -15,7 +51,7 @@
<span class="hh">Color:</span> <input type="text" size="7" maxlength="7" id="border_color" name="border_color" value="{BORDER_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('border_color', '#container', 'borderColor');" title="{L_COLOR_PICKER}"><img src="{ROOT_PATH}modules/cs/images/color.gif" alt="{L_COLOR_PICKER}" title="{L_COLOR_PICKER}"></a>
</p>
<p><span class="hh">Background Color:</span> <input type="text" size="7" maxlength="7" id="bg_color" name="bg_color" value="{BG_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('bg_color','#container','backgroundColor');" title="{L_COLOR_PICKER}"><img src="{ROOT_PATH}modules/cs/images/color.gif" alt="{L_COLOR_PICKER}" title="{L_COLOR_PICKER}"></a></p>
- <p><span class="hh">Background Image:</span> <input type="text" size="25" id="bg_img" name="bg_img" value="{BG_IMG}" onBlur="changecss('#container', 'backgroundImage', 'url('+this.value+')');"> <a href="#" onClick="album_popup('#container', 'bg_img','bg_select_link','bg_select');" id="bg_select_link">Select</a></p>
+ <p><span class="hh">Background Image:</span> <input type="text" size="25" id="bg_img" name="bg_img" value="{BG_IMG}" onBlur="changecss('#container', 'backgroundImage', 'url('+this.value+')');"> <a href="javascript:;" id="bg_img_link" onmousedown="pickbg('bg_img', '#container');">Select</a></p>
<p><span class="hh">Background Attachment:</span> <select name="bg_attachment" onChange="changecss('#container', 'backgroundAttachment', this.value);">{BG_ATTACH_OPTIONS}</select> <span id="opacity" class="hh">Opacity: <select name="bg_opacity" onChange="changecss('.drop', 'opacity', '0.'+this.value+'; -moz-opacity:0.'+this.value+'; filter:alpha(opacity='+this.value+')');">{BG_OPACITY_OPTIONS}</select></span></p>
<p><span class="hh">Background Style</span> <select name="bg_style" onChange="toggleBgStyle('body', this.value, '#dyn_position');">{BG_STYLE_OPTIONS}</select></p>
<div id="dyn_position" style="display:none; margin-right:250px;"><p align="right">{BG_POSITION_OPTIONS}</p></div>
@@ -35,7 +71,7 @@
<span class="hh">Color:</span> <input type="text" size="7" maxlength="7" id="hdr_border_color" name="hdr_border_color" value="{HDR_BORDER_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('hdr_border_color','.bhdr','borderColor')" title="{L_COLOR_PICKER}"><img src="{ROOT_PATH}modules/cs/images/color.gif" alt="{L_COLOR_PICKER}" title="{L_COLOR_PICKER}"></a>
</p>
<p><span class="hh">Background Color:</span> <input type="text" size="7" maxlength="7" id="hdr_bg_color" name="hdr_bg_color" value="{HDR_BG_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('hdr_bg_color','.bhdr','backgroundColor');" title="{L_COLOR_PICKER}"><img src="{ROOT_PATH}modules/cs/images/color.gif" alt="{L_COLOR_PICKER}" title="{L_COLOR_PICKER}"></a></p>
- <p><span class="hh">Background Image:</span> <input type="text" name="hdr_bg_img" value="{HDR_BG_IMG}" onBlur="changecss('.bhdr', 'backgroundImage', 'url('+this.value+')');"></p>
+ <p><span class="hh">Background Image:</span> <input type="text" id="hdr_bg_img" name="hdr_bg_img" value="{HDR_BG_IMG}" onBlur="changecss('.bhdr', 'backgroundImage', 'url('+this.value+')');"> <a href="javascript:;" id="hdr_bg_img_link" onmousedown="pickbg('hdr_bg_img', '.bhdr');">Select</a></p>
<p><span class="hh">Background Style:</span> <select name="hdr_bg_style" onChange="toggleBgStyle('.bhdr', this.value, '#dyn_hdr_position');">{HDR_BG_STYLE_OPTIONS}</select></p>
<div id="dyn_hdr_position" style="display:none; margin-right:250px;"><p align="right">{HDR_BG_POSITION_OPTIONS}</p></div>
<p><span class="hh">{L_LINK_DECOR}:</span> <select name="hdr_txt_decor" onChange="changecss('.bhdr a', 'textDecoration', this.value);">{HDR_TXT_DECOR_OPTIONS}</select>
@@ -57,7 +93,7 @@
<span class="hh">Color:</span> <input type="text" size="7" maxlength="7" id="blk_border_color" name="blk_border_color" value="{BLK_BORDER_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('blk_border_color','.bbody','borderColor');" title="{L_COLOR_PICKER}"><img src="{ROOT_PATH}modules/cs/images/color.gif" alt="{L_COLOR_PICKER}" title="{L_COLOR_PICKER}"></a>
</p>
<p><span class="hh">Background Color:</span> <input type="text" size="7" maxlength="7" id="blk_bg_color" name="blk_bg_color" value="{BLK_BG_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('blk_bg_color','.bbody','backgroundColor');" title="{L_COLOR_PICKER}"><img src="{ROOT_PATH}modules/cs/images/color.gif" alt="{L_COLOR_PICKER}" title="{L_COLOR_PICKER}"></a></p>
- <p><span class="hh">Background Image:</span> <input type="text" name="blk_bg_img" value="{BLK_BG_IMG}" onBlur="changecss('.bbody', 'backgroundImage', 'url('+this.value+')');"></p>
+ <p><span class="hh">Background Image:</span> <input type="text" id="blk_bg_img" name="blk_bg_img" value="{BLK_BG_IMG}" onBlur="changecss('.bbody', 'backgroundImage', 'url('+this.value+')');"> <a href="javascript:;" id="blk_bg_img_link" onmousedown="pickbg('blk_bg_img', '.bbody');">Select</a></p>
<p><span class="hh">Background Style</span> <select name="blk_bg_style" onChange="toggleBgStyle('.bbody', this.value, '#dyn_blk_position');">{BLK_BG_STYLE_OPTIONS}</select></p>
<div id="dyn_blk_position" style="display:none; margin-right:250px;"><p align="right">{BLK_BG_POSITION_OPTIONS}</p></div>
<p>
@@ -82,7 +118,6 @@
<p><label for="track_color"><span class="hh">{L_TRACK_COLOR}:</span></label> <input type="text" size="7" maxlength="7" id="track_color" name="track_color" value="{TRACK_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('track_color','body', 'scrollbarTrackColor');" title="{L_COLOR_PICKER}"><img src="{ROOT_PATH}modules/cs/images/color.gif" alt="{L_COLOR_PICKER}" title="{L_COLOR_PICKER}"></a></p>
</dd>
</dl>
- <br class="clear" />
<fieldset class="submit-buttons">
<input type="reset" value="{L_RESET}" name="reset" class="button2" />
@@ -90,29 +125,48 @@
</fieldset>
</form>
- <br />
+
<div id="colorpicker">
<div id="pickertitle"><a href="#" class="closePicker">X</a></div>
<div id="picker"></div>
<div id="pickeroptions">
<input type="text" id="pickercolor" size="7" maxlength="7" value="#123456" /><br />
<input type="button" value="{L_SELECT}" onClick="selectColor();" />
- <input type="button" class="closePicker" value="{L_CANCEL}" />
+ <input type="button" id="closeColorPicker" value="{L_CANCEL}" />
</div>
</div>
+
+ <div id="bgpicker">
+ <select multiple size="12" id="bg_options" name="bg_options"><option value="">{L_NONE}</option>{BG_IMG_OPTIONS}</select><br />
+ <input type="button" id="selectBg" value="{L_SELECT}" />
+ <input type="button" id="closeBgPicker" value="{L_CANCEL}" />
+ </div>
</div>
<script type="text/javascript" charset="utf-8">
$(document).ready(
function() {
$('#save').show().click(function(){ serializeBlocks(); });
- $('.closePicker').click(function() { closePicker(); });
+ $('#closeColorPicker').click(function() { closeColorPicker(); });
$('#myAccordion').Accordion({headerSelector:'dt', panelSelector:'dd', activeClass:'myAccordionActive', hoverClassn:'myAccordionHover', panelHeight:350, speed:300});
- $('.bhdr').hover(function(){$(this).css('cursor','move');},function(){$(this).css('cursor', '{MAIN_POINTER}');});
+ $('.sortable .bhdr h4').hover(function(){$(this).css('cursor','move');},function(){$(this).css('cursor', '{MAIN_POINTER}');});
$('.arrows').hide();
- $('#left').Sortable({accept:'sortable',handle:'.bhdr', activeclass:'sortableactive', hoverclass:'sortablehover', helperclass:'sorthelper', float: true, opacity:0.7, revert:true, tolerance:'intersect', cursorAt:{left:20,top:20}});
- $('#center').Sortable({accept:'sortable',handle:'.bhdr', activeclass:'sortableactive', hoverclass:'sortablehover', helperclass:'sorthelper', float: true, opacity:0.7, revert:true, tolerance:'intersect', cursorAt:{left:20,top:20}});
- $('#right').Sortable({accept:'sortable',handle:'.bhdr', activeclass:'sortableactive', hoverclass:'sortablehover', helperclass:'sorthelper', float: true, opacity:0.7, revert:true, tolerance:'intersect', cursorAt:{left:20,top:20}});
+ $('#left').Sortable({accept:'sortable',handle:'.bhdr', activeclass:'sortableactive', hoverclass:'sortablehover', helperclass:'sorthelper', float: true, opacity:0.7, revert:true, fit:false, tolerance:'intersect', cursorAt:{left:20,top:20}});
+ $('#center').Sortable({accept:'sortable',handle:'.bhdr', activeclass:'sortableactive', hoverclass:'sortablehover', helperclass:'sorthelper', float: true, opacity:0.7, revert:true, fit:false, tolerance:'intersect', cursorAt:{left:20,top:20}});
+ $('#right').Sortable({accept:'sortable',handle:'.bhdr', activeclass:'sortableactive', hoverclass:'sortablehover', helperclass:'sorthelper', float: true, opacity:0.7, revert:true, fit:false, tolerance:'intersect', cursorAt:{left:20,top:20}});
}
);
+$(window).bind('load', function() {
+ var preload = new Array();
+ var img = document.createElement('img');
+ $('#bg_options > option').each(function() {
+ s = $(this).val();
+ preload.push(s);
+ });
+ $(img).bind('load', function() {
+ if(preload[0]) {
+ this.src = preload.shift();
+ }
+ }).trigger('load');
+});
</script>
\ No newline at end of file
Modified: mods/cms/trunk/styles/prosilver/template/custom_style_view.html
===================================================================
--- mods/cms/trunk/styles/prosilver/template/custom_style_view.html 2007-10-13 15:03:02 UTC (rev 68)
+++ mods/cms/trunk/styles/prosilver/template/custom_style_view.html 2007-10-13 20:11:58 UTC (rev 69)
@@ -4,45 +4,6 @@
<!-- INCLUDE cs_generator.html -->
- <div class="panel bg2">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <div class="left-box" style="width:20%;">
- <!-- IF BLOCK_OPTIONS -->
- <form method="post"{S_MAX_BLOCKS}>
- <fieldset class="submit-buttons">
- <select name="block">{BLOCK_OPTIONS}</select>
- <select name="side">
- <!-- IF S_LEFT --><option value="l">{L_LEFT}</option><!-- ENDIF -->
- <option value="c">{L_CENTER}</option>
- <!-- IF S_RIGHT --><option value="r">{L_RIGHT}</option><!-- ENDIF -->
- </select>
- {HIDDEN_FIELDS}<input type="submit" name="submit" id="submit" value="{L_SUBMIT}" class="button1" />
- </fieldset>
- <input type="hidden" name="action" value="add">
- </form>
- <!-- ENDIF -->
- </div>
-
- <div class="left-box" style="width:55%;">
- <fieldset class="submit-buttons">
- <input type="button" name="save" id="save" style="display:none;" value="{L_SAVE_CHANGES}" class="button1" />
- </fieldset>
- </div>
-
- <!-- IF PREVIEW_OPTIONS -->
- <div class="left-box" style="width:25%;">
- <form method="post">
- <fieldset class="submit-buttons">
- {L_PREVIEW_AS}: <select name="user_perm">{PREVIEW_OPTIONS}</select>
- {HIDDEN_FIELDS}<input type="submit" name="submit" id="submit" value="{L_SUBMIT}" class="button1" />
- </fieldset>
- </form>
- </div>
- <!-- ENDIF -->
- <span class="corners-bottom"><span></span></span></div>
- </div>
-
<!-- ENDIF -->
<div class="panel" id="container">
@@ -55,13 +16,12 @@
<!-- IF .t_block2 > 1 -->
<!-- BEGIN t_block2 -->
<!-- IF t_block2.S_SELECTED -->
- <li class="activetab"><a href="{t_block2.U_TITLE}"><b><span class="tabbg">{t_block2.L_TITLE}</span><b><em></em></a></li>
+ <li class="activetab"><a href="{t_block2.U_TITLE}"><b><span class="tabbg">{t_block2.L_TITLE}</span><b></a></li>
<!-- ELSE -->
- <li><a href="{t_block2.U_TITLE}"><b><span class="tabbg">{t_block2.L_TITLE}</span><b><em></em></a></li>
+ <li><a href="{t_block2.U_TITLE}"><b><span class="tabbg">{t_block2.L_TITLE}</span><b></a></li>
<!-- ENDIF -->
<!-- END t_block2 -->
<!-- ENDIF -->
- <!-- IF U_CUSTOMIZE --><li><a href="javascript:void(0);" onClick="$('#ifxElement').FoldToggle(500, 20);"><b><span>{L_CUSTOMIZE}</span><b><em></em></a></li><!-- ENDIF -->
</ul>
</div>
<br clear="both" />
@@ -71,12 +31,18 @@
<!-- IF S_MODE eq 'viewprofile' -->
<div class="bcontainer" id="avatar">
+ <div class="drop">
+ <div class="bhdr">
+ <div class="inner"><span class="corners-top"><span></span></span>
+ <h4>{USERNAME}</h4>
+ <span class="corners-bottom"><span></span></span></div>
+ </div>
+ </div>
<div class="{SEPARATOR} shadow">
- <div class="bbody top_border<!-- IF ONLINE_IMG --> online<!-- ENDIF -->">
+ <div class="bbody top_border<!-- IF S_ONLINE --> online<!-- ENDIF -->">
<div class="inner"><span class="corners-top"><span></span></span>
<dl class="left-box">
- <span>{USERNAME}</span>
<dt>{AVATAR_IMG}</dt>
<!-- IF RANK_TITLE --><dd style="text-align: center;">{RANK_TITLE}</dd><!-- ENDIF -->
<!-- IF RANK_IMG --><dd style="text-align: center;">{RANK_IMG}</dd><!-- ENDIF -->
@@ -382,4 +348,4 @@
</div>
-<!-- INCLUDE overall_footer.html -->
+<!-- INCLUDE overall_footer.html -->
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2007-10-13 15:03:00
|
Revision: 68
http://thevr.svn.sourceforge.net/thevr/?rev=68&view=rev
Author: andrewbelcher
Date: 2007-10-13 08:03:02 -0700 (Sat, 13 Oct 2007)
Log Message:
-----------
Made changes to the way permissions work and how the sites are managed. There are also a couple database edits that will need including... The sites table needs the field 'all' added to it (added to thevr_pms_install.php) and the user table needs the field 'user_sites' added to it (will update thevr_pms_install.php when I've finished sorting it).
@TODO
Create a UCP panel to manage site memberships.
Modified Paths:
--------------
mods/pms/branches/permissions/adm/style/acp_sites.html
mods/pms/branches/permissions/common.php
mods/pms/branches/permissions/includes/acp/acp_sites.php
mods/pms/branches/permissions/includes/auth.php
mods/pms/branches/permissions/includes/functions_thevr.php
mods/pms/branches/permissions/includes/session.php
mods/pms/branches/permissions/includes/ucp/ucp_groups.php
mods/pms/branches/permissions/language/en/acp/sites.php
mods/pms/branches/permissions/thevr_pms_install.php
Modified: mods/pms/branches/permissions/adm/style/acp_sites.html
===================================================================
--- mods/pms/branches/permissions/adm/style/acp_sites.html 2007-09-27 07:24:47 UTC (rev 67)
+++ mods/pms/branches/permissions/adm/style/acp_sites.html 2007-10-13 15:03:02 UTC (rev 68)
@@ -39,6 +39,11 @@
<dd><select id="style" name="style"><option value="0">{L_DEFAULT_STYLE}</option>{S_STYLES_OPTIONS}</select></dd>
</dl>
+ <dl>
+ <dt><label for="all">{L_SITE_ALL}:</label><br /><span>{L_SITE_ALL_EXPLAIN}</span></dt>
+ <dd><label><input type="radio" class="radio" name="all" value="1"<!-- IF SITE_ALL --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
+ <label><input type="radio" class="radio" name="all" value="0"<!-- IF not SITE_ALL --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
+ </dl>
<!-- IF S_EDIT_SITE -->
<input id="id" name="id" type="hidden" value="{SITE_ID}">
<!-- ENDIF -->
Modified: mods/pms/branches/permissions/common.php
===================================================================
--- mods/pms/branches/permissions/common.php 2007-09-27 07:24:47 UTC (rev 67)
+++ mods/pms/branches/permissions/common.php 2007-10-13 15:03:02 UTC (rev 68)
@@ -229,38 +229,39 @@
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
- if (empty($row['site_id']))
- {
- $config['site_id'] = -1;
- }
- else
- {
- // Store the information in a config array $config
- $config = array_merge($config, array(
- 'site_id' => $row['site_id'],
- 'site_uname' => $row['name'],
- 'site_desc' => $row['description'],
- 'site_group_id' => $row['group_id'],
- 'site_home' => $row['home'],
- 'site_domain' => $domain,
- 'site_file' => $filename,
- 'site_vars' => $vars)
+if (empty($row['site_id']))
+{
+ $config['site_id'] = -1;
+}
+else
+{
+ // Store the information in a config array $config
+ $config = array_merge($config, array(
+ 'site_id' => $row['site_id'],
+ 'site_uname' => $row['name'],
+ 'site_desc' => $row['description'],
+ 'site_group_id' => $row['group_id'],
+ 'site_home' => $row['home'],
+ 'site_all' => $row['site_all'],
+ 'site_domain' => $domain,
+ 'site_file' => $filename,
+ 'site_vars' => $vars)
- );
- }
- //Fetch site specific config data:
- $sql = 'SELECT * FROM ' . SITE_CONFIG_TABLE . ' WHERE site_id = ' . $config['site_id'] . ' AND overide=1';
- $result = $db->sql_query($sql);
+ );
+}
+//Fetch site specific config data:
+$sql = 'SELECT * FROM ' . SITE_CONFIG_TABLE . ' WHERE site_id = ' . $config['site_id'] . ' AND overide=1';
+$result = $db->sql_query($sql);
- while ( $row = $db->sql_fetchrow($result) )
- {
- $config[$row['config_name']] = $row['config_value'];
- }
+while ( $row = $db->sql_fetchrow($result) )
+{
+ $config[$row['config_name']] = $row['config_value'];
+}
- if ($domain_bits[0] == 'm' OR $domain_bits[0] == 'mobile')
- {
- define('MOBILE_VERSION', true);
- }
+if ($domain_bits[0] == 'm' OR $domain_bits[0] == 'mobile')
+{
+ define('MOBILE_VERSION', true);
+}
/***** END *****/
?>
\ No newline at end of file
Modified: mods/pms/branches/permissions/includes/acp/acp_sites.php
===================================================================
--- mods/pms/branches/permissions/includes/acp/acp_sites.php 2007-09-27 07:24:47 UTC (rev 67)
+++ mods/pms/branches/permissions/includes/acp/acp_sites.php 2007-10-13 15:03:02 UTC (rev 68)
@@ -58,6 +58,7 @@
$site['group_id'] = request_var('group_id', $temp_data['group_id']);
$site['home'] = request_var('home', $temp_data['home']);
$site['style'] = request_var('style', $temp_data['default_style']);
+ $site['all'] = request_var('all', $temp_data['site_all']);
}
else
{
@@ -67,6 +68,7 @@
$site['group_id'] = request_var('group_id', '');
$site['home'] = request_var('home', '');
$site['style'] = request_var('style', '');
+ $site['all'] = request_var('all', '');
}
if ($submit)
@@ -130,6 +132,7 @@
'SITE_DESC' => $site['desc'],
'SITE_GROUP' => $site['group_id'],
'SITE_HOME' => $site['home'],
+ 'SITE_ALL' => $site['site_all'],
'S_STYLES_OPTIONS' => $styles_list
));
break;
@@ -448,7 +451,9 @@
'description' => $data['desc'],
'group_id' => $data['group_id'],
'home' => $data['home'],
- 'default_style' => $data['style'] );
+ 'default_style' => $data['style'],
+ 'site_all' => $data['all']
+ );
//Insert into sites table.
if( !$db->sql_query('INSERT INTO '.SITES_TABLE.' '.$db->sql_build_array('INSERT',$site_ins)))
@@ -485,7 +490,8 @@
'description' => $data['desc'],
'group_id' => $data['group_id'],
'home' => $data['home'],
- 'default_style' => $data['style']
+ 'default_style' => $data['style'],
+ 'site_all' => $data['all']
);
$sql = 'UPDATE '.SITES_TABLE.' SET '.$db->sql_build_array('UPDATE',$site_upd).' WHERE site_id='.$id;
Modified: mods/pms/branches/permissions/includes/auth.php
===================================================================
--- mods/pms/branches/permissions/includes/auth.php 2007-09-27 07:24:47 UTC (rev 67)
+++ mods/pms/branches/permissions/includes/auth.php 2007-10-13 15:03:02 UTC (rev 68)
@@ -94,6 +94,7 @@
*/
function acl_get($opt, $f = 0)
{
+ global $user;
$negate = false;
if (strpos($opt, '!') === 0)
@@ -124,13 +125,14 @@
if (isset($this->acl[$f]) && isset($this->acl[$f][$this->acl_options['local'][$opt]]))
{
$this->cache[$f][$opt] |= $this->acl[$f][$this->acl_options['local'][$opt]];
- }
- if (check_forum($f) == false)
- {
- $this->cache[$f][$opt] = false;
}
-
+ // Check that this forum is on this site's list
+ // If not, set permissions to false
+ if (!in_array($f, $user->data['site_forums']))
+ {
+ $this->cache[$f][$opt] = false;
+ }
}
}
Modified: mods/pms/branches/permissions/includes/functions_thevr.php
===================================================================
--- mods/pms/branches/permissions/includes/functions_thevr.php 2007-09-27 07:24:47 UTC (rev 67)
+++ mods/pms/branches/permissions/includes/functions_thevr.php 2007-10-13 15:03:02 UTC (rev 68)
@@ -8,50 +8,6 @@
*
*/
-function check_forum($f)
-{
- global $db, $config, $auth;
- if (isset($auth->cache['site_forums']))
- {
- $forums = $auth->cache['site_forums'];
-
- if (isset($forums[$f]))
- {
- return (isset($forums[$f])) ? true: false;
- }
- else
- {
- return false;
- }
- }
- else
- {
- $sql = 'SELECT f.forum_id, f.site_id
- FROM ' . FORUMS_TABLE . " as f
- WHERE ( f.site_id = '" . $config['site_id'] . "'
- OR f.site_id = '0' )";
- $result = $db->sql_query($sql);
-
- $forums = array();
-
- while ($row = $db->sql_fetchrow($result))
- {
- $forums[$row['forum_id']] = $row['site_id'];
- }
-
- $auth->cache['site_forums'] = $forums;
-
- if (isset($forums[$f]))
- {
- return (isset($forums[$f])) ? true: false;
- }
- else
- {
- return false;
- }
- }
-}
-
/*********************************
* Basically a clone of the function style_select().
* It creates a select box from all the sites
Modified: mods/pms/branches/permissions/includes/session.php
===================================================================
--- mods/pms/branches/permissions/includes/session.php 2007-09-27 07:24:47 UTC (rev 67)
+++ mods/pms/branches/permissions/includes/session.php 2007-10-13 15:03:02 UTC (rev 68)
@@ -1567,6 +1567,27 @@
}
}
+ // Set up the user's site/forum access
+ if ($config['site_all'] == true && isset($this->data['user_sites']))
+ {
+ $sql_site_list = '(0,' . $config['site_id'] . ',' . $this->data['user_sites'] . ')';
+ }
+ else
+ {
+ $sql_site_list = '(0,' . $config['site_id'] . ')';
+ }
+
+ $sql_where = '
+ WHERE f.site_id IN ' . $sql_site_list;
+
+ $sql = 'SELECT f.forum_id
+ FROM ' . FORUMS_TABLE . ' AS f' . $sql_where;
+ $result = $db->sql_query($sql);
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $this->data['site_forums'][] = $row['forum_id'];
+ }
+
return;
}
Modified: mods/pms/branches/permissions/includes/ucp/ucp_groups.php
===================================================================
--- mods/pms/branches/permissions/includes/ucp/ucp_groups.php 2007-09-27 07:24:47 UTC (rev 67)
+++ mods/pms/branches/permissions/includes/ucp/ucp_groups.php 2007-10-13 15:03:02 UTC (rev 68)
@@ -12,7 +12,7 @@
* ucp_groups
* @package ucp
*/
-class ucp_groups
+class ucp_sites
{
var $u_action;
Modified: mods/pms/branches/permissions/language/en/acp/sites.php
===================================================================
--- mods/pms/branches/permissions/language/en/acp/sites.php 2007-09-27 07:24:47 UTC (rev 67)
+++ mods/pms/branches/permissions/language/en/acp/sites.php 2007-10-13 15:03:02 UTC (rev 68)
@@ -83,6 +83,8 @@
'SITE_EDIT_EXPLAIN' => '',
'SITE_ADMIN' => 'Manage Sites',
'SITE_ADMIN_EXPLAIN' => '',
+ 'SITE_ALL' => 'All Sites',
+ 'SITE_ALL_EXPLAIN' => 'Makes this site display forums from all sites that the user is a member of.',
'SITE_DELETE' => 'Delete site',
'SITE_DELETE_EXPLAIN' => '',
'SITE_URL_ADMIN' => 'Manage Site URLs',
Modified: mods/pms/branches/permissions/thevr_pms_install.php
===================================================================
--- mods/pms/branches/permissions/thevr_pms_install.php 2007-09-27 07:24:47 UTC (rev 67)
+++ mods/pms/branches/permissions/thevr_pms_install.php 2007-10-13 15:03:02 UTC (rev 68)
@@ -18,12 +18,12 @@
$mode = request_var('mode','');
if($auth->acl_gets('acl_a_server'))
-{
+{
trigger_error('You are nto permitted to install this modification');
}
switch ($mode)
-{
+{
case 'install':
/***
* Create New Tables
@@ -34,15 +34,15 @@
`config_value` varchar(255) character set latin1 collate latin1_general_ci NOT NULL,
`is_dynamic` tinyint(1) NOT NULL,
`site_id` mediumint(4) NOT NULL,
- `overide` tinyint(1) NOT NULL
+ `overide` tinyint(1) NOT NULL,
)";
if($db->sql_query($sql))
- {
+ {
$success[] = 'site_config';
}
else
- {
+ {
define('ERROR',true);
}
@@ -72,6 +72,7 @@
`group_id` mediumint(8) NOT NULL default '1',
`home` varchar(255) character set utf8 collate utf8_bin NOT NULL default 'index.php',
`default_style` tinyint(4) NOT NULL default '1',
+ `site_all` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`site_id`)
)";
@@ -86,9 +87,9 @@
if(defined('ERROR'))
- {
+ {
foreach($success as $i => $table)
- {
+ {
$sql = "DROP TABLE " . $table_prefix . $table . " ";
@$db->sql_query($sql);
}
@@ -238,7 +239,7 @@
);
if(!$db->sql_multi_insert(MODULES_TABLE,$modules))
- {
+ {
foreach($success as $i => $table)
{
$sql = "DROP TABLE " . $table_prefix . $table . " ";
@@ -307,7 +308,7 @@
$errors[] = $user->lang['SITE_ADD_FAIL'];
}
else
- {
+ {
$success2[] = 'sites';
}
$data['site_id'] = $db->sql_nextid;
@@ -327,7 +328,7 @@
}
if (defined('ERROR'))
- {
+ {
foreach($success as $i => $table)
{
$sql = "DROP TABLE " . $table_prefix . $table . " ";
@@ -348,7 +349,7 @@
@$db->sql_query($sql);
foreach($modules as $array)
- {
+ {
$sql = 'DELETE
FROM ' . MODULES_TABLE . '
WHERE left_id = ' . $array['left_id'];
@@ -356,9 +357,9 @@
}
foreach($success2 as $ob)
- {
+ {
switch ($ob)
- {
+ {
case 'groups':
group_delete($group_id);
break;
@@ -379,7 +380,7 @@
$error = '';
foreach($errors as $message)
- {
+ {
$error .= $message;
}
@@ -392,7 +393,7 @@
case 'update':
$vers = request_var('v','');
switch ($vers)
- {
+ {
case '':
default:
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dac...@us...> - 2007-09-27 07:24:46
|
Revision: 67
http://thevr.svn.sourceforge.net/thevr/?rev=67&view=rev
Author: dachebodt
Date: 2007-09-27 00:24:47 -0700 (Thu, 27 Sep 2007)
Log Message:
-----------
Cleaning up
Removed Paths:
-------------
mods/cms/trunk/modules/cs/template/cs_css.html
mods/cms/trunk/modules/cs/template/cs_generator.html
mods/cms/trunk/modules/cs/template/custom_style_view.html
mods/cms/trunk/styles/prosilver/template/cs_css.html
Deleted: mods/cms/trunk/modules/cs/template/cs_css.html
===================================================================
--- mods/cms/trunk/modules/cs/template/cs_css.html 2007-09-27 07:09:25 UTC (rev 66)
+++ mods/cms/trunk/modules/cs/template/cs_css.html 2007-09-27 07:24:47 UTC (rev 67)
@@ -1,189 +0,0 @@
-<style type="text/css" media="all">
-html, body {
- scrollbar-3dlight-color:#{3DLIGHT_COLOR};
- scrollbar-arrow-color:{ARROW_COLOR};
- scrollbar-base-color:{BASE_COLOR};
- scrollbar-darkshadow-color:{DARK_SHADOW_COLOR};
- scrollbar-face-color:{FACE_COLOR};
- scrollbar-highlight-color:{HIGHLIGHT_COLOR};
- scrollbar-shadow-color:{SHADOW_COLOR};
- scrollbar-track-color:{TRACK_COLOR};
- background-color:{BG_COLOR};
- background-image:url({BG_IMG});
- background-repeat: {BG_STYLE};
- background-position: {BG_POSITION};
- background-attachment: {BG_ATTACHMENT};
- cursor: {MAIN_POINTER};
-}
-#container {
- border-width: {BORDER}px;
- border-style: {BORDER_STYLE};
- border-color: {BORDER_COLOR};
- margin:0px;
- width:100%;
- height: auto;
-}
-
-div.bcontainer {
- min-height: 100%;
- width: 100%;
- margin-top: 12px;
- margin-left: 4px;
- margin-right: -5px;
- position: relative;
- left:3px;
- top:3px;
-}
-.bhdr {
- padding: 4px 6px 4px 16px;
- border-width: {HDR_BORDER}px;
- border-bottom: {HDR_BORDER_BOTTOM}px;
- border-style: {HDR_BORDER_STYLE};
- border-color: {HDR_BORDER_COLOR};
- font-family: {HDR_FONT};
- font-size: {HDR_FONT_SIZE}px;
- color: {HDR_FONT_COLOR};
- background-color: {HDR_BG_COLOR};
- background-image: url({HDR_BG_IMG});
- background-repeat: {HDR_BG_STYLE};
- background-position: {HDR_BG_POSITION};
- position: relative;
- left:-4px;
- top:-4px;
- font-weight:bold;
- margin:0px;
- height: 25px;
- width:auto;
-}
-.bbody {
- border-width: {BLK_BORDER}px;
- border-top: {BLK_BORDER_TOP}px;
- border-style: {BLK_BORDER_STYLE};
- border-color: {BLK_BORDER_COLOR};
- font-family: {BLK_FONT};
- font-size: {BLK_FONT_SIZE}px;
- color: {BLK_FONT_COLOR};
- background-color: {BLK_BG_COLOR};
- background-image: url({BLK_BG_IMG});
- background-repeat: {BLK_BG_STYLE};
- background-position: {BLK_BG_POSITION};
- position: relative;
- left:-4px;
- top:-4px;
- margin:0px;
- padding:6px;
- width:auto;
-}
-
-.drop, .shadow {
- margin-top:5px;
- margin-right: 0px;
- background-color:{DROP_SHADOW_COLOR};
- opacity:0.{BG_OPACITY};
- filter:alpha(opacity={BG_OPACITY});
- -khtml-opacity: 0.{BG_OPACITY};
- -moz-opacity: 0.{BG_OPACITY};
-}
-.no-drop { margin-top:-1px; }
-
-.bhdr a {
- color:{HDR_LINK_COLOR};
- text-decoration:{HDR_TXT_DECOR};
-}
-.bhdr a:hover {
- color:{HDR_HOV_COLOR};
- text-decoration:{HDR_HOV_DECOR};
-}
-.bbody a {
- color:{BLK_LINK_COLOR};
- text-decoration:{BLK_TXT_DECOR};
-}
-.bbody a:hover {
- color:{BLK_HOV_COLOR};
- text-decoration:{BLK_HOV_DECOR};
-}
-.bhdr, .bbody a { cursor: {LINK_POINTER}; }
-.top_border {border-top-width: {BLK_BORDER}px;}
-.bbody hr {color:{BLK_BORDER_COLOR};clear:left;}
-img {position:relative;}
-#signature {text-align:center;}
-#container td { padding:10px;}
-h4 {float:left;}
-#left {padding-right:0px}
-#right {padding-left:0px}
-#center {padding:0px}
-#left,#right,#center {height:40px;min-height:25px};
-form {display:inline;}
-#cs_nav_menu {float:right;margin:0px;margin-top:-2px;width:100%;display:block;white-space:nowrap;}
-.row1 {background-color:{BLK_BG_COLOR};color:{BLK_FONT_COLOR};border:{BORDER}px solid {BORDER_COLOR};}
-.avatar {float:left;margin:10px;padding-left:15px;width:100%;max-width:140px;display:block}
-.info {float:left;max-width:100%;display:inline;}
-.edit {float: right; background-color:{BLK_BG_COLOR};padding:4px;margin-right:-3px;z-index:1;}
-.cs_menu {
- padding:0;
- margin:0;
- float:right;
- display:inline;
- text-align:right;
- list-style-type:none;
- white-space:nowrap;
-}
-.cs_menu li {
- float:left;
- min-width:80px;
- }
-.cs_menu a {
- position:relative;
- display:block;
- text-decoration:none;
- min-width:80px;
- float:left;
- }
-* html .cs_menu a {
- width:80px;
- }
-.cs_menu a span {
- display:block;
- color:{BLK_LINK_COLOR};
- text-align:center;
- padding:4px 5px;
- cursor:pointer;
- }
-* html .cs_menu a span {
- width:80px;
- cursor:hand;
- w\idth:66px;
- }
-.cs_menu a em {
- display:none;
- }
-.cs_menu a:hover {
- background:#fff;
- }
-.cs_menu a:hover span {
- color:{BLK_HOV_COLOR};
- background:{BLK_BG_COLOR};
- }
-.cs_menu a:hover em {
- display:block;
- overflow:hidden;
- border:6px solid #06a;
- border-color:{BLK_BG_COLOR} transparent;
- border-width:6px 6px 0 6px;
- position:absolute;
- left:50%;
- margin-left:-6px;
- }
-.clearfix:after {
- content: ".";
- display:block;
- height:0;
- clear:both;
- visibility:hidden;
-}
-.clearfix {display:inline-block;}
-/* Hides from IE-mac \*/
-*html .clearfix{height: 1%;}
-.clearfix {display:block;}
-/*End Hide from IE-mac */
-</style>
Deleted: mods/cms/trunk/modules/cs/template/cs_generator.html
===================================================================
--- mods/cms/trunk/modules/cs/template/cs_generator.html 2007-09-27 07:09:25 UTC (rev 66)
+++ mods/cms/trunk/modules/cs/template/cs_generator.html 2007-09-27 07:24:47 UTC (rev 67)
@@ -1,110 +0,0 @@
-<div id="ifxElement">
- <form method="post" name="generator" id="generator">
- <input type="hidden" name="action" value="save_changes" />
-
- <dl id="myAccordion">
- <dt class="title">OVERVIEW</dt>
- <dd class="content">
- <p>Overview</p>
- </dd>
-
- <dt class="title">GENERAL</dt>
- <dd class="content">
- <p><span class="hh">Page Border:</span><select name="border" onChange="changecss('#container', 'borderWidth', this.value);">{BORDER_OPTIONS}</select>
- <span class="hh">Style:</span><select name="border_style" onChange="changecss('#container', 'borderStyle', this.value);">{BORDER_STYLE_OPTIONS}</select>
- <span class="hh">Color:</span> <input type="text" size="7" maxlength="7" id="border_color" name="border_color" value="{BORDER_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('border_color', '#container', 'borderColor');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a>
- </p>
- <p><span class="hh">Background Color:</span> <input type="text" size="7" maxlength="7" id="bg_color" name="bg_color" value="{BG_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('bg_color','#container','backgroundColor');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a></p>
- <p><span class="hh">Background Image:</span> <input type="text" size="25" id="bg_img" name="bg_img" value="{BG_IMG}" onBlur="changecss('#container', 'backgroundImage', 'url('+this.value+')');"> <a href="#" onClick="album_popup('#container', 'bg_img','bg_select_link','bg_select');" id="bg_select_link">Select</a></p>
- <p><span class="hh">Background Attachment:</span> <select name="bg_attachment" onChange="changecss('#container', 'backgroundAttachment', this.value);">{BG_ATTACH_OPTIONS}</select> <span id="opacity" class="hh">Opacity: <select name="bg_opacity" onChange="changecss('.drop', 'opacity', '0.'+this.value+'; -moz-opacity:0.'+this.value+'; filter:alpha(opacity='+this.value+')');">{BG_OPACITY_OPTIONS}</select></span></p>
- <p><span class="hh">Background Style</span> <select name="bg_style" onChange="toggleBgStyle('body', this.value, '#dyn_position');">{BG_STYLE_OPTIONS}</select></p>
- <div id="dyn_position" style="display:none; margin-right:250px;"><p align="right">{BG_POSITION_OPTIONS}</p></div>
- <p><span class="hh">Block Type:</span> <select name="drop_shadow_option" onChange="toggle_shadow(this.value);">{DROP_SHADOW_OPTIONS}</select> <span class="hh">Shadow Color:</span> <input type="text" size="7" maxlength="7" id="drop_shadow_color" name="drop_shadow_color" value="{DROP_SHADOW_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('drop_shadow_color','.drop, .shadow','backgroundColor')" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a></p>
- <p><span class="hh">{L_MAIN_POINTER}</span> <select name="main_pointer" onChange="point_prev(this.value, 'main_prev'); changecss('body', 'cursor', this.value);">{MAIN_POINTER_OPTIONS}</select> <span id="main_prev" style="display:none;"></span></p>
- <p><span class="hh">{L_LINK_POINTER}</span> <select name="link_pointer" onChange="point_prev(this.value, 'link_prev'); changecss('.bhdr a', 'cursor', this.value); changecss('.bbody a', 'cursor', this.value);">{LINK_POINTER_OPTIONS}</select> <span id="link_prev" style="display:none;"></span></p>
- </dd>
-
- <dt class="title">BLOCK HEADER</dt>
- <dd class="content">
- <p><span class="hh">Font:</span> <select name="hdr_font" onChange="changecss('.bhdr', 'fontFamily', this.value);">{HDR_FONT_FAMILY_OPTIONS}</select>
- <span class="hh">Size:</span> <select name="hdr_font_size" onChange="changecss('.bhdr', 'fontSize', this.value, 'px', false, '');">{HDR_FONT_SIZE_OPTIONS}</select>
- <span class="hh">Color:</span> <input type="text" size="7" maxlength="7" id="hdr_font_color" name="hdr_font_color" value="{HDR_FONT_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('hdr_font_color','.bhdr','color')" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a>
- </p>
- <p><span class="hh">Block Border:</span> <select id="hdr_border" name="hdr_border" onChange="changecss('.bhdr', 'borderWidth', this.value);">{HDR_BORDER_OPTIONS}</select>
- <span class="hh">Style:</span><select id="hdr_border_style" name="hdr_border_style" onChange="changecss('.bhdr', 'borderStyle', this.value);">{HDR_BORDER_STYLE_OPTIONS}</select>
- <span class="hh">Color:</span> <input type="text" size="7" maxlength="7" id="hdr_border_color" name="hdr_border_color" value="{HDR_BORDER_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('hdr_border_color','.bhdr','borderColor')" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a>
- </p>
- <p><span class="hh">Background Color:</span> <input type="text" size="7" maxlength="7" id="hdr_bg_color" name="hdr_bg_color" value="{HDR_BG_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('hdr_bg_color','.bhdr','backgroundColor');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a></p>
- <p><span class="hh">Background Image:</span> <input type="text" name="hdr_bg_img" value="{HDR_BG_IMG}" onBlur="changecss('.bhdr', 'backgroundImage', 'url('+this.value+')');"></p>
- <p><span class="hh">Background Style:</span> <select name="hdr_bg_style" onChange="toggleBgStyle('.bhdr', this.value, '#dyn_hdr_position');">{HDR_BG_STYLE_OPTIONS}</select></p>
- <div id="dyn_hdr_position" style="display:none; margin-right:250px;"><p align="right">{HDR_BG_POSITION_OPTIONS}</p></div>
- <p><span class="hh">{L_LINK_DECOR}:</span> <select name="hdr_txt_decor" onChange="changecss('.bhdr a', 'textDecoration', this.value);">{HDR_TXT_DECOR_OPTIONS}</select>
- <span class="hh">{L_LINK_COLOR}:</span> <input type="text" size="7" maxlength="7" id="hdr_link_color" name="hdr_link_color" value="{HDR_LINK_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('hdr_link_color','.bhdr a','color');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a>
- </p>
- <p><span class="hh">{L_HOV_DECOR}:</span> <select name="hdr_hov_decor" onChange="changecss('.bhdr a:hover', 'textDecoration', this.value);">{HDR_HOV_DECOR_OPTIONS}</select>
- <span class="hh">{L_HOV_COLOR}:</span> <input type="text" size="7" maxlength="7" id="hdr_hov_color" name="hdr_hov_color" value="{HDR_HOV_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('hdr_hov_color','.bhdr a:hover','color');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a>
- </p>
- </dd>
-
- <dt class="title">BLOCK BODY</dt>
- <dd class="content">
- <p><span class="hh">Font:</span> <select name="blk_font" onChange="changecss('.bbody', 'fontFamily', this.value);">{BLK_FONT_FAMILY_OPTIONS}</select>
- <span class="hh">Size:</span> <select name="blk_font_size" onChange="changecss('.bbody', 'fontSize', this.value);">{BLK_FONT_SIZE_OPTIONS}</select>
- <span class="hh">Color:</span> <input type="text" size="7" maxlength="7" id="blk_font_color" name="blk_font_color" value="{BLK_FONT_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('blk_font_color','.bbody','color');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a>
- </p>
- <p><span class="hh">Block Border:</span> <select id="blk_border" name="blk_border" onChange="changecss('.bbody', 'borderWidth', this.value, 'px', false, '');">{BLK_BORDER_OPTIONS}</select>
- <span class="hh">Style:</span><select id="blk_border_style" name="blk_border_style" onChange="changecss('.bbody', 'borderStyle', this.value);">{BLK_BORDER_STYLE_OPTIONS}</select>
- <span class="hh">Color:</span> <input type="text" size="7" maxlength="7" id="blk_border_color" name="blk_border_color" value="{BLK_BORDER_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('blk_border_color','.bbody','borderColor');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a>
- </p>
- <p><span class="hh">Background Color:</span> <input type="text" size="7" maxlength="7" id="blk_bg_color" name="blk_bg_color" value="{BLK_BG_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('blk_bg_color','.bbody','backgroundColor');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a></p>
- <p><span class="hh">Background Image:</span> <input type="text" name="blk_bg_img" value="{BLK_BG_IMG}" onBlur="changecss('.bbody', 'backgroundImage', 'url('+this.value+')');"></p>
- <p><span class="hh">Background Style</span> <select name="blk_bg_style" onChange="toggleBgStyle('.bbody', this.value, '#dyn_blk_position');">{BLK_BG_STYLE_OPTIONS}</select></p>
- <div id="dyn_blk_position" style="display:none; margin-right:250px;"><p align="right">{BLK_BG_POSITION_OPTIONS}</p></div>
- <p>
- <span class="hh">[L_LINK_DECOR}:</span> <select name="blk_txt_decor" onChange="changecss('.bbody a', 'textDecoration', this.value);">{BLK_TXT_DECOR_OPTIONS}</select>
- <span class="hh">{L_LINK_COLOR}:</span> <input type="text" size="7" maxlength="7" id="blk_link_color" name="blk_link_color" value="{BLK_LINK_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('blk_link_color','.bbody a','color');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a>
- </p>
- <p>
- <span class="hh">{L_HOV_DECOR}:</span> <select name="blk_hov_decor" onChange="changecss('.bbody a:hover', 'textDecoration', this.value);">{BLK_HOV_DECOR_OPTIONS}</select>
- <span class="hh">{L_HOV_COLOR}:</span> <input type="text" size="7" maxlength="7" id="blk_hov_color" name="blk_hov_color" value="{BLK_HOV_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('blk_hov_color','.bbody a','color', 'hover');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a>
- </p>
- </dd>
-
- <dt class="title">SCROLLERS</dt>
- <dd class="content">
- <div style="float:right;margin:30px"><textarea name="" cols="1" rows="15"></textarea></div>
- <p><label for="face_color"><span class="hh">Face Color:</span></label> <input type="text" size="7" maxlength="7" id="face_color" name="face_color" value="{FACE_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('face_color','body', 'scrollbarFaceColor');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a></p>
- <p><label for="highlight_color"><span class="hh">Highlight Color:</span></label> <input type="text" size="7" maxlength="7" id="highlight_color" name="highlight_color" value="{HIGHLIGHT_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('highlight_color','body', 'scrollbarHighlightColor');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a></p>
- <p><label for="3Dlight_color"><span class="hh">3D Light Color:</span></label> <input type="text" size="7" maxlength="7" id="dlight_color" name="dlight_color" value="{3DLIGHT_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('dlight_color','body', 'scrollbar3dLightColor');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a></p>
- <p><label for="shadow_color"><span class="hh">Shadow Color:</span></label> <input type="text" size="7" maxlength="7" id="shadow_color" name="shadow_color" value="{SHADOW_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('shadow_color','body', 'scrollbarShadowColor');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a></p>
- <p><label for="dark_shadow_color"><span class="hh">Dark Shadow Color:</span></label> <input type="text" size="7" maxlength="7" id="dark_shadow_color" name="dark_shadow_color" value="{DARK_SHADOW_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('dark_shadow_color','body', 'scrollbarDarkShadowColor')" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a></p>
- <p><label for="arrow_color"><span class="hh">Arrow Color:</span></label> <input type="text" size="7" maxlength="7" id="arrow_color" name="arrow_color" value="{ARROW_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('arrow_color','body', 'scrollbarArrowColor');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a></p>
- <p><label for="track_color"><span class="hh">Track Color:</span></label> <input type="text" size="7" maxlength="7" id="track_color" name="track_color" value="{TRACK_COLOR}"> <a href="javascript:;" onmousedown="pickcolor('track_color','body', 'scrollbarTrackColor');" title="Color Picker"><img src="images/color.gif" alt="Color Picker" title="Color Picker"></a></p>
- </dd>
- </dl>
- <br class="clearfix" />
- <p align="center"><input type="reset" name="reset" value="{L_RESET}" /> <input type="submit" name="submit" id="submit" value="{L_SAVE_CHANGES}" /></p>
- </form>
- <br />
- <div id="colorpicker">
- <div id="pickertitle"><a href="#" class="closePicker">X</a></div>
- <div id="picker"></div>
- <div id="pickeroptions">
- <input type="text" id="pickercolor" size="7" maxlength="7" value="#123456" /><br />
- <input type="button" value="{L_SELECT}" onClick="selectColor();" />
- <input type="button" class="closePicker" value="{L_CANCEL}" />
- </div>
- </div>
-</div>
-
-<script type="text/javascript" charset="utf-8">
-$(document).ready(
- function() {
- $('#save').show().click(function(){ serializeBlocks(); });
- $('.closePicker').click(function() { closePicker(); });
- $('#myAccordion').Accordion({headerSelector:'dt', panelSelector:'dd', activeClass:'myAccordionActive', hoverClassn:'myAccordionHover', panelHeight:350, speed:300});
- $(".bhdr").hover(function(){$(this).css('cursor','move');},function(){$(this).css('cursor', '{MAIN_POINTER}');});
- $('.sortable').Sortable({accept:'sortable',handle:'.bhdr', activeclass:'sortableactive', hoverclass:'sortablehover', helperclass:'sorthelper', opacity:0.7, revert:true, tolerance:'intersect', cursorAt:{left:20,top:20}});
- }
-);
-</script>
\ No newline at end of file
Deleted: mods/cms/trunk/modules/cs/template/custom_style_view.html
===================================================================
--- mods/cms/trunk/modules/cs/template/custom_style_view.html 2007-09-27 07:09:25 UTC (rev 66)
+++ mods/cms/trunk/modules/cs/template/custom_style_view.html 2007-09-27 07:24:47 UTC (rev 67)
@@ -1,298 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<!-- IF U_CUSTOMIZE -->
-
- <!-- INCLUDE cs_generator.html -->
-
-<table border="0" width="95%" vspace="0" hspace="0" style="text-align:center" align="center">
- <tr>
-<!-- IF BLOCK_OPTIONS -->
- <td width="30%">
- <form method="post"{S_MAX_BLOCKS}>
- {HIDDEN_FIELDS}
- <select name="block">{BLOCK_OPTIONS}</select>
- <select name="side">
- <!-- IF S_LEFT --><option value="l">{L_LEFT}</option><!-- ENDIF -->
- <option value="c">{L_CENTER}</option>
- <!-- IF S_RIGHT --><option value="r">{L_RIGHT}</option><!-- ENDIF -->
- </select>
- <input type="submit" value="{L_SUBMIT}">
- <input type="hidden" name="action" value="add">
- </form>
- </td>
-<!-- ENDIF -->
-
- <td width="30%"><input id="save" style="display:none;" type="button" name="save" value="{L_SAVE_CHANGES}" /></td>
-
- <!-- IF PREVIEW_OPTIONS -->
- <td width="40%" style="text-align:right">
- <form method="post">{L_PREVIEW_AS}: <select name="user_perm">{PREVIEW_OPTIONS}</select> <input type="submit" name="preview" value="{L_SUBMIT}" />{HIDDEN_FIELDS}</form>
- </td>
- <!-- ENDIF -->
- </tr>
-</table>
-<!-- ENDIF -->
-
-
-<table border="0" width="100%" vspace="0" hspace="0" id="container">
- <tr>
- <td width="100%" height="10" colspan="{COLSPAN}" style="margin:0px;padding:0px;">
- <div id="cs_nav_menu">
- <ul class="cs_menu">
-
- <!-- IF .t_block2 > 1 -->
- <!-- BEGIN t_block2 -->
- <!-- IF t_block2.S_SELECTED -->
- <li class="activetab"><a href="{t_block2.U_TITLE}"><b><span class="tabbg">{t_block2.L_TITLE}</span><b><em></em></a></li>
- <!-- ELSE -->
- <li><a href="{t_block2.U_TITLE}"><b><span class="tabbg">{t_block2.L_TITLE}</span><b><em></em></a></li>
- <!-- ENDIF -->
- <!-- END t_block2 -->
- <!-- ENDIF -->
- <!-- IF U_CUSTOMIZE --><li><a href="javascript:void(0);" onClick="$('#ifxElement').FoldToggle(500, 20);"><b><span>{L_CUSTOMIZE}</span><b><em></em></a></li><!-- ENDIF -->
- </ul>
- </div>
- </td>
- </tr>
- <tr>
-
- <!-- IF S_LEFT -->
- <td width="{LEFT_WIDTH}" height="100%" valign="top" class="sortable" id="left">
- <div class="bcontainer" id="avatar">
- <div class="{SEPARATOR} shadow">
- <div class="bbody top_border">
- <div>
- <div class="avatar">
- <center>
- <b>{USERNAME}</b><br />
- <!-- IF RANK -->{RANK}<br /><!-- ENDIF -->
- <!-- IF RANK_IMG -->{RANK_IMG}<br /><!-- ENDIF -->
- {AVATAR_IMG}<br />
- <!-- IF ONLINE_IMG -->{ONLINE_IMG}<br /><!-- ENDIF -->
- </center>
- </div>
-
- <div class="info">
- <!-- IF AGE --><b>{L_AGE}</b>: {AGE}<br /><!-- ENDIF -->
- <b>{L_LOCATION}</b>: {LOCATION}<br />
- <b>{L_JOINED}</b> {JOINED}<br />
- <b>{L_VISITED}</b> {VISITED}<br />
- <b>{L_TOTAL_POSTS}: {POSTS}<!-- IF POSTS_PCT neq 0 --><br />[{POSTS_PCT} / {POSTS_DAY}]<!-- ENDIF --><br /><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a>
- </div>
- </div><hr style="clear:both">
-
- <!-- IF U_USE_THEME --><div class="use_theme"><a href="{U_USE_THEME}">{L_USE_THEME}</a></div><!-- ENDIF -->
-
- <div class="connections">
- <!-- IF S_USER_LOGGED_IN and S_ZEBRA -->{CONNECTION_INFO}<br />[ <a href="{U_ADD_FRIEND}">{L_ADD_FRIEND}</a> | <a href="{U_ADD_FOE}">{L_ADD_FOE}</a> ]<!-- ENDIF -->
- </div>
-
- <div class="contact" align="center">
- <!-- IF U_PM --><a href="{U_PM}">{PM_IMG}</a> <!-- ENDIF -->
- <!-- IF U_EMAIL --><a href="{U_EMAIL}">{EMAIL_IMG}</a> <!-- ENDIF -->
- <!-- IF U_MSN --><a href="{U_MSN}" onclick="popup('{U_MSN}', 550, 320); return false">{MSN_IMG}</a> <!-- ENDIF -->
- <!-- IF U_YIM --><a href="{U_YIM}" onclick="popup('{U_YIM}', 780, 550); return false">{YIM_IMG}</a> <!-- ENDIF -->
- <!-- IF U_AIM --><a href="{U_AIM}" onclick="popup('{U_AIM}', 550, 320); return false">{AIM_IMG}</a> <!-- ENDIF -->
- <!-- IF U_ICQ --><a href="{U_ICQ}" onclick="popup('{U_ICQ}', 550, 320); return false">{ICQ_IMG}</a> <!-- ENDIF -->
- <!-- IF U_JABBER and S_JABBER_ENABLED --><a href="{U_JABBER}" onclick="popup('{U_JABBER}', 550, 320); return false">{JABBER_IMG}</a><!-- ELSEIF U_JABBER -->{JABBER_IMG}<!-- ENDIF -->
- </div>
- </div>
- </div>
- </div>
-
- <!-- IF U_USER_ADMIN and not S_PREVIEW_MODE -->
- <div class="bcontainer" id="warning">
- <div class="drop">
- <div class="bhdr">
- <h4>{L_ADMIN_OPTIONS}</h4>
- </div>
- </div>
- <div class="{SEPARATOR} shadow">
- <div class="bbody">
- <!-- IF U_NOTES or U_WARN -->
- {L_WARNINGS}: <b class="gen">{WARNINGS}</b><br />
- [ <a href="{U_NOTES}">{L_VIEW_NOTES}</a> <!-- IF U_WARN --> | <a href="{U_WARN}">{L_WARN_USER}</a> <!-- ENDIF -->]<br />
- <!-- ENDIF -->
- <!-- IF U_SWITCH_PERMISSIONS -->[ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]<br /><!-- ENDIF -->
- [ <a href="{U_USER_ADMIN}">{L_USER_ADMIN}</a> ]
- </div>
- </div>
- </div>
- <!-- ENDIF -->
-
- <!-- BEGIN blockrow_l -->
- <div class="bcontainer sortable" id="{blockrow_l.BLOCK_ID}">
-
- <!-- IF blockrow_l.TITLE || blockrow_l.EDIT_LINKS -->
- <div class="drop">
- <div class="bhdr">
- <h4>{blockrow_l.TITLE}</h4>{blockrow_l.EDIT_LINKS}
- </div>
- </div>
- <!-- ENDIF -->
-
- <div class="{SEPARATOR} shadow">
- <div class="bbody{blockrow_l.CLASS_TOP_BORDER}">
- {blockrow_l.EDIT_FORM}
- {blockrow_l.CONTENT}
- </div>
- </div>
- </div>
- <!-- END blockrow_l -->
- <p> </p>
- </td>
- <!-- ENDIF -->
-
- <td width="{CENTER_WIDTH}" height="100%" valign="top" class="sortable" id="center">
-
- <!-- BEGIN blockrow_c -->
- <div class="bcontainer sortable" id="{blockrow_c.BLOCK_ID}">
-
- <!-- IF blockrow_c.TITLE || blockrow_c.EDIT_LINKS -->
- <div class="drop">
- <div class="bhdr">
- <h4>{blockrow_c.TITLE}</h4>{blockrow_c.EDIT_LINKS}
- </div>
- </div>
- <!-- ENDIF -->
-
- <div class="{SEPARATOR} shadow">
- <div class="bbody{blockrow_c.CLASS_TOP_BORDER}">
- {blockrow_c.EDIT_FORM}
- {blockrow_c.CONTENT}
- </div>
- </div>
- </div>
- <!-- END blockrow_c -->
-
- <!-- IF NO_PLUGIN -->
-
- <!-- IF S_CUSTOM_FIELDS -->
- <div class="bcontainer">
- <div class="drop">
- <div class="bhdr">
- <h4>{L_PROFILE_INFO}</h4>
- </div>
- </div>
- <div class="{SEPARATOR} shadow">
- <div class="bbody">
- <dl>
- <!-- BEGIN custom_fields -->
- <dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd><b class="genmed">{custom_fields.PROFILE_FIELD_VALUE}</b></dd>
- <!-- END custom_fields -->
- </dl>
- </div>
- </div>
- </div>
- <!-- ENDIF -->
-
- <!-- IF SIGNATURE -->
- <div class="bcontainer">
- <div class="drop">
- <div class="bbody top_border" id="signature">
- {SIGNATURE}
- </div>
- </div>
- </div>
- <!-- ENDIF -->
- <!-- ENDIF -->
-
- </td>
-
- <!-- IF S_RIGHT -->
- <td width="{RIGHT_WIDTH}" height="100%" valign="top" class="sortable" id="right">
-
- <!-- IF not S_LEFT -->
- <div class="bcontainer">
- <div class="{SEPARATOR} shadow">
- <div class="bbody top_border">
- <div>
- <div class="avatar">
- <center>
- <b>{USERNAME}</b><br />
- <!-- IF RANK -->{RANK}<br /><!-- ENDIF -->
- <!-- IF RANK_IMG -->{RANK_IMG}<br /><!-- ENDIF -->
- {AVATAR_IMG}<br />
- <!-- IF ONLINE_IMG -->{ONLINE_IMG}<br /><!-- ENDIF -->
- <!-- IF U_SWITCH_PERMISSIONS -->[ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]<br /><!-- ENDIF -->
- </center>
- </div>
-
- <div class="info">
- <!-- IF AGE --><b>{L_AGE}</b>: {AGE}<br /><!-- ENDIF -->
- <b>{L_LOCATION}</b>: {LOCATION}<br />
- <b>{L_JOINED}</b> {JOINED}<br />
- <b>{L_VISITED}</b> {VISITED}<br />
- <b>{L_TOTAL_POSTS}: {POSTS}<!-- IF POSTS_PCT neq 0 --><br />[{POSTS_PCT} / {POSTS_DAY}]<!-- ENDIF --><br /><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a>
- </div>
- </div><hr style="clear:both">
-
- <!-- IF U_USE_THEME --><div class="use_theme"><a href="{U_USE_THEME}">{L_USE_THEME}</a></div><!-- ENDIF -->
-
- <div class="connections">
- <!-- IF S_USER_LOGGED_IN and S_ZEBRA -->{CONNECTION_INFO}<br />[ <a href="{U_ADD_FRIEND}">{L_ADD_FRIEND}</a> | <a href="{U_ADD_FOE}">{L_ADD_FOE}</a> ]<!-- ENDIF -->
- </div>
-
- <div class="contact" align="center">
- <!-- IF U_PM --><a href="{U_PM}">{PM_IMG}</a> <!-- ENDIF -->
- <!-- IF U_EMAIL --><a href="{U_EMAIL}">{EMAIL_IMG}</a> <!-- ENDIF -->
- <!-- IF U_MSN --><a href="{U_MSN}" onclick="popup('{U_MSN}', 550, 320); return false">{MSN_IMG}</a> <!-- ENDIF -->
- <!-- IF U_YIM --><a href="{U_YIM}" onclick="popup('{U_YIM}', 780, 550); return false">{YIM_IMG}</a> <!-- ENDIF -->
- <!-- IF U_AIM --><a href="{U_AIM}" onclick="popup('{U_AIM}', 550, 320); return false">{AIM_IMG}</a> <!-- ENDIF -->
- <!-- IF U_ICQ --><a href="{U_ICQ}" onclick="popup('{U_ICQ}', 550, 320); return false">{ICQ_IMG}</a> <!-- ENDIF -->
- <!-- IF U_JABBER and S_JABBER_ENABLED --><a href="{U_JABBER}" onclick="popup('{U_JABBER}', 550, 320); return false">{JABBER_IMG}</a><!-- ELSEIF U_JABBER -->{JABBER_IMG}<!-- ENDIF -->
- </div>
- </div>
- </div>
- </div>
-
- <!-- IF U_USER_ADMIN && not S_PREVIEW_MODE -->
- <div class="bcontainer">
- <div class="drop">
- <div class="bhdr">
- <h4>{L_ADMIN_OPTIONS}</h4>
- </div>
- </div>
- <div class="{SEPARATOR} shadow">
- <div class="bbody">
- <!-- IF U_NOTES or U_WARN -->
- {L_WARNINGS}: <b class="gen">{WARNINGS}</b><br />
- [ <a href="{U_NOTES}">{L_VIEW_NOTES}</a> <!-- IF U_WARN --> | <a href="{U_WARN}">{L_WARN_USER}</a> <!-- ENDIF -->]<br />
- <!-- ENDIF -->
- <!-- IF U_SWITCH_PERMISSIONS -->[ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]<br /><!-- ENDIF -->
- [ <a href="{U_USER_ADMIN}">{L_USER_ADMIN}</a> ]
- </div>
- </div>
- </div>
- <!-- ENDIF -->
- <!-- ENDIF -->
-
- <!-- BEGIN blockrow_r -->
- <div class="bcontainer sortable" id="{blockrow_r.BLOCK_ID}">
-
- <!-- IF blockrow_r.TITLE || blockrow_r.EDIT_LINKS -->
- <div class="drop">
- <div class="bhdr">
- <h4>{blockrow_r.TITLE}</h4>{blockrow_r.EDIT_LINKS}
- </div>
- </div>
- <!-- ENDIF -->
-
- <div class="{SEPARATOR} shadow">
- <div class="bbody{blockrow_r.CLASS_TOP_BORDER}">
- {blockrow_r.EDIT_FORM}
- {blockrow_r.CONTENT}
- </div>
- </div>
- </div>
- <!-- END blockrow_r -->
- </td>
- <!-- ENDIF -->
-
- </tr>
- <tr>
- <td colspan="{COLSPAN}" height="65"> </td>
- </tr>
-</table>
-
-<!-- INCLUDE overall_footer.html -->
\ No newline at end of file
Deleted: mods/cms/trunk/styles/prosilver/template/cs_css.html
===================================================================
--- mods/cms/trunk/styles/prosilver/template/cs_css.html 2007-09-27 07:09:25 UTC (rev 66)
+++ mods/cms/trunk/styles/prosilver/template/cs_css.html 2007-09-27 07:24:47 UTC (rev 67)
@@ -1,182 +0,0 @@
-<style type="text/css" media="all">
-html, body {
- scrollbar-3dlight-color:#{3DLIGHT_COLOR};
- scrollbar-arrow-color:{ARROW_COLOR};
- scrollbar-base-color:{BASE_COLOR};
- scrollbar-darkshadow-color:{DARK_SHADOW_COLOR};
- scrollbar-face-color:{FACE_COLOR};
- scrollbar-highlight-color:{HIGHLIGHT_COLOR};
- scrollbar-shadow-color:{SHADOW_COLOR};
- scrollbar-track-color:{TRACK_COLOR};
- background-color:{BG_COLOR};
- background-image:url({BG_IMG});
- background-repeat: {BG_STYLE};
- background-position: {BG_POSITION};
- background-attachment: {BG_ATTACHMENT};
- cursor: {MAIN_POINTER};
-}
-#container {
- border-width: {BORDER}px;
- border-style: {BORDER_STYLE};
- border-color: {BORDER_COLOR};
- margin:0px;
- width:100%;
- height: auto;
-}
-
-div.bcontainer {
- min-height: 100%;
- width: 100%;
- margin-top: 12px;
- margin-left: 4px;
- margin-right: -5px;
-}
-.bhdr {
- padding: 4px 6px 4px 16px;
- border-width: {HDR_BORDER}px;
- border-bottom: {HDR_BORDER_BOTTOM}px;
- border-style: {HDR_BORDER_STYLE};
- border-color: {HDR_BORDER_COLOR};
- font-family: {HDR_FONT};
- font-size: {HDR_FONT_SIZE}px;
- color: {HDR_FONT_COLOR};
- background-color: {HDR_BG_COLOR};
- background-image: url({HDR_BG_IMG});
- background-repeat: {HDR_BG_STYLE};
- background-position: {HDR_BG_POSITION};
- font-weight:bold;
- margin-bottom: 4px;
- padding: 0 10px;
-}
-.bbody {
- border-width: {BLK_BORDER}px;
- border-top: {BLK_BORDER_TOP}px;
- border-style: {BLK_BORDER_STYLE};
- border-color: {BLK_BORDER_COLOR};
- font-family: {BLK_FONT};
- font-size: {BLK_FONT_SIZE}px;
- color: {BLK_FONT_COLOR};
- background-color: {BLK_BG_COLOR};
- background-image: url({BLK_BG_IMG});
- background-repeat: {BLK_BG_STYLE};
- background-position: {BLK_BG_POSITION};
- margin-bottom: 4px;
- padding: 0 10px;
-}
-
-.bbody span.corners-top, .bbody span.corners-bottom, .bhdr span.corners-top, .bhdr span.corners-bottom {
- margin: 0 -10px;
-}
-
-.drop, .shadow {
- margin-top:5px;
- margin-right: 0px;
- background-color:{DROP_SHADOW_COLOR};
- opacity:0.{BG_OPACITY};
- filter:alpha(opacity={BG_OPACITY});
- -khtml-opacity: 0.{BG_OPACITY};
- -moz-opacity: 0.{BG_OPACITY};
-}
-.no-drop { margin-top:-1px; }
-
-.bhdr a {
- color:{HDR_LINK_COLOR};
- text-decoration:{HDR_TXT_DECOR};
-}
-.bhdr a:hover {
- color:{HDR_HOV_COLOR};
- text-decoration:{HDR_HOV_DECOR};
-}
-.bbody a {
- color:{BLK_LINK_COLOR};
- text-decoration:{BLK_TXT_DECOR};
-}
-.bbody a:hover {
- color:{BLK_HOV_COLOR};
- text-decoration:{BLK_HOV_DECOR};
-}
-.bhdr, .bbody a { cursor: {LINK_POINTER}; }
-.top_border {border-top-width: {BLK_BORDER}px;}
-.bbody hr {color:{BLK_BORDER_COLOR};clear:left;}
-img {position:relative;}
-#signature {text-align:center;}
-#container td { padding:10px;}
-h4 {float:left;}
-#left {padding-right:0px}
-#right {padding-left:0px}
-#center {padding:0px}
-#left,#right,#center {height:40px;min-height:25px};
-form {display:inline;}
-#cs_nav_menu {float:right;margin:0px;margin-top:-2px;width:100%;display:block;white-space:nowrap;}
-.row1 {background-color:{BLK_BG_COLOR};color:{BLK_FONT_COLOR};border:{BORDER}px solid {BORDER_COLOR};}
-.avatar {float:left;margin:10px;padding-left:15px;width:100%;max-width:140px;display:block}
-.info {float:left;max-width:100%;display:inline;}
-.edit {float: right; background-color:{BLK_BG_COLOR};padding:4px;margin-right:-3px;z-index:2000;cursor:auto;}
-.cs_menu {
- padding:0;
- margin:0;
- float:right;
- display:inline;
- text-align:right;
- list-style-type:none;
- white-space:nowrap;
-}
-.cs_menu li {
- float:left;
- min-width:80px;
- }
-.cs_menu a {
- position:relative;
- display:block;
- text-decoration:none;
- min-width:80px;
- float:left;
- }
-* html .cs_menu a {
- width:80px;
- }
-.cs_menu a span {
- display:block;
- color:{BLK_LINK_COLOR};
- text-align:center;
- padding:4px 5px;
- cursor:pointer;
- }
-* html .cs_menu a span {
- width:80px;
- cursor:hand;
- w\idth:66px;
- }
-.cs_menu a em {
- display:none;
- }
-.cs_menu a:hover {
- background:#fff;
- }
-.cs_menu a:hover span {
- color:{BLK_HOV_COLOR};
- background:{BLK_BG_COLOR};
- }
-.cs_menu a:hover em {
- display:block;
- overflow:hidden;
- border:6px solid #06a;
- border-color:{BLK_BG_COLOR} transparent;
- border-width:6px 6px 0 6px;
- position:absolute;
- left:50%;
- margin-left:-6px;
- }
-.clearfix:after {
- content: ".";
- display:block;
- height:0;
- clear:both;
- visibility:hidden;
-}
-.clearfix {display:inline-block;}
-/* Hides from IE-mac \*/
-*html .clearfix{height: 1%;}
-.clearfix {display:block;}
-/*End Hide from IE-mac */
-</style>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dac...@us...> - 2007-09-27 07:09:22
|
Revision: 66
http://thevr.svn.sourceforge.net/thevr/?rev=66&view=rev
Author: dachebodt
Date: 2007-09-27 00:09:25 -0700 (Thu, 27 Sep 2007)
Log Message:
-----------
+ Major changes to custom style module
+ A few tweaks to forum, search, content and zebra modules
Modified Paths:
--------------
mods/cms/trunk/adm/index.php
mods/cms/trunk/common.php
mods/cms/trunk/includes/functions.php
mods/cms/trunk/includes/functions_display.php
mods/cms/trunk/includes/functions_module.php
mods/cms/trunk/modules/comments/functions_comments.php
mods/cms/trunk/modules/content/cms_content.php
mods/cms/trunk/modules/core/language/en/core.php
mods/cms/trunk/modules/cs/custom_style.php
mods/cms/trunk/modules/cs/custom_style_config.php
mods/cms/trunk/modules/cs/custom_style_grids.php
mods/cms/trunk/modules/cs/functions_blocks_admin.php
mods/cms/trunk/modules/cs/functions_style_generator.php
mods/cms/trunk/modules/cs/gcp_cs.php
mods/cms/trunk/modules/cs/info/acp_cs.php
mods/cms/trunk/modules/cs/info/pro_cs.php
mods/cms/trunk/modules/cs/language/en/common.php
mods/cms/trunk/modules/cs/language/en/style_generator.php
mods/cms/trunk/modules/cs/pro_cs.php
mods/cms/trunk/modules/cs/template/cs.css
mods/cms/trunk/modules/cs/template/stylegenerator.css
mods/cms/trunk/modules/cs/ucp_cs.php
mods/cms/trunk/modules/events/info/grp_events.php
mods/cms/trunk/modules/forums1/info/grp_forums.php
mods/cms/trunk/modules/zebra/pro_zebra.php
mods/cms/trunk/modules/zebra/template/balloons.css
mods/cms/trunk/styles/prosilver/template/cs_generator.html
mods/cms/trunk/styles/prosilver/template/custom_style_view.html
mods/cms/trunk/styles/prosilver/template/overall_header.html
Added Paths:
-----------
mods/cms/trunk/modules/cs/images/color.gif
mods/cms/trunk/modules/cs/info/grp_cs.php
mods/cms/trunk/modules/cs/style.php
mods/cms/trunk/modules/cs/template/stylesheet.css
Modified: mods/cms/trunk/adm/index.php
===================================================================
--- mods/cms/trunk/adm/index.php 2007-09-19 06:04:46 UTC (rev 65)
+++ mods/cms/trunk/adm/index.php 2007-09-27 07:09:25 UTC (rev 66)
@@ -1,519 +1,519 @@
-<?php
-/**
-*
-* @package acp
-* @version $Id: index.php,v 1.70 2007/08/24 14:06:54 acydburn Exp $
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-*/
-define('IN_PHPBB', true);
-define('ADMIN_START', true);
-define('NEED_SID', true);
-
-// Include files
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-require($phpbb_root_path . 'common.' . $phpEx);
-require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
-require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
-
-// Start session management
-$user->session_begin();
-$auth->acl($user->data);
-$user->setup('acp/common');
-// End session management
-
-// Have they authenticated (again) as an admin for this session?
-if (!isset($user->data['session_admin']) || !$user->data['session_admin'])
-{
- login_box('', $user->lang['LOGIN_ADMIN_CONFIRM'], $user->lang['LOGIN_ADMIN_SUCCESS'], true, false);
-}
-
-// Is user any type of admin? No, then stop here, each script needs to
-// check specific permissions but this is a catchall
-if (!$auth->acl_get('a_'))
-{
- trigger_error('NO_ADMIN');
-}
-
-// We define the admin variables now, because the user is now able to use the admin related features...
-define('IN_ADMIN', true);
-$phpbb_admin_path = './';
-
-// Some oft used variables
-$safe_mode = (@ini_get('safe_mode') || @strtolower(ini_get('safe_mode')) == 'on') ? true : false;
-$file_uploads = (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on') ? true : false;
-$module_id = request_var('i', '');
-$mode = request_var('mode', '');
-
-// Set custom template for admin area
-$template->set_custom_template($phpbb_admin_path . 'style', 'admin');
-$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
-
-// the acp template is never stored in the database
-$user->theme['template_storedb'] = false;
-
-// Instantiate new module
-$module = new p_master();
-
-// Instantiate module system and generate list of available modules
-$module->list_modules('acp');
-
-// Select the active module
-$module->set_active($module_id, $mode);
-
-// Assign data to the template engine for the list of modules
-// We do this before loading the active module for correct menu display in trigger_error
-$module->assign_tpl_vars(append_sid("{$phpbb_admin_path}index.$phpEx"));
-
-// Set custom template path
-$tpl_path = $phpbb_root_path . "modules/$module->p_dir/template";
-$mtemplate->set_custom_template($tpl_path, $module->p_dir);
-
-// Load and execute the relevant module
-$module->load_active();
-
-// Generate the page
-adm_page_header($module->get_page_title());
-
-$template->set_filenames(array(
- 'body' => $module->get_tpl_name())
-);
-
-adm_page_footer();
-
-/**
-* Header for acp pages
-*/
-function adm_page_header($page_title)
-{
- global $config, $db, $user, $template;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID;
-
- if (defined('HEADER_INC'))
- {
- return;
- }
-
- define('HEADER_INC', true);
-
- // gzip_compression
- if ($config['gzip_compress'])
- {
- if (@extension_loaded('zlib') && !headers_sent())
- {
- ob_start('ob_gzhandler');
- }
- }
-
- $template->assign_vars(array(
- 'PAGE_TITLE' => $page_title,
- 'USERNAME' => $user->data['username'],
-
- 'SID' => $SID,
- '_SID' => $_SID,
- 'SESSION_ID' => $user->session_id,
- 'ROOT_PATH' => $phpbb_admin_path,
-
- 'U_LOGOUT' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout'),
- 'U_ADM_INDEX' => append_sid("{$phpbb_admin_path}index.$phpEx"),
- 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"),
-
- 'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
- 'T_SMILIES_PATH' => "{$phpbb_root_path}{$config['smilies_path']}/",
- 'T_AVATAR_PATH' => "{$phpbb_root_path}{$config['avatar_path']}/",
- 'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$config['avatar_gallery_path']}/",
- 'T_ICONS_PATH' => "{$phpbb_root_path}{$config['icons_path']}/",
- 'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/",
- 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/",
-
- 'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
- 'ICON_MOVE_UP_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
- 'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
- 'ICON_MOVE_DOWN_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
- 'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
- 'ICON_EDIT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
- 'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
- 'ICON_DELETE_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
- 'ICON_SYNC' => '<img src="' . $phpbb_admin_path . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
- 'ICON_SYNC_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
-
- 'S_USER_LANG' => $user->lang['USER_LANG'],
- 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
- 'S_CONTENT_ENCODING' => 'UTF-8',
- 'S_CONTENT_FLOW_BEGIN' => ($user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right',
- 'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left',
- ));
-
- // application/xhtml+xml not used because of IE
- header('Content-type: text/html; charset=UTF-8');
-
- header('Cache-Control: private, no-cache="set-cookie"');
- header('Expires: 0');
- header('Pragma: no-cache');
-
- return;
-}
-
-/**
-* Page footer for acp pages
-*/
-function adm_page_footer($copyright_html = true)
-{
- global $db, $config, $template, $user, $auth, $cache;
- global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx;
-
- // Output page creation time
- if (defined('DEBUG'))
- {
- $mtime = explode(' ', microtime());
- $totaltime = $mtime[0] + $mtime[1] - $starttime;
-
- if (!empty($_REQUEST['explain']) && $auth->acl_get('a_') && defined('DEBUG_EXTRA') && method_exists($db, 'sql_report'))
- {
- $db->sql_report('display');
- }
-
- $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress']) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime);
-
- if ($auth->acl_get('a_') && defined('DEBUG_EXTRA'))
- {
- if (function_exists('memory_get_usage'))
- {
- if ($memory_usage = memory_get_usage())
- {
- global $base_memory_usage;
- $memory_usage -= $base_memory_usage;
- $memory_usage = ($memory_usage >= 1048576) ? round((round($memory_usage / 1048576 * 100) / 100), 2) . ' ' . $user->lang['MB'] : (($memory_usage >= 1024) ? round((round($memory_usage / 1024 * 100) / 100), 2) . ' ' . $user->lang['KB'] : $memory_usage . ' ' . $user->lang['BYTES']);
-
- $debug_output .= ' | Memory Usage: ' . $memory_usage;
- }
- }
-
- $debug_output .= ' | <a href="' . build_url() . '&explain=1">Explain</a>';
- }
- }
-
- $template->assign_vars(array(
- 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '',
- 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
- 'S_COPYRIGHT_HTML' => $copyright_html,
- 'VERSION' => $config['version'])
- );
-
- $template->display('body');
-
- garbage_collection();
-
- if (!defined('PHPBB_EMBEDDED'))
- {
- exit;
- }
-}
-
-/**
-* Generate back link for acp pages
-*/
-function adm_back_link($u_action)
-{
- global $user;
- return '<br /><br /><a href="' . $u_action . '">« ' . $user->lang['BACK_TO_PREV'] . '</a>';
-}
-
-/**
-* Build select field options in acp pages
-*/
-function build_select($option_ary, $option_default = false)
-{
- global $user;
-
- $html = '';
- foreach ($option_ary as $value => $title)
- {
- $selected = ($option_default !== false && $value == $option_default) ? ' selected="selected"' : '';
- $html .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$title] . '</option>';
- }
-
- return $html;
-}
-
-/**
-* Build radio fields in acp pages
-*/
-function h_radio($name, &$input_ary, $input_default = false, $id = false, $key = false)
-{
- global $user;
-
- $html = '';
- $id_assigned = false;
- foreach ($input_ary as $value => $title)
- {
- $selected = ($input_default !== false && $value == $input_default) ? ' checked="checked"' : '';
- $html .= '<label><input type="radio" name="' . $name . '"' . (($id && !$id_assigned) ? ' id="' . $id . '"' : '') . ' value="' . $value . '"' . $selected . (($key) ? ' accesskey="' . $key . '"' : '') . ' class="radio" /> ' . $user->lang[$title] . '</label>';
- $id_assigned = true;
- }
-
- return $html;
-}
-
-/**
-* Build configuration template for acp configuration pages
-*/
-function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
-{
- global $user, $module;
-
- $tpl = '';
- $name = 'config[' . $config_key . ']';
-
- switch ($tpl_type[0])
- {
- case 'text':
- case 'password':
- $size = (int) $tpl_type[1];
- $maxlength = (int) $tpl_type[2];
-
- $tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="' . $name . '" value="' . $new[$config_key] . '" />';
- break;
-
- case 'dimension':
- $size = (int) $tpl_type[1];
- $maxlength = (int) $tpl_type[2];
-
- $tpl = '<input id="' . $key . '" type="text"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="config[' . $config_key . '_height]" value="' . $new[$config_key . '_height'] . '" /> x <input type="text"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="config[' . $config_key . '_width]" value="' . $new[$config_key . '_width'] . '" />';
- break;
-
- case 'textarea':
- $rows = (int) $tpl_type[1];
- $cols = (int) $tpl_type[2];
-
- $tpl = '<textarea id="' . $key . '" name="' . $name . '" rows="' . $rows . '" cols="' . $cols . '">' . $new[$config_key] . '</textarea>';
- break;
-
- case 'radio':
- $key_yes = ($new[$config_key]) ? ' checked="checked"' : '';
- $key_no = (!$new[$config_key]) ? ' checked="checked"' : '';
-
- $tpl_type_cond = explode('_', $tpl_type[1]);
- $type_no = ($tpl_type_cond[0] == 'disabled' || $tpl_type_cond[0] == 'enabled') ? false : true;
-
- $tpl_no = '<label><input type="radio" name="' . $name . '" value="0"' . $key_no . ' class="radio" /> ' . (($type_no) ? $user->lang['NO'] : $user->lang['DISABLED']) . '</label>';
- $tpl_yes = '<label><input type="radio" id="' . $key . '" name="' . $name . '" value="1"' . $key_yes . ' class="radio" /> ' . (($type_no) ? $user->lang['YES'] : $user->lang['ENABLED']) . '</label>';
-
- $tpl = ($tpl_type_cond[0] == 'yes' || $tpl_type_cond[0] == 'enabled') ? $tpl_yes . $tpl_no : $tpl_no . $tpl_yes;
- break;
-
- case 'select':
- case 'custom':
-
- $return = '';
-
- if (isset($vars['method']))
- {
- $call = array($module->module, $vars['method']);
- }
- else if (isset($vars['function']))
- {
- $call = $vars['function'];
- }
- else
- {
- break;
- }
-
- if (isset($vars['params']))
- {
- $args = array();
- foreach ($vars['params'] as $value)
- {
- switch ($value)
- {
- case '{CONFIG_VALUE}':
- $value = $new[$config_key];
- break;
-
- case '{KEY}':
- $value = $key;
- break;
- }
-
- $args[] = $value;
- }
- }
- else
- {
- $args = array($new[$config_key], $key);
- }
-
- $return = call_user_func_array($call, $args);
-
- if ($tpl_type[0] == 'select')
- {
- $tpl = '<select id="' . $key . '" name="' . $name . '">' . $return . '</select>';
- }
- else
- {
- $tpl = $return;
- }
-
- break;
-
- default:
- break;
- }
-
- if (isset($vars['append']))
- {
- $tpl .= $vars['append'];
- }
-
- return $tpl;
-}
-
-/**
-* Going through a config array and validate values, writing errors to $error.
-*/
-function validate_config_vars($config_vars, &$cfg_array, &$error)
-{
- global $phpbb_root_path, $user;
-
- foreach ($config_vars as $config_name => $config_definition)
- {
- if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
- {
- continue;
- }
-
- if (!isset($config_definition['validate']))
- {
- continue;
- }
-
- // Validate a bit. ;) String is already checked through request_var(), therefore we do not check this again
- switch ($config_definition['validate'])
- {
- case 'bool':
- $cfg_array[$config_name] = ($cfg_array[$config_name]) ? 1 : 0;
- break;
-
- case 'int':
- $cfg_array[$config_name] = (int) $cfg_array[$config_name];
- break;
-
- // Absolute path
- case 'script_path':
- if (!$cfg_array[$config_name])
- {
- break;
- }
-
- $destination = str_replace('\\', '/', $cfg_array[$config_name]);
-
- if ($destination !== '/')
- {
- // Adjust destination path (no trailing slash)
- if (substr($destination, -1, 1) == '/')
- {
- $destination = substr($destination, 0, -1);
- }
-
- $destination = str_replace(array('../', './'), '', $destination);
-
- if ($destination[0] != '/')
- {
- $destination = '/' . $destination;
- }
- }
-
- $cfg_array[$config_name] = trim($destination);
-
- break;
-
- // Absolute path
- case 'lang':
- if (!$cfg_array[$config_name])
- {
- break;
- }
-
- $cfg_array[$config_name] = basename($cfg_array[$config_name]);
-
- if (!file_exists($phpbb_root_path . 'language/' . $cfg_array[$config_name] . '/'))
- {
- $error[] = $user->lang['WRONG_DATA_LANG'];
- }
- break;
-
- // Relative path (appended $phpbb_root_path)
- case 'rpath':
- case 'rwpath':
- if (!$cfg_array[$config_name])
- {
- break;
- }
-
- $destination = $cfg_array[$config_name];
-
- // Adjust destination path (no trailing slash)
- if (substr($destination, -1, 1) == '/' || substr($destination, -1, 1) == '\\')
- {
- $destination = substr($destination, 0, -1);
- }
-
- $destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination);
- if ($destination && ($destination[0] == '/' || $destination[0] == "\\"))
- {
- $destination = '';
- }
-
- $cfg_array[$config_name] = trim($destination);
-
- // Path being relative (still prefixed by phpbb_root_path), but with the ability to escape the root dir...
- case 'path':
- case 'wpath':
-
- if (!$cfg_array[$config_name])
- {
- break;
- }
-
- $cfg_array[$config_name] = trim($cfg_array[$config_name]);
-
- // Make sure no NUL byte is present...
- if (strpos($cfg_array[$config_name], "\0") !== false || strpos($cfg_array[$config_name], '%00') !== false)
- {
- $cfg_array[$config_name] = '';
- break;
- }
-
- if (!file_exists($phpbb_root_path . $cfg_array[$config_name]))
- {
- $error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]);
- }
-
- if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !is_dir($phpbb_root_path . $cfg_array[$config_name]))
- {
- $error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]);
- }
-
- // Check if the path is writable
- if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath')
- {
- if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !@is_writable($phpbb_root_path . $cfg_array[$config_name]))
- {
- $error[] = sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $cfg_array[$config_name]);
- }
- }
-
- break;
- }
- }
-
- return;
-}
-
+<?php
+/**
+*
+* @package acp
+* @version $Id: index.php,v 1.70 2007/08/24 14:06:54 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+*/
+define('IN_PHPBB', true);
+define('ADMIN_START', true);
+define('NEED_SID', true);
+
+// Include files
+$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
+require($phpbb_root_path . 'common.' . $phpEx);
+require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
+require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
+
+// Start session management
+$user->session_begin();
+$auth->acl($user->data);
+$user->setup('acp/common');
+// End session management
+
+// Have they authenticated (again) as an admin for this session?
+if (!isset($user->data['session_admin']) || !$user->data['session_admin'])
+{
+ login_box('', $user->lang['LOGIN_ADMIN_CONFIRM'], $user->lang['LOGIN_ADMIN_SUCCESS'], true, false);
+}
+
+// Is user any type of admin? No, then stop here, each script needs to
+// check specific permissions but this is a catchall
+if (!$auth->acl_get('a_'))
+{
+ trigger_error('NO_ADMIN');
+}
+
+// We define the admin variables now, because the user is now able to use the admin related features...
+define('IN_ADMIN', true);
+$phpbb_admin_path = './';
+
+// Some oft used variables
+$safe_mode = (@ini_get('safe_mode') || @strtolower(ini_get('safe_mode')) == 'on') ? true : false;
+$file_uploads = (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on') ? true : false;
+$module_id = request_var('i', '');
+$mode = request_var('mode', '');
+
+// Set custom template for admin area
+$template->set_custom_template($phpbb_admin_path . 'style', 'admin');
+$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
+
+// the acp template is never stored in the database
+$user->theme['template_storedb'] = false;
+
+// Instantiate new module
+$module = new p_master();
+
+// Instantiate module system and generate list of available modules
+$module->list_modules('acp');
+
+// Select the active module
+$module->set_active($module_id, $mode);
+
+// Assign data to the template engine for the list of modules
+// We do this before loading the active module for correct menu display in trigger_error
+$module->assign_tpl_vars(append_sid("{$phpbb_admin_path}index.$phpEx"));
+
+// Set custom template path
+$tpl_path = $phpbb_root_path . "modules/$module->p_dir/template";
+$mtemplate->set_custom_template($tpl_path, $module->p_dir);
+
+// Load and execute the relevant module
+$module->load_active();
+
+// Generate the page
+adm_page_header($module->get_page_title());
+
+$template->set_filenames(array(
+ 'body' => $module->get_tpl_name())
+);
+
+adm_page_footer();
+
+/**
+* Header for acp pages
+*/
+function adm_page_header($page_title)
+{
+ global $config, $db, $user, $template;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID;
+
+ if (defined('HEADER_INC'))
+ {
+ return;
+ }
+
+ define('HEADER_INC', true);
+
+ // gzip_compression
+ if ($config['gzip_compress'])
+ {
+ if (@extension_loaded('zlib') && !headers_sent())
+ {
+ ob_start('ob_gzhandler');
+ }
+ }
+
+ $template->assign_vars(array(
+ 'PAGE_TITLE' => $page_title,
+ 'USERNAME' => $user->data['username'],
+
+ 'SID' => $SID,
+ '_SID' => $_SID,
+ 'SESSION_ID' => $user->session_id,
+ 'ROOT_PATH' => $phpbb_admin_path,
+
+ 'U_LOGOUT' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout'),
+ 'U_ADM_INDEX' => append_sid("{$phpbb_admin_path}index.$phpEx"),
+ 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"),
+
+ 'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
+ 'T_SMILIES_PATH' => "{$phpbb_root_path}{$config['smilies_path']}/",
+ 'T_AVATAR_PATH' => "{$phpbb_root_path}{$config['avatar_path']}/",
+ 'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$config['avatar_gallery_path']}/",
+ 'T_ICONS_PATH' => "{$phpbb_root_path}{$config['icons_path']}/",
+ 'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/",
+ 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/",
+
+ 'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
+ 'ICON_MOVE_UP_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
+ 'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
+ 'ICON_MOVE_DOWN_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
+ 'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
+ 'ICON_EDIT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
+ 'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
+ 'ICON_DELETE_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
+ 'ICON_SYNC' => '<img src="' . $phpbb_admin_path . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
+ 'ICON_SYNC_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
+
+ 'S_USER_LANG' => $user->lang['USER_LANG'],
+ 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
+ 'S_CONTENT_ENCODING' => 'UTF-8',
+ 'S_CONTENT_FLOW_BEGIN' => ($user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right',
+ 'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left',
+ ));
+
+ // application/xhtml+xml not used because of IE
+ header('Content-type: text/html; charset=UTF-8');
+
+ header('Cache-Control: private, no-cache="set-cookie"');
+ header('Expires: 0');
+ header('Pragma: no-cache');
+
+ return;
+}
+
+/**
+* Page footer for acp pages
+*/
+function adm_page_footer($copyright_html = true)
+{
+ global $db, $config, $template, $user, $auth, $cache;
+ global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+
+ // Output page creation time
+ if (defined('DEBUG'))
+ {
+ $mtime = explode(' ', microtime());
+ $totaltime = $mtime[0] + $mtime[1] - $starttime;
+
+ if (!empty($_REQUEST['explain']) && $auth->acl_get('a_') && defined('DEBUG_EXTRA') && method_exists($db, 'sql_report'))
+ {
+ $db->sql_report('display');
+ }
+
+ $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress']) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime);
+
+ if ($auth->acl_get('a_') && defined('DEBUG_EXTRA'))
+ {
+ if (function_exists('memory_get_usage'))
+ {
+ if ($memory_usage = memory_get_usage())
+ {
+ global $base_memory_usage;
+ $memory_usage -= $base_memory_usage;
+ $memory_usage = ($memory_usage >= 1048576) ? round((round($memory_usage / 1048576 * 100) / 100), 2) . ' ' . $user->lang['MB'] : (($memory_usage >= 1024) ? round((round($memory_usage / 1024 * 100) / 100), 2) . ' ' . $user->lang['KB'] : $memory_usage . ' ' . $user->lang['BYTES']);
+
+ $debug_output .= ' | Memory Usage: ' . $memory_usage;
+ }
+ }
+
+ $debug_output .= ' | <a href="' . build_url() . '&explain=1">Explain</a>';
+ }
+ }
+
+ $template->assign_vars(array(
+ 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '',
+ 'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
+ 'S_COPYRIGHT_HTML' => $copyright_html,
+ 'VERSION' => $config['version'])
+ );
+
+ $template->display('body');
+
+ garbage_collection();
+
+ if (!defined('PHPBB_EMBEDDED'))
+ {
+ exit;
+ }
+}
+
+/**
+* Generate back link for acp pages
+*/
+function adm_back_link($u_action)
+{
+ global $user;
+ return '<br /><br /><a href="' . $u_action . '">« ' . $user->lang['BACK_TO_PREV'] . '</a>';
+}
+
+/**
+* Build select field options in acp pages
+*/
+function build_select($option_ary, $option_default = false)
+{
+ global $user;
+
+ $html = '';
+ foreach ($option_ary as $value => $title)
+ {
+ $selected = ($option_default !== false && $value == $option_default) ? ' selected="selected"' : '';
+ $html .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$title] . '</option>';
+ }
+
+ return $html;
+}
+
+/**
+* Build radio fields in acp pages
+*/
+function h_radio($name, &$input_ary, $input_default = false, $id = false, $key = false)
+{
+ global $user;
+
+ $html = '';
+ $id_assigned = false;
+ foreach ($input_ary as $value => $title)
+ {
+ $selected = ($input_default !== false && $value == $input_default) ? ' checked="checked"' : '';
+ $html .= '<label><input type="radio" name="' . $name . '"' . (($id && !$id_assigned) ? ' id="' . $id . '"' : '') . ' value="' . $value . '"' . $selected . (($key) ? ' accesskey="' . $key . '"' : '') . ' class="radio" /> ' . $user->lang[$title] . '</label>';
+ $id_assigned = true;
+ }
+
+ return $html;
+}
+
+/**
+* Build configuration template for acp configuration pages
+*/
+function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
+{
+ global $user, $module;
+
+ $tpl = '';
+ $name = 'config[' . $config_key . ']';
+
+ switch ($tpl_type[0])
+ {
+ case 'text':
+ case 'password':
+ $size = (int) $tpl_type[1];
+ $maxlength = (int) $tpl_type[2];
+
+ $tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="' . $name . '" value="' . $new[$config_key] . '" />';
+ break;
+
+ case 'dimension':
+ $size = (int) $tpl_type[1];
+ $maxlength = (int) $tpl_type[2];
+
+ $tpl = '<input id="' . $key . '" type="text"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="config[' . $config_key . '_height]" value="' . $new[$config_key . '_height'] . '" /> x <input type="text"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="config[' . $config_key . '_width]" value="' . $new[$config_key . '_width'] . '" />';
+ break;
+
+ case 'textarea':
+ $rows = (int) $tpl_type[1];
+ $cols = (int) $tpl_type[2];
+
+ $tpl = '<textarea id="' . $key . '" name="' . $name . '" rows="' . $rows . '" cols="' . $cols . '">' . $new[$config_key] . '</textarea>';
+ break;
+
+ case 'radio':
+ $key_yes = ($new[$config_key]) ? ' checked="checked"' : '';
+ $key_no = (!$new[$config_key]) ? ' checked="checked"' : '';
+
+ $tpl_type_cond = explode('_', $tpl_type[1]);
+ $type_no = ($tpl_type_cond[0] == 'disabled' || $tpl_type_cond[0] == 'enabled') ? false : true;
+
+ $tpl_no = '<label><input type="radio" name="' . $name . '" value="0"' . $key_no . ' class="radio" /> ' . (($type_no) ? $user->lang['NO'] : $user->lang['DISABLED']) . '</label>';
+ $tpl_yes = '<label><input type="radio" id="' . $key . '" name="' . $name . '" value="1"' . $key_yes . ' class="radio" /> ' . (($type_no) ? $user->lang['YES'] : $user->lang['ENABLED']) . '</label>';
+
+ $tpl = ($tpl_type_cond[0] == 'yes' || $tpl_type_cond[0] == 'enabled') ? $tpl_yes . $tpl_no : $tpl_no . $tpl_yes;
+ break;
+
+ case 'select':
+ case 'custom':
+
+ $return = '';
+
+ if (isset($vars['method']))
+ {
+ $call = array($module->module, $vars['method']);
+ }
+ else if (isset($vars['function']))
+ {
+ $call = $vars['function'];
+ }
+ else
+ {
+ break;
+ }
+
+ if (isset($vars['params']))
+ {
+ $args = array();
+ foreach ($vars['params'] as $value)
+ {
+ switch ($value)
+ {
+ case '{CONFIG_VALUE}':
+ $value = $new[$config_key];
+ break;
+
+ case '{KEY}':
+ $value = $key;
+ break;
+ }
+
+ $args[] = $value;
+ }
+ }
+ else
+ {
+ $args = array($new[$config_key], $key);
+ }
+
+ $return = call_user_func_array($call, $args);
+
+ if ($tpl_type[0] == 'select')
+ {
+ $tpl = '<select id="' . $key . '" name="' . $name . '">' . $return . '</select>';
+ }
+ else
+ {
+ $tpl = $return;
+ }
+
+ break;
+
+ default:
+ break;
+ }
+
+ if (isset($vars['append']))
+ {
+ $tpl .= $vars['append'];
+ }
+
+ return $tpl;
+}
+
+/**
+* Going through a config array and validate values, writing errors to $error.
+*/
+function validate_config_vars($config_vars, &$cfg_array, &$error)
+{
+ global $phpbb_root_path, $user;
+
+ foreach ($config_vars as $config_name => $config_definition)
+ {
+ if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
+ {
+ continue;
+ }
+
+ if (!isset($config_definition['validate']))
+ {
+ continue;
+ }
+
+ // Validate a bit. ;) String is already checked through request_var(), therefore we do not check this again
+ switch ($config_definition['validate'])
+ {
+ case 'bool':
+ $cfg_array[$config_name] = ($cfg_array[$config_name]) ? 1 : 0;
+ break;
+
+ case 'int':
+ $cfg_array[$config_name] = (int) $cfg_array[$config_name];
+ break;
+
+ // Absolute path
+ case 'script_path':
+ if (!$cfg_array[$config_name])
+ {
+ break;
+ }
+
+ $destination = str_replace('\\', '/', $cfg_array[$config_name]);
+
+ if ($destination !== '/')
+ {
+ // Adjust destination path (no trailing slash)
+ if (substr($destination, -1, 1) == '/')
+ {
+ $destination = substr($destination, 0, -1);
+ }
+
+ $destination = str_replace(array('../', './'), '', $destination);
+
+ if ($destination[0] != '/')
+ {
+ $destination = '/' . $destination;
+ }
+ }
+
+ $cfg_array[$config_name] = trim($destination);
+
+ break;
+
+ // Absolute path
+ case 'lang':
+ if (!$cfg_array[$config_name])
+ {
+ break;
+ }
+
+ $cfg_array[$config_name] = basename($cfg_array[$config_name]);
+
+ if (!file_exists($phpbb_root_path . 'language/' . $cfg_array[$config_name] . '/'))
+ {
+ $error[] = $user->lang['WRONG_DATA_LANG'];
+ }
+ break;
+
+ // Relative path (appended $phpbb_root_path)
+ case 'rpath':
+ case 'rwpath':
+ if (!$cfg_array[$config_name])
+ {
+ break;
+ }
+
+ $destination = $cfg_array[$config_name];
+
+ // Adjust destination path (no trailing slash)
+ if (substr($destination, -1, 1) == '/' || substr($destination, -1, 1) == '\\')
+ {
+ $destination = substr($destination, 0, -1);
+ }
+
+ $destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination);
+ if ($destination && ($destination[0] == '/' || $destination[0] == "\\"))
+ {
+ $destination = '';
+ }
+
+ $cfg_array[$config_name] = trim($destination);
+
+ // Path being relative (still prefixed by phpbb_root_path), but with the ability to escape the root dir...
+ case 'path':
+ case 'wpath':
+
+ if (!$cfg_array[$config_name])
+ {
+ break;
+ }
+
+ $cfg_array[$config_name] = trim($cfg_array[$config_name]);
+
+ // Make sure no NUL byte is present...
+ if (strpos($cfg_array[$config_name], "\0") !== false || strpos($cfg_array[$config_name], '%00') !== false)
+ {
+ $cfg_array[$config_name] = '';
+ break;
+ }
+
+ if (!file_exists($phpbb_root_path . $cfg_array[$config_name]))
+ {
+ $error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]);
+ }
+
+ if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !is_dir($phpbb_root_path . $cfg_array[$config_name]))
+ {
+ $error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]);
+ }
+
+ // Check if the path is writable
+ if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath')
+ {
+ if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !@is_writable($phpbb_root_path . $cfg_array[$config_name]))
+ {
+ $error[] = sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $cfg_array[$config_name]);
+ }
+ }
+
+ break;
+ }
+ }
+
+ return;
+}
+
?>
\ No newline at end of file
Modified: mods/cms/trunk/common.php
===================================================================
--- mods/cms/trunk/common.php 2007-09-19 06:04:46 UTC (rev 65)
+++ mods/cms/trunk/common.php 2007-09-27 07:09:25 UTC (rev 66)
@@ -197,6 +197,11 @@
require($phpbb_root_path . 'modules/core/functions_core.' . $phpEx);
$cms_modules = get_installed_modules();
+
+ foreach($cms_modules as $i => $module)
+ {
+ $user->add_mod_lang(array($module => 'common'));
+ }
}
?>
\ No newline at end of file
Modified: mods/cms/trunk/includes/functions.php
===================================================================
--- mods/cms/trunk/includes/functions.php 2007-09-19 06:04:46 UTC (rev 65)
+++ mods/cms/trunk/includes/functions.php 2007-09-27 07:09:25 UTC (rev 66)
@@ -4207,8 +4207,13 @@
if($config['cms_enabled'])
{
+ global $cms_modules;
+
+//print_r($cms_modules);
+
$template->assign_vars(array(
'L_INDEX' => $user->lang['HOME'],
+ 'U_MY_PROFILE' => (in_array('cs', $cms_modules)) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $user->data['user_id']) : '',
'U_SEARCH' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=search'),
'U_SEARCH_SELF' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=search&search_id=egosearch'),
'U_SEARCH_NEW' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=search&search_id=newposts'),
Modified: mods/cms/trunk/includes/functions_display.php
===================================================================
--- mods/cms/trunk/includes/functions_display.php 2007-09-19 06:04:46 UTC (rev 65)
+++ mods/cms/trunk/includes/functions_display.php 2007-09-27 07:09:25 UTC (rev 66)
@@ -1144,8 +1144,8 @@
//return '';
$avatar = 'default_avatar.gif';
$avatar_type = AVATAR_GALLERY;
- $avatar_width = (isset($avatar_width)) ? $avatar_width : $config['avatar_max_width'];
- $avatar_height = (isset($avatar_height)) ? $avatar_height : $config['avatar_max_height'];
+ $avatar_width = 70;
+ $avatar_height = 70;
}
$avatar_img = '';
Modified: mods/cms/trunk/includes/functions_module.php
===================================================================
--- mods/cms/trunk/includes/functions_module.php 2007-09-19 06:04:46 UTC (rev 65)
+++ mods/cms/trunk/includes/functions_module.php 2007-09-27 07:09:25 UTC (rev 66)
@@ -1,851 +1,853 @@
-<?php
-/**
-*
-* @package phpBB3
-* @version $Id: functions_module.php,v 1.58 2007/08/13 12:24:20 acydburn Exp $
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* Class handling all types of 'plugins' (a future term)
-* @package phpBB3
-*/
-class p_master
-{
- var $p_id;
- var $p_class;
- var $p_name;
- var $p_mode;
- var $p_parent;
-
- var $p_dir = '';
- var $active_module = false;
- var $active_module_row_id = false;
- var $acl_forum_id = false;
- var $module_ary = array();
-
- /**
- * List modules
- *
- * This creates a list, stored in $this->module_ary of all available
- * modules for the given class (ucp, mcp and acp). Additionally
- * $this->module_y_ary is created with indentation information for
- * displaying the module list appropriately. Only modules for which
- * the user has access rights are included in these lists.
- */
- function list_modules($p_class)
- {
- global $auth, $db, $user, $cache;
- global $config, $phpbb_root_path, $phpEx;
-
- // Sanitise for future path use, it's escaped as appropriate for queries
- $this->p_class = str_replace(array('.', '/', '\\'), '', basename($p_class));
- $lang_dir = $user->lang_path;
-
- // Get cached modules
- if (($this->module_cache = $cache->get('_modules_' . $this->p_class)) === false)
- {
- // Get modules
- $sql = 'SELECT *
- FROM ' . MODULES_TABLE . "
- WHERE module_class = '" . $db->sql_escape($this->p_class) . "'
- ORDER BY left_id ASC";
- $result = $db->sql_query($sql);
-
- $rows = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $rows[$row['module_id']] = $row;
- }
- $db->sql_freeresult($result);
-
- $this->module_cache = array();
- foreach ($rows as $module_id => $row)
- {
- $this->module_cache['modules'][] = $row;
- $this->module_cache['parents'][$row['module_id']] = $this->get_parents($row['parent_id'], $row['left_id'], $row['right_id'], $rows);
- }
- unset($rows);
-
- $cache->put('_modules_' . $this->p_class, $this->module_cache);
- }
-
- if (empty($this->module_cache))
- {
- $this->module_cache = array('modules' => array(), 'parents' => array());
- }
-
- // We "could" build a true tree with this function - maybe mod authors want to use this...
- // Functions for traversing and manipulating the tree are not available though
- // We might re-structure the module system to use true trees in 3.2.x...
- // $tree = $this->build_tree($this->module_cache['modules'], $this->module_cache['parents']);
-
- // Clean up module cache array to only let survive modules the user can access
- $right_id = false;
- foreach ($this->module_cache['modules'] as $key => $row)
- {
- // Not allowed to view module?
- if (!$this->module_auth($row['module_auth']))
- {
- unset($this->module_cache['modules'][$key]);
- continue;
- }
-
- // Category with no members, ignore
- if (!$row['module_basename'] && ($row['left_id'] + 1 == $row['right_id']))
- {
- unset($this->module_cache['modules'][$key]);
- continue;
- }
-
- // Skip branch
- if ($right_id !== false)
- {
- if ($row['left_id'] < $right_id)
- {
- unset($this->module_cache['modules'][$key]);
- continue;
- }
-
- $right_id = false;
- }
-
- // Not enabled?
- if (!$row['module_enabled'])
- {
- // If category is disabled then disable every child too
- unset($this->module_cache['modules'][$key]);
- $right_id = $row['right_id'];
- continue;
- }
-
- if($row['module_dir'])
- {
- $user->add_mod_lang(array($row['module_dir'] => 'common'));
- }
- }
-
- // Re-index (this is needed, else we are not able to array_slice later)
- $this->module_cache['modules'] = array_merge($this->module_cache['modules']);
-
- // Include MOD _info files for populating language entries within the menus
- $this->add_mod_info($this->p_class);
-
- // Now build the module array, but exclude completely empty categories...
- $right_id = false;
- $names = array();
-
- foreach ($this->module_cache['modules'] as $key => $row)
- {
- // Skip branch
- if ($right_id !== false)
- {
- if ($row['left_id'] < $right_id)
- {
- continue;
- }
-
- $right_id = false;
- }
-
- // Category with no members on their way down (we have to check every level)
- if (!$row['module_basename'])
- {
- $empty_category = true;
-
- // We go through the branch and look for an activated module
- foreach (array_slice($this->module_cache['modules'], $key + 1) as $temp_row)
- {
- if ($temp_row['left_id'] > $row['left_id'] && $temp_row['left_id'] < $row['right_id'])
- {
- // Module there
- if ($temp_row['module_basename'] && $temp_row['module_enabled'])
- {
- $empty_category = false;
- break;
- }
- continue;
- }
- break;
- }
-
- // Skip the branch
- if ($empty_category)
- {
- $right_id = $row['right_id'];
- continue;
- }
- }
-
- $depth = sizeof($this->module_cache['parents'][$row['module_id']]);
-
- // We need to prefix the functions to not create a naming conflict
-
- // Function for building 'url_extra'
- $url_func = '_module_' . $row['module_basename'] . '_url';
-
- // Function for building the language name
- $lang_func = '_module_' . $row['module_basename'] . '_lang';
-
- // Custom function for calling parameters on module init (for example assigning template variables)
- $custom_func = '_module_' . $row['module_basename'];
-
- $names[$row['module_basename'] . '_' . $row['module_mode']][] = true;
-
- $module_row = array(
- 'depth' => $depth,
-
- 'id' => (int) $row['module_id'],
- 'parent' => (int) $row['parent_id'],
- 'cat' => ($row['right_id'] > $row['left_id'] + 1) ? true : false,
-
- 'is_duplicate' => ($row['module_basename'] && sizeof($names[$row['module_basename'] . '_' . $row['module_mode']]) > 1) ? true : false,
-
- 'name' => (string) $row['module_basename'],
- 'mode' => (string) $row['module_mode'],
- 'display' => (int) $row['module_display'],
-
- 'url_extra' => (function_exists($url_func)) ? $url_func($row['module_mode'], $row) : '',
-
- 'lang' => ($row['module_basename'] && function_exists($lang_func)) ? $lang_func($row['module_mode'], $row['module_langname']) : ((!empty($user->lang[$row['module_langname']])) ? $user->lang[$row['module_langname']] : $row['module_langname']),
- 'langname' => $row['module_langname'],
-
- 'left' => $row['left_id'],
- 'right' => $row['right_id'],
- 'module_dir' => $row['module_dir'],
- );
-
- if (function_exists($custom_func))
- {
- $custom_func($row['module_mode'], $module_row);
- }
-
- $this->module_ary[] = $module_row;
- }
-
- $user->lang_path = $lang_dir;
- unset($this->module_cache['modules'], $names);
- }
-
- /**
- * Check if a certain main module is accessible/loaded
- * By giving the module mode you are able to additionally check for only one mode within the main module
- *
- * @param string $module_basename The module base name, for example logs, reports, main (for the mcp).
- * @param mixed $module_mode The module mode to check. If provided the mode will be checked in addition for presence.
- *
- * @return bool Returns true if module is loaded and accessible, else returns false
- */
- function loaded($module_basename, $module_mode = false)
- {
- if (empty($this->loaded_cache))
- {
- $this->loaded_cache = array();
-
- foreach ($this->module_ary as $row)
- {
- if (!$row['name'])
- {
- continue;
- }
-
- if (!isset($this->loaded_cache[$row['name']]))
- {
- $this->loaded_cache[$row['name']] = array();
- }
-
- if (!$row['mode'])
- {
- continue;
- }
-
- $this->loaded_cache[$row['name']][$row['mode']] = true;
- }
- }
-
- if ($module_mode === false)
- {
- return (isset($this->loaded_cache[$module_basename])) ? true : false;
- }
-
- return (!empty($this->loaded_cache[$module_basename][$module_mode])) ? true : false;
- }
-
- /**
- * Check module authorisation
- */
- function module_auth($module_auth, $forum_id = false)
- {
- global $auth, $config;
-
- $module_auth = trim($module_auth);
-
- // Generally allowed to access module if module_auth is empty
- if (!$module_auth)
- {
- return true;
- }
-
- // With the code below we make sure only those elements get eval'd we really want to be checked
- preg_match_all('/(?:
- "[^"\\\\]*(?:\\\\.[^"\\\\]*)*" |
- \'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\' |
- [(),] |
- [^\s(),]+)/x', $module_auth, $match);
-
- $tokens = $match[0];
- for ($i = 0, $size = sizeof($tokens); $i < $size; $i++)
- {
- $token = &$tokens[$i];
-
- switch ($token)
- {
- case ')':
- case '(':
- case '&&':
- case '||':
- case ',':
- break;
-
- default:
- if (!preg_match('#(?:acl_([a-z_]+)(,\$id)?)|(?:\$id)|(?:aclf_([a-z_]+))|(?:cfg_([a-z_]+))|(?:request_([a-z_]+))#', $token))
- {
- $token = '';
- }
- break;
- }
- }
-
- $module_auth = implode(' ', $tokens);
-
- // Make sure $id seperation is working fine
- $module_auth = str_replace(' , ', ',', $module_auth);
-
- $forum_id = ($forum_id === false) ? $this->acl_forum_id : $forum_id;
-
- $is_auth = false;
- eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z_]+)#', '#cfg_([a-z_]+)#', '#request_([a-z_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']', '!empty($_REQUEST[\'\\1\'])'), $module_auth) . ');');
-
- return $is_auth;
- }
-
- /**
- * Set active module
- */
- function set_active($id = false, $mode = false)
- {
- $icat = false;
- $this->active_module = false;
-
- if (request_var('icat', ''))
- {
- $icat = $id;
- $id = request_var('icat', '');
- }
-
- $category = false;
- foreach ($this->module_ary as $row_id => $item_ary)
- {
- // If this is a module and it's selected, active
- // If this is a category and the module is the first within it, active
- // If this is a module and no mode selected, select first mode
- // If no category or module selected, go active for first module in first category
- if (
- (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && (($item_ary['mode'] == $mode && !$item_ary['cat']) || ($icat && $item_ary['cat']))) ||
- ($item_ary['parent'] === $category && !$item_ary['cat'] && !$icat && $item_ary['display']) ||
- (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && !$mode && !$item_ary['cat']) ||
- (!$id && !$mode && !$item_ary['cat'] && $item_ary['display'])
- )
- {
- if ($item_ary['cat'])
- {
- $id = $icat;
- $icat = false;
-
- continue;
- }
-
- $this->p_id = $item_ary['id'];
- $this->p_parent = $item_ary['parent'];
- $this->p_name = $item_ary['name'];
- $this->p_mode = $item_ary['mode'];
- $this->p_left = $item_ary['left'];
- $this->p_right = $item_ary['right'];
- $this->p_dir = $item_ary['module_dir'];
-
- $this->module_cache['parents'] = $this->module_cache['parents'][$this->p_id];
- $this->active_module = $item_ary['id'];
- $this->active_module_row_id = $row_id;
-
- break;
- }
- else if (($item_ary['cat'] && $item_ary['id'] === (int) $id) || ($item_ary['parent'] === $category && $item_ary['cat']))
- {
- $category = $item_ary['id'];
- }
- }
- }
-
- /**
- * Loads currently active module
- *
- * This method loads a given module, passing it the relevant id and mode.
- */
- function load_active($mode = false, $module_url = false, $execute_module = true)
- {
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user;
-
- //$module_path = $phpbb_root_path . 'includes/' . $this->p_class;
- $module_path = $phpbb_root_path . (($this->p_dir) ? 'modules/' . $this->p_dir : 'includes/' . $this->p_class);
-
- $icat = request_var('icat', '');
-
- if ($this->active_module === false)
- {
- trigger_error('Module not accessible', E_USER_ERROR);
- }
-
- if (!class_exists("{$this->p_class}_$this->p_name"))
- {
- if (!file_exists("$module_path/{$this->p_class}_$this->p_name.$phpEx"))
- {
- trigger_error("Cannot find module $module_path/{$this->p_class}_$this->p_name.$phpEx", E_USER_ERROR);
- }
-
- include("$module_path/{$this->p_class}_$this->p_name.$phpEx");
-
- if (!class_exists("{$this->p_class}_$this->p_name"))
- {
- trigger_error("Module file $module_path/{$this->p_class}_$this->p_name.$phpEx does not contain correct class [{$this->p_class}_$this->p_name]", E_USER_ERROR);
- }
-
- if (!empty($mode))
- {
- $this->p_mode = $mode;
- }
-
- // Create a new instance of the desired module ... if it has a
- // constructor it will of course be executed
- $instance = "{$this->p_class}_$this->p_name";
-
- $this->module = new $instance($this);
-
- // We pre-define the action parameter we are using all over the place
- if (defined('IN_ADMIN'))
- {
- // Is first module automatically enabled a duplicate and the category not passed yet?
- if (!$icat && $this->module_ary[$this->active_module_row_id]['is_duplicate'])
- {
- $icat = $this->module_ary[$this->active_module_row_id]['parent'];
- }
-
- // Not being able to overwrite ;)
- $this->module->u_action = append_sid("{$phpbb_admin_path}index.$phpEx", "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
- }
- else
- {
- // If user specified the module url we will use it...
- if ($module_url !== false)
- {
- $this->module->u_action = $module_url;
- }
- else
- {
- $this->module->u_action = $phpbb_root_path . (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name'];
- }
-
- $this->module->u_action = append_sid($this->module->u_action, "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
- }
-
- // Add url_extra parameter to u_action url
- if (!empty($this->module_ary) && $this->active_module !== false && $this->module_ary[$this->active_module_row_id]['url_extra'])
- {
- $this->module->u_action .= $this->module_ary[$this->active_module_row_id]['url_extra'];
- }
-
- // Assign the module path for re-usage
- $this->module->module_path = $module_path . '/';
-
- // Execute the main method for the new instance, we send the module id and mode as parameters
- // Users are able to call the main method after this function to be able to assign additional parameters manually
- if ($execute_module)
- {
- $this->module->main($this->p_name, $this->p_mode);
- }
-
- return;
- }
- }
-
- /**
- * Appending url parameter to the currently active module.
- *
- * This function is called for adding specific url parameters while executing the current module.
- * It is doing the same as the _module_{name}_url() function, apart from being able to be called after
- * having dynamically parsed specific parameters. This allows more freedom in choosing additional parameters.
- * One example can be seen in /includes/mcp/mcp_notes.php - $this->p_master->adjust_url() call.
- *
- * @param string $url_extra Extra url parameters, e.g.: &u=$user_id
- *
- */
- function adjust_url($url_extra)
- {
- if (empty($this->module_ary[$this->active_module_row_id]))
- {
- return;
- }
-
- $row = &$this->module_ary[$this->active_module_row_id];
-
- // We check for the same url_extra in $row['url_extra'] to overcome doubled additions...
- if (strpos($row['url_extra'], $url_extra) === false)
- {
- $row['url_extra'] .= $url_extra;
- }
- }
-
- /**
- * Check if a module is active
- */
- function is_active($id, $mode = false)
- {
- // If we find a name by this id and being enabled we have our active one...
- foreach ($this->module_ary as $row_id => $item_ary)
- {
- if (($item_ary['name'] === $id || $item_ary['id'] === (int) $id) && $item_ary['display'])
- {
- if ($mode === false || $mode === $item_ary['mode'])
- {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * Get parents
- */
- function get_parents($parent_id, $left_id, $right_id, &$all_parents)
- {
- global $db;
-
- $parents = array();
-
- if ($parent_id > 0)
- {
- foreach ($all_parents as $module_id => $row)
- {
- if ($row['left_id'] < $left_id && $row['right_id'] > $right_id)
- {
- $parents[$module_id] = $row['parent_id'];
- }
-
- if ($row['left_id'] > $left_id)
- {
- break;
- }
- }
- }
-
- return $parents;
- }
-
- /**
- * Get tree branch
- */
- function get_branch($left_id, $right_id, $remaining)
- {
- $branch = array();
-
- foreach ($remaining as $key => $row)
- {
- if ($row['left_id'] > $left_id && $row['left_id'] < $right_id)
- {
- $branch[] = $row;
- continue;
- }
- break;
- }
-
- return $branch;
- }
-
- /**
- * Build true binary tree from given array
- * Not in use
- */
- function build_tree(&$modules, &$parents)
- {
- $tree = array();
-
- foreach ($modules as $row)
- {
- $branch = &$tree;
-
- if ($row['parent_id'])
- {
- // Go through the tree to find our branch
- $parent_tree = $parents[$row['module_id']];
-
- foreach ($parent_tree as $id => $value)
- {
- if (!isset($branch[$id]) && isset($branch['child']))
- {
- $branch = &$branch['child'];
- }
- $branch = &$branch[$id];
- }
- $branch = &$branch['child'];
- }
-
- $branch[$row['module_id']] = $row;
- if (!isset($branch[$row['module_id']]['child']))
- {
- $branch[$row['module_id']]['child'] = array();
- }
- }
-
- return $tree;
- }
-
- /**
- * Build navigation structure
- */
- function assign_tpl_vars($module_url, $cat_var = 'i', $mode_var = 'mode', $offset_prefix = '')
- {
- global $template;
-
- $current_id = $right_id = false;
-
- // Make sure the module_url has a question mark set, effectively determining the delimiter to use
- $delim = (strpos($module_url, '?') === false) ? '?' : '&';
-
- $current_padding = $current_depth = 0;
- $linear_offset = $offset_prefix . 'l_block1';
- $tabular_offset = $offset_prefix . 't_block2';
-
- // Generate the list of modules, we'll do this in two ways ...
- // 1) In a linear fashion
- // 2) In a combined tabbed + linear fashion ... tabs for the categories
- // and a linear list for subcategories/items
- foreach ($this->module_ary as $row_id => $item_ary)
- {
- // Skip hidden modules
- if (!$item_ary['display'])
- {
- continue;
- }
-
- // Skip branch
- if ($right_id !== false)
- {
- if ($item_ary['left'] < $right_id)
- {
- continue;
- }
-
- $right_id = false;
- }
-
- // Category with no members on their way down (we have to check every level)
- if (!$item_ary['name'])
- {
- $empty_category = true;
-
- // We go through the branch and look for an activated module
- foreach (array_slice($this->module_ary, $row_id + 1) as $temp_row)
- {
- if ($temp_row['left'] > $item_ary['left'] && $temp_row['left'] < $item_ary['right'])
- {
- // Module there and displayed?
- if ($temp_row['name'] && $temp_row['display'])
- {
- $empty_category = false;
- break;
- }
- continue;
- }
- break;
- }
-
- // Skip the branch
- if ($empty_category)
- {
- $right_id = $item_ary['right'];
- continue;
- }
- }
-
- // Select first id we can get
- if (!$current_id && (in_array($item_ary['id'], array_keys($this->module_cache['parents'])) || $item_ary['id'] == $this->p_id))
- {
- $current_id = $item_ary['id'];
- }
-
- $depth = $item_ary['depth'];
-
- if ($depth > $current_depth)
- {
- $linear_offset = $linear_offset . '.l_block' . ($depth + 1);
- $tabular_offset = ($depth + 1 > 2) ? $tabular_offset . '.t_block' . ($depth + 1) : $tabular_offset;
- }
- else if ($depth < $current_depth)
- {
- for ($i = $current_depth - $depth; $i > 0; $i--)
- {
- $linear_offset = substr($linear_offset, 0, strrpos($linear_offset, '.'));
- $tabular_offset = ($i + $depth > 1) ? substr($tabular_offset, 0, strrpos($tabular_offset, '.')) : $tabular_offset;
- }
- }
-
- $u_title = $module_url . $delim . $cat_var . '=' . (($item_ary['cat']) ? $item_ary['id'] : $item_ary['name'] . (($item_ary['is_duplicate']) ? '&icat=' . $current_id : '') . '&' . $mode_var . '=' . $item_ary['mode']);
-
- // Was not allowed in categories before - /*!$item_ary['cat'] && */
- $u_title .= (isset($item_ary['url_extra'])) ? $item_ary['url_extra'] : '';
-
- // Only output a categories items if it's currently selected
- if ($this->p_class == 'CMS' || !$depth || ($depth && (in_array($item_ary['parent'], array_values($this->module_cache['parents'])) || $item_ary['parent'] == $this->p_parent)))
- {
- $use_tabular_offset = (!$depth) ? $offset_prefix . 't_block1' : $tabular_offset;
-
- $tpl_ary = array(
- 'L_TITLE' => $item_ary['lang'],
- 'S_SELECTED' => (in_array($item_ary['id'], array_keys($this->module_cache['parents'])) || $item_ary['id'] == $this->p_id) ? true : false,
- 'U_TITLE' => $u_title
- );
-
- $template->assign_block_vars($use_tabular_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER)));
- }
-
- $tpl_ary = array(
- 'L_TITLE' => $item_ary['lang'],
- 'S_SELECTED' => (in_array($item_ary['id'], array_keys($this->module_cache['parents'])) || $item_ary['id'] == $this->p_id) ? true : false,
- 'U_TITLE' => $u_title
- );
-
- $template->assign_block_vars($linear_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER)));
-
- $current_depth = $depth;
- }
- }
-
- /**
- * Returns desired template name
- */
- function get_tpl_name()
- {
- return $this->module->tpl_name . '.html';
- }
-
- /**
- * Returns the desired page title
- */
- function get_page_title()
- {
- global $user;
-
- if (!isset($this->module->page_title))
- {
- return '';
- }
-
- return (isset($user->lang[$this->module->page_title])) ? $user->lang[$this->module->page_title] : $this->module->page_title;
- }
-
- /**
- * Load module as the current active one without the need for registering it
- */
- function load($class, $name, $mode = false)
- {
- $this->p_class = $class;
- $this->p_name = $name;
-
- // Set active module to true instead of using the id
- $this->active_module = true;
-
- $this->load_active($mode);
- }
-
- /**
- * Display module
- */
- function display($page_title, $display_online_list = true)
- {
- global $template, $user;
-
- // Generate the page
- if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin'])
- {
- adm_page_header($page_title);
- }
- else
- {
- page_header($page_title, $display_online_list);
- }
-
- $template->set_filenames(array(
...
[truncated message content] |
|
From: <dac...@us...> - 2007-09-19 06:04:42
|
Revision: 65
http://thevr.svn.sourceforge.net/thevr/?rev=65&view=rev
Author: dachebodt
Date: 2007-09-18 23:04:46 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
A few minor fixes on forum mod
Modified Paths:
--------------
mods/cms/trunk/modules/core/template/acp_core.html
mods/cms/trunk/posting.php
mods/cms/trunk/viewforum.php
mods/cms/trunk/viewtopic.php
Modified: mods/cms/trunk/modules/core/template/acp_core.html
===================================================================
--- mods/cms/trunk/modules/core/template/acp_core.html 2007-09-18 07:14:25 UTC (rev 64)
+++ mods/cms/trunk/modules/core/template/acp_core.html 2007-09-19 06:04:46 UTC (rev 65)
@@ -50,7 +50,7 @@
<table cellspacing="1">
<thead>
<tr>
- <th>{L_ACP_CORE}</th>
+ <th>{L_MODULE}</th>
<th>{L_MOD_VERS}</th>
<th>{L_MOD_DESC}</th>
<th>{L_MOD_CONTACT}</th>
Modified: mods/cms/trunk/posting.php
===================================================================
--- mods/cms/trunk/posting.php 2007-09-18 07:14:25 UTC (rev 64)
+++ mods/cms/trunk/posting.php 2007-09-19 06:04:46 UTC (rev 65)
@@ -1232,7 +1232,7 @@
$template->alter_block_array('navlinks', array('FORUM_NAME' => $user->lang['FORUMS']), array('FORUM_NAME' => strtoupper($cms_mode)), 'change');
$template->alter_block_array('navlinks', array('U_VIEW_FORUM' => $u_forum), array('U_VIEW_FORUM' => $u_other), 'change');
- $blocks->display($id, $cms_mode);
+ $blocks->display($module->p_id, $module->p_mode);
}
// END CMS mod
Modified: mods/cms/trunk/viewforum.php
===================================================================
--- mods/cms/trunk/viewforum.php 2007-09-18 07:14:25 UTC (rev 64)
+++ mods/cms/trunk/viewforum.php 2007-09-19 06:04:46 UTC (rev 65)
@@ -133,7 +133,8 @@
$template->alter_block_array('navlinks', array('FORUM_NAME' => $user->lang['FORUMS']), array('FORUM_NAME' => strtoupper($cms_mode)), 'change');
$template->alter_block_array('navlinks', array('U_VIEW_FORUM' => $u_forum), array('U_VIEW_FORUM' => $u_other), 'change');
- $blocks->display($id, $cms_mode);
+ // get active blocks
+ $blocks->display($module->p_id, $module->p_mode);
}
// END CMS mod
Modified: mods/cms/trunk/viewtopic.php
===================================================================
--- mods/cms/trunk/viewtopic.php 2007-09-18 07:14:25 UTC (rev 64)
+++ mods/cms/trunk/viewtopic.php 2007-09-19 06:04:46 UTC (rev 65)
@@ -530,7 +530,7 @@
$template->alter_block_array('navlinks', array('FORUM_NAME' => $user->lang['FORUMS']), array('FORUM_NAME' => strtoupper($cms_mode)), 'change');
$template->alter_block_array('navlinks', array('U_VIEW_FORUM' => $u_forum), array('U_VIEW_FORUM' => $u_other), 'change');
- $blocks->display($id, $cms_mode);
+ $blocks->display($module->p_id, $module->p_mode);
}
// END CMS mod
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dac...@us...> - 2007-09-18 07:14:22
|
Revision: 64
http://thevr.svn.sourceforge.net/thevr/?rev=64&view=rev
Author: dachebodt
Date: 2007-09-18 00:14:25 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
Fixed a few bugs in search mod
Modified Paths:
--------------
mods/cms/trunk/includes/functions.php
mods/cms/trunk/modules/blocks/blocks/cms_user_menu.php
mods/cms/trunk/modules/search1/cms_search.php
mods/cms/trunk/styles/prosilver/template/search_results.html
Modified: mods/cms/trunk/includes/functions.php
===================================================================
--- mods/cms/trunk/includes/functions.php 2007-09-16 21:15:22 UTC (rev 63)
+++ mods/cms/trunk/includes/functions.php 2007-09-18 07:14:25 UTC (rev 64)
@@ -4210,10 +4210,10 @@
$template->assign_vars(array(
'L_INDEX' => $user->lang['HOME'],
'U_SEARCH' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=search'),
- 'U_SEARCH_SELF' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=forums&search_id=egosearch'),
- 'U_SEARCH_NEW' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=forums&search_id=newposts'),
- 'U_SEARCH_UNANSWERED' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=forums&search_id=unanswered'),
- 'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=forums&search_id=active_topics'),
+ 'U_SEARCH_SELF' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=search&search_id=egosearch'),
+ 'U_SEARCH_NEW' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=search&search_id=newposts'),
+ 'U_SEARCH_UNANSWERED' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=search&search_id=unanswered'),
+ 'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=search&search_id=active_topics'),
));
if($display_online_list)
Modified: mods/cms/trunk/modules/blocks/blocks/cms_user_menu.php
===================================================================
--- mods/cms/trunk/modules/blocks/blocks/cms_user_menu.php 2007-09-16 21:15:22 UTC (rev 63)
+++ mods/cms/trunk/modules/blocks/blocks/cms_user_menu.php 2007-09-18 07:14:25 UTC (rev 64)
@@ -52,8 +52,8 @@
'USERNAME_COLOR' => $user_colour,
'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $user->data['user_id']),
- 'U_SEARCH_NEW' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=forums&search_id=newposts'),
- 'U_SEARCH_SELF' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=forums&search_id=egosearch'),
+ 'U_SEARCH_NEW' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=search&search_id=newposts'),
+ 'U_SEARCH_SELF' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=search&search_id=egosearch'),
'U_PRIVATE_MSG' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'),
'U_LOGOUT' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout', true, $user->session_id)
));
Modified: mods/cms/trunk/modules/search1/cms_search.php
===================================================================
--- mods/cms/trunk/modules/search1/cms_search.php 2007-09-16 21:15:22 UTC (rev 63)
+++ mods/cms/trunk/modules/search1/cms_search.php 2007-09-18 07:14:25 UTC (rev 64)
@@ -21,8 +21,6 @@
{
global $config, $columns, $_SID, $cache, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
-
$user->add_lang('search');
// Define initial vars
@@ -505,6 +503,7 @@
'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
'U_SEARCH_WORDS' => $u_search,
+ 'U_SEARCH' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=search'),
));
if ($sql_where)
@@ -917,7 +916,7 @@
$module_block['TITLE'] = '';
$module_block['CONTENT'] = $template->assign_display('body');
- //$template->assign_vars(array('S_NO_CONTAINER' => true));
+ $template->assign_vars(array('S_NO_CONTAINER' => true));
$template->assign_block_vars('module', $module_block);
return;
@@ -1039,7 +1038,6 @@
}
$s_hidden_fields['i'] = 'search';
- $s_hidden_fields['mode'] = 'forums';
$template->assign_vars(array(
'S_SEARCH_ACTION' => "{$phpbb_root_path}index.$phpEx?i=search",
Modified: mods/cms/trunk/styles/prosilver/template/search_results.html
===================================================================
--- mods/cms/trunk/styles/prosilver/template/search_results.html 2007-09-16 21:15:22 UTC (rev 63)
+++ mods/cms/trunk/styles/prosilver/template/search_results.html 2007-09-18 07:14:25 UTC (rev 64)
@@ -1,165 +1,165 @@
-<!-- IF not S_CMS_ENABLED -->
-<!-- INCLUDE overall_header.html -->
-<!-- ENDIF -->
-
-<h2><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --><!-- IF SEARCH_WORDS -->: <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2>
-<!-- IF IGNORED_WORDS --> <p>{L_IGNORED_TERMS}: <strong>{IGNORED_WORDS}</strong></p><!-- ENDIF -->
-
-<!-- IF SEARCH_TOPIC -->
- <p><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}">{L_RETURN_TO}: {SEARCH_TOPIC}</a></p>
-<!-- ELSE -->
- <p><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}">{L_RETURN_TO_SEARCH_ADV}</a></p>
-<!-- ENDIF -->
-
-<!-- IF PAGINATION or SEARCH_MATCHES or PAGE_NUMBER -->
- <form method="post" action="{S_SEARCH_ACTION}">
-
- <div class="topic-actions">
-
- <!-- IF SEARCH_MATCHES -->
- <div class="search-box">
- <!-- IF SEARCH_IN_RESULTS -->
- <label for="add_keywords">{L_SEARCH_IN_RESULTS}: <input type="text" name="add_keywords" id="add_keywords" value="" class="inputbox narrow" /></label>
- <input type="hidden" name="show_results" value="posts" />
- <input class="button2" type="submit" name="submit" value="{L_SEARCH}" />
- <!-- ENDIF -->
- </div>
- <!-- ENDIF -->
-
- <div class="rightside pagination">
- {SEARCH_MATCHES}<!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF -->
- </div>
- </div>
-
- </form>
-<!-- ENDIF -->
-
-<!-- IF S_SHOW_TOPICS -->
-
- <!-- IF .searchresults -->
- <div class="forumbg">
-
- <div class="inner"><span class="corners-top"><span></span></span>
- <ul class="topiclist">
- <li class="header">
- <dl class="icon">
- <dt>{L_TOPICS}</dt>
- <dd class="posts">{L_REPLIES}</dd>
- <dd class="views">{L_VIEWS}</dd>
- <dd class="lastpost"><span>{L_LAST_POST}</span></dd>
- </dl>
- </li>
- </ul>
- <ul class="topiclist topics">
-
- <!-- BEGIN searchresults -->
- <li class="row<!-- IF searchresults.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
- <dl class="icon" style="background-image: url({searchresults.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
- <dt <!-- IF searchresults.TOPIC_ICON_IMG -->style="background-image: url({T_ICONS_PATH}{searchresults.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF -->>
- <!-- IF searchresults.S_UNREAD_TOPIC --><a href="{searchresults.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF -->
- <a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a> {searchresults.ATTACH_ICON_IMG}
- <!-- IF searchresults.S_TOPIC_UNAPPROVED or searchresults.S_POSTS_UNAPPROVED --><a href="{searchresults.U_MCP_QUEUE}">{searchresults.UNAPPROVED_IMG}</a> <!-- ENDIF -->
- <!-- IF searchresults.S_TOPIC_REPORTED --><a href="{searchresults.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br />
- <!-- IF searchresults.PAGINATION --><strong class="pagination"><span>{searchresults.PAGINATION}</span></strong><!-- ENDIF -->
- {L_POST_BY_AUTHOR} {searchresults.TOPIC_AUTHOR_FULL} {L_POSTED_ON_DATE} {searchresults.FIRST_POST_TIME}
- <!-- IF not searchresults.S_TOPIC_GLOBAL -->{L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a><!-- ELSE --> ({L_GLOBAL})<!-- ENDIF -->
- </dt>
- <dd class="posts">{searchresults.TOPIC_REPLIES}</dd>
- <dd class="views">{searchresults.TOPIC_VIEWS}</dd>
- <dd class="lastpost"><span>
- {L_POST_BY_AUTHOR} {searchresults.LAST_POST_AUTHOR_FULL}
- <a href="{searchresults.U_LAST_POST}">{LAST_POST_IMG}</a> <br />{L_POSTED_ON_DATE} {searchresults.LAST_POST_TIME}<br /> </span>
- </dd>
- </dl>
- </li>
- <!-- END searchresults -->
- </ul>
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
- <!-- ELSE -->
- <div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
- <strong>{L_NO_SEARCH_RESULTS}</strong>
- <span class="corners-bottom"><span></span></span></div>
- </div>
- <!-- ENDIF -->
-
-<!-- ELSE -->
-
- <!-- BEGIN searchresults -->
- <div class="search post <!-- IF searchresults.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF searchresults.S_POST_REPORTED --> reported<!-- ENDIF -->">
- <div class="inner"><span class="corners-top"><span></span></span>
-
- <!-- IF searchresults.S_IGNORE_POST -->
- <div class="postbody">
- {searchresults.L_IGNORE_POST}
- </div>
- <!-- ELSE -->
- <div class="postbody">
- <h3><a href="{searchresults.U_VIEW_POST}">{searchresults.POST_SUBJECT}</a></h3>
- <div class="content">{searchresults.MESSAGE}</div>
- </div>
-
- <dl class="postprofile">
- <dt class="author">{L_POST_BY_AUTHOR} {searchresults.POST_AUTHOR_FULL}</dt>
- <dd>{L_POSTED_ON_DATE} {searchresults.POST_DATE}</dd>
- <dd> </dd>
- <!-- IF searchresults.FORUM_TITLE -->
- <dd>{L_FORUM}: <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a></dd>
- <dd>{L_TOPIC}: <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a></dd>
- <!-- ELSE -->
- <dd>{L_GLOBAL}: <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a></dd>
- <!-- ENDIF -->
- <dd>{L_REPLIES}: <strong>{searchresults.TOPIC_REPLIES}</strong></dd>
- <dd>{L_VIEWS}: <strong>{searchresults.TOPIC_VIEWS}</strong></dd>
- </dl>
- <!-- ENDIF -->
-
- <!-- IF not searchresults.S_IGNORE_POST -->
- <ul class="searchresults">
- <li ><a href="{searchresults.U_VIEW_POST}" class="{S_CONTENT_FLOW_END}">{L_JUMP_TO_POST}</a></li>
- </ul>
- <!-- ENDIF -->
-
- <span class="corners-bottom"><span></span></span></div>
- </div>
- <!-- BEGINELSE -->
- <div class="panel">
- <div class="inner"><span class="corners-top"><span></span></span>
- <strong>{L_NO_SEARCH_RESULTS}</strong>
- <span class="corners-bottom"><span></span></span></div>
- </div>
- <!-- END searchresults -->
-<!-- ENDIF -->
-
-<!-- IF PAGINATION or .searchresults or S_SELECT_SORT_KEY or S_SELECT_SORT_DAYS -->
- <form method="post" action="{S_SEARCH_ACTION}">
-
- <fieldset class="display-options">
- <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
- <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
- <!-- IF S_SELECT_SORT_DAYS or S_SELECT_SORT_KEY -->
- <label><!-- IF S_SHOW_TOPICS -->{L_DISPLAY_POSTS}<!-- ELSE -->{L_SORT_BY}</label><label><!-- ENDIF --> {S_SELECT_SORT_DAYS}<!-- IF S_SELECT_SORT_KEY --></label> <label>{S_SELECT_SORT_KEY}</label>
- <label>{S_SELECT_SORT_DIR} <!-- ELSE --></label><!-- ENDIF --><input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
- <!-- ENDIF -->
- </fieldset>
-
- </form>
-
- <hr />
-<!-- ENDIF -->
-
-<!-- IF PAGINATION or .searchresults or PAGE_NUMBER -->
- <ul class="linklist">
- <li class="rightside pagination">
- {SEARCH_MATCHES}<!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF -->
- </li>
- </ul>
-<!-- ENDIF -->
-
-<!-- INCLUDE jumpbox.html -->
-
-<!-- IF not S_CMS_ENABLED -->
-<!-- INCLUDE overall_footer.html -->
+<!-- IF not S_CMS_ENABLED -->
+<!-- INCLUDE overall_header.html -->
+<!-- ENDIF -->
+
+<h2><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --><!-- IF SEARCH_WORDS -->: <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2>
+<!-- IF IGNORED_WORDS --> <p>{L_IGNORED_TERMS}: <strong>{IGNORED_WORDS}</strong></p><!-- ENDIF -->
+
+<!-- IF SEARCH_TOPIC -->
+ <p><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}">{L_RETURN_TO}: {SEARCH_TOPIC}</a></p>
+<!-- ELSE -->
+ <p><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}">{L_RETURN_TO_SEARCH_ADV}</a></p>
+<!-- ENDIF -->
+
+<!-- IF PAGINATION or SEARCH_MATCHES or PAGE_NUMBER -->
+ <form method="post" action="{S_SEARCH_ACTION}">
+
+ <div class="topic-actions">
+
+ <!-- IF SEARCH_MATCHES -->
+ <div class="search-box">
+ <!-- IF SEARCH_IN_RESULTS -->
+ <label for="add_keywords">{L_SEARCH_IN_RESULTS}: <input type="text" name="add_keywords" id="add_keywords" value="" class="inputbox narrow" /></label>
+ <input type="hidden" name="show_results" value="posts" />
+ <input class="button2" type="submit" name="submit" value="{L_SEARCH}" />
+ <!-- ENDIF -->
+ </div>
+ <!-- ENDIF -->
+
+ <div class="rightside pagination">
+ {SEARCH_MATCHES}<!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF -->
+ </div>
+ </div>
+
+ </form>
+<!-- ENDIF -->
+
+<!-- IF S_SHOW_TOPICS -->
+
+ <!-- IF .searchresults -->
+ <div class="forumbg">
+
+ <div class="inner"><span class="corners-top"><span></span></span>
+ <ul class="topiclist">
+ <li class="header">
+ <dl class="icon">
+ <dt>{L_TOPICS}</dt>
+ <dd class="posts">{L_REPLIES}</dd>
+ <dd class="views">{L_VIEWS}</dd>
+ <dd class="lastpost"><span>{L_LAST_POST}</span></dd>
+ </dl>
+ </li>
+ </ul>
+ <ul class="topiclist topics">
+
+ <!-- BEGIN searchresults -->
+ <li class="row<!-- IF searchresults.S_ROW_COUNT is even --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
+ <dl class="icon" style="background-image: url({searchresults.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
+ <dt <!-- IF searchresults.TOPIC_ICON_IMG -->style="background-image: url({T_ICONS_PATH}{searchresults.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF -->>
+ <!-- IF searchresults.S_UNREAD_TOPIC --><a href="{searchresults.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF -->
+ <a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a> {searchresults.ATTACH_ICON_IMG}
+ <!-- IF searchresults.S_TOPIC_UNAPPROVED or searchresults.S_POSTS_UNAPPROVED --><a href="{searchresults.U_MCP_QUEUE}">{searchresults.UNAPPROVED_IMG}</a> <!-- ENDIF -->
+ <!-- IF searchresults.S_TOPIC_REPORTED --><a href="{searchresults.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br />
+ <!-- IF searchresults.PAGINATION --><strong class="pagination"><span>{searchresults.PAGINATION}</span></strong><!-- ENDIF -->
+ {L_POST_BY_AUTHOR} {searchresults.TOPIC_AUTHOR_FULL} {L_POSTED_ON_DATE} {searchresults.FIRST_POST_TIME}
+ <!-- IF not searchresults.S_TOPIC_GLOBAL -->{L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a><!-- ELSE --> ({L_GLOBAL})<!-- ENDIF -->
+ </dt>
+ <dd class="posts">{searchresults.TOPIC_REPLIES}</dd>
+ <dd class="views">{searchresults.TOPIC_VIEWS}</dd>
+ <dd class="lastpost"><span>
+ {L_POST_BY_AUTHOR} {searchresults.LAST_POST_AUTHOR_FULL}
+ <a href="{searchresults.U_LAST_POST}">{LAST_POST_IMG}</a> <br />{L_POSTED_ON_DATE} {searchresults.LAST_POST_TIME}<br /> </span>
+ </dd>
+ </dl>
+ </li>
+ <!-- END searchresults -->
+ </ul>
+
+ <span class="corners-bottom"><span></span></span></div>
+ </div>
+ <!-- ELSE -->
+ <div class="panel">
+ <div class="inner"><span class="corners-top"><span></span></span>
+ <strong>{L_NO_SEARCH_RESULTS}</strong>
+ <span class="corners-bottom"><span></span></span></div>
+ </div>
+ <!-- ENDIF -->
+
+<!-- ELSE -->
+
+ <!-- BEGIN searchresults -->
+ <div class="search post <!-- IF searchresults.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF searchresults.S_POST_REPORTED --> reported<!-- ENDIF -->">
+ <div class="inner"><span class="corners-top"><span></span></span>
+
+ <!-- IF searchresults.S_IGNORE_POST -->
+ <div class="postbody">
+ {searchresults.L_IGNORE_POST}
+ </div>
+ <!-- ELSE -->
+ <div class="postbody">
+ <h3><a href="{searchresults.U_VIEW_POST}">{searchresults.POST_SUBJECT}</a></h3>
+ <div class="content">{searchresults.MESSAGE}</div>
+ </div>
+
+ <dl class="postprofile">
+ <dt class="author">{L_POST_BY_AUTHOR} {searchresults.POST_AUTHOR_FULL}</dt>
+ <dd>{L_POSTED_ON_DATE} {searchresults.POST_DATE}</dd>
+ <dd> </dd>
+ <!-- IF searchresults.FORUM_TITLE -->
+ <dd>{L_FORUM}: <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a></dd>
+ <dd>{L_TOPIC}: <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a></dd>
+ <!-- ELSE -->
+ <dd>{L_GLOBAL}: <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a></dd>
+ <!-- ENDIF -->
+ <dd>{L_REPLIES}: <strong>{searchresults.TOPIC_REPLIES}</strong></dd>
+ <dd>{L_VIEWS}: <strong>{searchresults.TOPIC_VIEWS}</strong></dd>
+ </dl>
+ <!-- ENDIF -->
+
+ <!-- IF not searchresults.S_IGNORE_POST -->
+ <ul class="searchresults">
+ <li ><a href="{searchresults.U_VIEW_POST}" class="{S_CONTENT_FLOW_END}">{L_JUMP_TO_POST}</a></li>
+ </ul>
+ <!-- ENDIF -->
+
+ <span class="corners-bottom"><span></span></span></div>
+ </div>
+ <!-- BEGINELSE -->
+ <div class="panel">
+ <div class="inner"><span class="corners-top"><span></span></span>
+ <strong>{L_NO_SEARCH_RESULTS}</strong>
+ <span class="corners-bottom"><span></span></span></div>
+ </div>
+ <!-- END searchresults -->
+<!-- ENDIF -->
+
+<!-- IF PAGINATION or .searchresults or S_SELECT_SORT_KEY or S_SELECT_SORT_DAYS -->
+ <form method="post" action="{S_SEARCH_ACTION}">
+
+ <fieldset class="display-options">
+ <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
+ <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
+ <!-- IF S_SELECT_SORT_DAYS or S_SELECT_SORT_KEY -->
+ <label><!-- IF S_SHOW_TOPICS -->{L_DISPLAY_POSTS}<!-- ELSE -->{L_SORT_BY}</label><label><!-- ENDIF --> {S_SELECT_SORT_DAYS}<!-- IF S_SELECT_SORT_KEY --></label> <label>{S_SELECT_SORT_KEY}</label>
+ <label>{S_SELECT_SORT_DIR} <!-- ELSE --></label><!-- ENDIF --><input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
+ <!-- ENDIF -->
+ </fieldset>
+
+ </form>
+
+ <hr />
+<!-- ENDIF -->
+
+<!-- IF PAGINATION or .searchresults or PAGE_NUMBER -->
+ <ul class="linklist">
+ <li class="rightside pagination">
+ {SEARCH_MATCHES}<!-- IF PAGINATION --> • <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{PAGE_NUMBER}</a> • <span>{PAGINATION}</span><!-- ELSE --> • {PAGE_NUMBER}<!-- ENDIF -->
+ </li>
+ </ul>
+<!-- ENDIF -->
+
+<!-- INCLUDE jumpbox.html -->
+
+<!-- IF not S_CMS_ENABLED -->
+<!-- INCLUDE overall_footer.html -->
<!-- ENDIF -->
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dac...@us...> - 2007-09-16 21:15:18
|
Revision: 63
http://thevr.svn.sourceforge.net/thevr/?rev=63&view=rev
Author: dachebodt
Date: 2007-09-16 14:15:22 -0700 (Sun, 16 Sep 2007)
Log Message:
-----------
Re-adding forums and search mod
Added Paths:
-----------
mods/cms/trunk/modules/forums1/
mods/cms/trunk/modules/forums1/blocks/
mods/cms/trunk/modules/forums1/blocks/cms_polls.php
mods/cms/trunk/modules/forums1/blocks/cms_recent_topics.php
mods/cms/trunk/modules/forums1/blocks/grp_recent_topics.php
mods/cms/trunk/modules/forums1/cms_forums.php
mods/cms/trunk/modules/forums1/grp_forums.php
mods/cms/trunk/modules/forums1/info/
mods/cms/trunk/modules/forums1/info/cms_forums.php
mods/cms/trunk/modules/forums1/info/forums_info.php
mods/cms/trunk/modules/forums1/info/grp_forums.php
mods/cms/trunk/modules/forums1/language/
mods/cms/trunk/modules/forums1/language/en/
mods/cms/trunk/modules/forums1/language/en/admin.php
mods/cms/trunk/modules/forums1/language/en/common.php
mods/cms/trunk/modules/forums1/template/
mods/cms/trunk/modules/forums1/template/blank.html
mods/cms/trunk/modules/forums1/template/block_polls.html
mods/cms/trunk/modules/forums1/template/block_recent_topics.html
mods/cms/trunk/modules/forums1/template/block_wordgraph.html
mods/cms/trunk/modules/search1/
mods/cms/trunk/modules/search1/blocks/
mods/cms/trunk/modules/search1/blocks/cms_wordgraph.php
mods/cms/trunk/modules/search1/cms_search.php
mods/cms/trunk/modules/search1/info/
mods/cms/trunk/modules/search1/info/cms_search.php
mods/cms/trunk/modules/search1/info/search_info.php
mods/cms/trunk/modules/search1/language/
mods/cms/trunk/modules/search1/language/en/
mods/cms/trunk/modules/search1/language/en/admin.php
mods/cms/trunk/modules/search1/language/en/common.php
mods/cms/trunk/modules/search1/template/
mods/cms/trunk/modules/search1/template/block_wordgraph.html
Added: mods/cms/trunk/modules/forums1/blocks/cms_polls.php
===================================================================
--- mods/cms/trunk/modules/forums1/blocks/cms_polls.php (rev 0)
+++ mods/cms/trunk/modules/forums1/blocks/cms_polls.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,273 @@
+<?php
+/**
+*
+* @package phpBB3
+* @version $Id: cms_polls.php,v 1.259 2007/01/26 16:05:14 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+/**
+* Polls
+* @package phpBB3
+*/
+
+function polls_block($data)
+{
+ global $db, $phpbb_root_path, $phpEx, $mtemplate;
+ global $cache, $user, $auth, $config, $user_cache;
+
+ include_once($phpbb_root_path . 'modules/forums/functions_display.' . $phpEx);
+ include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+
+ $user->add_lang('viewtopic');
+
+ $auth_ary = $auth->acl_get_list($user->data['user_id'], 'f_read');
+ $forum_ary = array_keys($auth_ary);
+
+ $sort_order = ($data['config']['poll_display_order']) ? 't.poll_start DESC' : 'RAND()';
+
+ $sql = 'SELECT t.topic_id, t.forum_id, t.topic_first_post_id, t.poll_vote_change, t.poll_length, t.poll_start, t.topic_status, f.forum_status, t.poll_max_options, t.poll_title
+ FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f
+ WHERE t.poll_start > 0
+ AND f.forum_id = t.forum_id
+ AND ' . $db->sql_in_set('t.forum_id', $forum_ary) . "
+ ORDER BY $sort_order LIMIT 1";
+ $result = $db->sql_query($sql);
+ $topic_data = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $topic_id = $topic_data['topic_id'];
+ $forum_id = $topic_data['forum_id'];
+
+ // Does this topic contain a poll?
+ if ($forum_id && $topic_id)
+ {
+ $sql = 'SELECT o.*, p.bbcode_bitfield, p.bbcode_uid
+ FROM ' . POLL_OPTIONS_TABLE . ' o, ' . POSTS_TABLE . " p
+ WHERE o.topic_id = $topic_id
+ AND p.post_id = {$topic_data['topic_first_post_id']}
+ AND p.topic_id = o.topic_id
+ ORDER BY o.poll_option_id";
+ $result = $db->sql_query($sql);
+
+ $poll_info = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $poll_info[] = $row;
+ }
+ $db->sql_freeresult($result);
+
+ $cur_voted_id = array();
+ if ($user->data['is_registered'])
+ {
+ $sql = 'SELECT poll_option_id
+ FROM ' . POLL_VOTES_TABLE . '
+ WHERE topic_id = ' . $topic_id . '
+ AND vote_user_id = ' . $user->data['user_id'];
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $cur_voted_id[] = $row['poll_option_id'];
+ }
+ $db->sql_freeresult($result);
+ }
+ else
+ {
+ // Cookie based guest tracking ... I don't like this but hum ho
+ // it's oft requested. This relies on "nice" users who don't feel
+ // the need to delete cookies to mess with results.
+ if (isset($_COOKIE[$config['cookie_name'] . '_poll_' . $topic_id]))
+ {
+ $cur_voted_id = explode(',', $_COOKIE[$config['cookie_name'] . '_poll_' . $topic_id]);
+ $cur_voted_id = array_map('intval', $cur_voted_id);
+ }
+ }
+
+ $s_can_vote = (((!sizeof($cur_voted_id) && $auth->acl_get('f_vote', $forum_id)) ||
+ ($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change'])) &&
+ (($topic_data['poll_length'] != 0 && $topic_data['poll_start'] + $topic_data['poll_length'] > time()) || $topic_data['poll_length'] == 0) &&
+ $topic_data['topic_status'] != ITEM_LOCKED &&
+ $topic_data['forum_status'] != ITEM_LOCKED) ? true : false;
+ $s_display_results = (!$s_can_vote || ($s_can_vote && sizeof($cur_voted_id)) || $view == 'viewpoll') ? true : false;
+
+ if ($update && $s_can_vote)
+ {
+ if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'])
+ {
+ $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id");
+
+ meta_refresh(5, $redirect_url);
+
+ $message = (!sizeof($voted_id)) ? 'NO_VOTE_OPTION' : 'TOO_MANY_VOTE_OPTIONS';
+ $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>');
+ trigger_error($message);
+ }
+
+ foreach ($voted_id as $option)
+ {
+ if (in_array($option, $cur_voted_id))
+ {
+ continue;
+ }
+
+ $sql = 'UPDATE ' . POLL_OPTIONS_TABLE . '
+ SET poll_option_total = poll_option_total + 1
+ WHERE poll_option_id = ' . (int) $option . '
+ AND topic_id = ' . (int) $topic_id;
+ $db->sql_query($sql);
+
+ if ($user->data['is_registered'])
+ {
+ $sql_ary = array(
+ 'topic_id' => (int) $topic_id,
+ 'poll_option_id' => (int) $option,
+ 'vote_user_id' => (int) $user->data['user_id'],
+ 'vote_user_ip' => (string) $user->ip,
+ );
+
+ $sql = 'INSERT INTO ' . POLL_VOTES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
+ $db->sql_query($sql);
+ }
+ }
+
+ foreach ($cur_voted_id as $option)
+ {
+ if (!in_array($option, $voted_id))
+ {
+ $sql = 'UPDATE ' . POLL_OPTIONS_TABLE . '
+ SET poll_option_total = poll_option_total - 1
+ WHERE poll_option_id = ' . (int) $option . '
+ AND topic_id = ' . (int) $topic_id;
+ $db->sql_query($sql);
+
+ if ($user->data['is_registered'])
+ {
+ $sql = 'DELETE FROM ' . POLL_VOTES_TABLE . '
+ WHERE topic_id = ' . (int) $topic_id . '
+ AND poll_option_id = ' . (int) $option . '
+ AND vote_user_id = ' . (int) $user->data['user_id'];
+ $db->sql_query($sql);
+ }
+ }
+ }
+
+ if ($user->data['user_id'] == ANONYMOUS && !$user->data['is_bot'])
+ {
+ $user->set_cookie('poll_' . $topic_id, implode(',', $voted_id), time() + 31536000);
+ }
+
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET poll_last_vote = ' . time() . "
+ WHERE topic_id = $topic_id";
+ //, topic_last_post_time = ' . time() . " -- for bumping topics with new votes, ignore for now
+ $db->sql_query($sql);
+
+ $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id");
+
+ meta_refresh(5, $redirect_url);
+ trigger_error($user->lang['VOTE_SUBMITTED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>'));
+ }
+
+ $poll_total = 0;
+ foreach ($poll_info as $poll_option)
+ {
+ $poll_total += $poll_option['poll_option_total'];
+ }
+
+ if ($poll_info[0]['bbcode_bitfield'])
+ {
+ $poll_bbcode = new bbcode();
+ }
+ else
+ {
+ $poll_bbcode = false;
+ }
+
+ for ($i = 0, $size = sizeof($poll_info); $i < $size; $i++)
+ {
+ $poll_info[$i]['poll_option_text'] = censor_text($poll_info[$i]['poll_option_text']);
+ $poll_info[$i]['poll_option_text'] = str_replace("\n", '<br />', $poll_info[$i]['poll_option_text']);
+
+ if ($poll_bbcode !== false)
+ {
+ $poll_bbcode->bbcode_second_pass($poll_info[$i]['poll_option_text'], $poll_info[$i]['bbcode_uid'], $poll_option['bbcode_bitfield']);
+ }
+
+ $poll_info[$i]['poll_option_text'] = smiley_text($poll_info[$i]['poll_option_text']);
+ }
+
+ $topic_data['poll_title'] = censor_text($topic_data['poll_title']);
+ $topic_data['poll_title'] = str_replace("\n", '<br />', $topic_data['poll_title']);
+
+ if ($poll_bbcode !== false)
+ {
+ $poll_bbcode->bbcode_second_pass($topic_data['poll_title'], $poll_info[0]['bbcode_uid'], $poll_info[0]['bbcode_bitfield']);
+ }
+ $topic_data['poll_title'] = smiley_text($topic_data['poll_title']);
+
+ unset($poll_bbcode);
+
+ foreach ($poll_info as $poll_option)
+ {
+ $option_pct = ($poll_total > 0) ? $poll_option['poll_option_total'] / $poll_total : 0;
+ $option_pct_txt = sprintf("%.1d%%", ($option_pct * 100));
+
+ $mtemplate->assign_block_vars('poll_option', array(
+ 'POLL_OPTION_ID' => $poll_option['poll_option_id'],
+ 'POLL_OPTION_CAPTION' => $poll_option['poll_option_text'],
+ 'POLL_OPTION_RESULT' => $poll_option['poll_option_total'],
+ 'POLL_OPTION_PERCENT' => $option_pct_txt,
+ 'POLL_OPTION_PCT' => round($option_pct * 100),
+ 'POLL_OPTION_IMG' => $user->img('poll_center', $option_pct_txt, round($option_pct * 10)),
+ 'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false)
+ );
+ }
+
+ $poll_end = $topic_data['poll_length'] + $topic_data['poll_start'];
+
+ $mtemplate->assign_vars(array(
+ 'POLL_QUESTION' => $topic_data['poll_title'],
+ 'TOTAL_VOTES' => $poll_total,
+ 'POLL_LEFT_CAP_IMG' => $user->img('poll_left'),
+ 'POLL_RIGHT_CAP_IMG'=> $user->img('poll_right'),
+
+ 'L_MAX_VOTES' => ($topic_data['poll_max_options'] == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $topic_data['poll_max_options']),
+ 'L_POLL_LENGTH' => ($topic_data['poll_length']) ? sprintf($user->lang[($poll_end > time()) ? 'POLL_RUN_TILL' : 'POLL_ENDED_AT'], $user->format_date($poll_end)) : '',
+
+ 'S_HAS_POLL' => true,
+ 'S_CAN_VOTE' => $s_can_vote,
+ 'S_DISPLAY_RESULTS' => $s_display_results,
+ 'S_IS_MULTI_CHOICE' => ($topic_data['poll_max_options'] > 1) ? true : false,
+ 'S_POLL_ACTION' => $viewtopic_url,
+
+ 'U_VIEW_RESULTS' => $viewtopic_url . '&view=viewpoll')
+ );
+
+ unset($poll_end, $poll_info, $voted_id);
+
+ $mtemplate->set_filenames(array(
+ 'content' => 'block_polls.html')
+ );
+
+ $block['TITLE'] = $user->lang['POLLS'];
+ $block['CONTENT'] = $mtemplate->assign_display('content');
+
+ return $block;
+ }
+}
+
+function polls_block_config()
+{
+ $block_config = array(
+ array('field' => 'poll_display_order', 'label' => 'ORDER_BY', 'type' => 'radio', 'value' => '0', 'options' => array(array('field' => '', 'value' => '1', 'label' => 'POST_TIME'), array('field' => '', 'value' => '0', 'label' => 'RANDOM'))),
+ );
+
+ return $block_config;
+}
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/blocks/cms_recent_topics.php
===================================================================
--- mods/cms/trunk/modules/forums1/blocks/cms_recent_topics.php (rev 0)
+++ mods/cms/trunk/modules/forums1/blocks/cms_recent_topics.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,75 @@
+<?php
+/**
+*
+* @package Forums
+* @version $Id: cms_recent_topics.php,v 1.259 2007/01/26 16:05:14 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+/**
+* Recent Topic Block
+* @package phpBB3
+*/
+
+function recent_topics_block($data)
+{
+ global $auth, $db, $bconfig, $mtemplate, $phpbb_root_path, $phpEx, $user;
+
+ $bconfig = $data['config'];
+
+ $auth_ary = $auth->acl_get_list($user->data['user_id'], 'f_read');
+ $forum_ary = array_keys($auth_ary);
+
+ $sql_where = ' AND ' . $db->sql_in_set('forum_id', $forum_ary);
+ if ($bconfig['exclude_forums'])
+ {
+ $exclude_forums = explode(',', $bconfig['exclude_forums']);
+ $sql_where .= ' AND ' . $db->sql_in_set('forum_id', $exclude_forums, true);
+ }
+
+ $sql = 'SELECT topic_title, forum_id, topic_id
+ FROM ' . TOPICS_TABLE . "
+ WHERE topic_status <> 2
+ AND topic_approved = 1
+ AND topic_title <> ''
+ AND topic_type = 0 " . $sql_where . '
+ ORDER BY topic_time DESC';
+ $result = $db->sql_query_limit($sql, $bconfig['max_topics']);
+
+ while($row = $db->sql_fetchrow($result))
+ {
+ $title = censor_text($row['topic_title']);
+ $mtemplate->assign_block_vars('recent_topics', array(
+ 'TITLE' => truncate_string($title, $bconfig['recent_title_limit']),
+ 'FULL_TITLE' => $title,
+ 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'])
+ ));
+ }
+ $db->sql_freeresult($result);
+
+ $mtemplate->set_filenames(array(
+ 'content' => 'block_recent_topics.html')
+ );
+
+ $block['TITLE'] = $user->lang['RECENT_TOPICS'];
+ $block['CONTENT'] = $mtemplate->assign_display('content');
+
+ return $block;
+}
+
+function recent_topics_block_config()
+{
+ $block_config = array(
+ array('field' => 'max_topics', 'label' => 'MAX_TOPICS', 'type' => 'text', 'value' => '5'),
+ array('field' => 'recent_title_limit', 'label' => 'RECENT_TITLE_LIMIT', 'type' => 'text', 'value' => '25'),
+ array('field' => 'exclude_forums', 'label' => 'EXCLUDE_FORUMS', 'type' => 'text', 'value' => '')
+ );
+
+ return $block_config;
+}
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/blocks/grp_recent_topics.php
===================================================================
--- mods/cms/trunk/modules/forums1/blocks/grp_recent_topics.php (rev 0)
+++ mods/cms/trunk/modules/forums1/blocks/grp_recent_topics.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,79 @@
+<?php
+/**
+*
+* @package Forums
+* @version $Id: grp_recent_topics.php,v 1.259 2007/01/26 16:05:14 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+/**
+* Recent Topic Block
+* @package phpBB3
+*/
+
+function recent_topics_block($data)
+{
+ global $auth, $db, $bconfig, $mtemplate, $phpbb_root_path, $phpEx, $user;
+
+ $bconfig = $data['config'];
+
+ $auth_ary = $auth->acl_get_list($user->data['user_id'], 'f_read');
+ $forum_ary = array_keys($auth_ary);
+
+ $sql_where = ' AND ' . $db->sql_in_set('forum_id', $forum_ary);
+ if ($bconfig['exclude_forums'])
+ {
+ $exclude_forums = explode(',', $bconfig['exclude_forums']);
+ $sql_where .= ' AND ' . $db->sql_in_set('forum_id', $exclude_forums, true);
+ }
+
+ $sql = 'SELECT topic_title, forum_id, topic_id
+ FROM ' . TOPICS_TABLE . '
+ WHERE topic_status <> 2
+ AND topic_approved = 1
+ AND topic_type = 0 ' . $sql_where . '
+ ORDER BY topic_time DESC';
+ $result = $db->sql_query_limit($sql, $bconfig['max_topics']);
+
+ while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title'] != '') )
+ {
+ $mtemplate->assign_block_vars('recent_topics', array(
+ 'TITLE' => character_limit($row['topic_title'], $bconfig['recent_title_limit']),
+ 'FULL_TITLE' => censor_text($row['topic_title']),
+ 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=forums&disp=topic&f=' . $row['forum_id'] . '&t=' . $row['topic_id'])
+ )
+ );
+ }
+ $db->sql_freeresult($result);
+
+ $mtemplate->set_filenames(array(
+ 'content' => 'block_recent_topics.html')
+ );
+
+ $block['TITLE'] = $user->lang['RECENT_TOPICS'];
+ $block['CONTENT'] = $mtemplate->assign_display('content');
+
+ return $block;
+}
+
+function character_limit($data, $lim)
+{
+ return $data;
+}
+
+function recent_topics_block_config()
+{
+ $block_config = array(
+ array('field' => 'max_topics', 'label' => 'MAX_TOPICS', 'type' => 'text', 'value' => '5'),
+ array('field' => 'recent_title_limit', 'label' => 'RECENT_TITLE_LIMIT', 'type' => 'text', 'value' => '25'),
+ array('field' => 'exclude_forums', 'label' => 'EXCLUDE_FORUMS', 'type' => 'text', 'value' => '')
+ );
+
+ return $block_config;
+}
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/cms_forums.php
===================================================================
--- mods/cms/trunk/modules/forums1/cms_forums.php (rev 0)
+++ mods/cms/trunk/modules/forums1/cms_forums.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,59 @@
+<?php
+/**
+*
+* @package cms
+* @version $Id: cms_forums.php,v 1.41 2007/01/24 11:28:50 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* cms_forums
+* @package cms
+*/
+class cms_forums
+{
+ var $u_action;
+
+ function main($id, $mode)
+ {
+ global $config, $columns, $db, $user, $auth, $template, $mtemplate, $phpbb_root_path, $phpEx;
+
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+
+ $s_hidden_fields = '';
+
+ $mode = request_var('mode', '');
+ $action = request_var('action', false);
+ $submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false;
+
+ display_forums('', $config['load_moderators']);
+
+ $template->assign_vars(array(
+ 'S_NO_CONTAINER' => true,
+ 'FORUM_IMG' => $user->img('forum_read', 'NO_NEW_POSTS'),
+ 'FORUM_NEW_IMG' => $user->img('forum_unread', 'NEW_POSTS'),
+ 'FORUM_LOCKED_IMG' => $user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'),
+ 'FORUM_NEW_LOCKED_IMG' => $user->img('forum_unread_locked', 'NO_NEW_POSTS_LOCKED'),
+ ));
+
+ $template->set_filenames(array(
+ 'body' => 'forumlist_body.html')
+ );
+
+ $u_other = append_sid("{$phpbb_root_path}index.$phpEx", "i=$id&mode=$mode");
+ $u_forum = append_sid("{$phpbb_root_path}index.$phpEx", "i=$id&mode=forum");
+
+ $template->alter_block_array('navlinks', array('FORUM_NAME' => $user->lang['FORUMS']), array('FORUM_NAME' => strtoupper($mode)), 'change');
+ $template->alter_block_array('navlinks', array('U_VIEW_FORUM' => $u_forum), array('U_VIEW_FORUM' => $u_other), 'change');
+
+ $this->page_title = $user->lang['FORUMS'];
+ $module_block['TITLE'] = '';
+ $module_block['CONTENT'] = $template->assign_display('body');
+
+ $template->assign_block_vars('module', $module_block);
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/grp_forums.php
===================================================================
--- mods/cms/trunk/modules/forums1/grp_forums.php (rev 0)
+++ mods/cms/trunk/modules/forums1/grp_forums.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,88 @@
+<?php
+/**
+*
+* @package cms
+* @version $Id: gui_forums.php,v 1.41 2007/01/24 11:28:50 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* grp_forums
+* @package grp
+*/
+class grp_forums
+{
+ var $u_action;
+ var $tpl_name;
+
+ function main($id, $mode)
+ {
+ global $config, $columns, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+
+ $s_hidden_fields = '';
+
+ $disp = request_var('disp', '');
+ $action = request_var('action', false);
+ $submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false;
+
+ switch($disp)
+ {
+ case 'posting':
+
+ include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
+ include($phpbb_root_path . 'modules/forums/posting.' . $phpEx);
+ include($phpbb_root_path . 'modules/forums/functions_posting.' . $phpEx);
+
+ display_posting();
+ $tpl_name = 'posting_body';
+
+ break;
+
+ case 'topic':
+
+ include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ include($phpbb_root_path . 'modules/forums/viewtopic.' . $phpEx);
+
+ display_topic();
+ $tpl_name = 'viewtopic_body';
+
+ break;
+
+ default:
+
+ include($phpbb_root_path . 'modules/forums/viewforum.' . $phpEx);
+
+ $forum_id = 3; // $user->data['group_data']['forum_id'];
+ if($forum_id)
+ {
+ $url = "{$phpbb_root_path}memberlist.$phpEx?mode=group&g=14";
+ display_viewforums($forum_id, $url);
+ }
+
+ $template->set_filenames(array(
+ 'body' => 'viewforum_body.html')
+ );
+ $tpl_name = 'viewforum_body';
+
+ break;
+ }
+
+ $template->assign_vars(array('S_CMS_ENABLED' => true));
+
+ $template->set_filenames(array(
+ 'content' => $tpl_name . '.html')
+ );
+
+ $this->page_title = 'FORUMS';
+ $this->tpl_name = 'blank';
+
+ $module_block['TITLE'] = '';
+ $module_block['CONTENT'] = $template->assign_display('content');
+
+ $template->assign_block_vars('blockrow_c', $module_block);
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/info/cms_forums.php
===================================================================
--- mods/cms/trunk/modules/forums1/info/cms_forums.php (rev 0)
+++ mods/cms/trunk/modules/forums1/info/cms_forums.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,47 @@
+<?php
+/**
+*
+* @package cms
+* @version $Id: cms_forums.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class cms_forums_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'cms_forums',
+ 'title' => 'CMS_COMMUNITY',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'forum' => array('title' => 'FORUMS', 'auth' => '', 'cat' => array('CMS_COMMUNITY')),
+ 'viewforum' => array('title' => 'VIEWFORUM', 'auth' => '', 'cat' => array('CMS_COMMUNITY')),
+ 'viewtopic' => array('title' => 'VIEWTOPIC', 'auth' => '', 'cat' => array('CMS_COMMUNITY')),
+ 'posting' => array('title' => 'POSTING', 'auth' => '', 'cat' => array('CMS_COMMUNITY')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ global $db;
+
+ $mods_ary = array('viewforum', 'viewtopic', 'posting');
+ $sql = 'UPDATE ' . MODULES_TABLE . '
+ SET module_display = 0
+ WHERE ' . $db->sql_in_set('module_mode', $mods_ary);
+ $db->sql_query($sql);
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/info/forums_info.php
===================================================================
--- mods/cms/trunk/modules/forums1/info/forums_info.php (rev 0)
+++ mods/cms/trunk/modules/forums1/info/forums_info.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,30 @@
+<?php
+/**
+*
+* @package ucp
+* @version $Id: ucp_attachments.php,v 1.3 2006/10/06 18:43:54 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+$module_info = array(
+ 'mod_name' => 'forums',
+ 'mod_disp_name' => 'Forums',
+ 'mod_short_desc' => 'Community forum',
+ 'mod_long_desc' => 'phpbb core forum',
+ 'mod_image' => '',
+ 'mod_author' => 'mod',
+ 'mod_contact' => 'www.phpbb.com',
+ 'mod_url' => 'www.phpbb.com',
+ 'mod_vers' => '1.00',
+ 'mod_compat' => 'rc4',
+ 'mod_type' => 'mod',
+ 'mod_demo_url' => '',
+ 'mod_dependents' => ''
+);
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/info/grp_forums.php
===================================================================
--- mods/cms/trunk/modules/forums1/info/grp_forums.php (rev 0)
+++ mods/cms/trunk/modules/forums1/info/grp_forums.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* @package grp
+* @version $Id: grp_forums.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class grp_forums_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'grp_forums',
+ 'title' => 'GRP_MODS',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'forum' => array('title' => 'FORUMS', 'auth' => '', 'cat' => array('GRP_MODS')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/language/en/admin.php
===================================================================
--- mods/cms/trunk/modules/forums1/language/en/admin.php (rev 0)
+++ mods/cms/trunk/modules/forums1/language/en/admin.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,39 @@
+<?php
+/**
+*
+* blocks [English]
+*
+* @package language
+* @version $Id: style_generator.php,v x.xxx yyyy/mm/dd hh:mm:ss Username Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'MAX_TOPICS' => 'Maximum number of topics',
+ 'RECENT_TITLE_LIMIT' => 'Maximum # of words for topic title',
+ 'EXCLUDE_FORUMS' => 'Exclude forums',
+ 'RANDOM' => 'Random',
+ 'ORDER_BY' => 'Order by',
+));
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/language/en/common.php
===================================================================
--- mods/cms/trunk/modules/forums1/language/en/common.php (rev 0)
+++ mods/cms/trunk/modules/forums1/language/en/common.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,38 @@
+<?php
+/**
+*
+* @package language
+* @version $Id: common.php,v x.xxx yyyy/mm/dd hh:mm:ss Username Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'CMS_COMMUNITY' => 'Community',
+ 'FORUMS_SEARCH' => 'Forums Search',
+ 'RECENT_TOPICS' => 'Recent Topics',
+ 'POLLS' => 'Polls',
+ 'FORUMS_ONLINE' => 'Board index',
+ 'SEARCH_FORUMS_ONLINE' => 'Searching forums',
+));
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/forums1/template/blank.html
===================================================================
Added: mods/cms/trunk/modules/forums1/template/block_polls.html
===================================================================
--- mods/cms/trunk/modules/forums1/template/block_polls.html (rev 0)
+++ mods/cms/trunk/modules/forums1/template/block_polls.html 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,42 @@
+<form method="post" action="{S_POLL_ACTION}">
+<b>{POLL_QUESTION}</b><br />
+<!-- BEGIN poll_option -->
+ <!-- IF S_CAN_VOTE -->
+ <!-- IF S_IS_MULTI_CHOICE -->
+ <input type="checkbox" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF -->/>
+ <!-- ELSE -->
+ <input type="radio" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> />
+ <!-- ENDIF -->
+ <!-- ENDIF -->
+ <!-- IF S_CAN_VOTE -->
+ <label for="vote_{poll_option.POLL_OPTION_ID}">{poll_option.POLL_OPTION_CAPTION}</label>
+ <!-- ELSE -->
+ {poll_option.POLL_OPTION_CAPTION}
+ <!-- ENDIF --><br />
+ <!-- IF S_DISPLAY_RESULTS --><dd class="resultbar"><div class="<!-- IF poll_option.POLL_OPTION_PCT < 20 -->pollbar1<!-- ELSEIF poll_option.POLL_OPTION_PCT < 40 -->pollbar2<!-- ELSEIF poll_option.POLL_OPTION_PCT < 60 -->pollbar3<!-- ELSEIF poll_option.POLL_OPTION_PCT < 80 -->pollbar4<!-- ELSE -->pollbar5<!-- ENDIF -->" style="width:{poll_option.POLL_OPTION_PERCENT};">{poll_option.POLL_OPTION_RESULT}</div></dd>
+ <dd><!-- IF poll_option.POLL_OPTION_RESULT == 0 -->{L_NO_VOTES}<!-- ELSE -->{poll_option.POLL_OPTION_PERCENT}<!-- ENDIF --></dd><!-- ENDIF -->
+<!-- END poll_option -->
+ <p>{L_POLL_LENGTH}<!-- IF S_CAN_VOTE and L_POLL_LENGTH --><br /><!-- ENDIF --><!-- IF S_CAN_VOTE -->{L_MAX_VOTES}<!-- ENDIF --></p>
+
+ <!-- IF S_DISPLAY_RESULTS -->
+ <dl>
+ <dt> </dt>
+ <dd class="resultbar">{L_TOTAL_VOTES} : {TOTAL_VOTES}</dd>
+ </dl>
+ <!-- ENDIF -->
+
+ <!-- IF S_CAN_VOTE -->
+ <dl style="border-top: none;">
+ <dt> </dt>
+ <dd class="resultbar"><input type="submit" name="update" value="{L_SUBMIT_VOTE}" class="button1" /></dd>
+ </dl>
+ <!-- ENDIF -->
+
+ <!-- IF not S_DISPLAY_RESULTS -->
+ <dl style="border-top: none;">
+ <dt> </dt>
+ <dd class="resultbar"><a href="{U_VIEW_RESULTS}">{L_VIEW_RESULTS}</a></dd>
+ </dl>
+ <!-- ENDIF -->
+{S_HIDDEN_FIELDS}
+</form>
Added: mods/cms/trunk/modules/forums1/template/block_recent_topics.html
===================================================================
--- mods/cms/trunk/modules/forums1/template/block_recent_topics.html (rev 0)
+++ mods/cms/trunk/modules/forums1/template/block_recent_topics.html 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,3 @@
+<!-- BEGIN recent_topics -->
+ <a href="{recent_topics.U_VIEW_TOPIC}" title="{recent_topics.FULL_TITLE}">{recent_topics.TITLE}</a><br />
+<!-- END recent_topics -->
Added: mods/cms/trunk/modules/forums1/template/block_wordgraph.html
===================================================================
--- mods/cms/trunk/modules/forums1/template/block_wordgraph.html (rev 0)
+++ mods/cms/trunk/modules/forums1/template/block_wordgraph.html 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,3 @@
+<!-- BEGIN wordgraph -->
+ <a href="{wordgraph.WORD_URL}" style="font-size: {wordgraph.WORD_SIZE}px;">{wordgraph.WORD}</a>
+<!-- END wordgraph -->
Added: mods/cms/trunk/modules/search1/blocks/cms_wordgraph.php
===================================================================
--- mods/cms/trunk/modules/search1/blocks/cms_wordgraph.php (rev 0)
+++ mods/cms/trunk/modules/search1/blocks/cms_wordgraph.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,118 @@
+<?php
+/**
+*
+* @package Forums
+* @version $Id: cms_wordgraph.php,v 1.259 2007/01/26 16:05:14 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+/**
+* Word Graph Block
+* Based on nedka's Wordgraph Mod, contact: http://www.wonasti.com, ad...@wo...
+* @package phpBB3
+*/
+
+function wordgraph_block($data)
+{
+ global $auth, $db, $mtemplate, $phpbb_root_path, $phpEx, $user;
+
+ $bconfig = $data['config'];
+ $topic_id = request_var('t', '');
+
+ // Get words and number of those words
+ if($topic_id)
+ {
+ $sql = 'SELECT l.word_text, COUNT(*) AS word_count
+ FROM ' . SEARCH_WORDLIST_TABLE . ' l, ' . SEARCH_WORDMATCH_TABLE . ' m, ' . POSTS_TABLE . " p
+ WHERE m.word_id = l.word_id
+ AND m.post_id = p.post_id
+ AND p.topic_id = $topic_id
+ GROUP BY m.word_id
+ ORDER BY word_count DESC";
+ }
+ else
+ {
+ $sql = 'SELECT l.word_text, COUNT(*) AS word_count
+ FROM ' . SEARCH_WORDLIST_TABLE . ' l, ' . SEARCH_WORDMATCH_TABLE . " m
+ WHERE m.word_id = l.word_id
+ GROUP BY m.word_id
+ ORDER BY word_count DESC";
+ }
+ $result = $db->sql_query_limit($sql, $bconfig['wordgraph_word_number']);
+
+ $words_array = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $word = strtolower($row['word_text']);
+ $words_array[$word] = $row['word_count'];
+ }
+ $db->sql_freeresult($result);
+
+ // Get max value and min value of word count, use it to create word size
+ static $words_max, $words_min;
+ foreach (array_keys($words_array) as $word)
+ {
+ if ($words_array[$word] > $words_max)
+ {
+ $words_max = $words_array[$word];
+ }
+
+ if ($words_array[$word] < $words_min)
+ {
+ $words_min = $words_array[$word];
+ }
+ }
+
+ // Sort words in result
+ $words = array_keys($words_array);
+ sort($words);
+
+ foreach ($words as $word)
+ {
+ // Calculate word size and limit its size
+ $word_size = (int) $words_array[$word] * ($words_max - $words_min) / 2;
+
+ if ($word_size > $bconfig['wordgraph_max_size'])
+ {
+ $word_size = $bconfig['wordgraph_max_size'];
+ }
+
+ if ($word_size < $bconfig['wordgraph_min_size'])
+ {
+ $word_size = $bconfig['wordgraph_min_size'];
+ }
+
+ $mtemplate->assign_block_vars('wordgraph', array(
+ 'WORD' => ($bconfig['wordgraph_word_count']) ? $word . '(' . $words_array[$word] . ')' : $word,
+ 'WORD_SIZE' => $word_size,
+ 'WORD_URL' => append_sid("{$phpbb_root_path}index.$phpEx", 'i=forums&mode=forum&disp=search&keywords=' . urlencode($word)),
+ ));
+ }
+
+ $mtemplate->set_filenames(array(
+ 'content' => 'block_wordgraph.html')
+ );
+
+ $block['TITLE'] = $user->lang['WORDGRAPH'];
+ $block['CONTENT'] = $mtemplate->assign_display('content');
+
+ return $block;
+}
+
+function wordgraph_block_config()
+{
+ global $user;
+
+ return array(
+ array('field' => 'wordgraph_word_count', 'label' => 'ALLOW_WORD_COUNT', 'validate' => 'bool', 'explain' => true, 'type' => 'radio', 'value' => '1', 'options' => array(array('field' => '', 'value' => '1', 'label' => 'YES'), array('field' => '', 'value' => '0', 'label' => 'NO'))),
+ array('field' => 'wordgraph_word_number', 'label' => 'WORD_NUMBER', 'validate' => 'int', 'type' => 'text', 'explain' => true, 'value' => '100', 'append' => ' ' . $user->lang['WORDS']),
+ array('field' => 'wordgraph_max_size', 'label' => 'WORD_MAX_SIZE', 'validate' => 'int', 'type' => 'text', 'explain' => true, 'value' => '36', 'append' => ' ' . $user->lang['PIXEL']),
+ array('field' => 'wordgraph_min_size', 'label' => 'WORD_MIN_SIZE', 'validate' => 'int', 'type' => 'text', 'explain' => true, 'value' => '9', 'append' => ' ' . $user->lang['PIXEL']),
+ );
+}
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/search1/cms_search.php
===================================================================
--- mods/cms/trunk/modules/search1/cms_search.php (rev 0)
+++ mods/cms/trunk/modules/search1/cms_search.php 2007-09-16 21:15:22 UTC (rev 63)
@@ -0,0 +1,1113 @@
+<?php
+/**
+*
+* @package cms
+* @version $Id: cms_search.php,v 1.210 2007/08/23 13:41:32 naderman Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* cms_search
+* @package search
+*/
+class cms_search
+{
+ var $u_action;
+ var $tpl_name;
+
+ function main($id, $mode)
+ {
+ global $config, $columns, $_SID, $cache, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+
+ $user->add_lang('search');
+
+ // Define initial vars
+ $search_id = request_var('search_id', '');
+ $start = max(request_var('start', 0), 0);
+ $post_id = request_var('p', 0);
+ $topic_id = request_var('t', 0);
+ $view = request_var('view', '');
+
+ $submit = request_var('submit', false);
+ $keywords = utf8_normalize_nfc(request_var('keywords', '', true));
+ $add_keywords = utf8_normalize_nfc(request_var('add_keywords', '', true));
+ $author = request_var('author', '', true);
+ $author_id = request_var('author_id', 0);
+ $show_results = ($topic_id) ? 'posts' : request_var('sr', 'posts');
+ $show_results = ($show_results == 'posts') ? 'posts' : 'topics';
+ $search_terms = request_var('terms', 'all');
+ $search_fields = request_var('sf', 'all');
+ $search_child = request_var('sc', true);
+
+ $sort_days = request_var('st', 0);
+ $sort_key = request_var('sk', 't');
+ $sort_dir = request_var('sd', 'd');
+
+ $return_chars = request_var('ch', ($topic_id) ? -1 : 300);
+ $search_forum = request_var('fid', array(0));
+
+ // Is user able to search? Has search been disabled?
+ if (!$auth->acl_get('u_search') || !$auth->acl_getf_global('f_search') || !$config['load_search'])
+ {
+ $template->assign_var('S_NO_SEARCH', true);
+ trigger_error('NO_SEARCH');
+ }
+
+ // Check search load limit
+ if ($user->load && $config['limit_search_load'] && ($user->load > doubleval($config['limit_search_load'])))
+ {
+ $template->assign_var('S_NO_SEARCH', true);
+ trigger_error('NO_SEARCH_TIME');
+ }
+
+ // Check flood limit ... if applicable
+ $interval = ($user->data['user_id'] == ANONYMOUS) ? $config['search_anonymous_interval'] : $config['search_interval'];
+ if ($interval && !$auth->acl_get('u_ignoreflood'))
+ {
+ if ($user->data['user_last_search'] > time() - $interval)
+ {
+ $template->assign_var('S_NO_SEARCH', true);
+ trigger_error('NO_SEARCH_TIME');
+ }
+ }
+
+ // Define some vars
+ $limit_days = array(0 => $user->lang['ALL_RESULTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
+ $sort_by_text = array('a' => $user->lang['SORT_AUTHOR'], 't' => $user->lang['SORT_TIME'], 'f' => $user->lang['SORT_FORUM'], 'i' => $user->lang['SORT_TOPIC_TITLE'], 's' => $user->lang['SORT_POST_SUBJECT']);
+
+ $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
+ gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
+
+ if ($keywords || $author || $author_id || $search_id || $submit)
+ {
+ // clear arrays
+ $id_ary = array();
+
+ // egosearch is an author search
+ if ($search_id == 'egosearch')
+ {
+ $author_id = $user->data['user_id'];
+
+ if ($user->data['user_id'] == ANONYMOUS)
+ {
+ login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
+ }
+ }
+
+ // If we are looking for authors get their ids
+ $author_id_ary = array();
+ if ($author_id)
+ {
+ $author_id_ary[] = $author_id;
+ }
+ else if ($author)
+ {
+ if ((strpos($author, '*') !== false) && (utf8_strlen(str_replace(array('*', '%'), '', $author)) < $config['min_search_author_chars']))
+ {
+ trigger_error(sprintf($user->lang['TOO_FEW_AUTHOR_CHARS'], $config['min_search_author_chars']));
+ }
+
+ $sql_where = (strpos($author, '*') !== false) ? ' username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " username_clean = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
+
+ $sql = 'SELECT user_id
+ FROM ' . USERS_TABLE . "
+ WHERE $sql_where
+ AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
+ $result = $db->sql_query_limit($sql, 100);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $author_id_ary[] = (int) $row['user_id'];
+ }
+ $db->sql_freeresult($result);
+
+ if (!sizeof($author_id_ary))
+ {
+ trigger_error('NO_SEARCH_RESULTS');
+ }
+ }
+
+ // if we search in an existing search result just add the additional keywords. But we need to use "all search terms"-mode
+ // so we can keep the old keywords in their old mode, but add the new ones as required words
+ if ($add_keywords)
+ {
+ if ($search_terms == 'all')
+ {
+ $keywords .= ' ' . $add_keywords;
+ }
+ else
+ {
+ $search_terms = 'all';
+ $keywords = implode(' |', explode(' ', preg_replace('#\s+#u', ' ', $keywords))) . ' ' .$add_keywords;
+ }
+ }
+
+ // Which forums should not be searched? Author searches are also carried out in unindexed forums
+ if (empty($keywords) && sizeof($author_id_ary))
+ {
+ $ex_fid_ary = array_keys($auth->acl_getf('!f_read', true));
+ }
+ else
+ {
+ $ex_fid_ary = array_unique(array_merge(array_keys($auth->acl_getf('!f_read', true)), array_keys($auth->acl_getf('!f_search', true))));
+ }
+
+ $not_in_fid = (sizeof($ex_fid_ary)) ? 'WHERE ' . $db->sql_in_set('f.forum_id', $ex_fid_ary, true) . " OR (f.forum_password <> '' AND fa.user_id <> " . (int) $user->data['user_id'] . ')' : "";
+
+ $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, fa.user_id
+ FROM ' . FORUMS_TABLE . ' f
+ LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id
+ AND fa.session_id = '" . $db->sql_escape($user->session_id) . "')
+ $not_in_fid
+ ORDER BY f.left_id";
+ $result = $db->sql_query($sql);
+
+ $right_id = 0;
+ $reset_search_forum = true;
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if ($row['forum_password'] && $row['user_id'] != $user->data['user_id'])
+ {
+ $ex_fid_ary[] = (int) $row['forum_id'];
+ continue;
+ }
+
+ if (sizeof($search_forum))
+ {
+ if ($search_child)
+ {
+ if (in_array($row['forum_id'], $search_forum) && $row['right_id'] > $right_id)
+ {
+ $right_id = (int) $row['right_id'];
+ }
+ else if ($row['right_id'] < $right_id)
+ {
+ continue;
+ }
+ }
+
+ if (!in_array($row['forum_id'], $search_forum))
+ {
+ $ex_fid_ary[] = (int) $row['forum_id'];
+ $reset_search_forum = false;
+ }
+ }
+ }
+ $db->sql_freeresult($result);
+
+ // find out in which forums the user is allowed to view approved posts
+ if ($auth->acl_get('m_approve'))
+ {
+ $m_approve_fid_ary = array(-1);
+ $m_approve_fid_sql = '';
+ }
+ else if ($auth->acl_getf_global('m_approve'))
+ {
+ $m_approve_fid_ary = array_diff(array_keys($auth->acl_getf('!m_approve', true)), $ex_fid_ary);
+ $m_approve_fid_sql = ' AND (p.post_approved = 1' . ((sizeof($m_approve_fid_ary)) ? ' OR ' . $db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) : '') . ')';
+ }
+ else
+ {
+ $m_approve_fid_ary = array();
+ $m_approve_fid_sql = ' AND p.post_approved = 1';
+ }
+
+ if ($reset_search_forum)
+ {
+ $search_forum = array();
+ }
+
+ // Select which method we'll use to obtain the post_id or topic_id information
+ $search_type = basename($config['search_type']);
+
+ if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
+ {
+ trigger_error('NO_SUCH_SEARCH_MODULE');
+ }
+
+ require("{$phpbb_root_path}includes/search/$search_type.$phpEx");
+
+ // We do some additional checks in the module to ensure it can actually be utilised
+ $error = false;
+ $search = new $search_type($error);
+
+ if ($error)
+ {
+ trigger_error($error);
+ }
+
+ // let the search module split up the keywords
+ if ($keywords)
+ {
+ $correct_query = $search->split_keywords($keywords, $search_terms);
+ if (!$correct_query || (empty($search->search_query) && !sizeof($author_id_ary) && !$search_id))
+ {
+ $ignored = (sizeof($search->common_words)) ? sprintf($user->lang['IGNORED_TERMS_EXPLAIN'], implode(' ', $search->common_words)) . '<br />' : '';
+ trigger_error($ignored . sprintf($user->lang['NO_KEYWORDS'], $search->word_length['min'], $search->word_length['max']));
+ }
+ }
+
+ if (!$keywords && sizeof($author_id_ary))
+ {
+ // if it is an author search we want to show topics by default
+ $show_results = ($topic_id) ? 'posts' : request_var('sr', ($search_id == 'egosearch') ? 'topics' : 'posts');
+ $show_results = ($show_results == 'posts') ? 'posts' : 'topics';
+ }
+
+ // define some variables needed for retrieving post_id/topic_id information
+ $sort_by_sql = array('a' => 'u.username_clean', 't' => (($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time'), 'f' => 'f.forum_id', 'i' => 't.topic_title', 's' => (($show_results == 'posts') ? 'p.post_subject' : 't.topic_title'));
+
+ // pre-made searches
+ $sql = $field = $l_search_title = '';
+ if ($search_id)
+ {
+ switch ($search_id)
+ {
+ // Oh holy Bob, bring us some activity...
+ case 'active_topics':
+ $l_search_title = $user->lang['SEARCH_ACTIVE_TOPICS'];
+ $show_results = 'topics';
+ $sort_key = 't';
+ $sort_dir = 'd';
+ $sort_days = request_var('st', 7);
+ $sort_by_sql['t'] = 't.topic_last_post_time';
+
+ gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
+ $s_sort_key = $s_sort_dir = '';
+
+ $last_post_time_sql = ($sort_days) ? ' AND t.topic_last_post_time > ' . (time() - ($sort_days * 24 * 3600)) : '';
+
+ $sql = 'SELECT t.topic_last_post_time, t.topic_id
+ FROM ' . TOPICS_TABLE . " t
+ WHERE t.topic_moved_id = 0
+ $last_post_time_sql
+ " . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
+ ' . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '') . '
+ ORDER BY t.topic_last_post_time DESC';
+ $field = 'topic_id';
+ break;
+
+ case 'unanswered':
+ $l_search_title = $user->lang['SEARCH_UNANSWERED'];
+ $show_results = request_var('sr', 'topics');
+ $show_results = ($show_results == 'posts') ? 'posts' : 'topics';
+ $sort_by_sql['t'] = ($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time';
+ $sort_by_sql['s'] = ($show_results == 'posts') ? 'p.post_subject' : 't.topic_title';
+ $sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
+
+ $sort_join = ($sort_key == 'f') ? FORUMS_TABLE . ' f, ' : '';
+ $sql_sort = ($sort_key == 'f') ? ' AND f.forum_id = p.forum_id ' . $sql_sort : $sql_sort;
+
+ if ($sort_days)
+ {
+ $last_post_time = 'AND p.post_time > ' . (time() - ($sort_days * 24 * 3600));
+ }
+ else
+ {
+ $last_post_time = '';
+ }
+
+
+ if ($sort_key == 'a')
+ {
+ $sort_join = USERS_TABLE . ' u, ';
+ $sql_sort = ' AND u.user_id = p.poster_id ' . $sql_sort;
+ }
+ if ($show_results == 'posts')
+ {
+ $sql = "SELECT p.post_id
+ FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
+ WHERE t.topic_replies = 0
+ AND p.topic_id = t.topic_id
+ $last_post_time
+ $m_approve_fid_sql
+ " . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . "
+ $sql_sort";
+ $field = 'post_id';
+ }
+ else
+ {
+ $sql = 'SELECT DISTINCT ' . $sort_by_sql[$sort_key] . ", p.topic_id
+ FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
+ WHERE t.topic_replies = 0
+ AND t.topic_moved_id = 0
+ AND p.topic_id = t.topic_id
+ $last_post_time
+ $m_approve_fid_sql
+ " . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . "
+ $sql_sort";
+ $field = 'topic_id';
+ }
+ break;
+
+ case 'newposts':
+ $l_search_title = $user->lang['SEARCH_NEW'];
+ // force sorting
+ $show_results = (request_var('sr', 'topics') == 'posts') ? 'posts' : 'topics';
+ $sort_key = 't';
+ $sort_dir = 'd';
+ $sort_by_sql['t'] = ($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time';
+ $sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
+
+ gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
+ $s_sort_key = $s_sort_dir = $u_sort_param = $s_limit_days = '';
+
+ if ($show_results == 'posts')
+ {
+ $sql = 'SELECT p.post_id
+ FROM ' . POSTS_TABLE . ' p
+ WHERE p.post_time > ' . $user->data['user_lastvisit'] . "
+ $m_approve_fid_sql
+ " . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . "
+ $sql_sort";
+ $field = 'post_id';
+ }
+ else
+ {
+ $sql = 'SELECT t.topic_id
+ FROM ' . TOPICS_TABLE . ' t
+ WHERE t.topic_last_post_time > ' . $user->data['user_lastvisit'] . '
+ AND t.topic_moved_id = 0
+ ' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
+ ' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '') . "
+ $sql_sort";
+ $field = 'topic_id';
+ }
+ break;
+
+ case 'egosearch':
+ $l_search_title = $user->lang['SEARCH_SELF'];
+ break;
+ }
+ }
+
+ // show_results should not change after this
+ $per_page = ($show_results == 'posts') ? $config['posts_per_page'] : $config['topics_per_page'];
+ $total_match_count = 0;
+
+ if ($search_id)
+ {
+ if ($sql)
+ {
+ // only return up to 1000 ids (the last one will be removed later)
+ $result = $db->sql_query_limit($sql, 1001 - $start, $start);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $id_ary[] = $row[$field];
+ }
+ $db->sql_freeresult($result);
+
+ $total_match_count = sizeof($id_ary) + $start;
+ $id_ary = array_slice($id_ary, 0, $per_page);
+ }
+ else
+ {
+ $search_id = '';
+ }
+ }
+
+ // make sure that some arrays are always in the same order
+ sort($ex_fid_ary);
+ sort($m_approve_fid_ary);
+ sort($author_id_ary);
+
+ if (!empty($search->search_query))
+ {
+ $total_match_count = $search->keyword_search($show_results, $search_fields, $search_terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $id_ary, $start, $per_page);
+ }
+ else if (sizeof($author_id_ary))
+ {
+ $firstpost_only = ($search_fields === 'firstpost') ? true : false;
+ $total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $id_ary, $start, $per_page);
+ }
+
+ // For some searches we need to print out the "no results" page directly to allow re-sorting/refining the search options.
+ if (!sizeof($id_ary) && !$search_id)
+ {
+ trigger_error('NO_SEARCH_RESULTS');
+ }
+
+ $sql_where = '';
+
+ if (sizeof($id_ary))
+ {
+ $sql_where .= $db->sql_in_set(($show_results == 'posts') ? 'p.post_id' : 't.topic_id', $id_ary);
+ $sql_where .= (sizeof($ex_fid_ary)) ? ' AND (' . $db->sql_in_set('f.forum_id', $ex_fid_ary, true) . ' OR f.forum_id IS NULL)' : '';
+ $sql_where .= ($show_results == 'posts') ? $m_approve_fid_sql : str_replace(array('p.post_approved', 'p.forum_id'), array('t.topic_approved', 't.forum_id'), $m_approve_fid_sql);
+ }
+
+ if ($show_results == 'posts')
+ {
+ include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
+ }
+ else
+ {
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ }
+
+ // Grab icons
+ $icons = $cache->obtain_icons();
+
+ // Output header
+ if ($search_id && ($total_match_count > 1000))
+ {
+ // limit the number to 1000 for pre-made searches
+ $total_match_count--;
+ $l_search_matches = sprintf($user->lang['FOUND_MORE_SEARCH_MATCHES'], $total_match_count);
+ }
+ else
+ {
+ $l_search_matches = ($total_match_count == 1) ? sprintf($user->lang['FOUND_SEARCH_MATCH'], $total_match_count) : sprintf($user->lang['FOUND_SEARCH_MATCHES'], $total_match_count);
+ }
+
+ // define some vars for urls
+ $hilit = implode('|', explode(' ', preg_replace('#\s+#u', ' ', str_replace(array('+', '-', '|', '(', ')', '"'), ' ', $keywords))));
+ $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit)));
+ $u_show_results = ($show_results != 'posts') ? '&sr=' . $show_results : '';
+ $u_search_forum = implode('&fid%5B%5D=', $search_forum);
+
+ $u_search = append_sid("{$phpbb_root_path}index.$phpEx", 'i=search&mode=search&' . $u_sort_param . $u_show_results);
+ $u_search .= ($search_id) ? '&search_id=' . $search_id : '';
+ $u_search .= ($u_hilit) ? '&keywords=' . urlencode(htmlspecialchars_decode($search->search_query)) : '';
+ $u_search .= ($topic_id) ? '&t=' . $topic_id : '';
+ $u_search .= ($author) ? '&author=' . urlencode(htmlspecialchars_decode($author)) : '';
+ $u_search .= ($author_id) ? '&author_id=' . $author_id : '';
+ $u_search .= ($u_search_forum) ? '&fid%5B%5D=' . $u_search_forum : '';
+ $u_search .= (!$search_child) ? '&sc=0' : '';
+ $u_search .= ($search_fields != 'all') ? '&sf=' . $search_fields : '';
+ $u_search .= ($return_chars != 300) ? '&ch=' . $return_chars : '';
+
+ $template->assign_vars(array(
+ 'SEARCH_TITLE' => $l_search_title,
+ 'SEARCH_MATCHES' => $l_search_matches,
+ 'SEARCH_WORDS' => $search->search_query,
+ 'IGNORED_WORDS' => (sizeof($search->common_words)) ? implode(' ', $search->common_words) : '',
+ 'PAGINATION' => generate_pagination($u_search, $total_match_count, $per_page, $start),
+ 'PAGE_NUMBER' => on_page($total_match_count, $per_page, $start),
+ 'TOTAL_MATCHES' => $total_match_count,
+ 'SEARCH_IN_RESULTS' => ($search_id) ? false : true,
+
+ 'S_SELECT_SORT_DIR' => $s_sort_dir,
+ 'S_SELECT_SORT_KEY' => $s_sort_key,
+ 'S_SELECT_SORT_DAYS' => $s_limit_days,
+ 'S_SEARCH_ACTION' => $u_search,
+ 'S_SHOW_TOPICS' => ($show_results == 'posts') ? false : true,
+
+ 'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
+ 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
+ 'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'),
+ 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'),
+ 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
+
+ 'U_SEARCH_WORDS' => $u_search,
+ ));
+
+ if ($sql_where)
+ {
+ if ($show_results == 'posts')
+ {
+ // @todo Joining this query to the one below?
+ $sql = 'SELECT zebra_id, friend, foe
+ FROM ' . ZEBRA_TABLE . '
+ WHERE user_id = ' . $user->data['user_id'];
+ $result = $db->sql_query($sql);
+
+ $zebra = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $zebra[($row['friend']) ? 'friend' : 'foe'][] = $row['zebra_id'];
+ }
+ $db->sql_freeresult($result);
+
+ $sql = 'SELECT p.*, f.forum_id, f.forum_name, t.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_colour
+ FROM ' . POSTS_TABLE . ' p
+ LEFT JOIN ' . TOPICS_TABLE . ' t ON (p.topic_id = t.topic_id)
+ LEFT JOIN ' . FORUMS_TABLE . ' f ON (p.forum_id = f.forum_id)
+ LEFT JOIN ' . USERS_TABLE . " u ON (p.poster_id = u.user_id)
+ WHERE $sql_where";
+ }
+ else
+ {
+ $sql_from = TOPICS_TABLE . ' t
+ LEFT JOIN ' . FORUMS_TABLE . ' f ON (f.forum_id = t.forum_id)
+ ' . (($sort_key == 'a') ? ' LEFT JOIN ' . USERS_TABLE . ' u ON (u.user_id = t.topic_poster) ' : '');
+ $sql_select = 't.*, f.forum_id, f.forum_name';
+
+ if ($user->data['is_registered'])
+ {
+ if ($config['load_db_track'])
+ {
+ $sql_from .= ' LEFT JOIN ' . TOPICS_POSTED_TABLE . ' tp ON (tp.user_id = ' . $user->data['user_id'] . '
+ AND t.topic_id = tp.topic_id)';
+ $sql_select .= ', tp.topic_posted';
+ }
+
+ if ($config['load_db_lastread'])
+ {
+ $sql_from .= ' LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.user_id = ' . $user->data['user_id'] . '
+ AND t.topic_id = tt.topic_id)
+ LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . '
+ AND ft.forum_id = f.forum_id)';
+ $sql_select .= ', tt.mark_time, ft.mark_time as f_mark_time';
+ }
+ }
+
+ if ($config['load_anon_lastread'] || ($user->data['is_registered'] && !$config['load_db_lastread']))
+ {
+ $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
+ $tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
+ }
+
+ $sql = "SELECT $sql_select
+ FROM $sql_from
+ WHERE $sql_where";
+ }
+ $sql .= ' ORDER BY ' . $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
+ $result = $db->sql_query($sql);
+ $result_topic_id = 0;
+
+ $rowset = array();
+
+ if ($show_results == 'topics')
+ {
+ $forums = $rowset = $shadow_topic_list = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if ($row['topic_status'] == ITEM_MOVED)
+ {
+ $shadow_topic_list[$row['topic_moved_id']] = $row['topic_id'];
+ }
+
+ $rowset[$row['topic_id']] = $row;
+
+ if (!isset($forums[$row['forum_id']]) && $user->data['is_registered'] && $config['load_db_lastread'])
+ {
+ $forums[$row['forum_id']]['mark_time'] = $row['f_mark_time'];
+ }
+ $forums[$row['forum_id']]['topic_list'][] = $row['topic_id'];
+ $forums[$row['forum_id']]['rowset'][$row['topic_id']] = &$rowset[$row['topic_id']];
+ }
+ $db->sql_freeresult($result);
+
+ // If we have some shadow topics, update the rowset to reflect their topic information
+ if (sizeof($shadow_topic_list))
+ {
+ $sql = 'SELECT *
+ FROM ' . TOPICS_TABLE . '
+ WHERE ' . $db->sql_in_set('topic_id', array_keys($shadow_topic_list));
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $orig_topic_id = $shadow_topic_list[$row['topic_id']];
+
+ // We want to retain some values
+ $row = array_merge($row, array(
+ 'topic_moved_id' => $rowset[$orig_topic_id]['topic_moved_id'],
+ 'topic_status' => $rowset[$orig_topic_id]['topic_status'],
+ 'forum_name' => $rowset[$orig_topic_id]['forum_name'])
+ );
+
+ $rowset[$orig_topic_id] = $row;
+ }
+ $db->sql_freeresult($result);
+ }
+ unset($shadow_topic_list);
+
+ foreach ($forums as $forum_id => $forum)
+ {
+ if ($user->data['is_registered'] && $config['load_db_lastread'])
+ {
+ $topic_tracking_info[$forum_id] = get_topic_tracking($forum_id, $forum['topic_list'], $forum['rowset'], array($forum_id => $forum['mark_time']), ($forum_id) ? false : $forum['topic_list']);
+ }
+ else if ($config['load_anon_lastread'] || $user->data['is_registered'])
+ {
+ $topic_tracking_info[$forum_id] = get_complete_topic_tracking($forum_id, $forum['topic_list'], ($forum_id) ? false : $forum['topic_list']);
+
+ if (!$user->data['is_registered'])
+ {
+ $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0;
+ }
+ }
+ }
+ unset($forum...
[truncated message content] |
|
From: <dac...@us...> - 2007-09-16 20:18:48
|
Revision: 62
http://thevr.svn.sourceforge.net/thevr/?rev=62&view=rev
Author: dachebodt
Date: 2007-09-16 13:18:52 -0700 (Sun, 16 Sep 2007)
Log Message:
-----------
Removed file/folder
Removed Paths:
-------------
mods/cms/trunk/modules/forums/
mods/cms/trunk/modules/forums1/
mods/cms/trunk/modules/search/
mods/cms/trunk/modules/search1/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dac...@us...> - 2007-09-16 20:17:30
|
Revision: 61
http://thevr.svn.sourceforge.net/thevr/?rev=61&view=rev
Author: dachebodt
Date: 2007-09-16 13:17:34 -0700 (Sun, 16 Sep 2007)
Log Message:
-----------
Removed file/folder
Removed Paths:
-------------
mods/cms/trunk/modules/mods/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dac...@us...> - 2007-09-16 20:14:57
|
Revision: 60
http://thevr.svn.sourceforge.net/thevr/?rev=60&view=rev
Author: dachebodt
Date: 2007-09-16 13:15:00 -0700 (Sun, 16 Sep 2007)
Log Message:
-----------
+successfully changed forum mod to use viewforum.php and viewtopic.php instead of duplicating those files in forum mod
+ made various little updates
Modified Paths:
--------------
mods/cms/trunk/cms_install.php
mods/cms/trunk/common.php
mods/cms/trunk/includes/functions_display.php
mods/cms/trunk/modules/blocks/functions_blocks.php
mods/cms/trunk/modules/calendar/functions_calendar.php
mods/cms/trunk/modules/content/acp_content.php
mods/cms/trunk/modules/content/cms_content.php
mods/cms/trunk/modules/content/functions_content.php
mods/cms/trunk/modules/content/functions_properties.php
mods/cms/trunk/modules/content/info/acp_content.php
mods/cms/trunk/modules/content/info/cms_content.php
mods/cms/trunk/modules/content/info/content_info.php
mods/cms/trunk/modules/content/info/mcp_content.php
mods/cms/trunk/modules/content/info/ucp_content.php
mods/cms/trunk/modules/content/language/en/content.php
mods/cms/trunk/modules/content/mcp_content.php
mods/cms/trunk/modules/content/template/acp_content.html
mods/cms/trunk/modules/content/template/cms_content.html
mods/cms/trunk/modules/content/ucp_content.php
mods/cms/trunk/modules/cs/images/bg/raindro2.gif
mods/cms/trunk/posting.php
mods/cms/trunk/styles/prosilver/template/layout.html
mods/cms/trunk/styles/prosilver/template/overall_header.html
mods/cms/trunk/styles/prosilver/template/posting_layout.html
mods/cms/trunk/styles/prosilver/template/viewforum_body.html
mods/cms/trunk/styles/prosilver/template/viewtopic_body.html
mods/cms/trunk/viewforum.php
mods/cms/trunk/viewtopic.php
Added Paths:
-----------
mods/cms/trunk/images/avatars/gallery/default_avatar.gif
mods/cms/trunk/modules/core/
mods/cms/trunk/modules/core/acp_core.php
mods/cms/trunk/modules/core/functions_core.php
mods/cms/trunk/modules/core/functions_permissions.php
mods/cms/trunk/modules/core/info/
mods/cms/trunk/modules/core/info/acp_core.php
mods/cms/trunk/modules/core/info/core_info.php
mods/cms/trunk/modules/core/language/
mods/cms/trunk/modules/core/language/en/
mods/cms/trunk/modules/core/language/en/common.php
mods/cms/trunk/modules/core/language/en/core.php
mods/cms/trunk/modules/core/template/
mods/cms/trunk/modules/core/template/acp_core.html
mods/cms/trunk/modules/forums1/
mods/cms/trunk/modules/forums1/blocks/
mods/cms/trunk/modules/forums1/blocks/cms_polls.php
mods/cms/trunk/modules/forums1/blocks/cms_recent_topics.php
mods/cms/trunk/modules/forums1/blocks/grp_recent_topics.php
mods/cms/trunk/modules/forums1/cms_forums.php
mods/cms/trunk/modules/forums1/grp_forums.php
mods/cms/trunk/modules/forums1/info/
mods/cms/trunk/modules/forums1/info/cms_forums.php
mods/cms/trunk/modules/forums1/info/forums_info.php
mods/cms/trunk/modules/forums1/info/grp_forums.php
mods/cms/trunk/modules/forums1/language/
mods/cms/trunk/modules/forums1/language/en/
mods/cms/trunk/modules/forums1/language/en/admin.php
mods/cms/trunk/modules/forums1/language/en/common.php
mods/cms/trunk/modules/forums1/template/
mods/cms/trunk/modules/forums1/template/blank.html
mods/cms/trunk/modules/forums1/template/block_polls.html
mods/cms/trunk/modules/forums1/template/block_recent_topics.html
mods/cms/trunk/modules/forums1/template/block_wordgraph.html
mods/cms/trunk/modules/search1/
mods/cms/trunk/modules/search1/blocks/
mods/cms/trunk/modules/search1/blocks/cms_wordgraph.php
mods/cms/trunk/modules/search1/cms_search.php
mods/cms/trunk/modules/search1/info/
mods/cms/trunk/modules/search1/info/cms_search.php
mods/cms/trunk/modules/search1/info/search_info.php
mods/cms/trunk/modules/search1/language/
mods/cms/trunk/modules/search1/language/en/
mods/cms/trunk/modules/search1/language/en/admin.php
mods/cms/trunk/modules/search1/language/en/common.php
mods/cms/trunk/modules/search1/template/
mods/cms/trunk/modules/search1/template/block_wordgraph.html
Modified: mods/cms/trunk/cms_install.php
===================================================================
--- mods/cms/trunk/cms_install.php 2007-09-10 03:47:19 UTC (rev 59)
+++ mods/cms/trunk/cms_install.php 2007-09-16 20:15:00 UTC (rev 60)
@@ -41,7 +41,7 @@
$mod = request_var('m', '');
$action = request_var('action', '');
-$to_install = array('mods', 'blocks', 'content', 'search', 'forums', 'comments');
+$to_install = array('core', 'blocks', 'content', 'search', 'forums', 'comments');
if($mod && $action)
{
@@ -56,7 +56,7 @@
trigger_error($user->lang['NO_ADMIN']);
}
- include($phpbb_root_path . "modules/mods/acp_mods.$phpEx");
+ include($phpbb_root_path . "modules/core/acp_core.$phpEx");
if($mod == 'mods')
{
@@ -143,11 +143,11 @@
}
// Set custom template path
- $tpl_path = $phpbb_root_path . "modules/mods/template";
- $mtemplate->set_custom_template($tpl_path, 'mods');
+ $tpl_path = $phpbb_root_path . "modules/core/template";
+ $mtemplate->set_custom_template($tpl_path, 'core');
$module = new p_master();
- $installer = new acp_mods();
+ $installer = new acp_core();
$installer->main('', '');
$mod_key = array_search($mod, $to_install);
@@ -173,7 +173,7 @@
}
else if($action)
{
- $meta_info = append_sid("{$phpbb_root_path}cms_install.$phpEx", "action=install&m=mods", true, $user->session_id);
+ $meta_info = append_sid("{$phpbb_root_path}cms_install.$phpEx", "action=install&m=core", true, $user->session_id);
meta_refresh(3, $meta_info);
$content = 'Installing CMS, please wait...'; //sprintf($user->lang['INSTALLING_MOD'], 'CMS');
}
Modified: mods/cms/trunk/common.php
===================================================================
--- mods/cms/trunk/common.php 2007-09-10 03:47:19 UTC (rev 59)
+++ mods/cms/trunk/common.php 2007-09-16 20:15:00 UTC (rev 60)
@@ -1,202 +1,202 @@
-<?php
-/**
-*
-* @package phpBB3
-* @version $Id: common.php,v 1.205 2007/08/13 12:14:05 acydburn Exp $
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-* Minimum Requirement: PHP 4.3.3
-*/
-
-/**
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-$starttime = explode(' ', microtime());
-$starttime = $starttime[1] + $starttime[0];
-
-// Report all errors, except notices
-error_reporting(E_ALL ^ E_NOTICE);
-
-/*
-* Remove variables created by register_globals from the global scope
-* Thanks to Matt Kavanagh
-*/
-function deregister_globals()
-{
- $not_unset = array(
- 'GLOBALS' => true,
- '_GET' => true,
- '_POST' => true,
- '_COOKIE' => true,
- '_REQUEST' => true,
- '_SERVER' => true,
- '_SESSION' => true,
- '_ENV' => true,
- '_FILES' => true,
- 'phpEx' => true,
- 'phpbb_root_path' => true
- );
-
- // Not only will array_merge and array_keys give a warning if
- // a parameter is not an array, array_merge will actually fail.
- // So we check if _SESSION has been initialised.
- if (!isset($_SESSION) || !is_array($_SESSION))
- {
- $_SESSION = array();
- }
-
- // Merge all into one extremely huge array; unset this later
- $input = array_merge(
- array_keys($_GET),
- array_keys($_POST),
- array_keys($_COOKIE),
- array_keys($_SERVER),
- array_keys($_SESSION),
- array_keys($_ENV),
- array_keys($_FILES)
- );
-
- foreach ($input as $varname)
- {
- if (isset($not_unset[$varname]))
- {
- // Hacking attempt. No point in continuing.
- exit;
- }
-
- unset($GLOBALS[$varname]);
- }
-
- unset($input);
-}
-
-// If we are on PHP >= 6.0.0 we do not need some code
-if (version_compare(PHP_VERSION, '6.0.0-dev', '>='))
-{
- /**
- * @ignore
- */
- define('STRIP', false);
-}
-else
-{
- set_magic_quotes_runtime(0);
-
- // Be paranoid with passed vars
- if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
- {
- deregister_globals();
- }
-
- define('STRIP', (get_magic_quotes_gpc()) ? true : false);
-}
-
-if (defined('IN_CRON'))
-{
- $phpbb_root_path = dirname(__FILE__) . DIRECTORY_SEPARATOR;
-}
-
-if (!file_exists($phpbb_root_path . 'config.' . $phpEx))
-{
- die("<p>The config.$phpEx file could not be found.</p><p><a href=\"{$phpbb_root_path}install/index.$phpEx\">Click here to install phpBB</a></p>");
-}
-
-require($phpbb_root_path . 'config.' . $phpEx);
-
-if (!defined('PHPBB_INSTALLED'))
-{
- // Redirect the user to the installer
- // We have to generate a full HTTP/1.1 header here since we can't guarantee to have any of the information
- // available as used by the redirect function
- $server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
- $server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
- $secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0;
-
- $script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
- if (!$script_name)
- {
- $script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
- }
-
- // Replace any number of consecutive backslashes and/or slashes with a single slash
- // (could happen on some proxy setups and/or Windows servers)
- $script_path = trim(dirname($script_name)) . '/install/index.' . $phpEx;
- $script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
-
- $url = (($secure) ? 'https://' : 'http://') . $server_name;
-
- if ($server_port && (($secure && $server_port <> 443) || (!$secure && $server_port <> 80)))
- {
- $url .= ':' . $server_port;
- }
-
- $url .= $script_path;
- header('Location: ' . $url);
- exit;
-}
-
-if (defined('DEBUG_EXTRA'))
-{
- $base_memory_usage = 0;
- if (function_exists('memory_get_usage'))
- {
- $base_memory_usage = memory_get_usage();
- }
-}
-
-// Load Extensions
-if (!empty($load_extensions))
-{
- $load_extensions = explode(',', $load_extensions);
-
- foreach ($load_extensions as $extension)
- {
- @dl(trim($extension));
- }
-}
-
-// Include files
-require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
-require($phpbb_root_path . 'includes/cache.' . $phpEx);
-require($phpbb_root_path . 'includes/template.' . $phpEx);
-require($phpbb_root_path . 'includes/session.' . $phpEx);
-require($phpbb_root_path . 'includes/auth.' . $phpEx);
-require($phpbb_root_path . 'includes/functions.' . $phpEx);
-require($phpbb_root_path . 'includes/constants.' . $phpEx);
-require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
-require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
-
-// Set PHP error handler to ours
-set_error_handler('msg_handler');
-
-// Instantiate some basic classes
-$user = new user();
-$auth = new auth();
-$template = new template();
-$cache = new cache();
-$db = new $sql_db();
-
-// Connect to DB
-$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false);
-
-// We do not need this any longer, unset for safety purposes
-unset($dbpasswd);
-
-// Grab global variables, re-cache if necessary
-$config = $cache->obtain_config();
-
-$mtemplate = new template();
-$cms_modules = array();
-if($config['cms_enabled'])
-{
- require($phpbb_root_path . 'modules/mods/functions_mods.' . $phpEx);
-
- $cms_modules = get_installed_modules();
-}
-
+<?php
+/**
+*
+* @package phpBB3
+* @version $Id: common.php,v 1.205 2007/08/13 12:14:05 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+* Minimum Requirement: PHP 4.3.3
+*/
+
+/**
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+$starttime = explode(' ', microtime());
+$starttime = $starttime[1] + $starttime[0];
+
+// Report all errors, except notices
+error_reporting(E_ALL ^ E_NOTICE);
+
+/*
+* Remove variables created by register_globals from the global scope
+* Thanks to Matt Kavanagh
+*/
+function deregister_globals()
+{
+ $not_unset = array(
+ 'GLOBALS' => true,
+ '_GET' => true,
+ '_POST' => true,
+ '_COOKIE' => true,
+ '_REQUEST' => true,
+ '_SERVER' => true,
+ '_SESSION' => true,
+ '_ENV' => true,
+ '_FILES' => true,
+ 'phpEx' => true,
+ 'phpbb_root_path' => true
+ );
+
+ // Not only will array_merge and array_keys give a warning if
+ // a parameter is not an array, array_merge will actually fail.
+ // So we check if _SESSION has been initialised.
+ if (!isset($_SESSION) || !is_array($_SESSION))
+ {
+ $_SESSION = array();
+ }
+
+ // Merge all into one extremely huge array; unset this later
+ $input = array_merge(
+ array_keys($_GET),
+ array_keys($_POST),
+ array_keys($_COOKIE),
+ array_keys($_SERVER),
+ array_keys($_SESSION),
+ array_keys($_ENV),
+ array_keys($_FILES)
+ );
+
+ foreach ($input as $varname)
+ {
+ if (isset($not_unset[$varname]))
+ {
+ // Hacking attempt. No point in continuing.
+ exit;
+ }
+
+ unset($GLOBALS[$varname]);
+ }
+
+ unset($input);
+}
+
+// If we are on PHP >= 6.0.0 we do not need some code
+if (version_compare(PHP_VERSION, '6.0.0-dev', '>='))
+{
+ /**
+ * @ignore
+ */
+ define('STRIP', false);
+}
+else
+{
+ set_magic_quotes_runtime(0);
+
+ // Be paranoid with passed vars
+ if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
+ {
+ deregister_globals();
+ }
+
+ define('STRIP', (get_magic_quotes_gpc()) ? true : false);
+}
+
+if (defined('IN_CRON'))
+{
+ $phpbb_root_path = dirname(__FILE__) . DIRECTORY_SEPARATOR;
+}
+
+if (!file_exists($phpbb_root_path . 'config.' . $phpEx))
+{
+ die("<p>The config.$phpEx file could not be found.</p><p><a href=\"{$phpbb_root_path}install/index.$phpEx\">Click here to install phpBB</a></p>");
+}
+
+require($phpbb_root_path . 'config.' . $phpEx);
+
+if (!defined('PHPBB_INSTALLED'))
+{
+ // Redirect the user to the installer
+ // We have to generate a full HTTP/1.1 header here since we can't guarantee to have any of the information
+ // available as used by the redirect function
+ $server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
+ $server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
+ $secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0;
+
+ $script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
+ if (!$script_name)
+ {
+ $script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI');
+ }
+
+ // Replace any number of consecutive backslashes and/or slashes with a single slash
+ // (could happen on some proxy setups and/or Windows servers)
+ $script_path = trim(dirname($script_name)) . '/install/index.' . $phpEx;
+ $script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
+
+ $url = (($secure) ? 'https://' : 'http://') . $server_name;
+
+ if ($server_port && (($secure && $server_port <> 443) || (!$secure && $server_port <> 80)))
+ {
+ $url .= ':' . $server_port;
+ }
+
+ $url .= $script_path;
+ header('Location: ' . $url);
+ exit;
+}
+
+if (defined('DEBUG_EXTRA'))
+{
+ $base_memory_usage = 0;
+ if (function_exists('memory_get_usage'))
+ {
+ $base_memory_usage = memory_get_usage();
+ }
+}
+
+// Load Extensions
+if (!empty($load_extensions))
+{
+ $load_extensions = explode(',', $load_extensions);
+
+ foreach ($load_extensions as $extension)
+ {
+ @dl(trim($extension));
+ }
+}
+
+// Include files
+require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
+require($phpbb_root_path . 'includes/cache.' . $phpEx);
+require($phpbb_root_path . 'includes/template.' . $phpEx);
+require($phpbb_root_path . 'includes/session.' . $phpEx);
+require($phpbb_root_path . 'includes/auth.' . $phpEx);
+require($phpbb_root_path . 'includes/functions.' . $phpEx);
+require($phpbb_root_path . 'includes/constants.' . $phpEx);
+require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
+require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
+
+// Set PHP error handler to ours
+set_error_handler('msg_handler');
+
+// Instantiate some basic classes
+$user = new user();
+$auth = new auth();
+$template = new template();
+$cache = new cache();
+$db = new $sql_db();
+
+// Connect to DB
+$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false);
+
+// We do not need this any longer, unset for safety purposes
+unset($dbpasswd);
+
+// Grab global variables, re-cache if necessary
+$config = $cache->obtain_config();
+
+$mtemplate = new template();
+$cms_modules = array();
+if($config['cms_enabled'])
+{
+ require($phpbb_root_path . 'modules/core/functions_core.' . $phpEx);
+
+ $cms_modules = get_installed_modules();
+}
+
?>
\ No newline at end of file
Added: mods/cms/trunk/images/avatars/gallery/default_avatar.gif
===================================================================
(Binary files differ)
Property changes on: mods/cms/trunk/images/avatars/gallery/default_avatar.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: mods/cms/trunk/includes/functions_display.php
===================================================================
--- mods/cms/trunk/includes/functions_display.php 2007-09-10 03:47:19 UTC (rev 59)
+++ mods/cms/trunk/includes/functions_display.php 2007-09-16 20:15:00 UTC (rev 60)
@@ -1,1164 +1,1168 @@
-<?php
-/**
-*
-* @package phpBB3
-* @version $Id: functions_display.php,v 1.165 2007/08/24 18:00:28 davidmj Exp $
-* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
-*
-*/
-
-/**
-* Display Forums
-*/
-function display_forums($root_data = '', $display_moderators = true, $return_moderators = false)
-{
- global $db, $auth, $user, $template;
- global $phpbb_root_path, $phpEx, $config;
-
- $forum_rows = $subforums = $forum_ids = $forum_ids_moderator = $forum_moderators = $active_forum_ary = array();
- $parent_id = $visible_forums = 0;
- $sql_from = '';
-
- // Mark forums read?
- $mark_read = request_var('mark', '');
-
- if ($mark_read == 'all')
- {
- $mark_read = '';
- }
-
- if (!$root_data)
- {
- if ($mark_read == 'forums')
- {
- $mark_read = 'all';
- }
-
- $root_data = array('forum_id' => 0);
- $sql_where = '';
- }
- else
- {
- $sql_where = 'left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id'];
- }
-
- // Display list of active topics for this category?
- $show_active = (isset($root_data['forum_flags']) && ($root_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false;
-
- $sql_array = array(
- 'SELECT' => 'f.*',
- 'FROM' => array(
- FORUMS_TABLE => 'f'
- ),
- 'LEFT_JOIN' => array(),
- );
-
- if ($config['load_db_lastread'] && $user->data['is_registered'])
- {
- $sql_array['LEFT_JOIN'][] = array('FROM' => array(FORUMS_TRACK_TABLE => 'ft'), 'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id');
- $sql_array['SELECT'] .= ', ft.mark_time';
- }
- else if ($config['load_anon_lastread'] || $user->data['is_registered'])
- {
- $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
- $tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
-
- if (!$user->data['is_registered'])
- {
- $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0;
- }
- }
-
- if ($show_active)
- {
- $sql_array['LEFT_JOIN'][] = array(
- 'FROM' => array(FORUMS_ACCESS_TABLE => 'fa'),
- 'ON' => "fa.forum_id = f.forum_id AND fa.session_id = '" . $db->sql_escape($user->session_id) . "'"
- );
-
- $sql_array['SELECT'] .= ', fa.user_id';
- }
-
- $sql = $db->sql_build_query('SELECT', array(
- 'SELECT' => $sql_array['SELECT'],
- 'FROM' => $sql_array['FROM'],
- 'LEFT_JOIN' => $sql_array['LEFT_JOIN'],
-
- 'WHERE' => $sql_where,
-
- 'ORDER_BY' => 'f.left_id',
- ));
-
- $result = $db->sql_query($sql);
-
- $forum_tracking_info = array();
- $branch_root_id = $root_data['forum_id'];
- while ($row = $db->sql_fetchrow($result))
- {
- $forum_id = $row['forum_id'];
-
- // Mark forums read?
- if ($mark_read == 'forums' || $mark_read == 'all')
- {
- if ($auth->acl_get('f_list', $forum_id))
- {
- $forum_ids[] = $forum_id;
- continue;
- }
- }
-
- // Category with no members
- if ($row['forum_type'] == FORUM_CAT && ($row['left_id'] + 1 == $row['right_id']))
- {
- continue;
- }
-
- // Skip branch
- if (isset($right_id))
- {
- if ($row['left_id'] < $right_id)
- {
- continue;
- }
- unset($right_id);
- }
-
- if (!$auth->acl_get('f_list', $forum_id))
- {
- // if the user does not have permissions to list this forum, skip everything until next branch
- $right_id = $row['right_id'];
- continue;
- }
-
- $forum_ids[] = $forum_id;
-
- if ($config['load_db_lastread'] && $user->data['is_registered'])
- {
- $forum_tracking_info[$forum_id] = (!empty($row['mark_time'])) ? $row['mark_time'] : $user->data['user_lastmark'];
- }
- else if ($config['load_anon_lastread'] || $user->data['is_registered'])
- {
- if (!$user->data['is_registered'])
- {
- $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0;
- }
- $forum_tracking_info[$forum_id] = (isset($tracking_topics['f'][$forum_id])) ? (int) (base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate']) : $user->data['user_lastmark'];
- }
-
- $row['forum_topics'] = ($auth->acl_get('m_approve', $forum_id)) ? $row['forum_topics_real'] : $row['forum_topics'];
-
- // Display active topics from this forum?
- if ($show_active && $row['forum_type'] == FORUM_POST && $auth->acl_get('f_read', $forum_id) && ($row['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS))
- {
- if (!isset($active_forum_ary['forum_topics']))
- {
- $active_forum_ary['forum_topics'] = 0;
- }
-
- if (!isset($active_forum_ary['forum_posts']))
- {
- $active_forum_ary['forum_posts'] = 0;
- }
-
- $active_forum_ary['forum_id'][] = $forum_id;
- $active_forum_ary['enable_icons'][] = $row['enable_icons'];
- $active_forum_ary['forum_topics'] += $row['forum_topics'];
- $active_forum_ary['forum_posts'] += $row['forum_posts'];
-
- // If this is a passworded forum we do not show active topics from it if the user is not authorised to view it...
- if ($row['forum_password'] && $row['user_id'] != $user->data['user_id'])
- {
- $active_forum_ary['exclude_forum_id'][] = $forum_id;
- }
- }
-
- //
- if ($row['parent_id'] == $root_data['forum_id'] || $row['parent_id'] == $branch_root_id)
- {
- if ($row['forum_type'] != FORUM_CAT)
- {
- $forum_ids_moderator[] = (int) $forum_id;
- }
-
- // Direct child of current branch
- $parent_id = $forum_id;
- $forum_rows[$forum_id] = $row;
-
- if ($row['forum_type'] == FORUM_CAT && $row['parent_id'] == $root_data['forum_id'])
- {
- $branch_root_id = $forum_id;
- }
- $forum_rows[$parent_id]['forum_id_last_post'] = $row['forum_id'];
- $forum_rows[$parent_id]['orig_forum_last_post_time'] = $row['forum_last_post_time'];
- }
- else if ($row['forum_type'] != FORUM_CAT)
- {
- $subforums[$parent_id][$forum_id]['display'] = ($row['display_on_index']) ? true : false;
- $subforums[$parent_id][$forum_id]['name'] = $row['forum_name'];
- $subforums[$parent_id][$forum_id]['orig_forum_last_post_time'] = $row['forum_last_post_time'];
-
- $forum_rows[$parent_id]['forum_topics'] += $row['forum_topics'];
-
- // Do not list redirects in LINK Forums as Posts.
- if ($row['forum_type'] != FORUM_LINK)
- {
- $forum_rows[$parent_id]['forum_posts'] += $row['forum_posts'];
- }
-
- if ($row['forum_last_post_time'] > $forum_rows[$parent_id]['forum_last_post_time'])
- {
- $forum_rows[$parent_id]['forum_last_post_id'] = $row['forum_last_post_id'];
- $forum_rows[$parent_id]['forum_last_post_subject'] = $row['forum_last_post_subject'];
- $forum_rows[$parent_id]['forum_last_post_time'] = $row['forum_last_post_time'];
- $forum_rows[$parent_id]['forum_last_poster_id'] = $row['forum_last_poster_id'];
- $forum_rows[$parent_id]['forum_last_poster_name'] = $row['forum_last_poster_name'];
- $forum_rows[$parent_id]['forum_last_poster_colour'] = $row['forum_last_poster_colour'];
- $forum_rows[$parent_id]['forum_id_last_post'] = $forum_id;
- }
- }
- }
- $db->sql_freeresult($result);
-
- // Handle marking posts
- if ($mark_read == 'forums' || $mark_read == 'all')
- {
- $redirect = build_url('mark');
-
- if ($mark_read == 'all')
- {
- markread('all');
-
- $message = sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>');
- }
- else
- {
- markread('topics', $forum_ids);
-
- $message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>');
- }
-
- meta_refresh(3, $redirect);
- trigger_error($user->lang['FORUMS_MARKED'] . '<br /><br />' . $message);
- }
-
- // Grab moderators ... if necessary
- if ($display_moderators)
- {
- if ($return_moderators)
- {
- $forum_ids_moderator[] = $root_data['forum_id'];
- }
- get_moderators($forum_moderators, $forum_ids_moderator);
- }
-
- // Used to tell whatever we have to create a dummy category or not.
- $last_catless = true;
- foreach ($forum_rows as $row)
- {
- // Empty category
- if ($row['parent_id'] == $root_data['forum_id'] && $row['forum_type'] == FORUM_CAT)
- {
- $template->assign_block_vars('forumrow', array(
- 'S_IS_CAT' => true,
- 'FORUM_ID' => $row['forum_id'],
- 'FORUM_NAME' => $row['forum_name'],
- 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),
- 'FORUM_FOLDER_IMG' => '',
- 'FORUM_FOLDER_IMG_SRC' => '',
- 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang['FORUM_CAT'] . '" />' : '',
- 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
- 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']))
- );
-
- continue;
- }
-
- $visible_forums++;
- $forum_id = $row['forum_id'];
-
- $forum_unread = (isset($forum_tracking_info[$forum_id]) && $row['orig_forum_last_post_time'] > $forum_tracking_info[$forum_id]) ? true : false;
-
- $folder_image = $folder_alt = $l_subforums = '';
- $subforums_list = array();
-
- // Generate list of subforums if we need to
- if (isset($subforums[$forum_id]))
- {
- foreach ($subforums[$forum_id] as $subforum_id => $subforum_row)
- {
- $subforum_unread = (isset($forum_tracking_info[$subforum_id]) && $subforum_row['orig_forum_last_post_time'] > $forum_tracking_info[$subforum_id]) ? true : false;
-
- if ($subforum_row['display'] && $subforum_row['name'])
- {
- $subforums_list[] = array(
- 'link' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $subforum_id),
- 'name' => $subforum_row['name'],
- 'unread' => $subforum_unread,
- );
- }
- else
- {
- unset($subforums[$forum_id][$subforum_id]);
- }
-
- // If one subforum is unread the forum gets unread too...
- if ($subforum_unread)
- {
- $forum_unread = true;
- }
- }
-
- $l_subforums = (sizeof($subforums[$forum_id]) == 1) ? $user->lang['SUBFORUM'] . ': ' : $user->lang['SUBFORUMS'] . ': ';
- $folder_image = ($forum_unread) ? 'forum_unread_subforum' : 'forum_read_subforum';
- }
- else
- {
- switch ($row['forum_type'])
- {
- case FORUM_POST:
- $folder_image = ($forum_unread) ? 'forum_unread' : 'forum_read';
- break;
-
- case FORUM_LINK:
- $folder_image = 'forum_link';
- break;
- }
- }
-
- // Which folder should we display?
- if ($row['forum_status'] == ITEM_LOCKED)
- {
- $folder_image = ($forum_unread) ? 'forum_unread_locked' : 'forum_read_locked';
- $folder_alt = 'FORUM_LOCKED';
- }
- else
- {
- $folder_alt = ($forum_unread) ? 'NEW_POSTS' : 'NO_NEW_POSTS';
- }
-
- // Create last post link information, if appropriate
- if ($row['forum_last_post_id'])
- {
- $last_post_subject = $row['forum_last_post_subject'];
- $last_post_time = $user->format_date($row['forum_last_post_time']);
- $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
- }
- else
- {
- $last_post_subject = $last_post_time = $last_post_url = '';
- }
-
- // Output moderator listing ... if applicable
- $l_moderator = $moderators_list = '';
- if ($display_moderators && !empty($forum_moderators[$forum_id]))
- {
- $l_moderator = (sizeof($forum_moderators[$forum_id]) == 1) ? $user->lang['MODERATOR'] : $user->lang['MODERATORS'];
- $moderators_list = implode(', ', $forum_moderators[$forum_id]);
- }
-
- $l_post_click_count = ($row['forum_type'] == FORUM_LINK) ? 'CLICKS' : 'POSTS';
- $post_click_count = ($row['forum_type'] != FORUM_LINK || $row['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? $row['forum_posts'] : '';
-
- $s_subforums_list = array();
- foreach ($subforums_list as $subforum)
- {
- $s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '">' . $subforum['name'] . '</a>';
- }
- $s_subforums_list = (string) implode(', ', $s_subforums_list);
- $catless = ($row['parent_id'] == $root_data['forum_id']) ? true : false;
-
- if ($row['forum_type'] != FORUM_LINK)
- {
- $u_viewforum = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']);
- }
- else
- {
- // If the forum is a link and we count redirects we need to visit it
- // If the forum is having a password or no read access we do not expose the link, but instead handle it in viewforum
- if (($row['forum_flags'] & FORUM_FLAG_LINK_TRACK) || $row['forum_password'] || !$auth->acl_get('f_read', $forum_id))
- {
- $u_viewforum = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']);
- }
- else
- {
- $u_viewforum = $row['forum_link'];
- }
- }
-
- $template->assign_block_vars('forumrow', array(
- 'S_IS_CAT' => false,
- 'S_NO_CAT' => $catless && !$last_catless,
- 'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false,
- 'S_UNREAD_FORUM' => $forum_unread,
- 'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false,
- 'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false,
-
- 'FORUM_ID' => $row['forum_id'],
- 'FORUM_NAME' => $row['forum_name'],
- 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),
- 'TOPICS' => $row['forum_topics'],
- $l_post_click_count => $post_click_count,
- 'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
- 'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'),
- 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '',
- 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
- 'LAST_POST_SUBJECT' => censor_text($last_post_subject),
- 'LAST_POST_TIME' => $last_post_time,
- 'LAST_POSTER' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
- 'LAST_POSTER_COLOUR' => get_username_string('colour', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
- 'LAST_POSTER_FULL' => get_username_string('full', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
- 'MODERATORS' => $moderators_list,
- 'SUBFORUMS' => $s_subforums_list,
-
- 'L_SUBFORUM_STR' => $l_subforums,
- 'L_FORUM_FOLDER_ALT' => $folder_alt,
- 'L_MODERATOR_STR' => $l_moderator,
-
- 'U_VIEWFORUM' => $u_viewforum,
- 'U_LAST_POSTER' => get_username_string('profile', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
- 'U_LAST_POST' => $last_post_url)
- );
-
- // Assign subforums loop for style authors
- foreach ($subforums_list as $subforum)
- {
- $template->assign_block_vars('forumrow.subforum', array(
- 'U_SUBFORUM' => $subforum['link'],
- 'SUBFORUM_NAME' => $subforum['name'],
- 'S_UNREAD' => $subforum['unread'])
- );
- }
-
- $last_catless = $catless;
- }
-
- $template->assign_vars(array(
- 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $root_data['forum_id'] . '&mark=forums') : '',
- 'S_HAS_SUBFORUM' => ($visible_forums) ? true : false,
- 'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'],
- 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'))
- );
-
- if ($return_moderators)
- {
- return array($active_forum_ary, $forum_moderators);
- }
-
- return array($active_forum_ary, array());
-}
-
-/**
-* Create forum rules for given forum
-*/
-function generate_forum_rules(&$forum_data)
-{
- if (!$forum_data['forum_rules'] && !$forum_data['forum_rules_link'])
- {
- return;
- }
-
- global $template, $phpbb_root_path, $phpEx;
-
- if ($forum_data['forum_rules'])
- {
- $forum_data['forum_rules'] = generate_text_for_display($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options']);
- }
-
- $template->assign_vars(array(
- 'S_FORUM_RULES' => true,
- 'U_FORUM_RULES' => $forum_data['forum_rules_link'],
- 'FORUM_RULES' => $forum_data['forum_rules'])
- );
-}
-
-/**
-* Create forum navigation links for given forum, create parent
-* list if currently null, assign basic forum info to template
-*/
-function generate_forum_nav(&$forum_data)
-{
- global $db, $user, $template, $auth;
- global $phpEx, $phpbb_root_path;
-
- if (!$auth->acl_get('f_list', $forum_data['forum_id']))
- {
- return;
- }
-
- // Get forum parents
- $forum_parents = get_forum_parents($forum_data);
-
- // Build navigation links
- if (!empty($forum_parents))
- {
- foreach ($forum_parents as $parent_forum_id => $parent_data)
- {
- list($parent_name, $parent_type) = array_values($parent_data);
-
- // Skip this parent if the user does not have the permission to view it
- if (!$auth->acl_get('f_list', $parent_forum_id))
- {
- continue;
- }
-
- $template->assign_block_vars('navlinks', array(
- 'S_IS_CAT' => ($parent_type == FORUM_CAT) ? true : false,
- 'S_IS_LINK' => ($parent_type == FORUM_LINK) ? true : false,
- 'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false,
- 'FORUM_NAME' => $parent_name,
- 'FORUM_ID' => $parent_forum_id,
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id))
- );
- }
- }
-
- $template->assign_block_vars('navlinks', array(
- 'S_IS_CAT' => ($forum_data['forum_type'] == FORUM_CAT) ? true : false,
- 'S_IS_LINK' => ($forum_data['forum_type'] == FORUM_LINK) ? true : false,
- 'S_IS_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false,
- 'FORUM_NAME' => $forum_data['forum_name'],
- 'FORUM_ID' => $forum_data['forum_id'],
- 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data['forum_id']))
- );
-
- $template->assign_vars(array(
- 'FORUM_ID' => $forum_data['forum_id'],
- 'FORUM_NAME' => $forum_data['forum_name'],
- 'FORUM_DESC' => generate_text_for_display($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options']))
- );
-
- return;
-}
-
-/**
-* Returns forum parents as an array. Get them from forum_data if available, or update the database otherwise
-*/
-function get_forum_parents(&$forum_data)
-{
- global $db;
-
- $forum_parents = array();
-
- if ($forum_data['parent_id'] > 0)
- {
- if ($forum_data['forum_parents'] == '')
- {
- $sql = 'SELECT forum_id, forum_name, forum_type
- FROM ' . FORUMS_TABLE . '
- WHERE left_id < ' . $forum_data['left_id'] . '
- AND right_id > ' . $forum_data['right_id'] . '
- ORDER BY left_id ASC';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $forum_parents[$row['forum_id']] = array($row['forum_name'], (int) $row['forum_type']);
- }
- $db->sql_freeresult($result);
-
- $forum_data['forum_parents'] = serialize($forum_parents);
-
- $sql = 'UPDATE ' . FORUMS_TABLE . "
- SET forum_parents = '" . $db->sql_escape($forum_data['forum_parents']) . "'
- WHERE parent_id = " . $forum_data['parent_id'];
- $db->sql_query($sql);
- }
- else
- {
- $forum_parents = unserialize($forum_data['forum_parents']);
- }
- }
-
- return $forum_parents;
-}
-
-/**
-* Generate topic pagination
-*/
-function topic_generate_pagination($replies, $url)
-{
- global $config, $user;
-
- // Make sure $per_page is a valid value
- $per_page = ($config['posts_per_page'] <= 0) ? 1 : $config['posts_per_page'];
-
- if (($replies + 1) > $per_page)
- {
- $total_pages = ceil(($replies + 1) / $per_page);
- $pagination = '';
-
- $times = 1;
- for ($j = 0; $j < $replies + 1; $j += $per_page)
- {
- $pagination .= '<a href="' . $url . '&start=' . $j . '">' . $times . '</a>';
- if ($times == 1 && $total_pages > 5)
- {
- $pagination .= ' ... ';
-
- // Display the last three pages
- $times = $total_pages - 3;
- $j += ($total_pages - 4) * $per_page;
- }
- else if ($times < $total_pages)
- {
- $pagination .= '<span class="page-sep">' . $user->lang['COMMA_SEPARATOR'] . '</span>';
- }
- $times++;
- }
- }
- else
- {
- $pagination = '';
- }
-
- return $pagination;
-}
-
-/**
-* Obtain list of moderators of each forum
-*/
-function get_moderators(&$forum_moderators, $forum_id = false)
-{
- global $config, $template, $db, $phpbb_root_path, $phpEx;
-
- // Have we disabled the display of moderators? If so, then return
- // from whence we came ...
- if (!$config['load_moderators'])
- {
- return;
- }
-
- $forum_sql = '';
-
- if ($forum_id !== false)
- {
- if (!is_array($forum_id))
- {
- $forum_id = array($forum_id);
- }
-
- // If we don't have a forum then we can't have a moderator
- if (!sizeof($forum_id))
- {
- return;
- }
-
- $forum_sql = 'AND m.' . $db->sql_in_set('forum_id', $forum_id);
- }
-
- $sql_array = array(
- 'SELECT' => 'm.*, u.user_colour, g.group_colour, g.group_type',
-
- 'FROM' => array(
- MODERATOR_CACHE_TABLE => 'm',
- ),
-
- 'LEFT_JOIN' => array(
- array(
- 'FROM' => array(USERS_TABLE => 'u'),
- 'ON' => 'm.user_id = u.user_id',
- ),
- array(
- 'FROM' => array(GROUPS_TABLE => 'g'),
- 'ON' => 'm.group_id = g.group_id',
- ),
- ),
-
- 'WHERE' => "m.display_on_index = 1 $forum_sql",
- );
-
- $sql = $db->sql_build_query('SELECT', $sql_array);
- $result = $db->sql_query($sql, 3600);
-
- while ($row = $db->sql_fetchrow($result))
- {
- if (!empty($row['user_id']))
- {
- $forum_moderators[$row['forum_id']][] = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
- }
- else
- {
- $forum_moderators[$row['forum_id']][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
- }
- }
- $db->sql_freeresult($result);
-
- return;
-}
-
-/**
-* User authorisation levels output
-*
-* @param string $mode Can be forum or topic. Not in use at the moment.
-* @param int $forum_id The current forum the user is in.
-* @param int $forum_status The forums status bit.
-*/
-function gen_forum_auth_level($mode, $forum_id, $forum_status)
-{
- global $template, $auth, $user, $config;
-
- $locked = ($forum_status == ITEM_LOCKED && !$auth->acl_get('m_edit', $forum_id)) ? true : false;
-
- $rules = array(
- ($auth->acl_get('f_post', $forum_id) && !$locked) ? $user->lang['RULES_POST_CAN'] : $user->lang['RULES_POST_CANNOT'],
- ($auth->acl_get('f_reply', $forum_id) && !$locked) ? $user->lang['RULES_REPLY_CAN'] : $user->lang['RULES_REPLY_CANNOT'],
- ($user->data['is_registered'] && $auth->acl_gets('f_edit', 'm_edit', $forum_id) && !$locked) ? $user->lang['RULES_EDIT_CAN'] : $user->lang['RULES_EDIT_CANNOT'],
- ($user->data['is_registered'] && $auth->acl_gets('f_delete', 'm_delete', $forum_id) && !$locked) ? $user->lang['RULES_DELETE_CAN'] : $user->lang['RULES_DELETE_CANNOT'],
- );
-
- if ($config['allow_attachments'])
- {
- $rules[] = ($auth->acl_get('f_attach', $forum_id) && $auth->acl_get('u_attach') && !$locked) ? $user->lang['RULES_ATTACH_CAN'] : $user->lang['RULES_ATTACH_CANNOT'];
- }
-
- foreach ($rules as $rule)
- {
- $template->assign_block_vars('rules', array('RULE' => $rule));
- }
-
- return;
-}
-
-/**
-* Generate topic status
-*/
-function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$folder_alt, &$topic_type)
-{
- global $user, $config;
-
- $folder = $folder_new = '';
-
- if ($topic_row['topic_status'] == ITEM_MOVED)
- {
- $topic_type = $user->lang['VIEW_TOPIC_MOVED'];
- $folder_img = 'topic_moved';
- $folder_alt = 'TOPIC_MOVED';
- }
- else
- {
- switch ($topic_row['topic_type'])
- {
- case POST_GLOBAL:
- $topic_type = $user->lang['VIEW_TOPIC_GLOBAL'];
- $folder = 'global_read';
- $folder_new = 'global_unread';
- break;
-
- case POST_ANNOUNCE:
- $topic_type = $user->lang['VIEW_TOPIC_ANNOUNCEMENT'];
- $folder = 'announce_read';
- $folder_new = 'announce_unread';
- break;
-
- case POST_STICKY:
- $topic_type = $user->lang['VIEW_TOPIC_STICKY'];
- $folder = 'sticky_read';
- $folder_new = 'sticky_unread';
- break;
-
- default:
- $topic_type = '';
- $folder = 'topic_read';
- $folder_new = 'topic_unread';
-
- if ($config['hot_threshold'] && $replies >= $config['hot_threshold'] && $topic_row['topic_status'] != ITEM_LOCKED)
- {
- $folder .= '_hot';
- $folder_new .= '_hot';
- }
- break;
- }
-
- if ($topic_row['topic_status'] == ITEM_LOCKED)
- {
- $topic_type = $user->lang['VIEW_TOPIC_LOCKED'];
- $folder .= '_locked';
- $folder_new .= '_locked';
- }
-
-
- $folder_img = ($unread_topic) ? $folder_new : $folder;
- $folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
-
- // Posted image?
- if (!empty($topic_row['topic_posted']) && $topic_row['topic_posted'])
- {
- $folder_img .= '_mine';
- }
- }
-
- if ($topic_row['poll_start'] && $topic_row['topic_status'] != ITEM_MOVED)
- {
- $topic_type = $user->lang['VIEW_TOPIC_POLL'];
- }
-}
-
-/**
-* Assign/Build custom bbcodes for display in screens supporting using of bbcodes
-* The custom bbcodes buttons will be placed within the template block 'custom_codes'
-*/
-function display_custom_bbcodes()
-{
- global $db, $template;
-
- // Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing)
- $num_predefined_bbcodes = 22;
-
- $sql = 'SELECT bbcode_id, bbcode_tag, bbcode_helpline
- FROM ' . BBCODES_TABLE . '
- WHERE display_on_posting = 1
- ORDER BY bbcode_tag';
- $result = $db->sql_query($sql);
-
- $i = 0;
- while ($row = $db->sql_fetchrow($result))
- {
- $template->assign_block_vars('custom_tags', array(
- 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
- 'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2),
- 'BBCODE_TAG' => $row['bbcode_tag'],
- 'BBCODE_HELPLINE' => str_replace(array('&', '"', "'", '<', '>'), array('\&', '\"', '\\\'', '<', '>'), $row['bbcode_helpline']))
- );
-
- $i++;
- }
- $db->sql_freeresult($result);
-}
-
-/**
-* Display reasons
-*/
-function display_reasons($reason_id = 0)
-{
- global $db, $user, $template;
-
- $sql = 'SELECT *
- FROM ' . REPORTS_REASONS_TABLE . '
- ORDER BY reason_order ASC';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- // If the reason is defined within the language file, we will use the localized version, else just use the database entry...
- if (isset($user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]))
- {
- $row['reason_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])];
- $row['reason_title'] = $user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])];
- }
-
- $template->assign_block_vars('reason', array(
- 'ID' => $row['reason_id'],
- 'TITLE' => $row['reason_title'],
- 'DESCRIPTION' => $row['reason_description'],
- 'S_SELECTED' => ($row['reason_id'] == $reason_id) ? true : false)
- );
- }
- $db->sql_freeresult($result);
-}
-
-/**
-* Display user activity (action forum/topic)
-*/
-function display_user_activity(&$userdata)
-{
- global $auth, $template, $db, $user;
- global $phpbb_root_path, $phpEx;
-
- // Do not display user activity for users having more than 5000 posts...
- if ($userdata['user_posts'] > 5000)
- {
- return;
- }
-
- $forum_ary = array();
-
- // Do not include those forums the user is not having read access to...
- $forum_read_ary = $auth->acl_getf('!f_read');
-
- foreach ($forum_read_ary as $forum_id => $not_allowed)
- {
- if ($not_allowed['f_read'])
- {
- $forum_ary[] = (int) $forum_id;
- }
- }
-
- $forum_ary = array_unique($forum_ary);
- $forum_sql = (sizeof($forum_ary)) ? 'AND ' . $db->sql_in_set('forum_id', $forum_ary, true) : '';
-
- // Obtain active forum
- $sql = 'SELECT forum_id, COUNT(post_id) AS num_posts
- FROM ' . POSTS_TABLE . '
- WHERE poster_id = ' . $userdata['user_id'] . "
- AND post_postcount = 1
- $forum_sql
- GROUP BY forum_id
- ORDER BY num_posts DESC";
- $result = $db->sql_query_limit($sql, 1);
- $active_f_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!empty($active_f_row))
- {
- $sql = 'SELECT forum_name
- FROM ' . FORUMS_TABLE . '
- WHERE forum_id = ' . $active_f_row['forum_id'];
- $result = $db->sql_query($sql, 3600);
- $active_f_row['forum_name'] = (string) $db->sql_fetchfield('forum_name');
- $db->sql_freeresult($result);
- }
-
- // Obtain active topic
- $sql = 'SELECT topic_id, COUNT(post_id) AS num_posts
- FROM ' . POSTS_TABLE . '
- WHERE poster_id = ' . $userdata['user_id'] . "
- AND post_postcount = 1
- $forum_sql
- GROUP BY topic_id
- ORDER BY num_posts DESC";
- $result = $db->sql_query_limit($sql, 1);
- $active_t_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!empty($active_t_row))
- {
- $sql = 'SELECT topic_title
- FROM ' . TOPICS_TABLE . '
- WHERE topic_id = ' . $active_t_row['topic_id'];
- $result = $db->sql_query($sql);
- $active_t_row['topic_title'] = (string) $db->sql_fetchfield('topic_title');
- $db->sql_freeresult($result);
- }
-
- $userdata['active_t_row'] = $active_t_row;
- $userdata['active_f_row'] = $active_f_row;
-
- $active_f_name = $active_f_id = $active_f_count = $active_f_pct = '';
- if (!empty($active_f_row['num_posts']))
- {
- $active_f_name = $active_f_row['forum_name'];
- $active_f_id = $active_f_row['forum_id'];
- $active_f_count = $active_f_row['num_posts'];
- $active_f_pct = ($userdata['user_posts']) ? ($active_f_count / $userdata['user_posts']) * 100 : 0;
- }
-
- $active_t_name = $active_t_id = $active_t_count = $active_t_pct = '';
- if (!empty($active_t_row['num_posts']))
- {
- $active_t_name = $active_t_row['topic_title'];
- $active_t_id = $active_t_row['topic_id'];
- $active_t_count = $active_t_row['num_posts'];
- $active_t_pct = ($userdata['user_posts']) ? ($active_t_count / $userdata['user_posts']) * 100 : 0;
- }
-
- $l_active_pct = ($userdata['user_id'] != ANONYMOUS && $userdata['user_id'] == $user->data['user_id']) ? $user->lang['POST_PCT_ACTIVE_OWN'] : $user->lang['POST_PCT_ACTIVE'];
-
- $template->assign_vars(array(
- 'ACTIVE_FORUM' => $active_f_name,
- 'ACTIVE_FORUM_POSTS' => ($active_f_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_f_count),
- 'ACTIVE_FORUM_PCT' => sprintf($l_active_pct, $active_f_pct),
- 'ACTIVE_TOPIC' => censor_text($active_t_name),
- 'ACTIVE_TOPIC_POSTS' => ($active_t_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_t_count),
- 'ACTIVE_TOPIC_PCT' => sprintf($l_active_pct, $active_t_pct),
- 'U_ACTIVE_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $active_f_id),
- 'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id),
- 'S_SHOW_ACTIVITY' => true)
- );
-}
-
-/**
-* Topic and forum watching common code
-*/
-function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0)
-{
- global $template, $db, $user, $phpEx, $start, $phpbb_root_path;
-
- $table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE;
- $where_sql = ($mode == 'forum') ? 'forum_id' : 'topic_id';
- $match_id = ($mode == 'forum') ? $forum_id : $topic_id;
-
- $u_url = ($mode == 'forum') ? 'f' : 'f=' . $forum_id . '&t';
-
- // Is user watching this thread?
- if ($user_id != ANONYMOUS)
- {
- $can_watch = true;
-
- if ($notify_status == 'unset')
- {
- $sql = "SELECT notify_status
- FROM $table_sql
- WHERE $where_sql = $match_id
- AND user_id = $user_id";
- $result = $db->sql_query($sql);
-
- $notify_status = ($row = $db->sql_fetchrow($result)) ? $row['notify_status'] : NULL;
- $db->sql_freeresult($result);
- }
-
- if (!is_null($notify_status) && $notify_status !== '')
- {
- if (isset($_GET['unwatch']))
- {
- if ($_GET['unwatch'] == $mode)
- {
- $is_watching = 0;
-
- $sql = 'DELETE FROM ' . $table_sql . "
- WHERE $where_sql = $match_id
- AND user_id = $user_id";
- $db->sql_query($sql);
- }
-
- $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
-
- meta_refresh(3, $redirect_url);
-
- $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
- trigger_error($message);
- }
- else
- {
- $is_watching = true;
-
- if ($notify_status)
- {
- $sql = 'UPDATE ' . $table_sql . "
- SET notify_status = 0
- WHERE $where_sql = $match_id
- AND user_id = $user_id";
- $db->sql_query($sql);
- }
- }
- }
- else
- {
- if (isset($_GET['watch']))
- {
- if ($_GET['watch'] == $mode)
- {
- $is_watching = true;
-
- $sql = 'INSERT INTO ' . $table_sql . " (user_id, $where_sql, notify_status)
- VALUES ($user_id, $match_id, 0)";
- $db->sql_query($sql);
- }
-
- $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
- meta_refresh(3, $redirect_url);
-
- $message = $user->lang['ARE_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
- trigger_error($message);
- }
- else
- {
- $is_watching = 0;
- }
- }
- }
- else
- {
- if (isset($_GET['unwatch']) && $_GET['unwatch'] == $mode)
- {
- login_box();
- }
- else
- {
- $can_watch = 0;
- $is_watching = 0;
- }
- }
-
- if ($can_watch)
- {
- $s_watching['link'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start");
- $s_watching['title'] = $user->lang[(($is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)];
- $s_watching['is_watching'] = $is_watching;
- }
-
- return;
-}
-
-/**
-* Get user rank title and image
-*
-* @param int $user_rank the current stored users rank id
-* @param int $user_posts the users number of posts
-* @param string &$rank_title the rank title will be stored here after execution
-* @param string &$rank_img the rank image as full img tag is stored here after execution
-* @param string &$rank_img_src the rank image source is stored here after execution
-*
-*/
-function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
-{
- global $ranks, $config;
-
- if (empty($ranks))
- {
- global $cache;
- $ranks = $cache->obtain_ranks();
- }
-
- if (!empty($user_rank))
- {
- $rank_title = (isset($ranks['special'][$user_rank]['rank_title'])) ? $ranks['special'][$user_rank]['rank_title'] : '';
- $rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] . '" alt="' . $ranks['special'][$user_rank]['rank_title'] . '" title="' . $ranks['special'][$user_rank]['rank_title'] . '" />' : '';
- $rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : '';
- }
- else
- {
- if (!empty($ranks['normal']))
- {
- foreach ($ranks['normal'] as $rank)
- {
- if ($user_posts >= $rank['rank_min'])
- {
- $rank_title = $rank['rank_title'];
- $rank_img = (!empty($rank['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
- $rank_img_src = (!empty($rank['rank_image'])) ? $config['ranks_path'] . '/' . $rank['rank_image'] : '';
- break;
- }
- }
- }
- }
-}
-
-/**
-* Get user avatar
-*
-* @param string $avatar Users assigned avatar name
-* @param int $avatar_type Type of avatar
-* @param string $avatar_width Width of users avatar
-* @param string $avatar_height Height of users avatar
-* @param string $alt Optional language string for alt tag within image, can be a language key or text
-*
-* @return string Avatar image
-*/
-function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR')
-{
- global $user, $config, $phpbb_root_path, $phpEx;
-
- if (empty($avatar) || !$avatar_type)
- {
- return '';
- }
-
- $avatar_img = '';
-
- switch ($avatar_type)
- {
- case AVATAR_UPLOAD:
- $avatar_img = $phpbb_root_path . "download.$phpEx?avatar=";
- break;
-
- case AVATAR_GALLERY:
- $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
- break;
- }
-
- $avatar_img .= $avatar;
- return '<img src="' . $avatar_img . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
-}
-
+<?php
+/**
+*
+* @package phpBB3
+* @version $Id: functions_display.php,v 1.165 2007/08/24 18:00:28 davidmj Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* Display Forums
+*/
+function display_forums($root_data = '', $display_moderators = true, $return_moderators = false)
+{
+ global $db, $auth, $user, $template;
+ global $phpbb_root_path, $phpEx, $config;
+
+ $forum_rows = $subforums = $forum_ids = $forum_ids_moderator = $forum_moderators = $active_forum_ary = array();
+ $parent_id = $visible_forums = 0;
+ $sql_from = '';
+
+ // Mark forums read?
+ $mark_read = request_var('mark', '');
+
+ if ($mark_read == 'all')
+ {
+ $mark_read = '';
+ }
+
+ if (!$root_data)
+ {
+ if ($mark_read == 'forums')
+ {
+ $mark_read = 'all';
+ }
+
+ $root_data = array('forum_id' => 0);
+ $sql_where = '';
+ }
+ else
+ {
+ $sql_where = 'left_id > ' . $root_data['left_id'] . ' AND left_id < ' . $root_data['right_id'];
+ }
+
+ // Display list of active topics for this category?
+ $show_active = (isset($root_data['forum_flags']) && ($root_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false;
+
+ $sql_array = array(
+ 'SELECT' => 'f.*',
+ 'FROM' => array(
+ FORUMS_TABLE => 'f'
+ ),
+ 'LEFT_JOIN' => array(),
+ );
+
+ if ($config['load_db_lastread'] && $user->data['is_registered'])
+ {
+ $sql_array['LEFT_JOIN'][] = array('FROM' => array(FORUMS_TRACK_TABLE => 'ft'), 'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id');
+ $sql_array['SELECT'] .= ', ft.mark_time';
+ }
+ else if ($config['load_anon_lastread'] || $user->data['is_registered'])
+ {
+ $tracking_topics = (isset($_COOKIE[$config['cookie_name'] . '_track'])) ? ((STRIP) ? stripslashes($_COOKIE[$config['cookie_name'] . '_track']) : $_COOKIE[$config['cookie_name'] . '_track']) : '';
+ $tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
+
+ if (!$user->data['is_registered'])
+ {
+ $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0;
+ }
+ }
+
+ if ($show_active)
+ {
+ $sql_array['LEFT_JOIN'][] = array(
+ 'FROM' => array(FORUMS_ACCESS_TABLE => 'fa'),
+ 'ON' => "fa.forum_id = f.forum_id AND fa.session_id = '" . $db->sql_escape($user->session_id) . "'"
+ );
+
+ $sql_array['SELECT'] .= ', fa.user_id';
+ }
+
+ $sql = $db->sql_build_query('SELECT', array(
+ 'SELECT' => $sql_array['SELECT'],
+ 'FROM' => $sql_array['FROM'],
+ 'LEFT_JOIN' => $sql_array['LEFT_JOIN'],
+
+ 'WHERE' => $sql_where,
+
+ 'ORDER_BY' => 'f.left_id',
+ ));
+
+ $result = $db->sql_query($sql);
+
+ $forum_tracking_info = array();
+ $branch_root_id = $root_data['forum_id'];
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $forum_id = $row['forum_id'];
+
+ // Mark forums read?
+ if ($mark_read == 'forums' || $mark_read == 'all')
+ {
+ if ($auth->acl_get('f_list', $forum_id))
+ {
+ $forum_ids[] = $forum_id;
+ continue;
+ }
+ }
+
+ // Category with no members
+ if ($row['forum_type'] == FORUM_CAT && ($row['left_id'] + 1 == $row['right_id']))
+ {
+ continue;
+ }
+
+ // Skip branch
+ if (isset($right_id))
+ {
+ if ($row['left_id'] < $right_id)
+ {
+ continue;
+ }
+ unset($right_id);
+ }
+
+ if (!$auth->acl_get('f_list', $forum_id))
+ {
+ // if the user does not have permissions to list this forum, skip everything until next branch
+ $right_id = $row['right_id'];
+ continue;
+ }
+
+ $forum_ids[] = $forum_id;
+
+ if ($config['load_db_lastread'] && $user->data['is_registered'])
+ {
+ $forum_tracking_info[$forum_id] = (!empty($row['mark_time'])) ? $row['mark_time'] : $user->data['user_lastmark'];
+ }
+ else if ($config['load_anon_lastread'] || $user->data['is_registered'])
+ {
+ if (!$user->data['is_registered'])
+ {
+ $user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? (int) (base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate']) : 0;
+ }
+ $forum_tracking_info[$forum_id] = (isset($tracking_topics['f'][$forum_id])) ? (int) (base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate']) : $user->data['user_lastmark'];
+ }
+
+ $row['forum_topics'] = ($auth->acl_get('m_approve', $forum_id)) ? $row['forum_topics_real'] : $row['forum_topics'];
+
+ // Display active topics from this forum?
+ if ($show_active && $row['forum_type'] == FORUM_POST && $auth->acl_get('f_read', $forum_id) && ($row['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS))
+ {
+ if (!isset($active_forum_ary['forum_topics']))
+ {
+ $active_forum_ary['forum_topics'] = 0;
+ }
+
+ if (!isset($active_forum_ary['forum_posts']))
+ {
+ $active_forum_ary['forum_posts'] = 0;
+ }
+
+ $active_forum_ary['forum_id'][] = $forum_id;
+ $active_forum_ary['enable_icons'][] = $row['enable_icons'];
+ $active_forum_ary['forum_topics'] += $row['forum_topics'];
+ $active_forum_ary['forum_posts'] += $row['forum_posts'];
+
+ // If this is a passworded forum we do not show active topics from it if the user is not authorised to view it...
+ if ($row['forum_password'] && $row['user_id'] != $user->data['user_id'])
+ {
+ $active_forum_ary['exclude_forum_id'][] = $forum_id;
+ }
+ }
+
+ //
+ i...
[truncated message content] |
|
From: <dac...@us...> - 2007-09-10 03:47:18
|
Revision: 59
http://thevr.svn.sourceforge.net/thevr/?rev=59&view=rev
Author: dachebodt
Date: 2007-09-09 20:47:19 -0700 (Sun, 09 Sep 2007)
Log Message:
-----------
Fixed auth bug in installer
Modified Paths:
--------------
mods/cms/trunk/cms_install.php
Modified: mods/cms/trunk/cms_install.php
===================================================================
--- mods/cms/trunk/cms_install.php 2007-09-10 03:46:15 UTC (rev 58)
+++ mods/cms/trunk/cms_install.php 2007-09-10 03:47:19 UTC (rev 59)
@@ -31,19 +31,9 @@
login_box('', $user->lang['LOGIN_ADMIN'], $user->lang['LOGIN_ADMIN_SUCCESS'], true);
}
-// Have they authenticated (again) as an admin for this session?
-if (!isset($user->data['session_admin']) || !$user->data['session_admin'])
-{
- login_box('', $user->lang['LOGIN_ADMIN_CONFIRM'], $user->lang['LOGIN_ADMIN_SUCCESS'], true, false);
-}
page_header('CMS Installation');
-if (!$auth->acl_get('a_'))
-{
- trigger_error($user->lang['NO_ADMIN']);
-}
-
// We define the admin variables now, because the user is now able to use the admin related features...
define('IN_ADMIN', true);
$phpbb_admin_path = $phpbb_root_path . 'adm/';
@@ -55,6 +45,17 @@
if($mod && $action)
{
+ // Have they authenticated (again) as an admin for this session?
+ if (!isset($user->data['session_admin']) || !$user->data['session_admin'])
+ {
+ login_box('', $user->lang['LOGIN_ADMIN_CONFIRM'], $user->lang['LOGIN_ADMIN_SUCCESS'], true, false);
+ }
+
+ if (!$auth->acl_get('a_'))
+ {
+ trigger_error($user->lang['NO_ADMIN']);
+ }
+
include($phpbb_root_path . "modules/mods/acp_mods.$phpEx");
if($mod == 'mods')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dac...@us...> - 2007-09-10 03:46:13
|
Revision: 58
http://thevr.svn.sourceforge.net/thevr/?rev=58&view=rev
Author: dachebodt
Date: 2007-09-09 20:46:15 -0700 (Sun, 09 Sep 2007)
Log Message:
-----------
A few updates
Modified Paths:
--------------
mods/cms/trunk/modules/content/acp_content.php
mods/cms/trunk/modules/content/cms_content.php
mods/cms/trunk/modules/content/functions_content.php
mods/cms/trunk/modules/content/functions_properties.php
mods/cms/trunk/modules/content/info/acp_content.php
mods/cms/trunk/modules/content/info/cms_content.php
mods/cms/trunk/modules/content/info/content_info.php
mods/cms/trunk/modules/content/info/mcp_content.php
mods/cms/trunk/modules/content/info/ucp_content.php
mods/cms/trunk/modules/content/language/en/content.php
mods/cms/trunk/modules/content/mcp_content.php
mods/cms/trunk/modules/content/template/acp_content.html
mods/cms/trunk/modules/content/ucp_content.php
Modified: mods/cms/trunk/modules/content/acp_content.php
===================================================================
--- mods/cms/trunk/modules/content/acp_content.php 2007-09-08 22:26:25 UTC (rev 57)
+++ mods/cms/trunk/modules/content/acp_content.php 2007-09-10 03:46:15 UTC (rev 58)
@@ -1,8 +1,8 @@
<?php
/**
*
-* @package acp
-* @version $Id: acp_content.php,v 1.38 2006/11/24 14:58:07 acydburn Exp $
+* @package content
+* @version $Id: acp_content.php,v 1.38 2006/11/24 14:58:07 Blitze Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -32,7 +32,7 @@
$field_id = request_var('f', '');
$content_id = request_var('t', '');
- $fields_ary = array('title', 'image', 'summary', 'content');
+ $fields_ary = array('title', 'summary', 'content');
$_module = &new acp_modules();
$_module->module_class = 'cms';
@@ -189,17 +189,24 @@
$item_id = request_var('id', '');
$status = request_var('status', '1');
+ $post_date = request_var('post_date', '');
$post_time = request_var('post_time', '');
- $tags = request_var('tags', '');
+ $tags = utf8_normalize_nfc(request_var('tags', '', true));
if($post_time)
{
+ $date_ary = explode('/', $post_date);
$time_ary = explode('/', $post_time);
- $month = $time_ary[0];
- $day = $time_ary[1];
- $year = $time_ary[2];
- $post_time = mktime(0, 0, 0, $month, $day, $year);
+ $month = $date_ary[0];
+ $day = $date_ary[1];
+ $year = $date_ary[2];
+ $hour = $time_ary[0];
+ $minute = $time_ary[1];
+
+ $dst = $config['board_dst'] * 3600;
+ $timezone = (($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone']))) * 3600;
+ $post_time = gmmktime($hour, $minute, 0, $month, $day, $year) + $timezone + $dst;
}
save_item($content_id, $status, $post_time, $tags);
@@ -353,7 +360,6 @@
include_once($phpbb_root_path . "modules/content/functions_properties.$phpEx");
$data[] = array('name' => 'title', 'label' => '', 'type' => '0', 'teaser' => '1', 'body' => '1', 'required' => '1', 'validate' => '');
- $data[] = array('name' => 'image', 'label' => '', 'type' => '0', 'teaser' => '', 'body' => '', 'required' => '', 'validate' => '');
$data[] = array('name' => 'summary', 'label' => '', 'type' => '1', 'teaser' => '', 'body' => '', 'required' => '', 'validate' => '');
$data[] = array('name' => 'content', 'label' => '', 'type' => '2', 'teaser' => '', 'body' => '', 'required' => '', 'validate' => '');
Modified: mods/cms/trunk/modules/content/cms_content.php
===================================================================
--- mods/cms/trunk/modules/content/cms_content.php 2007-09-08 22:26:25 UTC (rev 57)
+++ mods/cms/trunk/modules/content/cms_content.php 2007-09-10 03:46:15 UTC (rev 58)
@@ -1,7 +1,7 @@
<?php
/**
*
-* @package cms
+* @package Content
* @version $Id: cms_content.php,v 1.38 2006/11/24 14:58:07 Blitze Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
@@ -96,7 +96,7 @@
if($item_id)
{
$sql_array = array(
- 'SELECT' => 'c.id, c.title, c.content_id, c.image, c.summary, c.summary_bitfield, c.summary_uid, c.summary_options, c.content, c.content_bitfield, c.content_uid, c.content_options, c.author, c.post_time, c.approver, c.keywords, u.username as author_name, a.username as approver_name',
+ 'SELECT' => 'c.id, c.title, c.content_id, c.summary, c.summary_bitfield, c.summary_uid, c.summary_options, c.content, c.content_bitfield, c.content_uid, c.content_options, c.author, c.post_time, c.approver, c.keywords, u.username as author_name, a.username as approver_name',
'FROM' => array(
USERS_TABLE => 'u',
@@ -143,7 +143,6 @@
$mtemplate->assign_vars(array(
'S_ITEM' => true,
- 'S_IMAGE' => ($this->data['image']['body']) ? true : false,
'S_SUMMARY' => ($this->data['summary']['body']) ? true : false,
'S_CONTENT' => ($this->data['content']['body']) ? true : false,
'S_CAN_COMMENT' => ($auth->acl_get('u_comments_post')) ? true : false,
@@ -153,7 +152,6 @@
'TITLE' => censor_text($row['title']),
'AUTHOR' => $row['author_name'],
'POSTED' => $user->format_date($row['post_time']),
- 'IMAGE' => ($this->data['image']['body']) ? $row['image'] : '',
'SUMMARY' => ($this->data['summary']['body']) ? $this->parse_text('summary', $row) : '',
'CONTENT' => $text,
'APPROVER' => $row['approver_name'],
@@ -248,7 +246,7 @@
}
}
- $sql = 'SELECT c.id, c.title, c.image, c.summary, c.summary_bitfield, c.summary_uid, c.summary_options, c.content, c.content_bitfield, c.content_uid, c.content_options, c.author, c.post_time, c.status, u.username
+ $sql = 'SELECT c.id, c.title, c.summary, c.summary_bitfield, c.summary_uid, c.summary_options, c.content, c.content_bitfield, c.content_uid, c.content_options, c.author, c.post_time, c.status, u.username
FROM ' . USERS_TABLE . ' u, ' . CONTENT_TABLE. ' c
WHERE c.author = u.user_id
AND c.content_id = ' . $content_data['content_id'] . '
@@ -297,7 +295,6 @@
'CONTENT_TITLE' => $title,
'CONTENT_AUTHOR' => $row['username'],
'CONTENT_POSTED' => $user->format_date($row['post_time']),
- 'CONTENT_IMAGE' => ($this->data['image']['teaser']) ? $row['image'] : '',
'CONTENT_SUMMARY' => ($this->data['summary']['teaser']) ? $this->parse_text('summary', $row) : '',
'CONTENT' => $content,
'NUM_COMMENTS' => $num_comments,
Modified: mods/cms/trunk/modules/content/functions_content.php
===================================================================
--- mods/cms/trunk/modules/content/functions_content.php 2007-09-08 22:26:25 UTC (rev 57)
+++ mods/cms/trunk/modules/content/functions_content.php 2007-09-10 03:46:15 UTC (rev 58)
@@ -1,4 +1,12 @@
<?php
+/**
+*
+* @package content
+* @version $Id: functions_content.php,v 1.38 2006/11/24 14:58:07 Blitze Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
function add_item($type_id)
{
@@ -8,11 +16,11 @@
$item_id = request_var('id', '');
- $row['id'] = $row['status'] = $row['title'] = $row['image'] = $row['summary'] = $row['summary_uid'] = $row['content'] = $row['content_uid'] = $row['keywords'] = $row['post_time'] = $row['status'] = '';
+ $row['id'] = $row['status'] = $row['title'] = $row['summary'] = $row['summary_uid'] = $row['content'] = $row['content_uid'] = $row['keywords'] = $row['post_time'] = $row['status'] = '';
if($item_id)
{
- $sql = 'SELECT c.id, c.content_id, c.title, c.image, c.summary, c.summary_uid, c.content, c.content_uid, c.keywords, c.author, c.post_time, c.status, c.approver, u.username as author_name, a.username as approver_name
+ $sql = 'SELECT c.id, c.content_id, c.title, c.summary, c.summary_uid, c.content, c.content_uid, c.keywords, c.author, c.post_time, c.status, c.approver, u.username as author_name, a.username as approver_name
FROM ' . USERS_TABLE . ' u, ' . CONTENT_TYPES_TABLE . ' t, ' . CONTENT_TABLE . ' c
LEFT JOIN ' . USERS_TABLE . " a
ON a.user_id = c.approver
@@ -22,11 +30,10 @@
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $post_time = date("m/d/Y", $row['post_time']);
-
$mtemplate->assign_vars(array(
'STATUS' => $row['status'],
- 'POST_TIME' => $post_time,
+ 'POST_DATE' => $user->format_date($row['post_time'], 'm/d/Y', true),
+ 'POST_TIME' => $user->format_date($row['post_time'], 'H:i', true),
'TAGS' => $row['keywords'],
));
}
@@ -122,7 +129,7 @@
$sql_ary = array(
'content_id' => $type_id,
'status' => $status,
- 'keywords' => $tags,
+ 'keywords' => utf8_case_fold_nfc($tags),
'post_time' => ($post_time) ? $post_time : time()
);
Modified: mods/cms/trunk/modules/content/functions_properties.php
===================================================================
--- mods/cms/trunk/modules/content/functions_properties.php 2007-09-08 22:26:25 UTC (rev 57)
+++ mods/cms/trunk/modules/content/functions_properties.php 2007-09-10 03:46:15 UTC (rev 58)
@@ -1,4 +1,12 @@
-<?
+<?php
+/**
+*
+* @package content
+* @version $Id: functions_properties.php,v 1.38 2006/11/24 14:58:07 Blitze Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
function get_properties()
{
Modified: mods/cms/trunk/modules/content/info/acp_content.php
===================================================================
--- mods/cms/trunk/modules/content/info/acp_content.php 2007-09-08 22:26:25 UTC (rev 57)
+++ mods/cms/trunk/modules/content/info/acp_content.php 2007-09-10 03:46:15 UTC (rev 58)
@@ -1,8 +1,8 @@
<?php
/**
*
-* @package acp
-* @version $Id: acp_content.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @package content
+* @version $Id: acp_content.php,v 1.2 2006/05/01 19:45:42 Blitze Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -40,7 +40,6 @@
`summary_uid` varchar(5) collate utf8_bin NOT NULL,
`summary_options` int(11) unsigned NOT NULL default '7',
`summary` text collate utf8_bin,
- `image` text collate utf8_bin NOT NULL,
`content` text collate utf8_bin,
`content_bitfield` varchar(255) collate utf8_bin NOT NULL,
`content_uid` varchar(5) collate utf8_bin NOT NULL,
@@ -54,9 +53,7 @@
) CHARACTER SET `utf8` COLLATE `utf8_bin`";
$sql_ary[] = 'CREATE TABLE IF NOT EXISTS ' . CONTENT_TYPES_TABLE . " (
- `content_id` int(3) NOT NULL auto_increment,
- `content_name` varchar(125) collate utf8_bin NOT NULL,
- `content_langname` varchar(255) collate utf8_bin NOT NULL,
+ `content_id` mediumint(8) NOT NULL auto_increment,
`content_fields` text collate utf8_bin,
`req_approval` tinyint(1) NOT NULL default '1',
`allow_comments` tinyint(1) NOT NULL default '1',
@@ -67,8 +64,6 @@
`allow_smilies` tinyint(1) NOT NULL default '1',
`allow_urls` tinyint(1) NOT NULL default '1',
`display_type` tinyint(1) NOT NULL default '0',
- `active` tinyint(1) NOT NULL default '0',
- `content_order` tinyint(2) NOT NULL default '0',
PRIMARY KEY (`content_id`)
) CHARACTER SET `utf8` COLLATE `utf8_bin`";
Modified: mods/cms/trunk/modules/content/info/cms_content.php
===================================================================
--- mods/cms/trunk/modules/content/info/cms_content.php 2007-09-08 22:26:25 UTC (rev 57)
+++ mods/cms/trunk/modules/content/info/cms_content.php 2007-09-10 03:46:15 UTC (rev 58)
@@ -1,8 +1,8 @@
<?php
/**
*
-* @package cms
-* @version $Id: cms_content.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @package content
+* @version $Id: cms_content.php,v 1.2 2006/05/01 19:45:42 Blitze Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -75,8 +75,8 @@
if($mod_id)
{
$time = time();
- $sql_ary[] = 'INSERT INTO ' . CONTENT_TABLE . " VALUES (1, 'Welcome to phpbb3 CMS', $mod_id, '', '', 7, NULL, '', 'Congratulations! You have successfully installed the phpbb3 CMS. You may now configure your site as you wish. From the administrative control panel you can enable/disable modules and their blocks.\n\nEnjoy.', '', '', 7, '', 2, $time, 1, 0);";
- $sql_ary[] = 'INSERT INTO ' . CONTENT_TYPES_TABLE . " VALUES ($mod_id, '', '', '', 0x613a343a7b733a353a227469746c65223b613a373a7b733a353a226c6162656c223b733a353a225469746c65223b733a343a2274797065223b733a313a2230223b733a363a22746561736572223b733a313a2231223b733a343a22626f6479223b733a313a2231223b733a383a227265717569726564223b733a313a2231223b733a343a226e616d65223b733a353a227469746c65223b733a383a2276616c6964617465223b733a313a2230223b7d733a353a22696d616765223b613a373a7b733a353a226c6162656c223b733a353a22496d616765223b733a343a2274797065223b733a313a2230223b733a363a22746561736572223b733a313a2231223b733a343a22626f6479223b733a313a2231223b733a343a226e616d65223b733a353a22696d616765223b733a383a227265717569726564223b733a313a2230223b733a383a2276616c6964617465223b733a313a2230223b7d733a373a2273756d6d617279223b613a373a7b733a353a226c6162656c223b733a303a22223b733a343a2274797065223b733a313a2231223b733a343a226e616d65223b733a373a2273756d6d617279223b733a363a22746561736572223b733a313a2230223b733a343a22626f6479223b733a313a2230223b733a383a227265717569726564223b733a313a2230223b733a383a2276616c6964617465223b733a313a2230223b7d733a373a22636f6e74656e74223b613a373a7b733a353a226c6162656c223b733a343a224e657773223b733a343a2274797065223b733a313a2232223b733a363a22746561736572223b733a313a2231223b733a343a22626f6479223b733a313a2231223b733a343a226e616d65223b733a373a22636f6e74656e74223b733a383a227265717569726564223b733a313a2230223b733a383a2276616c6964617465223b733a313a2230223b7d7d, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0);";
+ $sql_ary[] = 'INSERT INTO ' . CONTENT_TABLE . " VALUES (1, 'Welcome to phpbb3 CMS', $mod_id, '', '', 7, NULL, 'Congratulations! You have successfully installed the phpbb3 CMS. You may now configure your site as you wish. From the administrative control panel you can enable/disable modules and their blocks.\n\nEnjoy.', '', '', 7, '', 2, $time, 1, 0);";
+ $sql_ary[] = 'INSERT INTO ' . CONTENT_TYPES_TABLE . " VALUES ($mod_id, 0x613a343a7b733a353a227469746c65223b613a373a7b733a353a226c6162656c223b733a353a225469746c65223b733a343a2274797065223b733a313a2230223b733a363a22746561736572223b733a313a2231223b733a343a22626f6479223b733a313a2231223b733a383a227265717569726564223b733a313a2231223b733a343a226e616d65223b733a353a227469746c65223b733a383a2276616c6964617465223b733a313a2230223b7d733a353a22696d616765223b613a373a7b733a353a226c6162656c223b733a353a22496d616765223b733a343a2274797065223b733a313a2230223b733a363a22746561736572223b733a313a2231223b733a343a22626f6479223b733a313a2231223b733a343a226e616d65223b733a353a22696d616765223b733a383a227265717569726564223b733a313a2230223b733a383a2276616c6964617465223b733a313a2230223b7d733a373a2273756d6d617279223b613a373a7b733a353a226c6162656c223b733a303a22223b733a343a2274797065223b733a313a2231223b733a343a226e616d65223b733a373a2273756d6d617279223b733a363a22746561736572223b733a313a2230223b733a343a22626f6479223b733a313a2230223b733a383a227265717569726564223b733a313a2230223b733a383a2276616c6964617465223b733a313a2230223b7d733a373a22636f6e74656e74223b613a373a7b733a353a226c6162656c223b733a343a224e657773223b733a343a2274797065223b733a313a2232223b733a363a22746561736572223b733a313a2231223b733a343a22626f6479223b733a313a2231223b733a343a226e616d65223b733a373a22636f6e74656e74223b733a383a227265717569726564223b733a313a2230223b733a383a2276616c6964617465223b733a313a2230223b7d7d, 1, 1, 1, 1, 1, 1, 1, 1, 1);";
foreach($sql_ary as $i => $sql)
{
Modified: mods/cms/trunk/modules/content/info/content_info.php
===================================================================
--- mods/cms/trunk/modules/content/info/content_info.php 2007-09-08 22:26:25 UTC (rev 57)
+++ mods/cms/trunk/modules/content/info/content_info.php 2007-09-10 03:46:15 UTC (rev 58)
@@ -1,8 +1,8 @@
<?php
/**
*
-* @package ucp
-* @version $Id: ucp_attachments.php,v 1.3 2006/10/06 18:43:54 acydburn Exp $
+* @package content
+* @version $Id: content_info.php,v 1.3 2006/10/06 18:43:54 Blitze Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Modified: mods/cms/trunk/modules/content/info/mcp_content.php
===================================================================
--- mods/cms/trunk/modules/content/info/mcp_content.php 2007-09-08 22:26:25 UTC (rev 57)
+++ mods/cms/trunk/modules/content/info/mcp_content.php 2007-09-10 03:46:15 UTC (rev 58)
@@ -1,8 +1,8 @@
<?php
/**
*
-* @package mcp
-* @version $Id: ucp_zebra.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @package content
+* @version $Id: mcp_content.php,v 1.2 2006/05/01 19:45:42 Blitze Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Modified: mods/cms/trunk/modules/content/info/ucp_content.php
===================================================================
--- mods/cms/trunk/modules/content/info/ucp_content.php 2007-09-08 22:26:25 UTC (rev 57)
+++ mods/cms/trunk/modules/content/info/ucp_content.php 2007-09-10 03:46:15 UTC (rev 58)
@@ -1,8 +1,8 @@
<?php
/**
*
-* @package ucp
-* @version $Id: ucp_zebra.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @package content
+* @version $Id: ucp_content.php,v 1.2 2006/05/01 19:45:42 Blitze Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Modified: mods/cms/trunk/modules/content/language/en/content.php
===================================================================
--- mods/cms/trunk/modules/content/language/en/content.php 2007-09-08 22:26:25 UTC (rev 57)
+++ mods/cms/trunk/modules/content/language/en/content.php 2007-09-10 03:46:15 UTC (rev 58)
@@ -47,6 +47,8 @@
'VIEW_TYPE' => 'View content type',
'EDIT_TYPE' => 'Edit content type',
'EDIT_ITEM' => 'Edit Item',
+ 'ITEM_ADDED' => 'Item added successfully',
+ 'ITEM_EDITED' => 'Item updated successfully',
'NAME' => 'Content type name',
'LANGNAME' => 'Content type language name',
Modified: mods/cms/trunk/modules/content/mcp_content.php
===================================================================
--- mods/cms/trunk/modules/content/mcp_content.php 2007-09-08 22:26:25 UTC (rev 57)
+++ mods/cms/trunk/modules/content/mcp_content.php 2007-09-10 03:46:15 UTC (rev 58)
@@ -1,8 +1,8 @@
<?php
/**
*
-* @package mcp
-* @version $Id: mcp_content.php,v 1.38 2006/11/24 14:58:07 acydburn Exp $
+* @package Content
+* @version $Id: mcp_content.php,v 1.38 2006/11/24 14:58:07 Blitze Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
Modified: mods/cms/trunk/modules/content/template/acp_content.html
===================================================================
--- mods/cms/trunk/modules/content/template/acp_content.html 2007-09-08 22:26:25 UTC (rev 57)
+++ mods/cms/trunk/modules/content/template/acp_content.html 2007-09-10 03:46:15 UTC (rev 58)
@@ -3,51 +3,50 @@
<form id="edit_item" method="post" action="{U_ACTION}">
- <table cellspacing="1" cellspacing="0" border="0" width="100%">
- <tbody>
- <!-- BEGIN fields -->
- <tr>
- <td class="row3" valign="top"><label for="{fields.NAME}"><!-- IF fields.S_REQUIRED -->*<!-- ENDIF -->{fields.LABEL}</label></td>
- <td class="row3">{fields.FIELD}</td>
- </tr>
- <!-- END fields -->
+ <fieldset>
+ <legend>{L_EDIT_ITEM}</legend>
- <!-- IF CATEGORY -->
- <tr>
- <td class="row3"><label for="category">{L_CATEGORY}: </label></td>
- <td class="row3"><select name="category">{CATEGORY}</select></td>
- </tr>
- <!-- ENDIF -->
+ <!-- BEGIN fields -->
+ <dl>
+ <dt><label for="{fields.NAME}"><!-- IF fields.S_REQUIRED -->*<!-- ENDIF -->{fields.LABEL}</label></dt>
+ <dd>{fields.FIELD}</dd>
+ </dl>
+ <!-- END fields -->
- <!-- IF S_TAGS -->
- <tr>
- <td class="row3"><label for="tags">{L_TAGS}: </label></td>
- <td class="row3"><input type="text" name="tags" value="{TAGS}" /></td>
- </tr>
- <!-- ENDIF -->
+ <!-- IF CATEGORY -->
+ <dl>
+ <dt><label for="category">{L_CATEGORY}: </label></dt>
+ <dd><select name="category">{CATEGORY}</select></dd>
+ </dl>
+ <!-- ENDIF -->
- <tr>
- <td class="row3"><label for="status">{L_STATUS}: </label></td>
- <td class="row3">
- <select name="status">
- <option value="0"<!-- IF not STATUS --> selected="selected"<!-- ENDIF -->>{L_PENDING}</option>
- <option value="1"<!-- IF STATUS --> selected="selected"<!-- ENDIF -->>{L_APPROVED}</option>
- </select>
- </td>
- </tr>
- <tr>
- <td class="row3"><label for="post_time">{L_POST_TIME}: </label></td>
- <td class="row3"><input type="text" name="post_time" value="{POST_TIME}" /></td>
- </tr>
- <tr>
- <td class="row2" colspan="2">
- <p class="submit-buttons">
- <input class="button1" type="submit" id="fieldsubmit" name="submit" value="{L_SUBMIT}" />
- <input class="button2" type="reset" id="fieldreset" name="reset" value="{L_RESET}" />
- </p>
- </td>
- </tr>
- </table>
+ <!-- IF S_TAGS -->
+ <dl>
+ <dt><label for="tags">{L_TAGS}: </label></dt>
+ <dd><input type="text" name="tags" value="{TAGS}" /></dd>
+ </dl>
+ <!-- ENDIF -->
+
+ <dl>
+ <dt><label for="status">{L_STATUS}: </label></dt>
+ <dd>
+ <select name="status">
+ <option value="0"<!-- IF not STATUS --> selected="selected"<!-- ENDIF -->>{L_PENDING}</option>
+ <option value="1"<!-- IF STATUS --> selected="selected"<!-- ENDIF -->>{L_APPROVED}</option>
+ </select>
+ </dd>
+ </dl>
+ <dl>
+ <dt><label for="post_time">{L_POST_TIME}: </label><br /><span>{L_POST_TIME_EXPLAIN}</span></dt>
+ <dd><input type="text" name="post_date" value="{POST_DATE}" /> {L_TIME}: <input type="text" name="post_time" value="{POST_TIME}" /></dd>
+ </dl>
+ </fieldset>
+
+ <fieldset class="submit-buttons">
+ <legend>{L_SUBMIT}</legend>
+ <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
+ <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
+ </fieldset>
</form>
<!-- ELSEIF S_VIEW_TYPE -->
Modified: mods/cms/trunk/modules/content/ucp_content.php
===================================================================
--- mods/cms/trunk/modules/content/ucp_content.php 2007-09-08 22:26:25 UTC (rev 57)
+++ mods/cms/trunk/modules/content/ucp_content.php 2007-09-10 03:46:15 UTC (rev 58)
@@ -1,8 +1,8 @@
<?php
/**
*
-* @package ucp
-* @version $Id: ucp_content.php,v 1.38 2006/11/24 14:58:07 acydburn Exp $
+* @package content
+* @version $Id: ucp_content.php,v 1.38 2006/11/24 14:58:07 Blitze Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dac...@us...> - 2007-09-08 22:26:21
|
Revision: 57
http://thevr.svn.sourceforge.net/thevr/?rev=57&view=rev
Author: dachebodt
Date: 2007-09-08 15:26:25 -0700 (Sat, 08 Sep 2007)
Log Message:
-----------
Added Calendar and Event mods
- fixed some bugs in bloks and content mods
Modified Paths:
--------------
mods/cms/trunk/modules/blocks/functions_blocks.php
mods/cms/trunk/modules/content/cms_content.php
mods/cms/trunk/modules/content/language/en/content.php
mods/cms/trunk/modules/forums/cms_search.php
Added Paths:
-----------
mods/cms/trunk/modules/calendar/
mods/cms/trunk/modules/calendar/blocks/
mods/cms/trunk/modules/calendar/blocks/cms_calendar.php
mods/cms/trunk/modules/calendar/functions_calendar.php
mods/cms/trunk/modules/calendar/language/
mods/cms/trunk/modules/calendar/language/en/
mods/cms/trunk/modules/calendar/language/en/calendar.php
mods/cms/trunk/modules/calendar/language/en/common.php
mods/cms/trunk/modules/calendar/template/
mods/cms/trunk/modules/calendar/template/calendar_day.html
mods/cms/trunk/modules/calendar/template/calendar_footer.html
mods/cms/trunk/modules/calendar/template/calendar_header.html
mods/cms/trunk/modules/calendar/template/calendar_mini.html
mods/cms/trunk/modules/calendar/template/calendar_month.html
mods/cms/trunk/modules/calendar/template/calendar_week.html
mods/cms/trunk/modules/calendar/template/calendar_year.html
mods/cms/trunk/modules/events/
mods/cms/trunk/modules/events/acp_events.php
mods/cms/trunk/modules/events/blocks/
mods/cms/trunk/modules/events/cms_events.php
mods/cms/trunk/modules/events/constants.php
mods/cms/trunk/modules/events/functions_events.php
mods/cms/trunk/modules/events/info/
mods/cms/trunk/modules/events/info/acp_events.php
mods/cms/trunk/modules/events/info/cms_events.php
mods/cms/trunk/modules/events/info/events_info.php
mods/cms/trunk/modules/events/info/gcp_events.php
mods/cms/trunk/modules/events/info/grp_events.php
mods/cms/trunk/modules/events/info/mcp_events.php
mods/cms/trunk/modules/events/info/ucp_events.php
mods/cms/trunk/modules/events/language/
mods/cms/trunk/modules/events/language/en/
mods/cms/trunk/modules/events/language/en/common.php
mods/cms/trunk/modules/events/language/en/events.php
mods/cms/trunk/modules/events/language/en/permissions_comments.php
mods/cms/trunk/modules/events/template/
mods/cms/trunk/modules/events/template/acp_events.html
mods/cms/trunk/modules/events/template/events_list.html
mods/cms/trunk/modules/events/template/events_map.html
Modified: mods/cms/trunk/modules/blocks/functions_blocks.php
===================================================================
--- mods/cms/trunk/modules/blocks/functions_blocks.php 2007-09-05 05:46:11 UTC (rev 56)
+++ mods/cms/trunk/modules/blocks/functions_blocks.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -10,12 +10,10 @@
include($phpbb_root_path . "modules/blocks/constants.$phpEx");
- $front = request_var('front', '');
-
$user->add_mod_lang(array('blocks' => 'common'));
- $url_chunks = explode("&", $_SERVER['QUERY_STRING']);
- $is_front = (sizeof($url_chunks) <= 1 || $front) ? true : false;
+ $url_chunks = explode("&", $user->page['page']);
+ $is_front = (sizeof($url_chunks) <= 1) ? true : false;
// Get cached blocks
if (($this->block_cache = $cache->get('_block_' . $module_name)) === false)
Added: mods/cms/trunk/modules/calendar/blocks/cms_calendar.php
===================================================================
--- mods/cms/trunk/modules/calendar/blocks/cms_calendar.php (rev 0)
+++ mods/cms/trunk/modules/calendar/blocks/cms_calendar.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,29 @@
+<?php
+/**
+*
+* @package blocks
+* @version $Id: cms_calendar.php,v 1.38 2006/11/24 14:58:07 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+function calendar_block($data)
+{
+ global $config, $template, $phpbb_root_path, $phpEx, $user;
+
+ include_once($phpbb_root_path . "modules/calendar/functions_calendar.$phpEx");
+
+ $block['TITLE'] = 'Calendar';
+ $block['CONTENT'] = build_calendar('', 'mini');
+
+ return $block;
+}
+
+function calendar_block_config()
+{
+ $block_config = array();
+
+ return $block_config;
+}
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/calendar/functions_calendar.php
===================================================================
--- mods/cms/trunk/modules/calendar/functions_calendar.php (rev 0)
+++ mods/cms/trunk/modules/calendar/functions_calendar.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,336 @@
+<?php
+
+// Based on an article by Jason Gilmore found here http://www.zend.com/zend/trick/tricks-Oct-2002.php
+
+function build_calendar($u_action, $display = 'month', $data = array(), $month = false, $day = false, $year = false, $tpl_recur = false, $calendar = false)
+{
+ global $phpbb_root_path, $phpEx, $user, $config;
+
+ $user->add_mod_lang(array('calendar' => 'calendar'));
+
+ if(empty($calendar))
+ {
+ $calendar = new template();
+ $tpl_path = $phpbb_root_path . "modules/calendar/template/";
+ $calendar->set_custom_template($tpl_path, 'calendar');
+ }
+
+ if($display == 'month' && $year && !$month)
+ {
+ $display = 'year';
+ }
+ elseif($display == 'day' && $year && $month && !$day)
+ {
+ $display = 'month';
+ }
+
+ // set defaults
+ $dst = $config['board_dst'] * 3600;
+ $timezone = (($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone']))) * 3600;
+
+ list($curr_day, $curr_month, $curr_year) = explode(' ', gmdate('j n Y', time() + $timezone + $dst));
+
+ $year = ($year) ? $year : $curr_year;
+ $month = ($month) ? $month : $curr_month;
+ $day = ($day) ? $day : $curr_day;
+
+ $today = "$curr_year-$curr_month-$curr_day";
+
+ $lang_dates = $user->lang['datetime'];
+
+ switch($display)
+ {
+ case 'day':
+
+ $d = "$year-$month-$day";
+ $data = calendar_prepare_data($data, 'time');
+
+ for($i = 5; $i < 30; $i++)
+ {
+ $unix_time = mktime($i, 0, 0, $month, $day, $year);
+ $calendar->assign_block_vars('cal_day', array(
+ 'TIME' => date('h:i a', $unix_time), //$user->format_date($unix_time, 'h:i a'),
+ ));
+
+ $t = date('G', $unix_time);
+ if(isset($data["$d/$t"]))
+ {
+ $tdata = $data["$d/$t"];
+ foreach($tdata as $j => $row)
+ {
+ $calendar->assign_block_vars('cal_day.events', array(
+ 'TITLE' => $row['title'],
+ 'U_LINK' => $row['url'],
+ ));
+ }
+ }
+ }
+
+ $unix_time = mktime(0, 0, 0, $month, $day, $year);
+ $next_day = date("Y-n-j", strtotime("+1 day", $unix_time));
+ $prev_day = date("Y-n-j", strtotime("-1 day", $unix_time));
+
+ $calendar->assign_vars(array(
+ 'DAY' => strtr(@gmdate(str_replace('|', '', 'l F d, Y'), $unix_time), $lang_dates),
+ 'U_NEXT_DAY' => $u_action . '&display=day&date=' . $next_day,
+ 'U_PREV_DAY' => $u_action . '&display=day&date=' . $prev_day,
+ ));
+
+ if("$curr_year-$curr_month" == "$year-$month")
+ {
+ if($curr_day == $day || $curr_day == ($day - 1))
+ {
+ $calendar->assign_vars(array('L_PREV_DAY' => $user->lang['datetime']['YESTERDAY']));
+ }
+
+ if($curr_day == $day || $curr_day == ($day + 1))
+ {
+ $calendar->assign_vars(array('L_NEXT_DAY' => $user->lang['datetime']['TOMORROW']));
+ }
+ }
+
+ break;
+
+ case 'week':
+
+ $week_num = date('W', mktime(0, 0, 0, $month, $day, $year));
+ $unix_start = strtotime("+ $week_num weeks -1 day", mktime(0, 0, 0, 1, 1, $year));
+ $data = calendar_prepare_data($data, 'date');
+
+ for($i = 0; $i < 7; $i++)
+ {
+ $unix_time = strtotime("+$i day", $unix_start);
+ $tdate = date('Y-n-j', $unix_time);
+
+ $calendar->assign_block_vars('week_days', array(
+ 'DAY' => strtr(@gmdate(str_replace('|', '', 'M d'), $unix_time), $lang_dates),
+ 'L_DAY' => strtr(@gmdate(str_replace('|', '', 'l'), $unix_time), $lang_dates),
+ 'U_DAY' => $u_action . '&display=day&date=' . $tdate,
+ ));
+
+ $calendar->assign_block_vars('cal_week', array());
+
+ if(isset($data[$tdate]))
+ {
+ $edata = $data[$tdate];
+ foreach($edata as $j => $row)
+ {
+ $calendar->assign_block_vars('cal_week.events', array(
+ 'TITLE' => $row['title'],
+ 'U_LINK' => $row['url'],
+ ));
+ }
+ }
+ }
+
+ $to_year = date('Y', $unix_time);
+ $format = ($year != $to_year) ? 'M d, Y' : 'M d';
+
+ $from_day = strtr(@gmdate(str_replace('|', '', $format), $unix_start), $lang_dates);
+ $to_day = strtr(@gmdate(str_replace('|', '', 'M d, Y'), $unix_time), $lang_dates);
+
+ $next_week = date("Y-n-j", strtotime("+1 day", $unix_time));
+ $last_week = date("Y-n-j", strtotime("-7 days", $unix_start));
+
+ $calendar->assign_vars(array(
+ 'WEEK_DAYS' => sprintf($user->lang['WEEK_OF'], $from_day, $to_day),
+ 'U_NEXT_WEEK' => $u_action . '&display=week&date=' . $next_week,
+ 'U_PREV_WEEK' => $u_action . '&display=week&date=' . $last_week,
+ ));
+
+ break;
+
+ case 'mini':
+ case 'month':
+
+ // What is the first day of the month in question?
+ $unix_start = mktime(0, 0, 0, $month, 1, $year);
+
+ // How many days does this month contain?
+ $numberDays = date('t', $unix_start);
+
+ // Retrieve some information about the first day of the month in question.
+ $date_components = getdate($unix_start);
+
+ // What is the index value (0-6) of the first day of the month in question.
+ $day_of_week = $date_components['wday'];
+
+ $start_day = $day_of_week;
+
+ $u_month = "$year-$month";
+ $next_month = date("Y-n", strtotime("+1 month", $unix_start));
+ $last_month = date("Y-n", strtotime("-1 month", $unix_start));
+ $next_year = date("Y-n", strtotime("+1 year", $unix_start));
+ $last_year = date("Y-n", strtotime("-1 year", $unix_start));
+
+ $tpl_ary = array(
+ 'MONTH' => strtr(@gmdate(str_replace('|', '', 'F Y'), $unix_start), $lang_dates),
+ 'S_DAY_OF_WEEK' => $start_day,
+ 'S_REMAINING_DAYS' => ($day_of_week != 7) ? (7 - $day_of_week) : '',
+
+ 'U_MONTH' => $u_action . '&display=month&date=' . $u_month,
+ 'U_NEXT_MONTH' => $u_action . '&display=month&date=' . $next_month,
+ 'U_LAST_MONTH' => $u_action . '&display=month&date=' . $last_month,
+ 'U_NEXT_YEAR' => $u_action . '&display=month&date=' . $next_year,
+ 'U_LAST_YEAR' => $u_action . '&display=month&date=' . $last_year,
+ );
+
+ if($tpl_recur)
+ {
+ $calendar->assign_block_vars($tpl_recur, $tpl_ary);
+ $handle = $tpl_recur . '.cal_' . $display;
+ }
+ else
+ {
+ $calendar->assign_vars($tpl_ary);
+ $handle = 'cal_' . $display;
+ }
+
+ $current_day = 1;
+ $data = calendar_prepare_data($data, 'date');
+
+ while ($current_day <= $numberDays)
+ {
+ // Seventh column (Saturday) reached. Start a new row.
+ $break = '';
+ if ($day_of_week == 7)
+ {
+ $day_of_week = 0;
+ $break = 1;
+ }
+
+ $tdate = "$year-$month-$current_day";
+ $calendar->assign_block_vars($handle, array(
+ 'S_BREAK' => $break,
+ 'S_TODAY' => ($tdate == $today) ? true : false,
+ 'CURR_DAY' => $current_day,
+ 'U_LINK' => (isset($data[$tdate])) ? (($tpl_recur || $display == 'month') ? $u_action . '&display=day' : $u_action) . '&date=' . $tdate : '',
+ ));
+
+ if($display == 'month' && isset($data[$tdate]))
+ {
+ $mdata = $data[$tdate];
+ foreach($mdata as $j => $row)
+ {
+ $calendar->assign_block_vars($handle . '.events', array(
+ 'TITLE' => $row['title'],
+ 'U_LINK' => $row['url'],
+ ));
+ }
+ }
+
+ $current_day++;
+ $day_of_week++;
+ }
+
+ if($tpl_recur)
+ {
+ return;
+ }
+ else
+ {
+ $days_ary = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
+ foreach($days_ary as $i => $day)
+ {
+ $tpl_ary['L_' . strtoupper($day)] = $user->lang['datetime'][$day];
+ }
+ $calendar->assign_vars($tpl_ary);
+ }
+
+ break;
+
+ case 'year':
+
+ for($i = 1; $i < 13; $i++)
+ {
+ build_calendar($u_action, 'mini', $data, $i, false, $year, 'cal_year', &$calendar);
+ }
+
+ $calendar->assign_vars(array(
+ 'YEAR' => $year,
+ 'U_NEXT_YEAR' => $u_action . '&display=year&date=' . ($year + 1),
+ 'U_LAST_YEAR' => $u_action . '&display=year&date=' . ($year - 1),
+ ));
+
+ break;
+ }
+
+ $display_options = array('day', 'week', 'month', 'year');
+
+ foreach($display_options as $i => $option)
+ {
+ $calendar->assign_block_vars('cal_menu', array(
+ 'S_ACTIVE' => ($option == $display) ? true : false,
+ 'OPTION' => $user->lang[strtoupper($option)],
+ 'U_OPTION' => $u_action . '&display=' . $option,
+ ));
+ }
+
+ $calendar->set_filenames(array(
+ 'calendar' => "calendar_$display.html")
+ );
+
+ return $calendar->assign_display('calendar');
+}
+
+function calendar_prepare_data($data, $format)
+{
+ global $user;
+
+ $return = array();
+ if($format == 'date')
+ {
+ foreach($data as $timestamp => $row)
+ {
+ $date = $user->format_date($timestamp, 'Y-n-j');
+ $return[$date][] = $row;
+ }
+ }
+ else
+ {
+ foreach($data as $timestamp => $row)
+ {
+ $time = $user->format_date($timestamp, 'Y-n-j/G');
+ $return[$time][] = $row;
+ }
+ }
+
+ return $return;
+}
+
+function calendar_get_datetime_limits($display, $year, $month, $day)
+{
+ global $user, $config;
+
+ $dst = $config['board_dst'] * 3600;
+ $timezone = (($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone']))) * 3600;
+
+ switch($display)
+ {
+ case 'day':
+ $start = mktime(0, 0, 0, $month, $day, $year) + $timezone + $dst;
+ $stop = $start + (60 * 60 * 24); //mktime(23, 59, 59, $month, $day, $year) + $timezone + $dst;
+ break;
+ case 'week':
+ $week_num = date('W', mktime(0, 0, 0, $month, $day, $year));
+ $start = strtotime("+ $week_num weeks -1 day", mktime(0, 0, 0, 1, 1, $year)) + $timezone + $dst;
+ $stop = $start + (60 * 60 * 24 * 7);
+ break;
+ case 'year':
+ $start = mktime(0, 0, 0, 1, 1, $year) + $timezone + $dst;
+ $stop = mktime(23, 59, 59, 12, 31, $year) + $timezone + $dst;
+ break;
+ default:
+ $start = mktime(0, 0, 0, $month, 1, $year) + $timezone + $dst;
+ $num_days = date('t', $start);
+ $stop = mktime(23, 59, 59, $month, $num_days, $year) + $timezone + $dst;
+ break;
+ }
+
+ $data['start'] = $start;
+ $data['stop'] = $stop;
+
+ return $data;
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/calendar/language/en/calendar.php
===================================================================
--- mods/cms/trunk/modules/calendar/language/en/calendar.php (rev 0)
+++ mods/cms/trunk/modules/calendar/language/en/calendar.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,57 @@
+<?php
+/**
+*
+* calendar [English]
+*
+* @package language
+* @version $Id: calendar.php,v x.xxx yyyy/mm/dd hh:mm:ss Username Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'MINI_SUNDAY' => 'S',
+ 'MINI_MONDAY' => 'M',
+ 'MINI_TUESDAY' => 'T',
+ 'MINI_WEDNESDAY' => 'W',
+ 'MINI_THURSDAY' => 'T',
+ 'MINI_FRIDAY' => 'F',
+ 'MINI_SATURDAY' => 'S',
+
+ 'WEEK' => 'Week',
+ 'MONTH' => 'Month',
+
+ 'NEXT_WEEK' => 'Next Week',
+ 'PREV_WEEK' => 'Last Week',
+ 'WEEK_OF' => 'Week of %1$s - %2$s',
+
+ 'NEXT_MONTH' => 'Next Month',
+ 'NEXT_YEAR' => 'Next Year',
+ 'LAST_MONTH' => 'Last Month',
+ 'LAST_YEAR' => 'Last Year',
+
+ 'NEXT_DAY' => 'Next Day',
+ 'PREV_DAY' => 'Previous Day',
+
+));
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/calendar/language/en/common.php
===================================================================
--- mods/cms/trunk/modules/calendar/language/en/common.php (rev 0)
+++ mods/cms/trunk/modules/calendar/language/en/common.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* blocks [English]
+*
+* @package language
+* @version $Id: style_generator.php,v x.xxx yyyy/mm/dd hh:mm:ss Username Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'CALENDAR' => 'Calendar',
+
+));
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/calendar/template/calendar_day.html
===================================================================
--- mods/cms/trunk/modules/calendar/template/calendar_day.html (rev 0)
+++ mods/cms/trunk/modules/calendar/template/calendar_day.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,28 @@
+<!-- INCLUDE calendar_header.html -->
+
+<table class="calendar" width="100%" border="0" cellspacing="1">
+ <tr>
+ <td colspan="2" height="35">
+ <div class="left-box"><span><a href="{U_PREV_DAY}">{L_PREV_DAY}</a></span></div>
+ <div class="right-box"><span><a href="{U_NEXT_DAY}">{L_NEXT_DAY}</a></span></div>
+ <div style="text-align:center"><strong>{DAY}</strong></div>
+ </td>
+ </tr>
+
+ <!-- BEGIN cal_day -->
+ <tr>
+ <td width="90" height="25"><b>{cal_day.TIME}</b></td>
+ <td class="bg2" width="90%">
+ <!-- BEGIN events -->
+ <a href="{cal_day.events.U_LINK}">{cal_day.events.TITLE}</a>
+ <!-- END events -->
+ <td>
+ </tr>
+ <tr>
+ <td height="25"> </td>
+ <td class="bg2"><td>
+ </tr>
+ <!-- END cal_day -->
+</table>
+
+<!-- INCLUDE calendar_footer.html -->
Added: mods/cms/trunk/modules/calendar/template/calendar_footer.html
===================================================================
--- mods/cms/trunk/modules/calendar/template/calendar_footer.html (rev 0)
+++ mods/cms/trunk/modules/calendar/template/calendar_footer.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,2 @@
+ <span class="corners-bottom"><span></span></span></div>
+</div>
\ No newline at end of file
Added: mods/cms/trunk/modules/calendar/template/calendar_header.html
===================================================================
--- mods/cms/trunk/modules/calendar/template/calendar_header.html (rev 0)
+++ mods/cms/trunk/modules/calendar/template/calendar_header.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,10 @@
+<div id="tabs">
+ <ul class="rightside">
+ <!-- BEGIN cal_menu -->
+ <li<!-- IF cal_menu.S_ACTIVE --> class="activetab"<!-- ENDIF -->><a href="{cal_menu.U_OPTION}"><span>{cal_menu.OPTION}</span></a></li>
+ <!-- END cal_menu -->
+ </ul>
+</div>
+
+<div class="panel bg3">
+ <div class="inner"><span class="corners-top"><span></span></span>
\ No newline at end of file
Added: mods/cms/trunk/modules/calendar/template/calendar_mini.html
===================================================================
--- mods/cms/trunk/modules/calendar/template/calendar_mini.html (rev 0)
+++ mods/cms/trunk/modules/calendar/template/calendar_mini.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,28 @@
+<table width="100%" border="0" cellspacing="1">
+ <caption><b>{MONTH}</b></caption>
+ <tr>
+ <th>{L_MINI_SUNDAY}</th>
+ <th>{L_MINI_MONDAY}</th>
+ <th>{L_MINI_TUESDAY}</th>
+ <th>{L_MINI_WEDNESDAY}</th>
+ <th>{L_MINI_THURSDAY}</th>
+ <th>{L_MINI_FRIDAY}</th>
+ <th>{L_MINI_SATURDAY}</th>
+ </tr>
+ <tr>
+ <!-- IF S_DAY_OF_WEEK > 0 --><td colspan="{S_DAY_OF_WEEK}"> </td><!-- ENDIF -->
+
+ <!-- BEGIN cal_mini -->
+ <!-- IF cal_mini.S_BREAK --></tr><tr><!-- ENDIF -->
+ <td class="<!-- IF cal_mini.S_TODAY -->forumbg<!-- ENDIF -->" width="14.2%">
+ <!-- IF cal_mini.U_LINK -->
+ <span class="forabg"><a href="{cal_mini.U_LINK}" class="calendarlink">{cal_mini.CURR_DAY}</a></span>
+ <!-- ELSE -->
+ {cal_mini.CURR_DAY}
+ <!-- ENDIF -->
+ </td>
+ <!-- END cal_mini -->
+
+ <!-- IF S_REMAINING_DAYS --><td colspan="{S_REMAINING_DAYS}"> </td><!-- ENDIF -->
+ </tr>
+</table>
Added: mods/cms/trunk/modules/calendar/template/calendar_month.html
===================================================================
--- mods/cms/trunk/modules/calendar/template/calendar_month.html (rev 0)
+++ mods/cms/trunk/modules/calendar/template/calendar_month.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,47 @@
+<!-- INCLUDE calendar_header.html -->
+
+<table class="calendar" width="100%" border="0" cellspacing="1">
+ <tr>
+ <td><span><a href="{U_LAST_YEAR}" title="{L_LAST_YEAR}"><<</a></span></td>
+ <td><span><a href="{U_LAST_MONTH}" title="{L_LAST_MONTH}"><</a></span></td>
+ <td colspan="3"><h2 style="text-align:center">{MONTH}</h2></td>
+ <td><span class="right-box"><a href="{U_NEXT_MONTH}" title="{L_NEXT_MONTH}">></a></span></td>
+ <td><span class="right-box"><a href="{U_NEXT_YEAR}" title="{L_NEXT_YEAR}">>></a></span></td>
+ </tr>
+ <tr>
+ <th>{L_SUNDAY}</th>
+ <th>{L_MONDAY}</th>
+ <th>{L_TUESDAY}</th>
+ <th>{L_WEDNESDAY}</th>
+ <th>{L_THURSDAY}</th>
+ <th>{L_FRIDAY}</th>
+ <th>{L_SATURDAY}</th>
+ </tr>
+ <tr>
+ <!-- IF S_DAY_OF_WEEK > 0 --><td colspan="{S_DAY_OF_WEEK}"> </td><!-- ENDIF -->
+
+ <!-- BEGIN cal_month -->
+ <!-- IF cal_month.S_BREAK --></tr><tr><!-- ENDIF -->
+ <td width="14.2%">
+ <div class="<!-- IF cal_month.S_TODAY -->forabg<!-- ELSE -->bg3<!-- ENDIF -->" style="text-align:right">
+ <!-- IF cal_month.U_LINK -->
+ <a href="{cal_month.U_LINK}" class="bg1">{cal_month.CURR_DAY}</a>
+ <!-- ELSE -->
+ {cal_month.CURR_DAY}
+ <!-- ENDIF -->
+ </div>
+ <div class="bg2" style="height:100px"><br />
+ <ul>
+ <!-- BEGIN events -->
+ <li><a href="{cal_month.events.U_LINK}">{cal_month.events.TITLE}</a></li>
+ <!-- END events -->
+ </ul>
+ </div>
+ </td>
+ <!-- END cal_month -->
+
+ <!-- IF S_REMAINING_DAYS --><td colspan="{S_REMAINING_DAYS}"> </td><!-- ENDIF -->
+ </tr>
+</table>
+
+<!-- INCLUDE calendar_footer.html -->
Added: mods/cms/trunk/modules/calendar/template/calendar_week.html
===================================================================
--- mods/cms/trunk/modules/calendar/template/calendar_week.html (rev 0)
+++ mods/cms/trunk/modules/calendar/template/calendar_week.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,29 @@
+<!-- INCLUDE calendar_header.html -->
+
+<table class="calendar" width="100%" border="0" cellspacing="2">
+ <tr>
+ <td><span><a href="{U_PREV_WEEK}">{L_PREV_WEEK}</a></span></td>
+ <td colspan="5"><h2 style="text-align:center">{WEEK_DAYS}</h2></td>
+ <td><span class="right-box"><a href="{U_NEXT_WEEK}">{L_NEXT_WEEK}</a></span></td>
+ </tr>
+ <tr>
+ <!-- BEGIN week_days -->
+ <td style="width:14.2%;text-align:center"><span><b>{week_days.L_DAY}</b><br /><a href="{week_days.U_DAY}">{week_days.DAY}</a></span></td>
+ <!-- END week_days -->
+ </tr>
+ <tr>
+ <!-- BEGIN cal_week -->
+ <td style="width:14.2%; height:450px" valign="top">
+ <div class="bg2" style="height:450px"><br />
+ <ul>
+ <!-- BEGIN events -->
+ <li><a href="{cal_week.events.U_LINK}">{cal_week.events.TITLE}</li>
+ <!-- END events -->
+ </ul>
+ </div>
+ </td>
+ <!-- END cal_week -->
+ </tr>
+</table>
+
+<!-- INCLUDE calendar_footer.html -->
Added: mods/cms/trunk/modules/calendar/template/calendar_year.html
===================================================================
--- mods/cms/trunk/modules/calendar/template/calendar_year.html (rev 0)
+++ mods/cms/trunk/modules/calendar/template/calendar_year.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,48 @@
+<!-- INCLUDE calendar_header.html -->
+
+<div style="text-align:center; width:100%">
+ <div class="left-box"><span><a href="{U_LAST_YEAR}">{L_LAST_YEAR}</a></span></div>
+ <div class="right-box"><span><a href="{U_NEXT_YEAR}">{L_NEXT_YEAR}</a></span></div>
+ <p><strong>{YEAR}</strong></p>
+ <br />
+
+ <div class="bg2" style="height:100%">
+
+ <!-- BEGIN cal_year -->
+ <table border="0" cellspacing="1" class="bg3" style="float:left;margin:2%;width:27.9%;height:165px">
+ <tr>
+ <td colspan="7"><strong><a href="{cal_year.U_MONTH}">{cal_year.MONTH}</a></strong></td>
+ </tr>
+ <tr>
+ <th>{L_MINI_SUNDAY}</th>
+ <th>{L_MINI_MONDAY}</th>
+ <th>{L_MINI_TUESDAY}</th>
+ <th>{L_MINI_WEDNESDAY}</th>
+ <th>{L_MINI_THURSDAY}</th>
+ <th>{L_MINI_FRIDAY}</th>
+ <th>{L_MINI_SATURDAY}</th>
+ </tr>
+ <tr>
+ <!-- IF cal_year.S_DAY_OF_WEEK > 0 --><td colspan="{cal_year.S_DAY_OF_WEEK}"> </td><!-- ENDIF -->
+
+ <!-- BEGIN cal_mini -->
+ <!-- IF cal_year.cal_mini.S_BREAK --></tr><tr><!-- ENDIF -->
+ <td class="<!-- IF cal_year.cal_mini.S_TODAY -->forumbg<!-- ENDIF -->" width="14.2%">
+ <!-- IF cal_year.cal_mini.U_LINK -->
+ <span class="forabg"><a href="{cal_year.cal_mini.U_LINK}" class="calendarlink">{cal_year.cal_mini.CURR_DAY}</a></span>
+ <!-- ELSE -->
+ {cal_year.cal_mini.CURR_DAY}
+ <!-- ENDIF -->
+ </td>
+ <!-- END cal_mini -->
+
+ <!-- IF cal_year.S_REMAINING_DAYS --><td colspan="{cal_year.S_REMAINING_DAYS}"> </td><!-- ENDIF -->
+ </tr>
+ </table>
+ <!-- END cal_year -->
+
+ <br clear="both" />
+ </div>
+</div>
+
+<!-- INCLUDE calendar_footer.html -->
\ No newline at end of file
Modified: mods/cms/trunk/modules/content/cms_content.php
===================================================================
--- mods/cms/trunk/modules/content/cms_content.php 2007-09-05 05:46:11 UTC (rev 56)
+++ mods/cms/trunk/modules/content/cms_content.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -2,7 +2,7 @@
/**
*
* @package cms
-* @version $Id: gui_content.php,v 1.38 2006/11/24 14:58:07 acydburn Exp $
+* @version $Id: cms_content.php,v 1.38 2006/11/24 14:58:07 Blitze Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -124,7 +124,7 @@
$tags = '';
if($content_data['allow_keywords'] && $row['keywords'])
{
- $tags_ary = str_replace(' ', '', $row['keywords']);
+ $tags_ary = str_replace(', ', ',', $row['keywords']);
$tags_ary = explode(',', $tags_ary);
foreach($tags_ary as $i => $tag)
@@ -161,7 +161,7 @@
'U_HIDE_COMMENTS' => $url,
'U_VIEW_COMMENTS' => $url . "&comments=1#comments",
- 'U_POST_COMMENT' => $url . "&comments=1#post_comments",
+ 'U_POST_COMMENT' => $url . "&comments=1#post_comment",
'U_AUTHOR' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['author']),
'U_APPROVER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['approver']),
));
@@ -256,7 +256,7 @@
AND UNIX_TIMESTAMP(NOW()) > c.post_time';
$sql .= ($cat_items) ? ' AND ' . $db->sql_in_set('c.id', $cat_items) : '';
$sql .= ($author) ? ' AND c.author = ' . (int) $author : '';
- $sql .= ($tag) ? " AND c.keywords LIKE '%" . $db->sql_escape(utf8_clean_string($tag)) . "%'" : '';
+ $sql .= ($tag) ? " AND c.keywords " . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_case_fold_nfc("*$tag*"))) : '';
$sql .= ' ORDER BY c.post_time DESC';
$result = $db->sql_query_limit($sql, $config['posts_per_page'], $start);
Modified: mods/cms/trunk/modules/content/language/en/content.php
===================================================================
--- mods/cms/trunk/modules/content/language/en/content.php 2007-09-05 05:46:11 UTC (rev 56)
+++ mods/cms/trunk/modules/content/language/en/content.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -82,7 +82,7 @@
'NO_ITEMS' => 'There are no existing items for this content type.',
'NO_CONTENT_TYPE' => 'There are no existing content types',
- 'NO_CMS_CONTENT' => 'No %s(s) have been posted yet.',
+ 'NO_CMS_CONTENT' => 'No %s found.',
'TEXT' => 'Text',
'SMALL_TEXTAREA' => 'Small Textarea',
'LARGE_TEXTAREA' => 'Large Textarea',
Added: mods/cms/trunk/modules/events/acp_events.php
===================================================================
--- mods/cms/trunk/modules/events/acp_events.php (rev 0)
+++ mods/cms/trunk/modules/events/acp_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,151 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: acp_events.php,v 1.38 2006/11/24 14:58:07 Blitze Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* acp_events
+* @package events
+*/
+class acp_events
+{
+ var $u_action;
+
+ function main($id, $mode)
+ {
+ global $config, $db, $user, $auth, $template, $mtemplate, $phpbb_root_path, $phpEx;
+
+ include($phpbb_root_path . "modules/events/constants.$phpEx");
+ include($phpbb_root_path . "modules/events/functions_events.$phpEx");
+
+ $user->add_mod_lang(array('events' => 'events'));
+
+ $action = request_var('action', '');
+ $display = request_var('display', '');
+ $event_id = request_var('e', '');
+ $group_id = request_var('g', '');
+ $user_id = request_var('u', '');
+ $submit = (isset($_POST['submit'])) ? true : false;
+
+ if($submit)
+ {
+ event_save($event_id);
+ }
+
+ if($action == 'approve')
+ {
+ set_event_status($event_id, 1);
+ $event_id = '';
+ }
+
+ switch($action)
+ {
+ case 'edit':
+ case 'add':
+ event_add($event_id);
+ break;
+
+ default:
+
+ $sql_array = array(
+ 'SELECT' => 'e.*, u.username, u.user_colour, g.group_name',
+ 'FROM' => array(
+ EVENTS_TABLE => 'e',
+ USERS_TABLE => 'u',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(GROUPS_TABLE => 'g'),
+ 'ON' => 'g.group_id = e.group_id'
+ )
+ ),
+ 'WHERE' => 'u.user_id = e.user_id',
+ 'ORDER_BY' => 'e.event_start DESC'
+ );
+
+ if($display)
+ {
+ $sql_array['WHERE'] .= ' AND ';
+
+ switch($display)
+ {
+ case 'user':
+ $sql_array['WHERE'] .= ($user_id) ? 'e.user_id = ' . $user_id : "e.group_id = ''";
+ break;
+ case 'group':
+ $sql_array['WHERE'] .= ($group_id) ? 'e.group_id = ' . $group_id : "e.group_id <> ''";
+ break;
+ case 'pending':
+ $sql_array['WHERE'] .= 'e.event_status = 0';
+ break;
+ case 'approved':
+ $sql_array['WHERE'] .= 'e.event_status = 1';
+ break;
+ case 'past':
+ $sql_array['WHERE'] .= 'e.event_end < UNIX_TIMESTAMP(NOW())';
+ break;
+ }
+ }
+
+ if($event_id)
+ {
+ $sql_array['WHERE'] .= ' AND e.event_id = ' . $event_id;
+ $mtemplate->assign_vars(array('S_DETAILS' => true));
+ }
+
+ $sql = $db->sql_build_query('SELECT', $sql_array);
+ $result = $db->sql_query($sql);
+
+ while($row = $db->sql_fetchrow($result))
+ {
+ $mtemplate->assign_block_vars('events', array(
+ 'EVENT_TITLE' => censor_text($row['event_title']),
+ 'EVENT_START' => $user->format_date($row['event_start']),
+ 'EVENT_END' => $user->format_date($row['event_end']),
+ 'EVENT_POSTER' => $row['username'],
+ 'EVENT_STATUS' => $row['event_status'],
+ 'GROUP' => ($row['group_name']) ? ((isset($user->lang['G_' . $row['group_name']])) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) : '',
+
+ 'U_USER' => $this->u_action . '&display=user&u=' . $row['user_id'],
+ 'U_GROUP' => $this->u_action . '&display=group&g=' . $row['group_id'],
+ 'U_VIEW' => $this->u_action . '&e=' . $row['event_id'],
+ 'U_APPROVE' => $this->u_action . '&e=' . $row['event_id'] . '&action=approve',
+ 'U_DELETE' => $this->u_action . '&e=' . $row['event_id'] . '&action=delete',
+ 'U_EDIT' => $this->u_action . '&e=' . $row['event_id'] . '&action=edit',
+ ));
+ }
+ $db->sql_freeresult($result);
+
+ $mtemplate->assign_vars(array(
+ 'U_EVENT_ADD' => $this->u_action . '&action=add',
+ 'U_USER_VIEW' => $this->u_action . '&display=user',
+ 'U_GROUP_VIEW' => $this->u_action . '&display=group',
+ 'U_PENDING_VIEW' => $this->u_action . '&display=pending',
+ 'U_APPROVED_VIEW' => $this->u_action . '&display=approved',
+ 'U_PAST_VIEW' => $this->u_action . '&display=past',
+ ));
+
+ break;
+ }
+
+ $mtemplate->set_filenames(array(
+ 'content' => 'acp_events.html')
+ );
+
+ $template->assign_vars(array(
+ 'CONTENT' => $mtemplate->assign_display('content'),
+ 'L_TITLE' => $user->lang['EVENTS'],
+ 'L_TITLE_EXPLAIN' => '',
+ ));
+
+ $this->tpl_name = 'mod_admin';
+ $this->page_title = 'ACP_EVENTS';
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/cms_events.php
===================================================================
--- mods/cms/trunk/modules/events/cms_events.php (rev 0)
+++ mods/cms/trunk/modules/events/cms_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,41 @@
+<?php
+/**
+*
+* @package cms
+* @version $Id: cms_events.php,v 1.41 2007/01/24 11:28:50 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* cms_events
+* @package events
+*/
+class cms_events
+{
+ var $u_action;
+ var $tpl_name;
+
+ function main($id, $mode)
+ {
+ global $db, $user, $mtemplate, $template, $phpbb_root_path, $phpEx;
+
+ include_once($phpbb_root_path . "modules/events/constants.$phpEx");
+ include($phpbb_root_path . "modules/events/functions_events.$phpEx");
+
+ $user->add_mod_lang(array('events' => 'events'));
+
+ $event_id = request_var('e', '');
+
+ $this->page_title = $user->lang['CMS_EVENTS'];
+
+ $module_block['TITLE'] = $user->lang['CMS_EVENTS'];
+ $module_block['CONTENT'] = get_events($mode, $this->u_action, $event_id);
+
+ $template->assign_vars(array('S_NO_CONTAINER' => true));
+ $template->assign_block_vars('module', $module_block);
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/constants.php
===================================================================
--- mods/cms/trunk/modules/events/constants.php (rev 0)
+++ mods/cms/trunk/modules/events/constants.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,19 @@
+<?php
+/**
+*
+* @package phpBB3
+* @version $Id: constants.php,v 1.76 2006/10/19 13:54:47 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+*/
+
+global $table_prefix;
+
+define('EVENTS_TABLE', $table_prefix . 'events');
+define('EVENTS_RSVP_TABLE', $table_prefix . 'events_rsvp');
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/functions_events.php
===================================================================
--- mods/cms/trunk/modules/events/functions_events.php (rev 0)
+++ mods/cms/trunk/modules/events/functions_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,247 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: functions_events.php,v 1.38 2006/11/24 14:58:07 Blitze Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/*
+* get_events
+*
+* mode [string], list/calendar/map
+* event_id [int], limits to specific event
+* scope [string], accepts user/group: used to limits events by user/group
+* ug_id [int], id of the group or user
+* status [int], accepts 0/1: used to limit events by status (1 = approved)
+* path_to_details: if set, will be used instead of default to view event detail
+*/
+
+function get_events($mode, $u_action, $event_id = '', $scope = false, $ug_id = '', $status = 1, $path_to_details = '')
+{
+ global $db, $user, $config, $mtemplate, $phpbb_root_path, $phpEx;
+
+ $display = request_var('display', 'month');
+ $date = request_var('date', '');
+
+ $dst = $config['board_dst'] * 3600;
+ $timezone = (($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone']))) * 3600;
+
+ list($day, $month, $year) = explode(' ', gmdate('j n Y', time() + $timezone + $dst));
+
+ if($date)
+ {
+ $date_info = explode('-', $date);
+ $year = (isset($date_info[0])) ? $date_info[0] : '';
+ $month = (isset($date_info[1])) ? $date_info[1] : '';
+ $day = (isset($date_info[2])) ? $date_info[2] : '';
+ }
+
+ $sql_array = array(
+ 'SELECT' => 'e.*, u.username, u.user_colour, g.group_name',
+ 'FROM' => array(
+ EVENTS_TABLE => 'e',
+ USERS_TABLE => 'u',
+ ),
+ 'LEFT_JOIN' => array(
+ array(
+ 'FROM' => array(GROUPS_TABLE => 'g'),
+ 'ON' => 'g.group_id = e.group_id'
+ )
+ ),
+ 'WHERE' => 'u.user_id = e.user_id',
+ 'ORDER_BY' => 'e.event_start DESC'
+ );
+
+ if($mode == 'calendar')
+ {
+ include($phpbb_root_path . "modules/calendar/functions_calendar.$phpEx");
+
+ $limits = calendar_get_datetime_limits($display, $year, $month, $day);
+ $sql_array['WHERE'] .= ' AND e.event_start BETWEEN ' . $limits['start'] . ' AND ' . $limits['stop'];
+ }
+
+ if($scope)
+ {
+ if($scope == 'group')
+ {
+ $sql_array['WHERE'] .= ' AND ' . (($ug_id) ? "e.group_id = $ug_id" : "e.group_id <> ''");
+ }
+ else
+ {
+ $sql_array['WHERE'] .= ' AND ' . (($ug_id) ? "e.user_id = $ug_id" : "e.group_id = ''");
+ }
+ }
+
+ $sql_array['WHERE'] .= ' AND ' . (($status) ? 'e.event_status = 1' : 'e.event_status = 0');
+
+ $result = $db->sql_query($db->sql_build_query('SELECT', $sql_array));
+
+ $data = array();
+ $path_to_details = ($path_to_details) ? $path_to_details : append_sid("{$phpbb_root_path}index.$phpEx", 'i=events&mode=details');
+
+ switch($mode)
+ {
+ case 'map':
+ break;
+
+ case 'calendar':
+
+ while($row = $db->sql_fetchrow($result))
+ {
+ $data[$row['event_start']]['title'] = censor_text($row['event_title']);
+ $data[$row['event_start']]['url'] = $path_to_details . '&e=' . $row['event_id'];
+ }
+
+ $data = build_calendar($u_action, $display, $data, $month, $day, $year);
+
+ break;
+
+ default:
+
+ while($row = $db->sql_fetchrow($result))
+ {
+ $mtemplate->assign_block_vars('events', array(
+ 'EVENT_TITLE' => censor_text($row['event_title']),
+ 'EVENT_START' => $user->format_date($row['event_start']),
+ 'EVENT_END' => $user->format_date($row['event_end']),
+ 'EVENT_POSTER' => $row['username'],
+ 'EVENT_DESC' => $row['event_desc'],
+
+ 'U_VIEW' => $path_to_details . '&e=' . $row['event_id'],
+ 'U_USER' => $u_action . '&browseby=user&u=' . $row['user_id'],
+ 'U_APPROVE' => $u_action . '&e=' . $row['event_id'] . '&action=approve',
+ 'U_DELETE' => $u_action . '&e=' . $row['event_id'] . '&action=delete',
+ 'U_EDIT' => $u_action . '&e=' . $row['event_id'] . '&action=edit',
+ ));
+ }
+
+ $mtemplate->set_filenames(array(
+ 'events_list' => 'events_list.html')
+ );
+
+ $data = $mtemplate->assign_display('events_list');
+
+ break;
+ }
+ $db->sql_freeresult($result);
+
+ return $data;
+}
+
+function event_add($event_id)
+{
+ global $db, $mtemplate, $user;
+
+ if($event_id)
+ {
+ $sql = 'SELECT *
+ FROM ' . EVENTS_TABLE . "
+ WHERE event_id = $event_id";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $mtemplate->assign_vars(array(
+ 'EVENT_TITLE' => $row['event_title'],
+ 'EVENT_DESC' => $row['event_desc'],
+ 'EVENT_STARTDATE' => $user->format_date($row['event_start'], 'm/d/Y', true),
+ 'EVENT_STARTTIME' => $user->format_date($row['event_start'], 'H:i', true),
+ 'EVENT_ENDDATE' => $user->format_date($row['event_end'], 'm/d/Y', true),
+ 'EVENT_ENDTIME' => $user->format_date($row['event_end'], 'H:i', true),
+ 'EVENT_ADDRESS' => $row['event_address'],
+ 'EVENT_CONTACT' => $row['event_contact'],
+ 'S_RSVP' => $row['event_rsvp'],
+ 'L_EVENT_ADD' => $user->lang['EVENT_EDIT'],
+ ));
+ }
+
+ $mtemplate->assign_vars(array('S_EDIT' => true));
+}
+
+function event_save($event_id)
+{
+ global $db, $template, $user, $config;
+
+ $event_title = (string) request_var('title', '');
+ $event_desc = utf8_normalize_nfc(request_var('desc', '', true));
+ $event_startdate = request_var('start_date', '');
+ $event_starttime = request_var('start_time', '');
+ $event_enddate = request_var('end_date', '');
+ $event_endtime = request_var('end_time', '');
+
+ $errors = array();
+
+ if (!$event_title)
+ {
+ $errors[] = $user->lang['MISSING_TITLE'];
+ }
+
+ if(!$event_desc)
+ {
+ $errors[] = $user->lang['MISSING_DESC'];
+ }
+
+ if(sizeof($errors))
+ {
+ $template->assign_vars(array('MESSAGE' => join('<br>', $errors)));
+ return;
+ }
+
+ $enable_smilies = ($config['allow_smilies'] && $user->optionget('smilies')) ? true : false;
+ $enable_bbcode = ($config['allow_bbcode'] && $user->optionget('bbcode')) ? true : false;
+ $enable_urls = ($config['allow_urls']) ? true : false;
+
+ $sdate = explode('/', $event_startdate);
+ $stime = explode(':', $event_starttime);
+ $edate = explode('/', $event_enddate);
+ $etime = explode(':', $event_endtime);
+
+ $dst = $config['board_dst'] * 3600;
+ $timezone = ($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone'])) * 3600;
+
+ $event_start = mktime($stime[0], $stime[1], 60, $sdate[0], $sdate[1], $sdate[2]) + $timezone + $dst;
+ $event_end = mktime($etime[0], $etime[1], 60, $edate[0], $edate[1], $edate[2]) + $timezone + $dst;
+
+ $sql_ary = array(
+ 'event_desc' => $event_desc,
+ 'event_title' => $event_title,
+ 'event_contact' => request_var('contact', ''),
+ 'event_address' => request_var('address', ''),
+ 'event_start' => $event_start,
+ 'event_end' => $event_end,
+ 'event_recur' => request_var('recur', '0'),
+ 'event_props' => request_var('recur_prop', '0'),
+ 'event_rsvp' => request_var('rsvp', '0'),
+ 'event_auth' => request_var('auth', '1'),
+ );
+
+ if(!$event_id)
+ {
+ $sql_ary['user_id'] = $user->data['user_id'];
+ $sql_ary['group_id'] = (int) request_var('g', '');
+ $sql_ary['event_posttime'] = request_var('post_time', '');
+ }
+
+ generate_text_for_storage($sql_ary['event_desc'], $sql_ary['bbcode_uid'], $sql_ary['bbcode_bitfield'], $sql_ary['bbcode_options'], $enable_bbcode, $enable_urls, $enable_smilies);
+
+ $sql = ($event_id) ? 'UPDATE ' . EVENTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE event_id = ' . (int) $event_id : 'INSERT INTO ' . EVENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
+ $db->sql_query($sql);
+}
+
+function set_event_status($event_id, $status)
+{
+ global $db;
+
+ if(!$event_id)
+ {
+ return;
+ }
+
+ $sql = 'UPDATE ' . EVENTS_TABLE . " SET event_status = $status WHERE event_id = $event_id";
+ $db->sql_query($sql);
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/info/acp_events.php
===================================================================
--- mods/cms/trunk/modules/events/info/acp_events.php (rev 0)
+++ mods/cms/trunk/modules/events/info/acp_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,80 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: acp_events.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class acp_events_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'acp_events',
+ 'title' => 'ACP_EVENTS',
+ 'parent' => 'ACP_MOD_MANAGEMENT',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'events' => array('title' => 'ACP_EVENTS', 'auth' => '', 'cat' => array('ACP_EVENTS')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ global $db, $phpbb_root_path, $phpEx;
+
+ include_once($phpbb_root_path . "modules/events/constants.$phpEx");
+
+ $sql_ary[] = 'CREATE TABLE IF NOT EXISTS ' . EVENTS_TABLE . " (
+ `event_id` mediumint(8) NOT NULL auto_increment,
+ `user_id` mediumint(8) NOT NULL,
+ `group_id` mediumint(8) NOT NULL,
+ `event_title` varchar(100) collate utf8_bin NOT NULL,
+ `event_desc` text collate utf8_bin,
+ `bbcode_bitfield` varchar(255) collate utf8_bin NOT NULL,
+ `bbcode_uid` varchar(5) collate utf8_bin NOT NULL,
+ `bbcode_options` int(11) NOT NULL default '7',
+ `event_contact` varchar(255) collate utf8_bin NOT NULL,
+ `event_address` varchar(255) collate utf8_bin NOT NULL,
+ `event_start` int(11) NOT NULL default '0',
+ `event_end` int(11) NOT NULL default '0',
+ `event_posttime` int(11) NOT NULL default '0',
+ `event_rsvp` tinyint(1) NOT NULL default '0',
+ `event_recur` tinyint(1) NOT NULL default '0',
+ `event_props` tinyint(1) NOT NULL default '0',
+ `event_nexttime` int(11) NOT NULL default '0',
+ `event_status` tinyint(1) NOT NULL default '0',
+ `event_auth` mediumint(8) NOT NULL,
+ PRIMARY KEY (`event_id`)
+ ) CHARACTER SET `utf8` COLLATE `utf8_bin`";
+
+ $sql_ary[] = 'CREATE TABLE IF NOT EXISTS ' . EVENTS_RSVP_TABLE . " (
+ `event_id` mediumint(8) NOT NULL,
+ `user_id` mediumint(8) NOT NULL,
+ `event_rsvp` tinyint(2) NOT NULL default '0'
+ )";
+
+ $sql_ary[] = 'UPDATE ' . MODULES_TABLE . "
+ SET module_display = 0
+ WHERE module_mode = 'details'
+ AND module_dir = 'events'";
+
+ foreach($sql_ary as $i => $sql)
+ {
+ $db->sql_query($sql);
+ }
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/info/cms_events.php
===================================================================
--- mods/cms/trunk/modules/events/info/cms_events.php (rev 0)
+++ mods/cms/trunk/modules/events/info/cms_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: cms_events.php,v 1.2 2006/05/01 19:45:42 Blitze Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class cms_events_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'cms_events',
+ 'title' => 'CMS_EVENTS',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'list' => array('title' => 'EVENTS_LIST', 'auth' => '', 'cat' => array('CMS_EVENTS')),
+ 'calendar' => array('title' => 'EVENTS_CALENDAR', 'auth' => '', 'cat' => array('CMS_EVENTS')),
+ 'map' => array('title' => 'EVENTS_MAP', 'auth' => '', 'cat' => array('CMS_EVENTS')),
+ 'details' => array('title' => 'EVENTS_DETAILS', 'auth' => '', 'cat' => array('CMS_EVENTS')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/info/events_info.php
===================================================================
--- mods/cms/trunk/modules/events/info/events_info.php (rev 0)
+++ mods/cms/trunk/modules/events/info/events_info.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,30 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: events_info.php,v 1.3 2006/10/06 18:43:54 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+$module_info = array(
+ 'mod_name' => 'events',
+ 'mod_disp_name' => 'Events',
+ 'mod_short_desc' => 'Events System',
+ 'mod_long_desc' => 'Creates an events system',
+ 'mod_image' => '',
+ 'mod_author' => 'Blitze',
+ 'mod_contact' => '',
+ 'mod_url' => '',
+ 'mod_vers' => '1.01',
+ 'mod_compat' => 'rc5',
+ 'mod_type' => 'mod',
+ 'mod_demo_url' => '',
+ 'mod_dependents' => ''
+);
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/info/gcp_events.php
===================================================================
--- mods/cms/trunk/modules/events/info/gcp_events.php (rev 0)
+++ mods/cms/trunk/modules/events/info/gcp_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: gcp_events.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class gcp_events_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'gcp_events',
+ 'title' => 'GCP_EVENTS',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'events' => array('title' => 'EVENTS', 'auth' => '', 'cat' => array('GCP_EVENTS')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/info/grp_events.php
===================================================================
--- mods/cms/trunk/modules/events/info/grp_events.php (rev 0)
+++ mods/cms/trunk/modules/events/info/grp_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: grp_events.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class grp_events_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'grp_events',
+ 'title' => 'GRP_EVENTS',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'events' => array('title' => 'EVENTS', 'auth' => '', 'cat' => array('GRP_EVENTS')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/info/mcp_events.php
===================================================================
--- mods/cms/trunk/modules/events/info/mcp_events.php (rev 0)
+++ mods/cms/trunk/modules/events/info/mcp_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: mcp_events.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class mcp_events_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'mcp_events',
+ 'title' => 'MCP_EVENTS',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'events' => array('title' => 'EVENTS', 'auth' => '', 'cat' => array('MCP_EVENTS')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/info/ucp_events.php
===================================================================
--- mods/cms/trunk/modules/events/info/ucp_events.php (rev 0)
+++ mods/cms/trunk/modules/events/info/ucp_events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* @package events
+* @version $Id: ucp_events.php,v 1.2 2006/05/01 19:45:42 grahamje Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class ucp_events_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'ucp_events',
+ 'title' => 'UCP_EVENTS',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'events' => array('title' => 'EVENTS', 'auth' => '', 'cat' => array('UCP_EVENTS')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/language/en/common.php
===================================================================
--- mods/cms/trunk/modules/events/language/en/common.php (rev 0)
+++ mods/cms/trunk/modules/events/language/en/common.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,47 @@
+<?php
+/**
+*
+* Events [English]
+*
+* @package language
+* @version $Id: common.php,v x.xxx yyyy/mm/dd hh:mm:ss Username Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'EVENTS' => 'Events',
+ 'ACP_EVENTS' => 'Events',
+ 'CMS_EVENTS' => 'Events',
+ 'UCP_EVENTS' => 'Events',
+ 'MCP_EVENTS' => 'Events',
+ 'PRO_EVENTS' => 'Events',
+ 'GCP_EVENTS' => 'Events',
+ 'GRP_EVENTS' => 'Group Events',
+
+ 'EVENTS_LIST' => 'Events List',
+ 'EVENTS_CALENDAR' => 'Events Calendar',
+ 'EVENTS_MAP' => 'Events Map',
+ 'EVENTS_DETAILS' => 'Event Details',
+));
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/language/en/events.php
===================================================================
--- mods/cms/trunk/modules/events/language/en/events.php (rev 0)
+++ mods/cms/trunk/modules/events/language/en/events.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,50 @@
+<?php
+/**
+* @package Events
+* @version $Id: common.php,v x.xxx yyyy/mm/dd hh:mm:ss Username Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'PENDING' => 'Pending',
+
+ 'EVENT' => 'Event',
+ 'DATE_TIME' => 'Date/Time',
+ 'EVENT_ADD' => 'Add New Event',
+ 'EVENT_EDIT' => 'Edit Event',
+ 'NO_EVENTS' => 'No events have been posted',
+ 'TITLE' => 'Title',
+ 'DESCRIPTION' => 'Description',
+ 'BEGINS' => 'Begins',
+ 'ENDS' => 'Ends',
+ 'ADDRESS' => 'Address',
+ 'CONTACT' => 'Contact',
+ 'RSVP' => 'RSVP',
+ 'PERMISSION' => 'Permission',
+ 'POSTER' => 'Author',
+ 'STATUS' => 'Status',
+ 'OPTIONS' => 'Options',
+
+));
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/language/en/permissions_comments.php
===================================================================
--- mods/cms/trunk/modules/events/language/en/permissions_comments.php (rev 0)
+++ mods/cms/trunk/modules/events/language/en/permissions_comments.php 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,69 @@
+<?php
+/**
+* acp_permissions (phpBB Permission Set) [English]
+*
+* @package language
+* @version $Id: permissions_phpbb.php,v 1.24 2007/05/03 14:28:51 acydburn Exp $
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+/**
+* MODDERS PLEASE NOTE
+*
+* You are able to put your permission sets into a separate file too by
+* prefixing the new file with permissions_ and putting it into the acp
+* language folder.
+*
+* An example of how the file could look like:
+*
+* <code>
+*
+* if (empty($lang) || !is_array($lang))
+* {
+* $lang = array();
+* }
+*
+* // Adding new category
+* $lang['permission_cat']['bugs'] = 'Bugs';
+*
+* // Adding new permission set
+* $lang['permission_type']['bug_'] = 'Bug Permissions';
+*
+* // Adding the permissions
+* $lang = array_merge($lang, array(
+* 'acl_bug_view' => array('lang' => 'Can view bug reports', 'cat' => 'bugs'),
+* 'acl_bug_post' => array('lang' => 'Can post bugs', 'cat' => 'post'), // Using a phpBB category here
+* ));
+*
+* </code>
+*/
+
+// User Permissions
+$lang = array_merge($lang, array(
+ 'acl_u_comments_post' => array('lang' => 'Can post comments', 'cat' => 'misc'),
+ 'acl_m_comments_manage' => array('lang' => 'Can manage comments', 'cat' => 'misc'),
+ 'acl_a_comments_manage' => array('lang' => 'Can manage comments', 'cat' => 'misc'),
+));
+
+?>
\ No newline at end of file
Added: mods/cms/trunk/modules/events/template/acp_events.html
===================================================================
--- mods/cms/trunk/modules/events/template/acp_events.html (rev 0)
+++ mods/cms/trunk/modules/events/template/acp_events.html 2007-09-08 22:26:25 UTC (rev 57)
@@ -0,0 +1,82 @@
+<!-- IF S_EDIT -->
+ <form method="post" name="edit_event" action="{U_ACTION}">
+ <fieldset>
+ <legend>{L_EVENT_ADD}</legend>
+ <dl>
+ <dt><label for="title">{L_TITLE}:</label></dt>
+ <dd><input name="title" type="text" id="title" class="medium" maxlength="50" value="{EVENT_TITLE}" /></dd>
+ </dl>
+ <dl>
+ <dt><label for="desc">{L_DESCRIPTION}:</label></dt>
+ <dd><textarea name="desc" cols="15" rows="10">{EVENT_DESC}</textarea></dd>
+ </dl>
+ <dl>
+ <dt><label for="start_date">{L_BEGINS}:</label></dt>
+ <dd>
+ <input name="start_date" type="text" id="start_date" class="small" maxlength="10" value="{EVENT_STARTDATE}" /> @
+ <input name="start_time" type="text" id="start_time" class="small" maxlength="5" value="{EVENT_STARTTIME}" />
+ </dd>
+ </dl>
+ <dl>
+ <dt><label for="end_date">{L_ENDS}:</label></dt>
+ <dd>
+ <input name="end_date" type="text" id="end_date" class="small" maxlength="10" value="{EVENT_ENDDATE}" /> @
+ <input name="end_time" type="text" id="end_time" class="small" maxlength="5" value="{EVENT_ENDTIME}" />
+ </dd>
+ </dl>
+ <dl>
+ <dt><label for="address">{L_ADDRESS}:</label></dt>
+ <dd><input name="address" type="text" id="address" class="medium" maxlength="75" value="{EVENT_ADDRESS}" /></dd>
+ </...
[truncated message content] |
|
From: <dac...@us...> - 2007-09-05 05:46:10
|
Revision: 56
http://thevr.svn.sourceforge.net/thevr/?rev=56&view=rev
Author: dachebodt
Date: 2007-09-04 22:46:11 -0700 (Tue, 04 Sep 2007)
Log Message:
-----------
Some more bug fixes for block management and layout
Modified Paths:
--------------
mods/cms/trunk/modules/blocks/acp_blocks.php
mods/cms/trunk/modules/forums/cms_forums.php
mods/cms/trunk/styles/prosilver/template/layout.html
Modified: mods/cms/trunk/modules/blocks/acp_blocks.php
===================================================================
--- mods/cms/trunk/modules/blocks/acp_blocks.php 2007-09-04 17:58:18 UTC (rev 55)
+++ mods/cms/trunk/modules/blocks/acp_blocks.php 2007-09-05 05:46:11 UTC (rev 56)
@@ -90,21 +90,29 @@
$weight = ($max_weight) ? ($max_weight + 1) : 0;
if($bid)
{
- $sql = 'SELECT position, weight
+ $sql = 'SELECT style, position, weight
FROM ' . BLOCKS_TABLE . "
WHERE bid = $bid";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- if($row['position'] != $position)
+ $p = $row['position'];
+ $w = $row['weight'];
+ $s = $row['style'];
+
+ if($p != $position)
{
- $sql = 'UPDATE ' . BLOCKS_TABLE . ' SET weight = (weight - 1) WHERE weight > ' . $row['weight'];
+ $sql = 'UPDATE ' . BLOCKS_TABLE . "
+ SET weight = (weight - 1)
+ WHERE weight > $w
+ AND position = $p
+ AND style = $s";
$db->sql_query($sql);
}
else
{
- $weight = $row['weight'];
+ $weight = $w;
}
}
@@ -230,18 +238,23 @@
case 'up':
case 'down':
- $sql = 'SELECT module, weight, style
+ $sql = 'SELECT module, position, weight, style
FROM ' . BLOCKS_TABLE . "
WHERE bid = $bid";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
+ $style = $row['style'];
+ $position = $row['position'];
+ $weight = $row['weight'];
$nweight = ($action == 'up') ? ($row['weight'] - 1) : ($row['weight'] + 1);
+
$sql = 'UPDATE ' . BLOCKS_TABLE . "
- SET weight = '" . $row['weight'] . "'
+ SET weight = '$weight'
WHERE weight = $nweight
- AND style = " . $row['style'];
+ AND position = $position
+ AND style = $style";
$db->sql_query($sql);
$sql = 'UPDATE ' . BLOCKS_TABLE . "
Modified: mods/cms/trunk/modules/forums/cms_forums.php
===================================================================
--- mods/cms/trunk/modules/forums/cms_forums.php 2007-09-04 17:58:18 UTC (rev 55)
+++ mods/cms/trunk/modules/forums/cms_forums.php 2007-09-05 05:46:11 UTC (rev 56)
@@ -2,7 +2,7 @@
/**
*
* @package cms
-* @version $Id: gui_forums.php,v 1.41 2007/01/24 11:28:50 acydburn Exp $
+* @version $Id: cms_forums.php,v 1.41 2007/01/24 11:28:50 acydburn Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -83,8 +83,15 @@
break;
}
- $template->alter_block_array('navlinks', array('FORUM_NAME' => $user->lang['FORUMS']), array('FORUM_NAME' => strtoupper($mode)), 'change');
+ if($mode != 'forum')
+ {
+ $u_other = append_sid("{$phpbb_root_path}index.$phpEx", "i=$id&mode=$mode");
+ $u_forum = append_sid("{$phpbb_root_path}index.$phpEx", "i=$id&mode=forum");
+ $template->alter_block_array('navlinks', array('FORUM_NAME' => $user->lang['FORUMS']), array('FORUM_NAME' => strtoupper($mode)), 'change');
+ $template->alter_block_array('navlinks', array('U_VIEW_FORUM' => $u_forum), array('U_VIEW_FORUM' => $u_other), 'change');
+ }
+
$this->page_title = 'FORUMS';
$module_block['TITLE'] = '';
$module_block['CONTENT'] = $template->assign_display('body');
Modified: mods/cms/trunk/styles/prosilver/template/layout.html
===================================================================
--- mods/cms/trunk/styles/prosilver/template/layout.html 2007-09-04 17:58:18 UTC (rev 55)
+++ mods/cms/trunk/styles/prosilver/template/layout.html 2007-09-05 05:46:11 UTC (rev 56)
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<!-- IF .right -->
+<!-- IF .left -->
<div class="left-box" style="width:20%;margin-right:.5%">
@@ -34,7 +34,7 @@
</div>
<!-- ENDIF -->
-<div class="left-box" style="width:<!-- IF .right and .left -->59%<!-- ELSEIF .left || .right -->79.4%<!-- ELSE -->100%<!-- ENDIF -->">
+<div class="left-box" style="width:<!-- IF .right and .left -->59%<!-- ELSEIF .left or .right -->79.4%<!-- ELSE -->100%<!-- ENDIF -->">
<!-- BEGIN top -->
<div class="panel<!-- IF top.CLASS --> {top.CLASS}<!-- ENDIF -->">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dac...@us...> - 2007-09-04 17:58:18
|
Revision: 55
http://thevr.svn.sourceforge.net/thevr/?rev=55&view=rev
Author: dachebodt
Date: 2007-09-04 10:58:18 -0700 (Tue, 04 Sep 2007)
Log Message:
-----------
fixed a bug with the main menu. Also added functions to handle block admin that I forgot to commit earlier
Modified Paths:
--------------
mods/cms/trunk/modules/blocks/blocks/cms_main_menu.php
Added Paths:
-----------
mods/cms/trunk/modules/blocks/functions_blocks_admin.php
Modified: mods/cms/trunk/modules/blocks/blocks/cms_main_menu.php
===================================================================
--- mods/cms/trunk/modules/blocks/blocks/cms_main_menu.php 2007-09-03 11:34:57 UTC (rev 54)
+++ mods/cms/trunk/modules/blocks/blocks/cms_main_menu.php 2007-09-04 17:58:18 UTC (rev 55)
@@ -34,98 +34,98 @@
continue;
}
- // Skip branch
- if ($right_id !== false)
+ // Skip branch
+ if ($right_id !== false)
+ {
+ if ($item_ary['left'] < $right_id)
{
- if ($item_ary['left'] < $right_id)
- {
- continue;
- }
-
- $right_id = false;
+ continue;
}
- // Category with no members on their way down (we have to check every level)
- if (!$item_ary['name'])
+ $right_id = false;
+ }
+
+ // Category with no members on their way down (we have to check every level)
+ if (!$item_ary['name'])
+ {
+ $empty_category = true;
+
+ // We go through the branch and look for an activated module
+ foreach (array_slice($module->module_ary, $row_id + 1) as $temp_row)
{
- $empty_category = true;
-
- // We go through the branch and look for an activated module
- foreach (array_slice($module->module_ary, $row_id + 1) as $temp_row)
+ if ($temp_row['left'] > $item_ary['left'] && $temp_row['left'] < $item_ary['right'])
{
- if ($temp_row['left'] > $item_ary['left'] && $temp_row['left'] < $item_ary['right'])
+ // Module there and displayed?
+ if ($temp_row['name'] && $temp_row['display'])
{
- // Module there and displayed?
- if ($temp_row['name'] && $temp_row['display'])
- {
- $empty_category = false;
- break;
- }
- continue;
+ $empty_category = false;
+ break;
}
- break;
- }
-
- // Skip the branch
- if ($empty_category)
- {
- $right_id = $item_ary['right'];
continue;
}
+ break;
}
- // Select first id we can get
- if (!$current_id && (in_array($item_ary['id'], array_keys($module->module_cache['parents'])) || $item_ary['id'] == $module->p_id))
+ // Skip the branch
+ if ($empty_category)
{
- $current_id = $item_ary['id'];
+ $right_id = $item_ary['right'];
+ continue;
}
+ }
- $depth = $item_ary['depth'];
+ // Select first id we can get
+ if (!$current_id && (in_array($item_ary['id'], array_keys($module->module_cache['parents'])) || $item_ary['id'] == $module->p_id))
+ {
+ $current_id = $item_ary['id'];
+ }
- if ($depth > $current_depth)
+ $depth = $item_ary['depth'];
+
+ if ($depth > $current_depth)
+ {
+ $linear_offset = $linear_offset . '.l_block' . ($depth + 1);
+ $tabular_offset = ($depth + 1 > 2) ? $tabular_offset . '.t_block' . ($depth + 1) : $tabular_offset;
+ }
+ else if ($depth < $current_depth)
+ {
+ for ($i = $current_depth - $depth; $i > 0; $i--)
{
- $linear_offset = $linear_offset . '.l_block' . ($depth + 1);
- $tabular_offset = ($depth + 1 > 2) ? $tabular_offset . '.t_block' . ($depth + 1) : $tabular_offset;
+ $linear_offset = substr($linear_offset, 0, strrpos($linear_offset, '.'));
+ $tabular_offset = ($i + $depth > 1) ? substr($tabular_offset, 0, strrpos($tabular_offset, '.')) : $tabular_offset;
}
- else if ($depth < $current_depth)
- {
- for ($i = $current_depth - $depth; $i > 0; $i--)
- {
- $linear_offset = substr($linear_offset, 0, strrpos($linear_offset, '.'));
- $tabular_offset = ($i + $depth > 1) ? substr($tabular_offset, 0, strrpos($tabular_offset, '.')) : $tabular_offset;
- }
- }
+ }
- $u_title = $module_url . $delim . 'i=' . (($item_ary['cat']) ? $item_ary['id'] : $item_ary['name'] . (($item_ary['is_duplicate']) ? '&icat=' . $current_id : '') . '&mode=' . $item_ary['mode']);
+ $u_title = $module_url . $delim . 'i=' . (($item_ary['cat']) ? $item_ary['id'] : $item_ary['name'] . (($item_ary['is_duplicate']) ? '&icat=' . $current_id : '') . '&mode=' . $item_ary['mode']);
- // Was not allowed in categories before - /*!$item_ary['cat'] && */
- $u_title .= (isset($item_ary['url_extra'])) ? $item_ary['url_extra'] : '';
+ // Was not allowed in categories before - /*!$item_ary['cat'] && */
+ $u_title .= (isset($item_ary['url_extra'])) ? $item_ary['url_extra'] : '';
- // Only output a categories items if it's currently selected
- if (!$depth || ($depth && (in_array($item_ary['parent'], array_values($module->module_cache['parents'])) || $item_ary['parent'] == $module->p_parent)))
- {
- $use_tabular_offset = (!$depth) ? 't_block1' : $tabular_offset;
+ // Only output a categories items if it's currently selected
+ if (!$depth || ($depth && (in_array($item_ary['parent'], array_values($module->module_cache['parents'])) || $item_ary['parent'] == $module->p_parent)))
+ {
+ $use_tabular_offset = (!$depth) ? 't_block1' : $tabular_offset;
- $tpl_ary = array(
- 'L_TITLE' => $item_ary['lang'],
- 'S_SELECTED' => (in_array($item_ary['id'], array_keys($module->module_cache['parents'])) || $item_ary['id'] == $module->p_id) ? true : false,
- 'U_TITLE' => $u_title
- );
-
- $mtemplate->assign_block_vars($use_tabular_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER)));
- }
-
$tpl_ary = array(
'L_TITLE' => $item_ary['lang'],
'S_SELECTED' => (in_array($item_ary['id'], array_keys($module->module_cache['parents'])) || $item_ary['id'] == $module->p_id) ? true : false,
'U_TITLE' => $u_title
);
- $mtemplate->assign_block_vars($linear_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER)));
-
- $current_depth = $depth;
+ $mtemplate->assign_block_vars($use_tabular_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER)));
}
+ $tpl_ary = array(
+ 'L_TITLE' => $item_ary['lang'],
+ 'S_SELECTED' => (in_array($item_ary['id'], array_keys($module->module_cache['parents'])) || $item_ary['id'] == $module->p_id) ? true : false,
+ 'U_TITLE' => $u_title
+ );
+
+ $mtemplate->assign_block_vars($linear_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER)));
+
+ $current_depth = $depth;
+ }
+
$mtemplate->set_filenames(array(
'content' => 'block_main_menu.html')
);
@@ -136,7 +136,7 @@
return $block;
}
-function calendar_block_config()
+function main_menu_block_config()
{
$block_config = array();
Added: mods/cms/trunk/modules/blocks/functions_blocks_admin.php
===================================================================
--- mods/cms/trunk/modules/blocks/functions_blocks_admin.php (rev 0)
+++ mods/cms/trunk/modules/blocks/functions_blocks_admin.php 2007-09-04 17:58:18 UTC (rev 55)
@@ -0,0 +1,87 @@
+<?
+
+function delete_blocks($module, $block = false, $style = false)
+{
+ global $db;
+
+ $where = "module = '" . $db->sql_escape($module) . "'";
+ $where .= ($block) ? ((is_numeric($block)) ? " AND bid=$block" : " AND name='" . $db->sql_escape($block) . "'") : '';
+ $where .= ($style) ? " AND style=$style" : '';
+
+ $sql = 'SELECT bid, name, module, position, weight, style
+ FROM ' . BLOCKS_TABLE . '
+ WHERE ' . $where;
+ $result = $db->sql_query($sql);
+
+ $block_ids = array();
+ while($row = $db->sql_fetchrow($result))
+ {
+ $style_id = $row['style'];
+ $weight = $row['weight'];
+ $position = $row['position'];
+
+ $sql = 'UPDATE ' . BLOCKS_TABLE . "
+ SET weight = weight - 1
+ WHERE weight > $weight
+ AND position = $position";
+ $sql .= ($style) ? ' AND style = ' . $style_id : '';
+
+ $db->sql_query($sql);
+ $block_ids[] = $row['bid'];
+ }
+ $db->sql_freeresult($result);
+
+ $sql = 'DELETE
+ FROM ' . BLOCKS_TABLE . '
+ WHERE ' . $where;
+ $db->sql_query($sql);
+
+ // get module modes since blocks are cached separately for each module mode
+ $sql = 'SELECT DISTINCT module_id, module_mode
+ FROM ' . MODULES_TABLE . "
+ WHERE module_dir = '" . $db->sql_escape($module) . "'
+ AND module_class = 'cms'";
+ $result = $db->sql_query($sql);
+
+ $mode_list = array();
+ while($row = $db->sql_fetchrow($result))
+ {
+ $mode_list[$row['module_id']]['mode'] = $row['module_mode'];
+ }
+ $db->sql_freeresult($result);
+
+ remove_cache_file($mode_list);
+ delete_block_config($block_ids);
+}
+
+/*
+params: mod_list
+*/
+function remove_cache_file($mod_list)
+{
+ global $cache;
+
+ if(!sizeof($mod_list))
+ {
+ return;
+ }
+
+ foreach($mod_list as $i => $module)
+ {
+ $cache->destroy('_block_' . $module['mode']);
+ }
+}
+
+function delete_block_config($bid)
+{
+ global $db, $cache;
+
+ if(!empty($bid))
+ {
+ $sql = 'DELETE FROM ' . BLOCKS_CONFIG_TABLE . ' WHERE ' . ((is_array($bid)) ? $db->sql_in_set('bid', $bid) : 'bid = ' . $bid);
+ $db->sql_query($sql);
+ $cache->destroy('_block_config');
+ }
+}
+
+?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dac...@us...> - 2007-09-03 12:36:41
|
Revision: 54
http://thevr.svn.sourceforge.net/thevr/?rev=54&view=rev
Author: dachebodt
Date: 2007-09-03 04:34:57 -0700 (Mon, 03 Sep 2007)
Log Message:
-----------
Fixed a few bugs and completed code to allow setting permissions for different content types
Modified Paths:
--------------
mods/cms/trunk/modules/content/acp_content.php
mods/cms/trunk/modules/content/cms_content.php
mods/cms/trunk/modules/content/functions_properties.php
mods/cms/trunk/modules/content/info/acp_content.php
mods/cms/trunk/modules/content/language/en/content.php
mods/cms/trunk/modules/content/template/acp_content.html
Modified: mods/cms/trunk/modules/content/acp_content.php
===================================================================
--- mods/cms/trunk/modules/content/acp_content.php 2007-09-03 06:28:24 UTC (rev 53)
+++ mods/cms/trunk/modules/content/acp_content.php 2007-09-03 11:34:57 UTC (rev 54)
@@ -19,7 +19,7 @@
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $mtemplate, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $db, $user, $cache, $auth, $template, $mtemplate, $phpbb_root_path, $phpbb_admin_path, $phpEx;
include($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx);
include($phpbb_root_path . "modules/content/constants.$phpEx");
@@ -45,44 +45,95 @@
case 'edit_type':
$action = '';
+ $posted_permission = request_var('permission', '');
+ $content_name = utf8_normalize_nfc(request_var('content_name', '', true));
- $sql = 'SELECT module_id
- FROM ' . MODULES_TABLE . "
- WHERE module_langname = 'CMS_CONTENT'
- AND module_class = 'cms'
- AND parent_id = 0";
- $result = $db->sql_query($sql);
- $parent_id = $db->sql_fetchfield('module_id');
- $db->sql_freeresult($result);
-
- $module_data['module_class'] = 'cms';
- $module_data['module_basename'] = 'content';
- $module_data['module_dir'] = 'content';
- $module_data['parent_id'] = $parent_id;
$module_data['module_enabled'] = request_var('active', '0');
$module_data['module_display'] = request_var('display', '1');
$module_data['module_langname'] = utf8_normalize_nfc(request_var('content_langname', '', true));
- $module_data['module_mode'] = request_var('content_name', '');
- $module_data['module_auth'] = request_var('permission', '');
+ $module_data['module_mode'] = strtolower($content_name);
+ $module_data['module_auth'] = ($posted_permission) ? 'acl_' . $posted_permission : '';
if(!$module_data['module_langname'])
{
- trigger_error();
+ trigger_error('MISSING_CONTENT_LANGNAME');
}
if(!$module_data['module_mode'])
{
- trigger_error();
+ trigger_error('MISSING_CONTENT_NAME');
}
+ $permission = '';
if($content_id)
{
$module_data['module_id'] = $content_id;
+
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_id = $content_id";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $permission = $row['module_auth'];
+ $module_data['parent_id'] = $row['parent_id'];
+
+ $update = ($module_data['module_enabled'] != $row['module_enabled'] || $module_data['module_display'] != $row['module_display'] || $module_data['module_langname'] != $row['module_langname'] || $module_data['module_mode'] != $row['module_mode'] || $module_data['module_auth'] != $permission) ? true : false;
}
+ else
+ {
+ $sql = 'SELECT module_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_langname = 'CMS_CONTENT'
+ AND module_class = 'cms'";
+ $result = $db->sql_query($sql);
+ $parent_id = $db->sql_fetchfield('module_id');
+ $db->sql_freeresult($result);
- $errors = $_module->update_module_data($module_data, true);
- $_module->remove_cache_file();
+ $module_data['parent_id'] = $parent_id;
+ $update = true;
+ }
+ // handle content permission
+ if($module_data['module_auth'] != $permission)
+ {
+ include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+
+ $auth_admin = new auth_admin();
+
+ // if we already have permissions, remove it from acl
+ if($permission)
+ {
+ $sql = 'DELETE FROM ' . ACL_OPTIONS_TABLE . " WHERE auth_option = '$permission'";
+ $db->sql_query($sql);
+ }
+
+ if($posted_permission)
+ {
+ $permissions = array(
+ 'local' => array(),
+ 'global' => array($posted_permission),
+ );
+
+ $auth_admin->acl_add_option($permissions);
+ }
+
+ $cache->destroy('_acl_options');
+ $auth_admin->acl_clear_prefetch();
+ }
+
+ $errors = array();
+ if($update)
+ {
+ $module_data['module_class'] = 'cms';
+ $module_data['module_basename'] = 'content';
+ $module_data['module_dir'] = 'content';
+
+ $errors = $_module->update_module_data($module_data, true);
+ $_module->remove_cache_file();
+ }
+
if(empty($errors))
{
$data = array();
@@ -124,9 +175,7 @@
$db->sql_query($sql);
meta_refresh(3, $this->u_action);
-
- $message = $user->lang['TYPE_ADDED'];
- trigger_error($message);
+ trigger_error('CONTENT_TYPE_UPDATED');
}
else
{
@@ -209,10 +258,31 @@
$sql = 'DELETE FROM ' . CONTENT_TYPES_TABLE . ' WHERE content_id = ' . (int) $content_id;
$db->sql_query($sql);
+ // delete any permissions added by this content type
+ $sql = 'SELECT module_auth
+ FROM ' . MODULES_TABLE . "
+ WHERE module_langname = 'CMS_CONTENT'
+ AND module_class = 'cms'";
+ $result = $db->sql_query($sql);
+ $module_auth = $db->sql_fetchfield('module_auth');
+ $db->sql_freeresult($result);
+
+ if($module_auth)
+ {
+ include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+
+ $auth_admin = new auth_admin();
+ $permission = str_replace('acl_', '', $module_auth);
+
+ $sql = 'DELETE FROM ' . ACL_OPTIONS_TABLE . " WHERE auth_option = '$permission'";
+ $db->sql_query($sql);
+
+ $cache->destroy('_acl_options');
+ $auth_admin->acl_clear_prefetch();
+ }
+
meta_refresh(5, $this->u_action);
-
- $message = $user->lang['TYPE_DELETED'];
- trigger_error($message);
+ trigger_error('CONTENT_TYPE_DELETED');
}
break;
@@ -322,7 +392,7 @@
$mtemplate->assign_vars(array(
'CONTENT_NAME' => $row['module_mode'],
'LANGNAME' => $row['module_langname'],
- 'PERMISSION' => $row['module_auth'],
+ 'PERMISSION' => str_replace('acl_', '', $row['module_auth']),
'S_ACTIVE' => $row['module_enabled'],
'S_APPROVAL' => $row['req_approval'],
Modified: mods/cms/trunk/modules/content/cms_content.php
===================================================================
--- mods/cms/trunk/modules/content/cms_content.php 2007-09-03 06:28:24 UTC (rev 53)
+++ mods/cms/trunk/modules/content/cms_content.php 2007-09-03 11:34:57 UTC (rev 54)
@@ -335,6 +335,14 @@
'CONTENT' => $mtemplate->assign_display('content')
));
}
+
+ if(!sizeof($tpl_ary))
+ {
+ $template->assign_block_vars('module', array(
+ 'TITLE' => $content_name,
+ 'CONTENT' => sprintf($user->lang['NO_CMS_CONTENT'], $content_name)
+ ));
+ }
}
if(isset($store_mtemplate))
Modified: mods/cms/trunk/modules/content/functions_properties.php
===================================================================
--- mods/cms/trunk/modules/content/functions_properties.php 2007-09-03 06:28:24 UTC (rev 53)
+++ mods/cms/trunk/modules/content/functions_properties.php 2007-09-03 11:34:57 UTC (rev 54)
@@ -19,7 +19,7 @@
foreach($properties as $i => $props)
{
$selected = ($i == $type) ? ' selected="selected"' : '';
- $options .= '<option value="' . $i . '"' . $selected . '>' . $props['label'] . "</option>\n";
+ $options .= '<option value="' . $i . '"' . $selected . '>' . $user->lang[$props['label']] . "</option>\n";
}
return $options;
Modified: mods/cms/trunk/modules/content/info/acp_content.php
===================================================================
--- mods/cms/trunk/modules/content/info/acp_content.php 2007-09-03 06:28:24 UTC (rev 53)
+++ mods/cms/trunk/modules/content/info/acp_content.php 2007-09-03 11:34:57 UTC (rev 54)
@@ -57,7 +57,6 @@
`content_id` int(3) NOT NULL auto_increment,
`content_name` varchar(125) collate utf8_bin NOT NULL,
`content_langname` varchar(255) collate utf8_bin NOT NULL,
- `permission` mediumtext collate utf8_bin NOT NULL,
`content_fields` text collate utf8_bin,
`req_approval` tinyint(1) NOT NULL default '1',
`allow_comments` tinyint(1) NOT NULL default '1',
Modified: mods/cms/trunk/modules/content/language/en/content.php
===================================================================
--- mods/cms/trunk/modules/content/language/en/content.php 2007-09-03 06:28:24 UTC (rev 53)
+++ mods/cms/trunk/modules/content/language/en/content.php 2007-09-03 11:34:57 UTC (rev 54)
@@ -44,10 +44,14 @@
'SEARCH_USER_POSTS' => 'Search all posts by this user',
'VIEW_AUTHOR_CONTENTS' => 'View all %s by this author',
+ 'VIEW_TYPE' => 'View content type',
+ 'EDIT_TYPE' => 'Edit content type',
+ 'EDIT_ITEM' => 'Edit Item',
'NAME' => 'Content type name',
'LANGNAME' => 'Content type language name',
'PERMISSION' => 'Content type permission',
+ 'PERMISSION_AFTER' => 'Ex: u_view_news',
'LABEL' => 'Label',
'TYPE' => 'Type',
'TEASER_DISP' => 'Display Teaser?',
@@ -73,6 +77,23 @@
'CONTENT_TYPE' => 'Content Type',
'EDIT' => 'Edit',
'EDIT_TYPE' => 'Edit Content Type',
+ 'ADD_TYPE' => 'Add New Content Type',
+ 'ADD_ITEM' => 'Add New Item',
+
+ 'NO_ITEMS' => 'There are no existing items for this content type.',
+ 'NO_CONTENT_TYPE' => 'There are no existing content types',
+ 'NO_CMS_CONTENT' => 'No %s(s) have been posted yet.',
+ 'TEXT' => 'Text',
+ 'SMALL_TEXTAREA' => 'Small Textarea',
+ 'LARGE_TEXTAREA' => 'Large Textarea',
+
+ 'CONTENT_FIELDS' => 'Content Fields',
+ 'CONTENT_SETTINGS' => 'Content Settings',
+ 'CONTENT_TYPE_UPDATED' => 'Content type updated successfully',
+ 'CONTENT_TYPE_DELETED' => 'Content type deleted successfully',
+
+ 'MISSING_CONTENT_LANGNAME' => 'Missing content language name',
+ 'MISSING_CONTENT_NAME' => 'Missing content name',
));
?>
\ No newline at end of file
Modified: mods/cms/trunk/modules/content/template/acp_content.html
===================================================================
--- mods/cms/trunk/modules/content/template/acp_content.html 2007-09-03 06:28:24 UTC (rev 53)
+++ mods/cms/trunk/modules/content/template/acp_content.html 2007-09-03 11:34:57 UTC (rev 54)
@@ -52,15 +52,19 @@
<!-- ELSEIF S_VIEW_TYPE -->
- <p align="right"><a href="{U_ADD_ITEM}">{L_ADD}</a></p>
+ <p align="right"><a href="{U_ADD_ITEM}">{L_ADD_ITEM}</a></p>
<table cellspacing="1" width="90%">
<tbody>
+
+ <!-- IF .item -->
<tr>
<th style="text-align:center">{L_TITLE}</th>
<th style="text-align:center">{L_STATUS}</th>
<th style="text-align:center">{L_APPROVER}</th>
<th style="text-align:center">{L_ACTION}</th>
</tr>
+ <!-- ENDIF -->
+
<!-- BEGIN item -->
<tr>
<td><a href="{item.U_VIEW}">{item.TITLE}</a><br>{item.POSTED} <a href="{item.U_AUTHOR}">{item.AUTHOR}</a></td>
@@ -73,8 +77,11 @@
</tr>
<!-- BEGINELSE -->
<tr>
- <td>No content</td>
+ <th>{L_INFORMATION}</th>
</tr>
+ <tr>
+ <td>{L_NO_ITEMS}</td>
+ </tr>
<!-- END item -->
</tbody>
</table>
@@ -83,6 +90,7 @@
<form id="edit_type" method="post" action="{U_ACTION}">
<fieldset>
+ <legend>{L_CONTENT_TYPE}</legend>
<dl>
<dt><label for="content_name">{L_NAME}:</label></dt>
<dd><input name="content_name" type="text" id="content_name" class="medium" maxlength="50" value="{CONTENT_NAME}" /></dd>
@@ -93,7 +101,7 @@
</dl>
<dl>
<dt><label for="permission">{L_PERMISSION}:</label></dt>
- <dd><input name="permission" type="text" id="permission" class="medium" maxlength="75" value="{PERMISSION}" /></dd>
+ <dd><input name="permission" type="text" id="permission" class="medium" maxlength="75" value="{PERMISSION}" /> {L_PERMISSION_AFTER}</dd>
</dl>
<dl>
<dt><label for="active">{L_ACTIVE}:</label></dt>
@@ -102,6 +110,7 @@
</fieldset>
<fieldset>
+ <legend>{L_CONTENT_FIELDS}</legend>
<table cellspacing="1" width="90%">
<tbody>
<tr>
@@ -129,6 +138,7 @@
</fieldset>
<fieldset>
+ <legend>{L_CONTENT_SETTINGS}</legend>
<dl>
<dt><label for="req_approval">{L_REQ_APPROVAL}:</label></dt>
<dd><input type="radio" class="radio" id="req_approval" name="req_approval" value="1"<!-- IF S_APPROVAL --> checked="checked"<!-- ENDIF --> /> {L_YES} <input type="radio" class="radio" name="req_approval" value="0"<!-- IF not S_APPROVAL --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
@@ -174,8 +184,12 @@
<!-- ELSE -->
- <p align="right"><a href="{U_ADD_TYPE}">{L_ADD}</a></p>
+ <p align="right"><a href="{U_ADD_TYPE}">{L_ADD_TYPE}</a></p>
<table cellspacing="1" width="90%">
+ <thead>
+ <th>{L_CONTENT_TYPE}</th>
+ <th>{L_ACTION}</th>
+ </thead>
<tbody>
<!-- BEGIN types -->
<tr <!-- IF types.S_ROW_COUNT is even -->class="row1"<!-- ELSE -->class="row2"<!-- ENDIF -->>
@@ -200,7 +214,7 @@
</tr>
<!-- BEGINELSE -->
<tr>
- <td>No types</td>
+ <td>{L_NO_CONTENT_TYPES}</td>
</tr>
<!-- END types -->
</tbody>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dac...@us...> - 2007-09-03 08:15:42
|
Revision: 53
http://thevr.svn.sourceforge.net/thevr/?rev=53&view=rev
Author: dachebodt
Date: 2007-09-02 23:28:24 -0700 (Sun, 02 Sep 2007)
Log Message:
-----------
mod version is now installed in config and compared against mod files in directory, allowing for posibility to update modules.
Made other fixes to allow complete disabling of left and right columns
Modified Paths:
--------------
mods/cms/trunk/modules/blocks/acp_blocks.php
mods/cms/trunk/modules/blocks/functions_blocks.php
mods/cms/trunk/modules/mods/acp_mods.php
mods/cms/trunk/modules/mods/info/mods_info.php
mods/cms/trunk/modules/mods/language/en/mods.php
mods/cms/trunk/modules/mods/template/acp_mods.html
mods/cms/trunk/styles/prosilver/template/layout.html
Modified: mods/cms/trunk/modules/blocks/acp_blocks.php
===================================================================
--- mods/cms/trunk/modules/blocks/acp_blocks.php 2007-09-02 14:07:06 UTC (rev 52)
+++ mods/cms/trunk/modules/blocks/acp_blocks.php 2007-09-03 06:28:24 UTC (rev 53)
@@ -25,6 +25,7 @@
global $config, $cache, $db, $user, $auth, $template, $mtemplate, $phpbb_root_path, $phpbb_admin_path, $phpEx;
include($phpbb_root_path . "modules/blocks/constants.$phpEx");
+ include($phpbb_root_path . "modules/blocks/functions_blocks_admin.$phpEx");
$action = request_var('action', '');
$style_id = request_var('style', $config['default_style']);
@@ -126,7 +127,7 @@
if($sql_ary['name'] && $sql_ary['module'])
{
$db->sql_query($sql);
- $this->remove_cache_file();
+ remove_cache_file($this->cms_mod_list);
$bid = ($bid) ? $bid : $db->sql_nextid();
$this->save_block_config($bid, $sql_ary['name'], $sql_ary['module']);
@@ -163,7 +164,7 @@
if($pid)
{
$sql = 'UPDATE ' . BLOCK_POSITIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE pid = $pid";
- $this->remove_cache_file();
+ remove_cache_file($this->cms_mod_list);
}
else
{
@@ -202,7 +203,7 @@
{
case 'delete':
- $sql = 'SELECT name, module, weight, style
+ $sql = 'SELECT name, module, position, weight, style
FROM ' . BLOCKS_TABLE . "
WHERE bid = $bid";
$result = $db->sql_query($sql);
@@ -217,11 +218,12 @@
$sql = 'UPDATE ' . BLOCKS_TABLE . '
SET weight = weight - 1
- WHERE weight > ' . $row['weight'] . "
- AND style = $style_id";
+ WHERE weight > ' . $row['weight'] . '
+ AND position = ' . $row['position'] . '
+ AND style = ' . $row['style'];
$db->sql_query($sql);
- $this->remove_cache_file();
- $this->delete_block_config($bid);
+ remove_cache_file($this->cms_mod_list);
+ delete_block_config($bid);
break;
@@ -246,7 +248,7 @@
SET weight = $nweight
WHERE bid = $bid";
$db->sql_query($sql);
- $this->remove_cache_file();
+ remove_cache_file($this->cms_mod_list);
break;
@@ -257,7 +259,7 @@
$sql = 'UPDATE ' . BLOCKS_TABLE . " SET status = '$status' WHERE bid = $bid";
$db->sql_query($sql);
- $this->remove_cache_file();
+ remove_cache_file($this->cms_mod_list);
break;
@@ -445,7 +447,7 @@
$sql = 'DELETE FROM ' . BLOCK_POSITIONS_TABLE . " WHERE pid = $pid";
$db->sql_query($sql);
- $this->remove_cache_file();
+ remove_cache_file($this->cms_mod_list);
}
redirect($this->u_action);
}
@@ -460,7 +462,7 @@
$sql = 'UPDATE ' . BLOCK_POSITIONS_TABLE . " SET status = '$status' WHERE pid = $pid";
$db->sql_query($sql);
- $this->remove_cache_file();
+ remove_cache_file($this->cms_mod_list);
break;
@@ -620,16 +622,6 @@
return $options;
}
- function remove_cache_file()
- {
- global $cache;
-
- foreach($this->cms_mod_list as $i => $module)
- {
- $cache->destroy('_block_' . $module['mode']);
- }
- }
-
function generate_xmods($xmods_ary)
{
global $mtemplate;
@@ -747,22 +739,10 @@
);
}
// just remove old values and replace
- $this->delete_block_config($bid);
+ delete_block_config($bid);
$db->sql_multi_insert(BLOCKS_CONFIG_TABLE, $sql_ary);
$cache->destroy('_block_config');
}
-
- function delete_block_config($bid)
- {
- global $db, $cache;
-
- if($bid)
- {
- $sql = 'DELETE FROM ' . BLOCKS_CONFIG_TABLE . " WHERE bid = $bid";
- $db->sql_query($sql);
- $cache->destroy('_block_config');
- }
- }
}
?>
\ No newline at end of file
Modified: mods/cms/trunk/modules/blocks/functions_blocks.php
===================================================================
--- mods/cms/trunk/modules/blocks/functions_blocks.php 2007-09-02 14:07:06 UTC (rev 52)
+++ mods/cms/trunk/modules/blocks/functions_blocks.php 2007-09-03 06:28:24 UTC (rev 53)
@@ -96,7 +96,7 @@
$style = isset($this->block_cache[$user->data['user_style']]) ? $user->data['user_style'] : $config['default_style'];
$positions_ary = $this->block_cache[$style];
- if(!$is_front)
+ if(!$is_front && sizeof($positions_ary))
{
$active_pos = array();
foreach($positions_ary as $i => $position)
@@ -121,9 +121,20 @@
}
$db->sql_freeresult($result);
+ if(!sizeof($positions_ary))
+ {
+ return;
+ }
+
foreach($positions_ary as $i => $position)
{
$blocks = $position['blocks'];
+
+ if(!sizeof($blocks))
+ {
+ continue;
+ }
+
if($is_front || $position['props']['type'])
{
foreach($blocks as $i => $row)
Modified: mods/cms/trunk/modules/mods/acp_mods.php
===================================================================
--- mods/cms/trunk/modules/mods/acp_mods.php 2007-09-02 14:07:06 UTC (rev 52)
+++ mods/cms/trunk/modules/mods/acp_mods.php 2007-09-03 06:28:24 UTC (rev 53)
@@ -197,7 +197,9 @@
closedir($dh);
$db_mods[] = $mod;
- $message = 'module installed successfully in ' . implode(', ', $affected_classes);
+
+ $message = sprintf($user->lang['MOD_INSTALLED'], $mod, implode(', ', array_unique($affected_classes)));
+ set_config($mod . '_version', $dir_mods[$mod]['mod_vers']);
}
$template->assign_vars(array(
@@ -207,8 +209,53 @@
break;
+ case 'update':
+
+ if(in_array($mod, $db_mods) && $dir_mods[$mod]['mod_vers'] != $config[$mod . '_version'])
+ {
+ $update = false;
+ $dh = opendir($directory . "$mod/info/");
+
+ while (($file = readdir($dh)) !== false)
+ {
+ $file_ary = explode('_', $file);
+ $module_class = $file_ary[0];
+
+ if(in_array($module_class, $this->classrow))
+ {
+ include($directory . "$mod/info/$file");
+
+ $file = str_replace(".$phpEx", '', $file);
+ $basename = str_replace($module_class . '_', '', $file);
+
+ $c_class = $module_class . '_' . $basename . '_info';
+ $instance = new $c_class();
+
+ if(method_exists($instance, 'update'))
+ {
+ $instance->update();
+ $update = true;
+ }
+ }
+ }
+
+ $message = ($update) ? 'MOD_UPDATED_DB' : 'MOD_UPDATED_NO_DB';
+ $message = sprintf($user->lang[$message], $mod);
+ set_config($mod . '_version', $dir_mods[$mod]['mod_vers']);
+ }
+
+ $template->assign_vars(array(
+ 'S_WARNING' => true,
+ 'WARNING_MSG' => $message
+ ));
+
+ break;
+
case 'uninstall':
+ include($phpbb_root_path . "modules/blocks/constants.$phpEx");
+ include($phpbb_root_path . "modules/blocks/functions_blocks_admin.$phpEx");
+
$message = $user->lang['MOD_REQUIRED'];
if($dir_mods[$mod]['mod_type'] != 'core' && !in_array($mod, $required))
{
@@ -243,7 +290,7 @@
// which of these parents is being used by another module?
$sql = 'SELECT DISTINCT parent_id
FROM ' . MODULES_TABLE . "
- WHERE module_dir <> ''";
+ WHERE module_dir = '" . $db->sql_escape($mod) . "'";
$result = $db->sql_query($sql);
$active_parents = array();
@@ -253,6 +300,9 @@
}
$db->sql_freeresult($result);
+ $parent_ids = array_unique($parent_ids);
+ $active_parents = array_unique($active_parents);
+
$parent_ary = array_diff($parent_ids, $active_parents);
// remove parents
@@ -269,12 +319,18 @@
$_module->remove_cache_file();
}
+ $ver = $mod . '_version';
+ $sql = 'DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = '$ver'";
+ $db->sql_query($sql);
+ $cache->destroy('config');
+ delete_blocks($mod);
+
unset($db_mods[array_search($mod, $db_mods)]);
- $message = (sizeof($errors) > 0) ? $error : 'module successfully uninstalled from ' . implode(',', $affected_classes);
+ $message = (sizeof($errors) > 0) ? $error : sprintf($user->lang['MOD_UNINSTALLED'], $mod, implode(', ', $affected_classes));
}
else
{
- confirm_box(false, 'DELETE_MODULE', build_hidden_fields(array(
+ confirm_box(false, $user->lang['DELETE_MODULE'], build_hidden_fields(array(
'i' => $id,
'mode' => $mode,
'm' => $mod,
@@ -282,6 +338,10 @@
)));
}
}
+ else
+ {
+ trigger_error('MOD_REQUIRED');
+ }
$this->get_modules_list();
$template->assign_vars(array(
@@ -307,7 +367,7 @@
'MOD_AUTHOR' => $dir_mods[$mod]['mod_author'],
'MOD_CONTACT' => $dir_mods[$mod]['mod_contact'],
'MOD_DISP_NAME' => $dir_mods[$mod]['mod_disp_name'],
- 'MOD_DEPENDENTS' => $dir_mods[$mod]['mod_dependents'],
+ 'MOD_DEPENDENTS' => ($dir_mods[$mod]['mod_dependents']) ? $dir_mods[$mod]['mod_dependents'] : $user->lang['NONE'],
'MOD_COMPAT' => $dir_mods[$mod]['mod_compat'],
'MOD_ACTION' => $m_action,
@@ -324,9 +384,18 @@
ksort($dir_mods);
foreach($dir_mods as $mod => $data)
{
+ $vers = $mod . '_version';
$url = $this->u_action . '&m=' . $mod;
- $m_action = (!in_array($mod, $db_mods)) ? '<a href="' . $url . '&action=install">' . $user->lang['ENABLE'] . '</a>' : ((in_array($mod, $required) || $data['mod_type'] == 'core') ? $user->lang['MOD_REQUIRED'] : '<a href="' . $url . '&action=uninstall">' . $user->lang['DISABLE'] . '</a>');
+ if(in_array($mod, $db_mods))
+ {
+ $m_action = ($config[$vers] == $data['mod_vers']) ? ((in_array($mod, $required) || $data['mod_type'] == 'core') ? $user->lang['MOD_REQUIRED'] : '<a href="' . $url . '&action=uninstall">' . $user->lang['DISABLE'] . '</a>') : '<a href="' . $url . '&action=update">' . $user->lang['UPDATE'] . '</a>';
+ }
+ else
+ {
+ $m_action = '<a href="' . $url . '&action=install">' . $user->lang['ENABLE'] . '</a>';
+ }
+
$mtemplate->assign_block_vars('modules', array(
'MOD_NAME' => $data['mod_disp_name'],
'MOD_VERSION' => $data['mod_vers'],
Modified: mods/cms/trunk/modules/mods/info/mods_info.php
===================================================================
--- mods/cms/trunk/modules/mods/info/mods_info.php 2007-09-02 14:07:06 UTC (rev 52)
+++ mods/cms/trunk/modules/mods/info/mods_info.php 2007-09-03 06:28:24 UTC (rev 53)
@@ -21,7 +21,7 @@
'mod_contact' => '',
'mod_url' => '',
'mod_vers' => '1.00',
- 'mod_compat' => 'RC1',
+ 'mod_compat' => 'RC5',
'mod_type' => 'core',
'mod_scope' => 'acp',
'mod_demo_url' => '',
Modified: mods/cms/trunk/modules/mods/language/en/mods.php
===================================================================
--- mods/cms/trunk/modules/mods/language/en/mods.php 2007-09-02 14:07:06 UTC (rev 52)
+++ mods/cms/trunk/modules/mods/language/en/mods.php 2007-09-03 06:28:24 UTC (rev 53)
@@ -50,6 +50,14 @@
'MOD_DEPENDENTS' => 'Dependents',
'MOD_COMPAT' => 'Compatibility',
'MOD_CONFIG' => 'Config',
+ 'MOD_INFO' => 'Mod Info',
+ 'NONE' => 'None',
+
+ 'DELETE_MODULE' => 'Are you sure you want to remove this module?',
+ 'MOD_INSTALLED' => 'Module [%1$s] installed successfully in %2$s',
+ 'MOD_UNINSTALLED' => 'Module [%1$s] removed successfully from %2$s but you may have to remove the database manually.',
+ 'MOD_UPDATED_DB' => 'Module [%s] successfully updated',
+ 'MOD_UPDATED_NO_DB' => 'Module [%s] successfully updated but there were no update instructions. Please check the module package for any do-it-yourself instructions.',
));
?>
\ No newline at end of file
Modified: mods/cms/trunk/modules/mods/template/acp_mods.html
===================================================================
--- mods/cms/trunk/modules/mods/template/acp_mods.html 2007-09-02 14:07:06 UTC (rev 52)
+++ mods/cms/trunk/modules/mods/template/acp_mods.html 2007-09-03 06:28:24 UTC (rev 53)
@@ -3,9 +3,11 @@
<tr>
<th colspan="2">{L_MOD_INFO}</th>
</tr>
+ <!-- IF MOD_IMAGE -->
<tr class="row2">
<td><div style="float:right"><img src="{MOD_IMAGE}" alt="" height="35" width="35"></div></td>
</tr>
+ <!-- ENDIF -->
<tr class="row2">
<td><strong>{L_MOD_DISP_NAME}</strong></td><td>{MOD_DISP_NAME}</td>
</tr>
@@ -34,10 +36,10 @@
<td><strong>{L_MOD_DEPENDENTS}</strong></td><td>{MOD_DEPENDENTS}</td>
</tr>
<tr>
- <td class="row2" colspan="2">
- <span class="right-box">
- <!-- IF U_MOD_URL --><a href="{U_MOD_URL}">{L_SUPPORT}</a><!-- ENDIF -->
- <!-- IF U_MOD_DEMO--><a href="{U_MOD_DEMO}">{L_DEMO}</a><!-- ENDIF -->
+ <td class="row2" colspan="2" style="text-align:right">
+ <span>
+ <!-- IF U_MOD_URL --><a href="{U_MOD_URL}">{L_SUPPORT}</a> | <!-- ENDIF -->
+ <!-- IF U_MOD_DEMO--><a href="{U_MOD_DEMO}">{L_DEMO}</a> | <!-- ENDIF -->
{MOD_ACTION}
</span>
</td>
Modified: mods/cms/trunk/styles/prosilver/template/layout.html
===================================================================
--- mods/cms/trunk/styles/prosilver/template/layout.html 2007-09-02 14:07:06 UTC (rev 52)
+++ mods/cms/trunk/styles/prosilver/template/layout.html 2007-09-03 06:28:24 UTC (rev 53)
@@ -1,18 +1,21 @@
<!-- INCLUDE overall_header.html -->
-<div class="left-box" style="width:20%">
+<!-- IF .right -->
- <!-- BEGIN left -->
- <div class="panel<!-- IF left.CLASS --> {left.CLASS}<!-- ENDIF -->">
- <div class="inner">
- <span class="corners-top"><span></span></span>
- <!-- IF left.TITLE --><h3>{left.TITLE}</h3><!-- ENDIF -->
- <span>{left.CONTENT}</span>
- <span class="corners-bottom"><span></span></span>
+ <div class="left-box" style="width:20%;margin-right:.5%">
+
+ <!-- BEGIN left -->
+ <div class="panel<!-- IF left.CLASS --> {left.CLASS}<!-- ENDIF -->">
+ <div class="inner">
+ <span class="corners-top"><span></span></span>
+ <!-- IF left.TITLE --><h3>{left.TITLE}</h3><!-- ENDIF -->
+ <span>{left.CONTENT}</span>
+ <span class="corners-bottom"><span></span></span>
+ </div>
</div>
+ <!-- END left -->
</div>
- <!-- END left -->
-</div>
+<!-- ENDIF -->
<!-- IF .top_hor -->
<div class="left-box" style="width:70%;">
@@ -31,7 +34,7 @@
</div>
<!-- ENDIF -->
-<div class="left-box" style="width:<!-- IF .right -->59%<!-- ELSE -->79.4%<!-- ENDIF -->;margin-left:.5%">
+<div class="left-box" style="width:<!-- IF .right and .left -->59%<!-- ELSEIF .left || .right -->79.4%<!-- ELSE -->100%<!-- ENDIF -->">
<!-- BEGIN top -->
<div class="panel<!-- IF top.CLASS --> {top.CLASS}<!-- ENDIF -->">
@@ -75,9 +78,9 @@
</div>
- <!-- IF .right -->
+<!-- IF .right -->
-<div class="left-box" style="width:20%;margin-left:.5%">
+ <div class="left-box" style="width:20%;margin-left:.5%">
<!-- BEGIN right -->
<div class="panel<!-- IF right.CLASS --> {right.CLASS}<!-- ENDIF -->">
@@ -90,7 +93,7 @@
</div>
<!-- END right -->
-</div>
- <!-- ENDIF -->
+ </div>
+<!-- ENDIF -->
<!-- INCLUDE overall_footer.html -->
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <and...@us...> - 2007-09-02 14:07:14
|
Revision: 52
http://thevr.svn.sourceforge.net/thevr/?rev=52&view=rev
Author: andrewbelcher
Date: 2007-09-02 07:07:06 -0700 (Sun, 02 Sep 2007)
Log Message:
-----------
Creating branch to develop permissions back-end.
Added Paths:
-----------
mods/pms/branches/permissions/
Copied: mods/pms/branches/permissions (from rev 51, mods/pms/trunk)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dac...@us...> - 2007-09-02 07:50:31
|
Revision: 51
http://thevr.svn.sourceforge.net/thevr/?rev=51&view=rev
Author: dachebodt
Date: 2007-09-02 00:50:32 -0700 (Sun, 02 Sep 2007)
Log Message:
-----------
some bug fixes sorry for floading your emails
Modified Paths:
--------------
mods/cms/trunk/cms_install.php
Modified: mods/cms/trunk/cms_install.php
===================================================================
--- mods/cms/trunk/cms_install.php 2007-09-02 07:49:33 UTC (rev 50)
+++ mods/cms/trunk/cms_install.php 2007-09-02 07:50:32 UTC (rev 51)
@@ -155,7 +155,7 @@
if($next_mod)
{
- $meta_info = append_sid("{$phpbb_root_path}cms_install.$phpEx", "action=install&m=$next_mod", true, $user->session_id));
+ $meta_info = append_sid("{$phpbb_root_path}cms_install.$phpEx", "action=install&m=$next_mod", true, $user->session_id);
meta_refresh(3, $meta_info);
$content = "Installing $next_mod, please wait..."; //sprintf($user->lang['INSTALLING_MOD'], $next_mod);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dac...@us...> - 2007-09-02 07:49:31
|
Revision: 50
http://thevr.svn.sourceforge.net/thevr/?rev=50&view=rev
Author: dachebodt
Date: 2007-09-02 00:49:33 -0700 (Sun, 02 Sep 2007)
Log Message:
-----------
making some more installation fixes
Modified Paths:
--------------
mods/cms/trunk/modules/blocks/info/acp_blocks.php
Modified: mods/cms/trunk/modules/blocks/info/acp_blocks.php
===================================================================
--- mods/cms/trunk/modules/blocks/info/acp_blocks.php 2007-09-02 06:19:04 UTC (rev 49)
+++ mods/cms/trunk/modules/blocks/info/acp_blocks.php 2007-09-02 07:49:33 UTC (rev 50)
@@ -59,7 +59,7 @@
`style` mediumint(8) NOT NULL default '0',
`permission` varchar(125) default NULL,
`class` char(10) NOT NULL,
- `xfer_to` tinyint(2) NOT NULL default '',
+ `xfer_to` tinyint(2) NOT NULL,
`xtype` tinyint(1) NOT NULL default '0',
`xmodules` varchar(125) default NULL,
`status` tinyint(1) NOT NULL default '0',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|