PDA

View Full Version : Calendar



[CLS]_Airborne328
March 1st, 2005, 16:49
:chain: :chain: How are you guys adding events for calendar, We use same one i think, however I can't ad devents, DAMN, I am tired of forums and MODS... :roll: :spank: :shock: :D

If anyone else feels froggy, maybe they can also explain why I dont have a submit/preview button in private messages.


I think I am going crazy, and someone just stole the SOB :evil: :D


Thnak guys for any input

sniperkiller
March 1st, 2005, 17:37
Hee Hee Airborne328 :lol: Yea I hear ya on the Forum mess. By chance did you preview your code to see if the submit info was even somewhere in there? Maybe you added something in wrong spot for the submit button? Ill check into it for ya and see what I can find..........

[CLS]_Airborne328
March 1st, 2005, 18:02
dude, I will owe you... :banger:

However, where on your calendar, do you add event, i couldn't even find it here, :roll:

-=DoW=- Saw_Gunner69
March 1st, 2005, 19:42
For us we have a sub forum under our members section that is titled Calender Events..in there we have the option of adding an event, In the form of a post. Hope that helps man

[CLS]_Airborne328
March 1st, 2005, 23:54
For us we have a sub forum under our members section that is titled Calender Events..in there we have the option of adding an event, In the form of a post. Hope that helps man


OMG no... Thats means another MOD :chain: :chain: :chain: :D

Our old calendar I could give permission though ACP, now with this one I can't and it will show upcoming BD's

Question, how would I be able to post an event here to see an example..

appreciate the replies guys....



?????????????????????????????????????????????????? ?????????/

And that damn PM box, I installed the premodded CH version, so no editing was done to the prvmsg.php file, It is very strange that those buttons would be missing.

You can see for yourself, look at your pm box and try to reply or send one from our forums, you will be like WTF... :chain:

username=GuestUser
pass=123456


i even went as far as renaming current prvmsg.php, and adding fresh modded one, and still it wont show...

The hard installs were easier in comparison to these little things. :spank: :lol:

[CLS]_Airborne328
March 2nd, 2005, 02:42
:8): Hooah...1 more down

Got my preview/submit button for Pm's back, don't ask how, I am not... :shock:


Now for the last thing this dang Calendar...

-=DoW=- Acedeal
March 2nd, 2005, 05:26
you have to go into each forum in the admin panel, under permissions i think it is and allow clanedar topics for XZY forum--
I only allow certain forums for calander events ..

[CLS]_Airborne328
March 2nd, 2005, 19:49
well here is the scoop, I went through and double checked edits, found 2 minor errors.

However, when tryign to edit the functions_post.php, the last line, I come out to test a psot and new topic and get an error,

can someone look at this and see if they can put it right.

below is instruction line for that file


#
#-----[ OPEN ]------------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]------------------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : calendar --------------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full line is longer
#
function prepare_post(&$mode, &$post_data, &$bbcode_on
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : calendar --------------------------------------------------------------------------------
// here we have added
// , $topic_calendar_time = 0, $topic_calendar_duration = 0
//-- modify
#
#-----[ IN-LINE FIND ]----------------------------------------
#
)
#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
, $topic_calendar_time = 0, $topic_calendar_duration = 0
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- fin mod : calendar ----------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
$error_msg .= (!empty($error_msg)) ? '
' . $lang['Empty_message'] : $lang['Empty_message'];
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- mod : calendar --------------------------------------------------------------------------------
//-- add
//
// check calendar date
//
if ((!empty($topic_calendar_time)) && ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])))
{
$year = intval(date( 'Y', $topic_calendar_time));
$month = intval(date( 'm', $topic_calendar_time));
$day = intval(date( 'd', $topic_calendar_time));
if (!checkdate($month, $day, $year))
{
$error_msg .= (!empty($error_msg) ? '
' : '') . sprintf($lang['Date_error'], $day, $month, $year);
}
}
//-- fin mod : calendar ----------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
# this is a partial search : the full line is longer
#
function submit_post($mode, &$post_data, &$message
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : calendar --------------------------------------------------------------------------------
// here we have added
// , $topic_calendar_time = 0, $topic_calendar_duration = 0
//-- modify
#
#-----[ IN-LINE FIND ]----------------------------------------
#
)
#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
, $topic_calendar_time = 0, $topic_calendar_duration = 0
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- fin mod : calendar ----------------------------------------------------------------------------
#
#-----[ FIND ]------------------------------------------------
#
$sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : calendar --------------------------------------------------------------------------------
// here we have added
// , topic_calendar_time, topic_calendar_duration
// , $topic_calendar_time, $topic_calendar_duration
// and
// , topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration
//-- modify
#
#-----[ IN-LINE FIND ]----------------------------------------
#
, topic_status, topic_type
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, topic_calendar_time, topic_calendar_duration
#
#-----[ IN-LINE FIND ]----------------------------------------
#
, " . TOPIC_UNLOCKED . ", $topic_type
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, $topic_calendar_time, $topic_calendar_duration
#
#-----[ IN-LINE FIND ]----------------------------------------
#
, topic_type = $topic_type
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- fin mod : calendar ----------------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------------
#

below is my current function_post.php

[php:1:0a590b7555]
<?php
//-- mod : calendar --------------------------------------------------------------------------------
//-- mod : categories hierarchy ------------------------------------------------
/************************************************** *************************
* functions_post.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: functions_post.php,v 1.9.2.37 2004/11/18 17:49:44 acydburn Exp $
*
*
************************************************** *************************/

/************************************************** *************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
************************************************** *************************/

if (!defined('IN_PHPBB'))
{
die('Hacking attempt');
}

$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#');
$html_entities_replace = array('&', '<', '>');

$unhtml_specialchars_match = array('#>#', '#<#', '#"#', '#&#');
$unhtml_specialchars_replace = array('>', '<', '"', '&');

//
// This function will prepare a posted message for
// entry into the database.
//
function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0)
{
global $board_config, $html_entities_match, $html_entities_replace;

//
// Clean up the message
//
$message = trim($message);

if ($html_on)
{
$allowed_html_tags = split(',', $board_config['allow_html_tags']);

$end_html = 0;
$start_html = 1;
$tmp_message = '';
$message = ' ' . $message . ' ';

while ($start_html = strpos($message, '<', $start_html))
{
$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1, ($start_html - $end_html - 1)));

if ($end_html = strpos($message, '>', $start_html))
{
$length = $end_html - $start_html + 1;
$hold_string = substr($message, $start_html, $length);

if (($unclosed_open = strrpos(' ' . $hold_string, '<')) != 1)
{
$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($hold_string, 0, $unclosed_open - 1));
$hold_string = substr($hold_string, $unclosed_open - 1);
}

$tagallowed = false;
for ($i = 0; $i < sizeof($allowed_html_tags); $i++)
{
$match_tag = trim($allowed_html_tags[$i]);
if (preg_match('#^<\/?' . $match_tag . '[> ]#i', $hold_string))
{
$tagallowed = (preg_match('#^<\/?' . $match_tag . ' .*?(style[\t ]*?=|on[\w]+[\t ]*?=)#i', $hold_string)) ? false : true;
}
}

$tmp_message .= ($length && !$tagallowed) ? preg_replace($html_entities_match, $html_entities_replace, $hold_string) : $hold_string;

$start_html += $length;
}
else
{
$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $start_html, strlen($message)));

$start_html = strlen($message);
$end_html = $start_html;
}
}

if (!$end_html || ($end_html != strlen($message) && $tmp_message != ''))
{
$tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1));
}

$message = ($tmp_message != '') ? trim($tmp_message) : trim($message);
}
else
{
$message = preg_replace($html_entities_match, $html_entities_replace, $message);
}

if($bbcode_on && $bbcode_uid != '')
{
$message = bbencode_first_pass($message, $bbcode_uid);
}

return $message;
}

function unprepare_message($message)
{
global $unhtml_specialchars_match, $unhtml_specialchars_replace;

return preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $message);
}

//
// Prepare a message for posting
//
//-- mod : calendar --------------------------------------------------------------------------------
// here we have added
// , $topic_calendar_time = 0, $topic_calendar_duration = 0
//-- modify
function prepare_post(&$mode, &$post_data, &$bbcode_on, &$html_on, &$smilies_on, &$error_msg, &$username, &$bbcode_uid, &$subject, &$message, &$poll_title, &$poll_options, &$poll_length, $topic_calendar_time = 0, $topic_calendar_duration = 0)
//-- fin mod : calendar ----------------------------------------------------------------------------
{
global $board_config, $userdata, $lang, $phpEx, $phpbb_root_path;

// Check username
if (!empty($username))
{
$username = phpbb_clean_username($username);

if (!$userdata['session_logged_in'] || ($userdata['session_logged_in'] && $username != $userdata['username']))
{
include($phpbb_root_path . 'includes/functions_validate.'.$phpEx);

$result = validate_username($username);
if ($result['error'])
{
$error_msg .= (!empty($error_msg)) ? '
' . $result['error_msg'] : $result['error_msg'];
}
}
else
{
$username = '';
}
}

// Check subject
if (!empty($subject))
{
$subject = htmlspecialchars(trim($subject));
}
else if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))
{
$error_msg .= (!empty($error_msg)) ? '
' . $lang['Empty_subject'] : $lang['Empty_subject'];
}

// Check message
if (!empty($message))
{
$bbcode_uid = ($bbcode_on) ? make_bbcode_uid() : '';
$message = prepare_message(trim($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
}
else if ($mode != 'delete' && $mode != 'poll_delete')
{
$error_msg .= (!empty($error_msg)) ? '
' . $lang['Empty_message'] : $lang['Empty_message'];
}
//-- mod : calendar --------------------------------------------------------------------------------
//-- add
//
// check calendar date
//
if ((!empty($topic_calendar_time)) && ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])))
{
$year = intval(date( 'Y', $topic_calendar_time));
$month = intval(date( 'm', $topic_calendar_time));
$day = intval(date( 'd', $topic_calendar_time));
if (!checkdate($month, $day, $year))
{
$error_msg .= (!empty($error_msg) ? '
' : '') . sprintf($lang['Date_error'], $day, $month, $year);
}
}
//-- fin mod : calendar ----------------------------------------------------------------------------
//
// Handle poll stuff
//
if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))
{
$poll_length = (isset($poll_length)) ? max(0, intval($poll_length)) : 0;

if (!empty($poll_title))
{
$poll_title = htmlspecialchars(trim($poll_title));
}

if(!empty($poll_options))
{
$temp_option_text = array();
while(list($option_id, $option_text) = @each($poll_options))
{
$option_text = trim($option_text);
if (!empty($option_text))
{
$temp_option_text[$option_id] = htmlspecialchars($option_text);
}
}
$option_text = $temp_option_text;

if (count($poll_options) < 2)
{
$error_msg .= (!empty($error_msg)) ? '
' . $lang['To_few_poll_options'] : $lang['To_few_poll_options'];
}
else if (count($poll_options) > $board_config['max_poll_options'])
{
$error_msg .= (!empty($error_msg)) ? '
' . $lang['To_many_poll_options'] : $lang['To_many_poll_options'];
}
else if ($poll_title == '')
{
$error_msg .= (!empty($error_msg)) ? '
' . $lang['Empty_poll_title'] : $lang['Empty_poll_title'];
}
}
}

return;
}

//
// Post a new topic/reply/poll or edit existing post/poll
//
//-- mod : categories hierarchy ------------------------------------------------
// here we added
// , $post_icon=0, $topic_duration=0, $calendar_time=0, $calendar_duration=0, $sub_title=''
//-- modify
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length, $post_icon=0, $topic_duration=0, $calendar_time=0, $calendar_duration=0, $sub_title='')
//-- fin mod : categories hierarchy --------------------------------------------
{
global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
global $userdata, $user_ip;

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

$current_time = time();

if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost')
{
//
// Flood control
//
$where_sql = ($userdata['user_id'] == ANONYMOUS) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['user_id'];
$sql = "SELECT MAX(post_time) AS last_post_time
FROM " . POSTS_TABLE . "
WHERE $where_sql";
if ($result = $db->sql_query($sql))
{
if ($row = $db->sql_fetchrow($result))
{
if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) < intval($board_config['flood_interval']))
{
message_die(GENERAL_MESSAGE, $lang['Flood_Error']);
}
}
}
}

if ($mode == 'editpost')
{
remove_search_post($post_id);
}

//-- mod : categories hierarchy ------------------------------------------------
//-- add
$topic_fields = array();
if ( in_array($mode, array('newtopic', 'reply', 'editpost')) )
{
if ( $post_data['first_post'] || ($mode == 'newtopic') )
{
$topic_fields += array(
'topic_icon' => $post_icon,
'topic_duration' => $topic_duration,
'topic_first_username' => $post_username,
'topic_sub_title' => $sub_title,
);
if ( defined('POST_CALENDAR') )
{
$topic_fields += array(
'topic_calendar_time' => $calendar_time,
'topic_calendar_duration' => $calendar_duration,
);
}
}
if ( $post_data['last_post'] || ($mode == 'newtopic') || ($mode == 'reply') )
{
$topic_fields += array(
'topic_last_username' => $post_username,
);
if ( $mode != 'editpost' )
{
$topic_fields += array(
'topic_last_poster' => $userdata['user_id'],
'topic_last_time' => $current_time,
);
}
}
}
//-- fin mod : categories hierarchy --------------------------------------------

if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))
{
$topic_vote = (!empty($poll_title) && count($poll_options) >= 2) ? 1 : 0;

//-- mod : categories hierarchy ------------------------------------------------
//-- add
$db->sql_statement($topic_fields);
//-- here we added
// , " . $db->sql_fields . "
// , " . $db->sql_values . "
// , " . $db->sql_update . "
//-- modify
$sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, " . $db->sql_fields . ", topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $db->sql_values . ", " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', " . $db->sql_update . ", topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";//-- fin mod : categories hierarchy --------------------------------------------
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}

if ($mode == 'newtopic')
{
$topic_id = $db->sql_nextid();
}
}
//-- mod : categories hierarchy ------------------------------------------------
//-- add
// update last post informations when not equal to first post
else if ( ($mode == 'reply') || (($mode == 'editpost') && $post_data['last_post']) )
{
$db->sql_statement($topic_fields);
$sql = 'UPDATE ' . TOPICS_TABLE . '
SET ' . $db->sql_update . '
WHERE topic_id = ' . $topic_id;
$db->sql_query($sql, false, __LINE__, __FILE__);
}
//-- fin mod : categories hierarchy --------------------------------------------

$edited_sql = ($mode == 'editpost' && !$post_data['last_post'] && $post_data['poster_post']) ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : "";
//-- mod : categories hierarchy ------------------------------------------------
//-- add
$post_fields = array(
'post_icon' => $post_icon,
);
$db->sql_statement($post_fields);
//-- here we added
// , " . $db->sql_fields . "
// , " . $db->sql_values . "
// , " . $db->sql_update . "
//-- modify
$sql = ($mode != "editpost") ? "INSERT INTO " . POSTS_TABLE . " (topic_id, " . $db->sql_fields . ", forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, " . $db->sql_values . ", $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)" : "UPDATE " . POSTS_TABLE . " SET post_username = '$post_username', " . $db->sql_update . ", enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . " WHERE post_id = $post_id";
//-- fin mod : categories hierarchy --------------------------------------------
if (!$db->sql_query($sql, BEGIN_TRANSACTION))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}

if ($mode != 'editpost')
{
$post_id = $db->sql_nextid();
}

//-- mod : categories hierarchy ------------------------------------------------
//-- add
$post_text_fields = array(
'post_sub_title' => $sub_title,
);
$db->sql_statement($post_text_fields);
//-- here we added
// , " . $db->sql_fields . "
// , " . $db->sql_values . "
// , " . $db->sql_update . "
//-- modify
$sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, " . $db->sql_fields . ", post_subject, bbcode_uid, post_text) VALUES ($post_id, " . $db->sql_values . ", '$post_subject', '$bbcode_uid', '$post_message')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '$post_message', " . $db->sql_update . ", bbcode_uid = '$bbcode_uid', post_subject = '$post_subject' WHERE post_id = $post_id";
//-- fin mod : categories hierarchy --------------------------------------------
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}

//-- mod : categories hierarchy ------------------------------------------------
// here we added:
// . ' ' . $sub_title
//-- modified
add_search_words('single', $post_id, stripslashes($post_message), stripslashes($post_subject) . ' ' . $sub_title);
//-- fin mod : categories hierarchy --------------------------------------------

//
// Add poll
//
if (($mode == 'newtopic' || ($mode == 'editpost' && $post_data['edit_poll'])) && !empty($poll_title) && count($poll_options) >= 2)
{
$sql = (!$post_data['has_poll']) ? "INSERT INTO " . VOTE_DESC_TABLE . " (topic_id, vote_text, vote_start, vote_length) VALUES ($topic_id, '$poll_title', $current_time, " . ($poll_length * 86400) . ")" : "UPDATE " . VOTE_DESC_TABLE . " SET vote_text = '$poll_title', vote_length = " . ($poll_length * 86400) . " WHERE topic_id = $topic_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}

$delete_option_sql = '';
$old_poll_result = array();
if ($mode == 'editpost' && $post_data['has_poll'])
{
$sql = "SELECT vote_option_id, vote_result
FROM " . VOTE_RESULTS_TABLE . "
WHERE vote_id = $poll_id
ORDER BY vote_option_id ASC";
if (!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not obtain vote data results for this topic', '', __LINE__, __FILE__, $sql);
}

while ($row = $db->sql_fetchrow($result))
{
$old_poll_result[$row['vote_option_id']] = $row['vote_result'];

if (!isset($poll_options[$row['vote_option_id']]))
{
$delete_option_sql .= ($delete_option_sql != '') ? ', ' . $row['vote_option_id'] : $row['vote_option_id'];
}
}
}
else
{
$poll_id = $db->sql_nextid();
}

@reset($poll_options);

$poll_option_id = 1;
while (list($option_id, $option_text) = each($poll_options))
{
if (!empty($option_text))
{
$option_text = str_replace("\'", "''", htmlspecialchars($option_text));
$poll_result = ($mode == "editpost" && isset($old_poll_result[$option_id])) ? $old_poll_result[$option_id] : 0;

$sql = ($mode != "editpost" || !isset($old_poll_result[$option_id])) ? "INSERT INTO " . VOTE_RESULTS_TABLE . " (vote_id, vote_option_id, vote_option_text, vote_result) VALUES ($poll_id, $poll_option_id, '$option_text', $poll_result)" : "UPDATE " . VOTE_RESULTS_TABLE . " SET vote_option_text = '$option_text', vote_result = $poll_result WHERE vote_option_id = $option_id AND vote_id = $poll_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
$poll_option_id++;
}
}

if ($delete_option_sql != '')
{
$sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "
WHERE vote_option_id IN ($delete_option_sql)
AND vote_id = $poll_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error deleting pruned poll options', '', __LINE__, __FILE__, $sql);
}
}
}

//-- mod : categories hierarchy ------------------------------------------------
//-- add
// sync forum
if ( ($mode == 'editpost') && $post_data['first_post'] )
{
global $config;
include($config->url('includes/functions_admin'));
sync('forum', $forum_id);
}
//-- fin mod : categories hierarchy --------------------------------------------
$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">';
//-- mod : categories hierarchy ------------------------------------------------
//-- delete
// $message = $lang['Stored'] . '

' . sprintf($lang['Click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '

' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
//-- add
global $config;
$message = $lang['Stored'] . '

' . sprintf($lang['Click_view_message'], '<a href="' . $config->url('viewtopic', array(POST_POST_URL => $post_id), true, $post_id) . '">', '</a>') . '

' . sprintf($lang['Click_return_forum'], '<a href="' . $config->url('index', array(POST_FORUM_URL => $forum_id), true) . '">', '</a>');
//-- fin mod : categories hierarchy --------------------------------------------

return false;
}

//
// Update post stats and details
//
function update_post_stats(&$mode, &$post_data, &$forum_id, &$topic_id, &$post_id, &$user_id)
{
global $db;

$sign = ($mode == 'delete') ? '- 1' : '+ 1';
$forum_update_sql = "forum_posts = forum_posts $sign";
$topic_update_sql = '';

if ($mode == 'delete')
{
if ($post_data['last_post'])
{
if ($post_data['first_post'])
{
$forum_update_sql .= ', forum_topics = forum_topics - 1';
}
else
{

$topic_update_sql .= 'topic_replies = topic_replies - 1';

//-- mod : categories hierarchy ------------------------------------------------
//-- delete
// $sql = "SELECT MAX(post_id) AS last_post_id
// FROM " . POSTS_TABLE . "
// WHERE topic_id = $topic_id";
// if (!($result = $db->sql_query($sql)))
// {
// message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
// }
//
// if ($row = $db->sql_fetchrow($result))
// {
// $topic_update_sql .= ', topic_last_post_id = ' . $row['last_post_id'];
// }
//-- add
// get new last post data
$sql = 'SELECT post_id, poster_id, post_username, post_time
FROM ' . POSTS_TABLE . '
WHERE topic_id = ' . $topic_id . '
ORDER BY post_id DESC
LIMIT 1';
$result = $db->sql_query($sql, false, __LINE__, __FILE__);
$row = $db->sql_fetchrow($result);
$fields = array(
'topic_last_post_id' => intval($row['post_id']),
'topic_last_poster' => intval($row['poster_id']),
'topic_last_username' => $row['post_username'],
'topic_last_time' => intval($row['post_time']),
);
$db->sql_statement($fields);
$topic_update_sql .= ', ' . $db->sql_update;
//-- fin mod : categories hierarchy --------------------------------------------
}

if ($post_data['last_topic'])
{
//-- mod : categories hierarchy ------------------------------------------------
//-- delete
// $sql = "SELECT MAX(post_id) AS last_post_id
// FROM " . POSTS_TABLE . "
// WHERE forum_id = $forum_id";
// if (!($result = $db->sql_query($sql)))
// {
// message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
// }
//
// if ($row = $db->sql_fetchrow($result))
// {
// $forum_update_sql .= ($row['last_post_id']) ? ', forum_last_post_id = ' . $row['last_post_id'] : ', forum_last_post_id = 0';
// }
//-- fin mod : categories hierarchy --------------------------------------------
}
}
else if ($post_data['first_post'])
{
$sql = "SELECT MIN(post_id) AS first_post_id
FROM " . POSTS_TABLE . "
WHERE topic_id = $topic_id";
if (!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
}

if ($row = $db->sql_fetchrow($result))
{
$topic_update_sql .= 'topic_replies = topic_replies - 1, topic_first_post_id = ' . $row['first_post_id'];
}
}
else
{
$topic_update_sql .= 'topic_replies = topic_replies - 1';
}
}
else if ($mode != 'poll_delete')
{
//-- mod : categories hierarchy ------------------------------------------------
// here we deleted
// ", forum_last_post_id = $post_id" . ([../..])
//-- modify
$forum_update_sql .= ($mode == 'newtopic') ? ", forum_topics = forum_topics $sign" : "";
//-- fin mod : categories hierarchy ---------------------------------------------
$topic_update_sql = "topic_last_post_id = $post_id" . (($mode == 'reply') ? ", topic_replies = topic_replies $sign" : ", topic_first_post_id = $post_id");
}
else
{
$topic_update_sql .= 'topic_vote = 0';
}

//-- mod : categories hierarchy ------------------------------------------------
//-- delete
// $sql = "UPDATE " . FORUMS_TABLE . " SET
// $forum_update_sql
// WHERE forum_id = $forum_id";
// if (!$db->sql_query($sql))
// {
// message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
// }
//-- fin mod : categories hierarchy ---------------------------------------------

if ($topic_update_sql != '')
{
$sql = "UPDATE " . TOPICS_TABLE . " SET
$topic_update_sql
WHERE topic_id = $topic_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
}

if ($mode != 'poll_delete')
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_posts = user_posts $sign
WHERE user_id = $user_id";
if (!$db->sql_query($sql, END_TRANSACTION))
{
message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
}
}

//-- mod : categories hierarchy ------------------------------------------------
//-- add
global $config;

// resync forum
if ($mode != 'poll_delete')
{
// get last post data
$sql = 'SELECT t.topic_last_post_id, t.topic_title, t.topic_last_poster, t.topic_last_username, t.topic_last_time, u.username
FROM ' . TOPICS_TABLE . ' t
LEFT JOIN ' . USERS_TABLE . ' u ON u.user_id = t.topic_last_poster
WHERE forum_id = ' . $forum_id . '
AND topic_moved_id = 0
ORDER BY topic_last_post_id DESC
LIMIT 1';
$result = $db->sql_query($sql, false, __LINE__, __FILE__);
$row = $db->sql_fetchrow($result);
$fields = array(
'forum_last_post_id' => intval($row['topic_last_post_id']),
'forum_last_title' => $row['topic_title'],
'forum_last_poster' => intval($row['topic_last_poster']),
'forum_last_username' => (($row['topic_last_poster'] != ANONYMOUS) && !empty($row['username'])) ? $row['username'] : $row['topic_last_username'],
'forum_last_time' => intval($row['topic_last_time']),
);
$db->sql_statement($fields);
$forum_update_sql .= ', ' . $db->sql_update;
$sql = 'UPDATE ' . FORUMS_TABLE . '
SET ' . $forum_update_sql . '
WHERE forum_id = ' . $forum_id;
$db->sql_query($sql, false, __LINE__, __FILE__);

// resync sum
if ( $mode == 'delete' )
{
$config->set('stat_total_posts', $config->data['stat_total_posts'] - 1);
if ( $post_data['last_post'] && $post_data['first_post'] )
{
$config->set('stat_total_topics', $config->data['stat_total_topics'] - 1);
}
}
else
{
$config->set('stat_total_posts', $config->data['stat_total_posts'] + 1);
if ( $mode == 'newtopic' )
{
$config->set('stat_total_topics', $config->data['stat_total_topics'] + 1);
}
}
}
//-- fin mod : categories hierarchy --------------------------------------------

return;
}

//
// Delete a post/poll
//
function delete_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id)
{
global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
global $userdata, $user_ip;
//-- mod : categories hierarchy ------------------------------------------------
//-- add
global $config;
//-- fin mod : categories hierarchy --------------------------------------------

if ($mode != 'poll_delete')
{
include($phpbb_root_path . 'includes/functions_search.'.$phpEx);

$sql = "DELETE FROM " . POSTS_TABLE . "
WHERE post_id = $post_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
}

$sql = "DELETE FROM " . POSTS_TEXT_TABLE . "
WHERE post_id = $post_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
}

if ($post_data['last_post'])
{
if ($post_data['first_post'])
{
$forum_update_sql .= ', forum_topics = forum_topics - 1';
$sql = "DELETE FROM " . TOPICS_TABLE . "
WHERE topic_id = $topic_id
OR topic_moved_id = $topic_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
}

$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id = $topic_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
}
}
}

remove_search_post($post_id);
}

if ($mode == 'poll_delete' || ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post']) && $post_data['has_poll'] && $post_data['edit_poll'])
{
$sql = "DELETE FROM " . VOTE_DESC_TABLE . "
WHERE topic_id = $topic_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);
}

$sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "
WHERE vote_id = $poll_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);
}

$sql = "DELETE FROM " . VOTE_USERS_TABLE . "
WHERE vote_id = $poll_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error in deleting poll', '', __LINE__, __FILE__, $sql);
}
}

if ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post'])
{
//-- mod : categories hierarchy ------------------------------------------------
//-- delete
// $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $forum_id) . '">';
//-- add
$meta = '<meta http-equiv="refresh" content="3;url=' . $config->url('index', array(POST_FORUM_URL => $forum_id), true) . '">';
//-- fin mod : categories hierarchy --------------------------------------------
$message = $lang['Deleted'];
}
else
{
$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $topic_id) . '">';
$message = (($mode == 'poll_delete') ? $lang['Poll_delete'] : $lang['Deleted']) . '

' . sprintf($lang['Click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
}

//-- mod : categories hierarchy ------------------------------------------------
//-- delete
// $message .= '

' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');
//-- add
$message .= '

' . sprintf($lang['Click_return_forum'], '<a href="' . $config->url('index', array(POST_FORUM_URL => $forum_id), true) . '">', '</a>');
//-- fin mod : categories hierarchy --------------------------------------------

return;
}

//
// Handle user notification on new post
//
function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user)
{
global $board_config, $lang, $db, $phpbb_root_path, $phpEx;
global $userdata, $user_ip;

$current_time = time();

if ($mode == 'delete')
{
$delete_sql = (!$post_data['first_post'] && !$post_data['last_post']) ? " AND user_id = " . $userdata['user_id'] : '';
$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " WHERE topic_id = $topic_id" . $delete_sql;
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not change topic notify data', '', __LINE__, __FILE__, $sql);
}
}
else
{
if ($mode == 'reply')
{
$sql = "SELECT ban_userid
FROM " . BANLIST_TABLE;
if (!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not obtain banlist', '', __LINE__, __FILE__, $sql);
}

$user_id_sql = '';
while ($row = $db->sql_fetchrow($result))
{
if (isset($row['ban_userid']) && !empty($row['ban_userid']))
{
$user_id_sql .= ', ' . $row['ban_userid'];
}
}

$sql = "SELECT u.user_id, u.user_email, u.user_lang
FROM " . TOPICS_WATCH_TABLE . " tw, " . USERS_TABLE . " u
WHERE tw.topic_id = $topic_id
AND tw.user_id NOT IN (" . $userdata['user_id'] . ", " . ANONYMOUS . $user_id_sql . ")
AND tw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . "
AND u.user_id = tw.user_id";
if (!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not obtain list of topic watchers', '', __LINE__, __FILE__, $sql);
}

$update_watched_sql = '';
$bcc_list_ary = array();

if ($row = $db->sql_fetchrow($result))
{
// Sixty second limit
@set_time_limit(60);

do
{
if ($row['user_email'] != '')
{
$bcc_list_ary[$row['user_lang']][] = $row['user_email'];
}
$update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['user_id'] : $row['user_id'];
}
while ($row = $db->sql_fetchrow($result));

//
// Let's do some checking to make sure that mass mail functions
// are working in win32 versions of php.
//
if (preg_match('/[c-z]:\\\.*/i', getenv('PATH')) && !$board_config['smtp_delivery'])
{
$ini_val = (@phpversion() >= '4.0.0') ? 'ini_get' : 'get_cfg_var';

// We are running on windows, force delivery to use our smtp functions
// since php's are broken by default
$board_config['smtp_delivery'] = 1;
$board_config['smtp_host'] = @$ini_val('SMTP');
}

if (sizeof($bcc_list_ary))
{
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);

$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path']));
$script_name = ($script_name != '') ? $script_name . '/viewtopic.'.$phpEx : 'viewtopic.'.$phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';
$server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) . '/' : '/';

$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);

$emailer->from($board_config['board_email']);
$emailer->replyto($board_config['board_email']);

$topic_title = (count($orig_word)) ? preg_replace($orig_word, $replacement_word, unprepare_message($topic_title)) : unprepare_message($topic_title);

@reset($bcc_list_ary);
while (list($user_lang, $bcc_list) = each($bcc_list_ary))
{
$emailer->use_template('topic_notify', $user_lang);

for ($i = 0; $i < count($bcc_list); $i++)
{
$emailer->bcc($bcc_list[$i]);
}

// The Topic_reply_notification lang string below will be used
// if for some reason the mail template subject cannot be read
// ... note it will not necessarily be in the posters own language!
$emailer->set_subject($lang['Topic_reply_notification']);

// This is a nasty kludge to remove the username var ... till (if?)
// translators update their templates
$emailer->msg = preg_replace('#[ ]?{USERNAME}#', '', $emailer->msg);

$emailer->assign_vars(array(
'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('
', "\n", "-- \n" . $board_config['board_email_sig']) : '',
'SITENAME' => $board_config['sitename'],
'TOPIC_TITLE' => $topic_title,

'U_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_POST_URL . "=$post_id#$post_id",
'U_STOP_WATCHING_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_TOPIC_URL . "=$topic_id&unwatch=topic")
);

$emailer->send();
$emailer->reset();
}
}
}
$db->sql_freeresult($result);

if ($update_watched_sql != '')
{
$sql = "UPDATE " . TOPICS_WATCH_TABLE . "
SET notify_status = " . TOPIC_WATCH_NOTIFIED . "
WHERE topic_id = $topic_id
AND user_id IN ($update_watched_sql)";
$db->sql_query($sql);
}
}

$sql = "SELECT topic_id
FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id = $topic_id
AND user_id = " . $userdata['user_id'];
if (!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not obtain topic watch information', '', __LINE__, __FILE__, $sql);
}

$row = $db->sql_fetchrow($result);

if (!$notify_user && !empty($row['topic_id']))
{
$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id = $topic_id
AND user_id = " . $userdata['user_id'];
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not delete topic watch information', '', __LINE__, __FILE__, $sql);
}
}
else if ($notify_user && empty($row['topic_id']))
{
$sql = "INSERT INTO " . TOPICS_WATCH_TABLE . " (user_id, topic_id, notify_status)
VALUES (" . $userdata['user_id'] . ", $topic_id, 0)";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not insert topic watch information', '', __LINE__, __FILE__, $sql);
}
}
}
}

//
// Fill smiley templates (or just the variables) with smileys
// Either in a window or inline
//
function generate_smilies($mode, $page_id)
{
global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path;
global $user_ip, $session_length, $starttime;
global $userdata;
//-- mod : categories hierarchy ------------------------------------------------
//-- add
global $config, $user, $censored_words, $icons, $navigation, $themes, $smilies;
global $forums, $forum_id;

// fix this missing var
$topic_title = '';
$forum_id = intval($forum_id);
if ( empty($forum_id) )
{
$forum_id = _read(POST_FORUM_URL, TYPE_INT);
}
//-- fin mod : categories hierarchy --------------------------------------------

$inline_columns = 4;
$inline_rows = 5;
$window_columns = 8;

if ($mode == 'window')
{
$userdata = session_pagestart($user_ip, $page_id);
init_userprefs($userdata);

$gen_simple_header = TRUE;

$page_title = $lang['Emoticons'] . " - $topic_title";
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

$template->set_filenames(array(
'smiliesbody' => 'posting_smilies.tpl')
);
}

//-- mod : categories hierarchy ------------------------------------------------
//-- delete
// $sql = "SELECT emoticon, code, smile_url
// FROM " . SMILIES_TABLE . "
// ORDER BY smilies_id";
// if ($result = $db->sql_query($sql))
// {
// $num_smilies = 0;
// $rowset = array();
// while ($row = $db->sql_fetchrow($result))
// {
// if (empty($rowset[$row['smile_url']]))
// {
// $rowset[$row['smile_url']]['code'] = str_replace("'", "\\'", str_replace('\\', '\\\\', $row['code']));
// $rowset[$row['smile_url']]['emoticon'] = $row['emoticon'];
// $num_smilies++;
// }
// }
//-- add
// set a "if (true) {" only for the last "}" at bottom
if ( true )
{
global $smilies;

$data = $smilies->read();
$count_data = count($data);
$rowset = array();
$num_smilies = 0;
for ($i = 0; $i < $count_data; $i++ )
{
$row = $data[$i];
if (empty($rowset[$row['smile_url']]))
{
$rowset[$row['smile_url']]['code'] = str_replace("'", "\\'", str_replace('\\', '\\\\', $row['code']));
$rowset[$row['smile_url']]['emoticon'] = $row['emoticon'];
$num_smilies++;
}
}
//-- fin mod : categories hierarchy --------------------------------------------

if ($num_smilies)
{
$smilies_count = ($mode == 'inline') ? min(19, $num_smilies) : $num_smilies;
$smilies_split_row = ($mode == 'inline') ? $inline_columns - 1 : $window_columns - 1;

$s_colspan = 0;
$row = 0;
$col = 0;

while (list($smile_url, $data) = @each($rowset))
{
if (!$col)
{
$template->assign_block_vars('smilies_row', array());
}

$template->assign_block_vars('smilies_row.smilies_col', array(
'SMILEY_CODE' => $data['code'],
'SMILEY_IMG' => $board_config['smilies_path'] . '/' . $smile_url,
'SMILEY_DESC' => $data['emoticon'])
);

$s_colspan = max($s_colspan, $col + 1);

if ($col == $smilies_split_row)
{
if ($mode == 'inline' && $row == $inline_rows - 1)
{
break;
}
$col = 0;
$row++;
}
else
{
$col++;
}
}

if ($mode == 'inline' && $num_smilies > $inline_rows * $inline_columns)
{
$template->assign_block_vars('switch_smilies_extra', array());

$template->assign_vars(array(
'L_MORE_SMILIES' => $lang['More_emoticons'],
//-- mod : categories hierarchy ------------------------------------------------
//-- delete
// 'U_MORE_SMILIES' => append_sid("posting.$phpEx?mode=smilies"))
// );
//-- add
'U_MORE_SMILIES' => $config->url('posting', array(POST_FORUM_URL => $forum_id, 'mode' => 'smilies'), true),
));
//-- fin mod : categories hierarchy --------------------------------------------
}

$template->assign_vars(array(
'L_EMOTICONS' => $lang['Emoticons'],
'L_CLOSE_WINDOW' => $lang['Close_window'],
'S_SMILIES_COLSPAN' => $s_colspan)
);
}
}

if ($mode == 'window')
{
$template->pparse('smiliesbody');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
}

?>
[/php:1:0a590b7555]

The problem is the last editing it asks you to do..nomatter where I place, still get erros when trying to test post and new topic, sorry dont have the error, will getr it if neccessary


this is the one I cant get to go


#-----[ FIND ]------------------------------------------------
#
$sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
//-- mod : calendar --------------------------------------------------------------------------------
// here we have added
// , topic_calendar_time, topic_calendar_duration
// , $topic_calendar_time, $topic_calendar_duration
// and
// , topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration
//-- modify
#
#-----[ IN-LINE FIND ]----------------------------------------
#
, topic_status, topic_type
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, topic_calendar_time, topic_calendar_duration
#
#-----[ IN-LINE FIND ]----------------------------------------
#
, " . TOPIC_UNLOCKED . ", $topic_type
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, $topic_calendar_time, $topic_calendar_duration
#
#-----[ IN-LINE FIND ]----------------------------------------
#
, topic_type = $topic_type
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration
#
#-----[ AFTER, ADD ]------------------------------------------
#
//-- fin mod : calendar ----------------------------------------------------------------------------
#
#-----[ OPEN ]------------------------------------------------
#


thanks for any input...



Ace I will look into the forum management permissions thing, still new to that and learning it day by day.

That probably explains when I go into say General public and do a test topic, say for a upcoming match, it wont show in calendar, but I first have to get past this edit issue..


Thanks you guys.. :banger:

[CLS]_Airborne328
March 2nd, 2005, 23:37
Ace....

I went through my forum management, and looked up for an example, General Public, I chose Guest and then registered users, however nothing appears to show me a calendar permission,

I then went into management for Private chat, and chose CLS usergroup, then opened up to give permissions and also their nothing to show a calendar topic..

I am doing this in auths management ?right?

[CLS]_Airborne328
March 3rd, 2005, 00:18
Okay, First I am not spamming posts for money.... :roll: :roll:

I went ahead and completed the last "FIND" for functions_post.php,

Then created a Upcoming Calendar Events room, inside "private area".

I started a "test new topic" "scrimmage", and dated it for this sat the 5th.

The error returned is


Error in posting

DEBUG MODE

SQL Error : 1110 Column 'topic_calendar_duration' specified twice

INSERT INTO phpbb_topics (topic_title, topic_icon, topic_duration, topic_first_username, topic_sub_title, topic_calendar_time, topic_calendar_duration, topic_last_username, topic_last_poster, topic_last_time, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_calendar_time, topic_calendar_duration, topic_vote) VALUES ('Test Match', '0', 1109826785, '', '', '0', '0', '', '2', 1109826785, 2, 1109826785, 42, 0, 0, 1110058200, 89999, 0)

Line : 344
File : /var/www/html/forum/includes/functions_post.php


Only when I take out the last "FIND", does the posting error clear up..


Hmmmmmmmmmmmmm

trust me have posted in the support forums for this MOD, I sure am glad I am not holding my breathe, for their is no support for this stuff, whomeevr invented MODS should be :chain_sa: :D

I have to delete that edit now somembers can post, i just wanted you to see the error

Thanks

[CLS]_Airborne328
March 3rd, 2005, 16:20
well after recieving support from phpbb hacks forums, I got this reply


Thoul wrote:
Try changing this line:
Quote:

$sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, " . $db->sql_fields . ", topic_poster, topic_time, forum_id, topic_status, topic_type, topic_calendar_time, topic_calendar_duration, topic_vote) VALUES ('$post_subject', " . $db->sql_values . ", " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_calendar_time, $topic_calendar_duration, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', " . $db->sql_update . ", topic_type = $topic_type, topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";


To this:
Quote:
$sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, " . $db->sql_fields . ", topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $db->sql_values . ", " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', " . $db->sql_update . ", topic_type = $topic_type" . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";



I am not going to question how what where or who :shock: It worked, and no errors now whenposting or creating new topics,


wheww now onto trying to allow events posted.

ACE... I created a room inside private chat and named it Upcoming Events.

I go into that room, and do a test topic with a scrimm on saturday, but still no show.

I go into forums permissions for that room, and see no reference to a calendar for the permissions


??I'm trying bro.....slowly but surely... :banger:

[CLS]_Airborne328
March 3rd, 2005, 16:47
ACE>>>>>

I go into ACP, choose AUTHS/management/then choose Forums and then objects managed, i choose the room I created for posting events, and then open up permissions for "administrators" for test only, all I see is


Authorisations presets
View forum --
Read topics --
Create new topics --
Reply to existing topics --
Edit own posts
Delete own posts
Create stickies --
Create announces --
Create global announces --
Vote --
Can moderate the forum
Is displayed as a forum moderator
Can administrate

Should I NOT see something for allowing calendar evetns for that room.


???

-=DoW=- Acedeal
March 3rd, 2005, 17:55
_Airborne328]well after recieving support from phpbb hacks forums, I got this reply


Thoul wrote:
Try changing this line:
Quote:

$sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, " . $db->sql_fields . ", topic_poster, topic_time, forum_id, topic_status, topic_type, topic_calendar_time, topic_calendar_duration, topic_vote) VALUES ('$post_subject', " . $db->sql_values . ", " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_calendar_time, $topic_calendar_duration, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', " . $db->sql_update . ", topic_type = $topic_type, topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";


To this:
Quote:
$sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, " . $db->sql_fields . ", topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $db->sql_values . ", " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', " . $db->sql_update . ", topic_type = $topic_type" . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";



I am not going to question how what where or who :shock: It worked, and no errors now whenposting or creating new topics,


wheww now onto trying to allow events posted.

ACE... I created a room inside private chat and named it Upcoming Events.

I go into that room, and do a test topic with a scrimm on saturday, but still no show.

I go into forums permissions for that room, and see no reference to a calendar for the permissions


??I'm trying bro.....slowly but surely... :banger:

Thoul is a GOD when it come to phpbb hacks/mods :)

[CLS]_Airborne328
March 3rd, 2005, 19:15
_Airborne328]ACE>>>>>

I go into ACP, choose AUTHS/management/then choose Forums and then objects managed, i choose the room I created for posting events, and then open up permissions for "administrators" for test only, all I see is


Authorisations presets
View forum --
Read topics --
Create new topics --
Reply to existing topics --
Edit own posts
Delete own posts
Create stickies --
Create announces --
Create global announces --
Vote --
Can moderate the forum
Is displayed as a forum moderator
Can administrate

Should I NOT see something for allowing calendar evetns for that room.


???


well this is where i am at now.....