Meeting-mod By Oxpus - How To Add Portal-Block »  Show posts from    to     

Icy Phoenix


Old Support Topics - Meeting-mod By Oxpus - How To Add Portal-Block



JohnGF [ Wed 28 Feb, 2007 13:05 ]
Post subject: Meeting-mod By Oxpus - How To Add Portal-Block
I want to add the meeting mod to Icy Phoenix.
Within two little bugs, this mod is ready:
##############################################################
## MOD Title: Meeting
## MOD Author: OXPUS < > (Karsten Ude) http://www.oxpus.de
## MOD Description: Implement a meeting managemant for example to initiate a board meeting with your users
## MOD Version: 1.3.13
##

meeting.php will work with xs-bbcode.

Can you tell me, how to add the block to the portal? Here is the code for EzPortal:
Code: [Hide] [Select]
##############################################################
## MOD Title: Add-On: Meeting Block on ezPortal
## MOD Author: OXPUS < webmaster@oxpus.de > (Karsten Ude) http://www.oxpus.de
## MOD Description: Insert a block with the latest meetings as a new block on the ezPortal
## MOD Version: 1.0.2
##
## Installation Level: Easy
## Installation Time: 2-3 Minutes
## Files To Edit: 2
## portal.php
## templates/subSilver/portal_body.tpl
##
## Included Files: n/a
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##############################################################
## MOD History:
##
## 2005-02-04 - Version 1.0.2
## - Fix the meeting count and improve permissions
## To update replace the complete code in the portal.php
##
## 2005-02-04 - Version 1.0.1
## - Fix the number of signed on users.
## To update replace the complete code in the portal.php
##
## 2004-08-26 - Version 1.0.0
## - First release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
portal.php

#
#-----[ FIND ]------------------------------------------
#
//
// Start output of page
//
define('SHOW_ONLINE', true);
$page_title = $lang['Home'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

#
#-----[ AFTER, ADD ]------------------------------------------
#
// START Meeting Mod
if ( $userdata['session_logged_in'] && $userdata['user_id'] != ANONYMOUS )
{
$template->assign_block_vars('meeting_mod_on', array());

$meeting_link = '<span class="genmed"><a href="'.append_sid("meeting.$phpEx").'" class="nav">'.$lang['Meeting'].'</a></span>';

$template->assign_vars(array(
'MEETING_LINK' => $meeting_link)
);

// Get access status for all meetings
$sql = "SELECT m.meeting_id, mg.meeting_group FROM " . MEETING_DATA_TABLE . " m, " . MEETING_USERGROUP_TABLE . " mg
WHERE mg.meeting_id = m.meeting_id
AND meeting_time > ".time();
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not get meeting usergroups', '', __LINE__, __FILE__, $sql);
}

$meetings_access_ids = array();

while ( $row = $db->sql_fetchrow($result) )
{
$meeting_id = $row['meeting_id'];
$meeting_group = $row['meeting_group'];

if ( $meeting_group == -1 )
{
$meetings_access_ids[] = $meeting_id;
}
else
{
$sql_auth_id = "SELECT g.group_id FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug
WHERE g.group_id = $meeting_group
AND g.group_id = ug.group_id
AND ug.user_pending <> " . TRUE . "
AND g.group_single_user <> " . TRUE . "
AND ug.user_id = " . $userdata['user_id'];
if ( !$result_auth_id = $db->sql_query($sql_auth_id) )
{
message_die(GENERAL_ERROR, 'Could not get meeting access data', '', __LINE__, __FILE__, $sql_auth_id);
}

$count_usergroups = $db->sql_numrows($result_auth_id);
$db->sql_freeresult($result_auth_id);

if ( $count_usergroups > 0 )
{
$meetings_access_ids[] = $meeting_id;
}
}
}
$meeting_active_ids = $db->sql_numrows($result);
$db->sql_freeresult($result);

if ( count($meetings_access_ids) > 0 )
{
$meeting_ids = ( count($meetings_access_ids) == 1 ) ? $meetings_access_ids[0] : implode(',', $meetings_access_ids);
$sql_meeting_access = ' WHERE meeting_id IN ('.$meeting_ids.') AND meeting_time > '.time();
}
else if ($userdata['user_level'] == ADMIN)
{
$sql_meeting_access = ' WHERE meeting_time > '.time();
}
else
{
$sql_meeting_access = '';
}

if ($meeting_active_ids == 0 || $sql_meeting_access == '')
{
$template->assign_block_vars('meeting_mod_on.no_meeting', array(
'NO_MEETING' => $lang['No_active_meetings'])
);
}
else
{
$sql = "SELECT * FROM " . MEETING_DATA_TABLE . "
$sql_meeting_access
ORDER BY meeting_time DESC";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not get meeting data', '', __LINE__, __FILE__, $sql);
}

while ( $row = $db->sql_fetchrow($result) )
{
$meeting_id = $row['meeting_id'];
$meeting_user_ids = array();

$sql_user = "SELECT m.user_id, m.meeting_sure, u.username FROM " . MEETING_USER_TABLE . " m, " . USERS_TABLE . " u
WHERE m.user_id = u.user_id
AND m.meeting_id = $meeting_id
AND m.meeting_sure <> 0";
if ( !$result_user = $db->sql_query($sql_user) )
{
message_die(GENERAL_ERROR, 'Could not get meeting data', '', __LINE__, __FILE__, $sql_user);
}

while ( $row_user = $db->sql_fetchrow($result_user) )
{
$meeting_user_ids[] = $row_user['user_id'];
}
$db->sql_freeresult($result_user);

$meeting_users = sizeof($meeting_user_ids);
$meeting_places = $row['meeting_places'];
$meeting_free_places = ( $meeting_user_ids != 0 ) ? ($meeting_places - $meeting_users) : $meeting_places;

$template->assign_block_vars('meeting_mod_on.meetingrow', array(
'MEETING_SUBJECT' => $row['meeting_subject'],
'MEETING_FREE_PLACES' => $lang['Meeting_free_places'].': '.$meeting_free_places,
'MEETING_SIGNED_ON_USERS' => $lang['Meeting_userlist'].': '.$meeting_users)
);
}
$template->assign_vars(array(
'MEETING_ACTIVE' => '[ '.$meeting_active_ids.' ]')
);
$db->sql_freeresult($result);
}
}
// END Meeting Mod

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/portal_body.tpl

#
#-----[ FIND ]------------------------------------------
# // Wherever you want
</td></tr></table>


#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- BEGIN meeting_mod_on -->
<br />
<table width="100%" cellpadding="2" cellspacing="0" border="0" class="forumline">
<tr>
<td class="row4" align="center" colspan="2"><span class="genmed"><b>{MEETING_LINK}</b></span></td>
</tr>
<!-- BEGIN no_meeting -->
<tr>
<td class="row1" align="left" colspan="2"><span class="gensmall">{meeting_mod_on.no_meeting.NO_MEETING}</span></td>
</tr>
<!-- END no_meeting -->
<!-- BEGIN meetingrow -->
<tr>
<td class="row1" align="center" colspan="2" wrap="wrap"><span class="gensmall"><b>{meeting_mod_on.meetingrow.MEETING_SUBJECT}</b><br />{meeting_mod_on.meetingrow.MEETING_FREE_PLACES}<br />{meeting_mod_on.meetingrow.MEETING_SIGNED_ON_USERS}</span></td>
</tr>
<!-- END meetingrow -->
<tr>
<td class="row2" align="center" colspan="2">{MEETING_ACTIVE}</td>
</tr>
</table>
<!-- END meeting_mod_on -->


#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


When this mod is bugfree, I will post this here.
P.S: Comments for meetings doesn`t work yet!
Sorry for my bad english.


JohnGF [ Wed 28 Feb, 2007 14:55 ]
Post subject: Re: Meeting-mod By Oxpus - How To Add Portal-Block
Thanks, I have found it by myself.

Here are the files for the Portal-Block:


KugeLSichA [ Wed 28 Feb, 2007 15:22 ]
Post subject: Re: Meeting-mod By Oxpus - How To Add Portal-Block
thx JohnGF for sharing it


JohnGF [ Thu 01 Mar, 2007 18:39 ]
Post subject: Re: Meeting-mod By Oxpus - How To Add Portal-Block
I have some Problems with the bbcode-parser and the meeting-mod. Oxpus didn`t have the time to take a look at this. The bbcodes workes, but the users can`t make comments to the meetings. Try to fix it in the next time. If I have fixed this, I will post the mod here, if you agree.


Mighty Gorgon [ Sun 04 Mar, 2007 12:49 ]
Post subject: Re: Meeting-mod By Oxpus - How To Add Portal-Block
I've written a small how to on top of bbcode.php you can try to integrate BBCodes using this reference and comparing what has been done in other XS files.

If you provide a link I'll try to verify at least what the error is.

Code: [Hide] [Select]
=================
Includes
=================

include($phpbb_root_path . 'includes/bbcode.'.$phpEx);

=================
Globals
=================

global $bbcode;

=================
BBCode Parsing
=================

$text = $bbcode->parse($text, $bbcode_uid);

=================
BBCode Conditions
=================

$bbcode->allow_html = ( $userdata['user_allowhtml'] && $board_config['allow_html'] ) ? true : false;
$bbcode->allow_bbcode = ( $userdata['user_allowbbcode'] && $board_config['allow_bbcode'] ) ? true : false;
$bbcode->allow_smilies = ( $userdata['user_allowsmile'] && $board_config['allow_smilies'] ) ? true : false;

=================

$html_on = ( $userdata['user_allowhtml'] && $board_config['allow_html'] ) ? 1 : 0 ;
$bbcode_on = ( $userdata['user_allowbbcode'] && $board_config['allow_bbcode'] ) ? 1 : 0 ;
$smilies_on = ( $userdata['user_allowsmile'] && $board_config['allow_smilies'] ) ? 1 : 0 ;

$bbcode->allow_html = $html_on;
$bbcode->allow_bbcode = $bbcode_on;
$bbcode->allow_smilies = $smilies_on;

=================

$bbcode->allow_html = ( $board_config['allow_html'] ? $board_config['allow_html'] : false );
$bbcode->allow_bbcode = ( $board_config['allow_bbcode'] ? $board_config['allow_bbcode'] : false );
$bbcode->allow_smilies = ( $board_config['allow_smilies'] ? $board_config['allow_smilies'] : false );

=================

$bbcode->allow_html = $board_config['allow_html'];
$bbcode->allow_bbcode = $board_config['allow_bbcode'];
$bbcode->allow_smilies = $board_config['allow_smilies'];

=================

$bbcode->allow_html = ( $board_config['allow_html'] && $postrow[$i]['enable_bbcode'] ? true : false );
$bbcode->allow_bbcode = ( $board_config['allow_bbcode'] && $postrow[$i]['enable_bbcode'] ? true : false );
$bbcode->allow_smilies = ( $board_config['allow_smilies'] && $postrow[$i]['enable_smilies'] ? true : false );

=================

$bbcode->allow_smilies = ( $board_config['allow_smilies'] ? $board_config['allow_smilies'] : false );
$bbcode->allow_bbcode = ( $board_config['allow_bbcode'] ? $board_config['allow_bbcode'] : false );
//$bbcode->allow_bbcode = ( $bbcode_uid != '' ? $board_config['allow_bbcode'] : false );
=================

=================================
Acronyms, Autolinks, Word Wrap
=================================

$orig_autolink = array();
$replacement_autolink = array();
obtain_autolink_list($orig_autolink, $replacement_autolink, 99999999);
if( function_exists( 'acronym_pass' ) )
{
$text = acronym_pass( $text );
}
if( count($orig_autolink) )
{
$text = autolink_transform($text, $orig_autolink, $replacement_autolink);
}
$text = kb_word_wrap_pass ($text);
====================




Powered by Icy Phoenix