Update of /cvsroot/mxbb/mx_blogs In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv721/mx_blogs Added Files: Weblogs.pak db_install.php db_uninstall.php ljDigitalMultiplex.zip orangeBlue.zip the_blog_mod_v020.txt trackback.php weblog.php weblog_allentries.php weblog_blocked.php weblog_config.php weblog_contributors.php weblog_entry.php weblog_friends.php weblog_posting.php weblog_rss.php weblogs.php Log Message: mx_blogs, Initial checkin --- NEW FILE: weblog_friends.php --- <?php /*************************************************************************** * weblog_friends.php * ------------------------ * begin : Monday, September 5, 2004 * copyright : (C) 2005 Hyperion * email : vi...@ho... * * $Id: weblog_friends.php,v 1.0.0 2004/09/05, 13:17:43 Hyperion 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. * ***************************************************************************/ define('IN_PHPBB', true); define('IN_PORTAL', true); //$phpbb_root_path = './'; $mx_root_path = '../../'; $module_root_path = './'; //include($mx_root_path . 'extension.inc'); $phpEx = substr(strrchr(__FILE__, '.'), 1); include($mx_root_path . 'common.'.$phpEx); include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); // // Start session management // $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); // // End session management // //include($phpbb_root_path . 'includes/weblogs_common.'.$phpEx); include($module_root_path . 'includes/weblogs_constants.'.$phpEx); include($module_root_path . 'includes/weblogs_common.'.$phpEx); // // Start initial var setup // if( isset($HTTP_GET_VARS[POST_USERS_URL]) || isset($HTTP_POST_VARS[POST_USERS_URL]) ) { $user_id = ( isset($HTTP_GET_VARS[POST_USERS_URL]) ) ? intval($HTTP_GET_VARS[POST_USERS_URL]) : intval($HTTP_POST_VARS[POST_USERS_URL]); } else { $user_id = ''; } $user_exists = FALSE; // // Check if the user has actually sent a weblog ID with his/her request // If not give them a nice error page. // if( !empty($user_id) ) { $sql = "SELECT u.*, w.* FROM " . WEBLOGS_TABLE . " w, " . USERS_TABLE . " u WHERE u.user_id = $user_id AND w.weblog_id = u.user_weblog"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain weblogs information.", "", __LINE__, __FILE__, $sql); } } else { mx_message_die(GENERAL_MESSAGE, $lang['User_no_weblog']); } $weblog_data = array(); // // If the query doesn't return any rows this isn't a valid weblog. Inform // the user. // if( !($weblog_data = $db->sql_fetchrow($result)) ) { mx_message_die(GENERAL_MESSAGE, $lang['User_no_weblog']); } if ( $weblog_data['deleted'] ) { mx_message_die(GENERAL_ERROR, sprintf($lang['Weblog_deactivated'], $weblog_data['weblog_name'])); } // Get the user's clearence levels $auth_level = get_auth_level ( $weblog_data, $friends_data, $blocked_data, $weblog_data['user_id'] ); // See if user can see this weblog if ( $weblog_data['weblog_auth'] > $auth_level ) { mx_message_die(GENERAL_ERROR, $lang['Weblog_noaccess']); } // // Check to see if the owner added a friend // if ( $weblog_data['weblog_id'] == $userdata['user_weblog'] && isset($HTTP_POST_VARS['addfriend']) ) { $friend = htmlspecialchars($HTTP_POST_VARS['friend']); // Now, attempt to find a user with such a username $sql = "SELECT username, user_id FROM " . USERS_TABLE . " WHERE username = '$friend'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain username information.", "", __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { $friend_id = $row['user_id']; } else { mx_message_die(GENERAL_ERROR, $lang['User_not_exist'] . '<br /><br />' . sprintf($lang['Click_return_friends'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_friends.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>')); } // See if that friend hasn't already been added $sql = "SELECT * FROM " . WEBLOG_FRIENDS_TABLE . " WHERE friend_id = $friend_id AND owner_id = $user_id"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain friend information.", "", __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { mx_message_die (GENERAL_ERROR, $lang['Friend_already_added'] . '<br /><br />' . sprintf($lang['Click_return_friends'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_friends.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>')); } if ( $friend_id == $userdata['user_id'] ) { mx_message_die (GENERAL_ERROR, $lang['No_friend_owner'] . '<br /><br />' . sprintf($lang['Click_return_friends'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_friends.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>')); } if ( $friend_id == ANONYMOUS ) { mx_message_die (GENERAL_ERROR, $lang['No_friend_guests'] . '<br /><br />' . sprintf($lang['Click_return_blocked'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_blocked.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>')); } // Now insert new friend to friends table $sql = "INSERT INTO " . WEBLOG_FRIENDS_TABLE . " (owner_id, friend_id) VALUES ($user_id, $friend_id)"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain insert friend information.", "", __LINE__, __FILE__, $sql); } mx_message_die (GENERAL_MESSAGE, $lang['Friend_added'] . '<br /><br />' . sprintf($lang['Click_return_friends'], '<a href="' . append_sid($module_root_path . "weblog_friends.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>')); } else if ( $weblog_data['weblog_id'] == $userdata['user_weblog'] && isset($HTTP_POST_VARS['removeuser']) ) { $friend = htmlspecialchars($HTTP_POST_VARS['friend']); // Now, attempt to find a user with such a username $sql = "SELECT username, user_id FROM " . USERS_TABLE . " WHERE username = '$friend'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain username information.", "", __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { $friend_id = $row['user_id']; } else { mx_message_die(GENERAL_ERROR, $lang['User_not_exist'] . '<br /><br />' . sprintf($lang['Click_return_friends'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_friends.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>')); } if ( $userdata['user_id'] == $friend_id ) { mx_message_die(GENERAL_ERROR, $lang['User_no_remove_selffriend']); } // Now, attempt to find a user that is a friend of the owner $sql = "SELECT friend_id FROM " . WEBLOG_FRIENDS_TABLE . " WHERE owner_id = $user_id"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain friend information.", "", __LINE__, __FILE__, $sql); } if (!( $row = $db->sql_fetchrow($result) )) { mx_message_die(GENERAL_ERROR, $lang['User_not_friend'] . '<br /><br />' . sprintf($lang['Click_return_friends'], '<a href="' . append_sid($mx_root_path . "modules/mx_blogs/weblog_friends.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>')); } // Remove the friend :-( $sql = "DELETE FROM " . WEBLOG_FRIENDS_TABLE . " WHERE friend_id = $friend_id AND owner_id = $user_id"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain friend information.", "", __LINE__, __FILE__, $sql); } mx_message_die (GENERAL_MESSAGE, $lang['Friend_removed'] . '<br /><br />' . sprintf($lang['Click_return_friends'], '<a href="' . append_sid($mx_root_path . "modules/mx_blogs/weblog_friends.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>') ); } $template_dir = get_template_dir ($weblog_data['template_id']); $page_title = $weblog_data['weblog_name'] . ' :: ' . sprintf($lang['Friends'], $weblog_data['username']); // // Start output of page // use_weblog_header ( $weblog_data, $template_dir); $template->set_filenames(array( 'body' => $module_root_path . '/weblogs/templates/' . $template_dir . '/weblog_friends_body.htm') ); // // Get the moods data // $sql = "SELECT * FROM " . WEBLOG_MOODS_TABLE . " ORDER BY mood_text"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain mood data from database", "", __LINE__, __FILE__, $sql); } $mood_data = $db->sql_fetchrowset($result); // // Get the actions data // $sql = "SELECT * FROM " . WEBLOG_ACTIONS_TABLE . " ORDER BY action_text"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain action data from database", "", __LINE__, __FILE__, $sql); } $action_data = $db->sql_fetchrowset($result); // // Get this user's friends data // $sql = "SELECT f.friend_id, u.*, w.* FROM " . WEBLOG_FRIENDS_TABLE . " f, " . USERS_TABLE . " u, " . WEBLOGS_TABLE . " w WHERE f.owner_id = $user_id AND f.friend_id = u.user_id AND w.weblog_id = u.user_weblog"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain friends information.", "", __LINE__, __FILE__, $sql); } $friend_data = array(); while ( $row = $db->sql_fetchrow($result) ) { $friend_data[] = $row; } for ( $i = 0; $i < count($friend_data); $i++ ) { $auth_level2 = get_auth_level ( $friend_data[$i], $friends_data, $blocked_data, $friend_data[$i]['user_id'] ); $friend_entry_data = array(); if ( $friend_data[$i]['weblog_auth'] <= $auth_level2 ) { // Do a second query to find the latest entry, replies, etc. $sql = "SELECT * FROM " . WEBLOG_ENTRIES_TABLE . " WHERE weblog_id = " . $friend_data[$i]['weblog_id'] . " AND entry_access <= $auth_level2 AND entry_deleted <> " . TRUE . " ORDER BY entry_time DESC LIMIT 1"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain friends entry information.", "", __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { $friend_entry_data = $row; } // // Ok now prepare the data and output it // // Prepare Avatar Image $avatar_img = ''; if ( $friend_data[$i]['user_avatar_type'] && $friend_data[$i]['user_allowavatar'] ) { switch( $friend_data[$i]['user_avatar_type'] ) { case USER_AVATAR_UPLOAD: $avatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $phpbb_root_path . $board_config['avatar_path'] . '/' . $friend_data[$i]['user_avatar'] . '" alt="" border="0" />' : ''; break; case USER_AVATAR_REMOTE: $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $friend_data[$i]['user_avatar'] . '" alt="" border="0" />' : ''; break; case USER_AVATAR_GALLERY: $avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' .$phpbb_root_path . $board_config['avatar_gallery_path'] . '/' . $friend_data[$i]['user_avatar'] . '" alt="" border="0" />' : ''; break; } } // // Prepare the latest entry // $friend_entry_data['entry_text'] = htmlspecialchars($friend_entry_data['entry_text']); // BBCode if ( $friend_entry_data['enable_bbcode'] ) { $friend_entry_data['entry_text'] = bbencode_second_pass($friend_entry_data['entry_text'], $friend_entry_data['bbcode_uid']); } // Smilies if ( $friend_entry_data['enable_smilies'] ) { $friend_entry_data['entry_text'] = smilies_pass($friend_entry_data['entry_text']); } $friend_entry_data['entry_text'] = make_clickable($friend_entry_data['entry_text']); if ( !$weblog_config['censor_weblog'] ) { // Define censored word matches $orig_word = array(); $replacement_word = array(); obtain_word_list($orig_word, $replacement_word); // Censor text and title if (count($orig_word)) { $friend_entry_data['entry_subject'] = preg_replace($orig_word, $replacement_word, $friend_entry_data['entry_subject']); $friend_entry_data['entry_text'] = preg_replace($orig_word, $replacement_word, $friend_entry_data['entry_text']); } } $friend_entry_data['entry_text'] = nl2br($friend_entry_data['entry_text']); // Mood Icons $mood = array(); $mood = find_mood($friend_entry_data['entry_mood']); if ( $mood >= 0 ) { $mood = '<strong>[</strong> ' . sprintf($lang['Mood:'], '<img src="modules/mx_blogs/images/weblogs/' . $mood['mood_url'] . '" alt="' . $mood['mood_text'] . '" style="vertical-align: middle" border="0" />', $mood['mood_text']) . ' <strong>]</strong>'; } else { $mood = ''; } // Currently Icons $currently = array(); $currently = find_action($friend_entry_data['entry_currently']); if ( $currently > 0 ) { $action = '<strong>[</strong> ' . sprintf($lang['Currently:'], '<img src="modules/mx_blogs/images/weblogs/' . $currently['action_url'] . '" alt="' . $currently['action_text'] . ' ' . $entry_data[$i]['currently_text'] . '" style="vertical-align: middle" border="0" />', $currently['action_text'] . ' ' . $entry_data[$i]['currently_text']) . ' <strong>]</strong>'; } else if ( $entry_data[$i]['currently_text'] && $currently == -2 ) { $action = '<strong>[</strong>' . sprintf($lang['Currently:'], '', $entry_data[$i]['currently_text']) . ' <strong>]</strong>'; } else { $action = ''; } $time = create_date($board_config['default_dateformat'], $friend_entry_data['entry_time'], $board_config['board_timezone']); if ( $friend_data[$i]['font'] == '0' ) $font = 'Arial'; else if ( $friend_data[$i]['font'] == '1' ) $font = 'Comic Sans MS'; else if ( $friend_data[$i]['font'] == '2' ) $font = 'Courier New'; else if ( $friend_data[$i]['font'] == '3' ) $font = 'Georgia'; else if ( $friend_data[$i]['font'] == '4' ) $font = 'Verdana'; else if ( $friend_data[$i]['font'] == '5' ) $font = 'Times New Roman'; else if ( $friend_data[$i]['font'] == '6' ) $font = 'Trebuchet'; else $font = 'Verdana'; $template->assign_block_vars('friendsrow', array( 'ID' => 'friend' . $i, 'BACKGROUND_COLOR' => $friend_data[$i]['background_color'], 'ENTRY_BG_COLOR' => $friend_data[$i]['entry_bg_color'], 'BORDER_COLOR' => $friend_data[$i]['border_color'], 'BACKGROUND_IMAGE' => $friend_data[$i]['background_image'], 'BACKGROUND_IMAGE_FIXED' => ( $friend_data[$i]['background_image_fixed'] ) ? 'fixed' : 'scroll', 'BACKGROUND_REPEAT' => $friend_data[$i]['tile_bg'], 'BACKGROUND_POSITION' => $friend_data[$i]['bg_ypos'] . ' ' . $friend_data[$i]['bg_xpos'], 'SB_FACE_COLOR' => $friend_data[$i]['sb_face_color'], 'SB_HIGHLIGHT_COLOR' => $friend_data[$i]['sb_highlight_color'], 'SB_SHADOW_COLOR' => $friend_data[$i]['sb_shadow_color'], 'SB_3DLIGHT_COLOR' => $friend_data[$i]['sb_3dlight_color'], 'SB_ARROW_COLOR' => $friend_data[$i]['sb_arrow_color'], 'SB_TRACK_COLOR' => $friend_data[$i]['sb_track_color'], 'SB_DARKSHADOW_COLOR' => $friend_data[$i]['sb_darkshadow_color'], 'FONT' => $font, 'FONT_COLOR' => $friend_data[$i]['font_color'], 'FONT_SIZE' => $friend_data[$i]['font_size'], 'NORMAL_LINK_COLOR' => $friend_data[$i]['normal_link_color'], 'NORMAL_LINK_UNDERLINED' => ( $friend_data[$i]['normal_link_underline'] ) ? 'underline' : 'none', 'ACTIVE_LINK_COLOR' => $friend_data[$i]['active_link_color'], 'ACTIVE_LINK_UNDERLINED' => ( $friend_data[$i]['active_link_underline'] ) ? 'underline': 'none', 'HOVER_LINK_COLOR' => $friend_data[$i]['hover_link_color'], 'HOVER_LINK_UNDERLINED' => ( $friend_data[$i]['hover_link_underline'] ) ? 'underline': 'none', 'VISITED_LINK_COLOR' => $friend_data[$i]['visited_link_color'], 'VISITED_LINK_UNDERLINED' => ( $friend_data[$i]['visited_link_underline'] ) ? 'underline': 'none', 'WEBLOG_TITLE_COLOR' => $friend_data[$i]['weblog_title_color'], 'WEBLOG_TITLE_FONT_SIZE' => $friend_data[$i]['weblog_title_font_size'], 'ENTRY_TITLE_COLOR' => $friend_data[$i]['entry_title_color'], 'ENTRY_TITLE_FONT_SIZE' => $friend_data[$i]['entry_title_font_size'], 'DATE_TIME_COLOR' => $friend_data[$i]['date_time_color'], 'DATE_TIME_FONT_SIZE' => $friend_data[$i]['date_time_font_size'], 'BLOCK_TITLE_COLOR' => $friend_data[$i]['block_title_color'], 'BLOCK_TITLE_FONT_SIZE' => $friend_data[$i]['block_title_font_size'], 'BLOCK_BG_COLOR' => $friend_data[$i]['block_bg_color'], 'BLOCK_BORDER_COLOR' => $friend_data[$i]['block_border_color'], 'AVATAR_IMG' => $avatar_img, 'U_WEBLOG' => append_sid($mx_root_path . "modules/mx_blogs/weblog.$phpEx?" . POST_WEBLOG_URL . "=" . $friend_data[$i]['weblog_id']), 'WEBLOG_NAME' => $friend_data[$i]['weblog_name'], 'U_PROFILE' => append_sid($phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $friend_data[$i]['user_id']), 'FRIEND' => $friend_data[$i]['username'], 'SUBJECT' => $friend_entry_data['entry_subject'], 'ENTRY' => ( $friend_entry_data['entry_text'] ) ? $friend_entry_data['entry_text'] : '(' . $lang['No_entries'] . ')', 'TIME_DATE' => ( $friend_entry_data['entry_time'] ) ? $time : '', 'MOOD' => $mood, 'CURRENTLY' => $action, 'POST_COMMENT' => ( !$friend_entry_data['no_replies'] && $friend_entry_data['entry_text'] ) ? sprintf($friend_data[$i]['post_reply_text'], $friend_entry_data['entry_replies']) : '', 'REPLIES' => ( !$friend_entry_data['no_replies'] && $friend_entry_data['entry_text'] ) ? sprintf($friend_data[$i]['replies_text'], $friend_entry_data['entry_replies']) : '', 'U_VIEW_COMMENTS' => ( !$friend_entry_data['no_replies'] ) ? append_sid($mx_root_path . 'modules/mx_blogs/weblog_entry.' . $phpEx . '?' . POST_ENTRY_URL . '=' . $friend_entry_data['entry_id']) : '', 'U_POST_COMMENT' => ( !$friend_entry_data['no_replies'] ) ? append_sid($mx_root_path . 'modules/mx_blogs/weblog_posting.' . $phpEx . '?mode=reply&' . POST_ENTRY_URL . '=' . $friend_entry_data['entry_id']) : '') ); } } // // Query the users who have this user as a friend // $sql = "SELECT u.username, u.user_id FROM " . WEBLOG_FRIENDS_TABLE . " f, " . USERS_TABLE . " u WHERE u.user_id = f.owner_id AND f.friend_id = $user_id"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't get friend of information.", "", __LINE__, __FILE__, $sql); } while ( $row = $db->sql_fetchrow($result) ) { $template->assign_block_vars('friendofrow', array( 'U_PROFILE' => append_sid($phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']), 'FRIEND' => $row['username']) ); } // // Query the users who this user has added as a friend // $sql = "SELECT u.username, u.user_id FROM " . WEBLOG_FRIENDS_TABLE . " f, " . USERS_TABLE . " u WHERE u.user_id = f.friend_id AND f.owner_id = $user_id"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't get friend of information.", "", __LINE__, __FILE__, $sql); } while ( $row = $db->sql_fetchrow($result) ) { $template->assign_block_vars('friendrow', array( 'U_PROFILE' => append_sid($phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']), 'FRIEND' => $row['username']) ); } if ( $userdata['user_id'] == $user_id ) { $template->assign_block_vars('switch_owner', array()); } // // Generate page // $template->assign_vars(array( 'L_WEBLOG_FRIENDS' => sprintf($lang['Friends'], $weblog_data['username']), 'L_FRIENDS' => $lang['Friends_list'], 'L_FRIEND_OF' => $lang['Friend_of'], 'L_REMOVE_USER' => $lang['Remove_user'], 'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']), 'L_WEBLOGS' => $lang['Weblogs'], 'L_ADD_FRIEND' => $lang['Add_friend'], 'U_INDEX' => append_sid($mx_root_path . 'index.'.$phpEx), 'U_WEBLOGS' => append_sid($mx_root_path . "index.$phpEx?page=". $weblog_config['mx_weblog_list']), 'U_WEBLOG' => append_sid($mx_root_path . "modules/mx_blogs/weblog.$phpEx?" . POST_WEBLOG_URL . "=" . $weblog_data['weblog_id']), 'S_ADDFRIENDS_ACTION' => append_sid($mx_root_path . "modules/mx_blogs/weblog_friends.$phpEx?" . POST_USERS_URL . "=$user_id"), 'WEBLOG_NAME' => $weblog_data['weblog_name']) ); // // Output the body // $template->pparse('body'); $template->assign_vars(array( 'L_POWERED_BY' => sprintf($lang['Weblog_powered_by'], WEBLOGS_MOD_VERSION)) ); // // Output the footer // use_weblog_footer ($weblog_data, $template_dir); ?> --- NEW FILE: weblog_posting.php --- <?php /*************************************************************************** * weblog_posting.php * ------------------------ * begin : Monday, September 5, 2004 * copyright : (C) 2005 Hyperion * email : vi...@ho... * * $Id: weblog_posting.php,v 1.0.0 2004/09/05, 13:17:43 Hyperion 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. * [...1728 lines suppressed...] 'S_BBCODE_CHECKED' => ( !$bbcode_on ) ? 'checked="checked"' : '', 'S_SMILIES_CHECKED' => ( !$smilies_on ) ? 'checked="checked"' : '', 'S_SIGNATURE_CHECKED' => ( $attach_sig ) ? 'checked="checked"' : '', 'S_MEMORABLE_CHECKED' => ( $memorable ) ? 'checked="checked"' : '', 'S_DISABLE_REPLIES_CHECKED' => ( $disable_replies ) ? 'checked="checked"' : '', 'S_POST_ACTION' => append_sid($mx_root_path . "modules/mx_blogs/weblog_posting.$phpEx"), 'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields) ); $template->pparse('body'); $template->assign_vars(array( 'L_POWERED_BY' => sprintf($lang['Weblog_powered_by'], WEBLOGS_MOD_VERSION)) ); use_weblog_footer ( $weblog_data, $template_dir ); ?> --- NEW FILE: weblog_contributors.php --- <?php /*************************************************************************** * weblog_contributors.php * ----------------------------- * begin : Monday, September 5, 2004 * copyright : (C) 2005 Hyperion * email : vi...@ho... * * $Id: weblog_contributors.php,v 1.0.0 2004/09/05, 13:17:43 Hyperion 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. * ***************************************************************************/ define('IN_PHPBB', true); define('IN_PORTAL',true); //$phpbb_root_path = './'; $mx_root_path = '../../'; $module_root_path = './'; //include($phpbb_root_path . 'extension.inc'); //include($phpbb_root_path . 'common.'.$phpEx); //include($phpbb_root_path . 'includes/weblogs_common.'.$phpEx); //include($mx_root_path . 'extension.inc'); $phpEx = substr(strrchr(__FILE__, '.'), 1); include($mx_root_path . 'common.'.$phpEx); // // Start session management // $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); // // End session management // include($module_root_path . 'includes/weblogs_constants.'.$phpEx); include($module_root_path . 'includes/weblogs_common.'.$phpEx); // // Start initial var setup // if( isset($HTTP_GET_VARS[POST_WEBLOG_URL]) || isset($HTTP_POST_VARS[POST_WEBLOG_URL]) ) { $weblog_id = ( isset($HTTP_GET_VARS[POST_WEBLOG_URL]) ) ? intval($HTTP_GET_VARS[POST_WEBLOG_URL]) : intval($HTTP_POST_VARS[POST_WEBLOG_URL]); } else { $weblog_id = 0; } $user_exists = FALSE; // // Make sure that the weblog exists // if ( $weblog_id ) { $sql = "SELECT w.* FROM " . WEBLOGS_TABLE . " w WHERE w.weblog_id = $weblog_id"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain weblogs information.", "", __LINE__, __FILE__, $sql); } if ( !($weblog_data = $db->sql_fetchrow($result)) ) { mx_message_die(GENERAL_ERROR, 'Weblog_not_exist'); } } else { mx_message_die(GENERAL_MESSAGE, 'Weblog_not_exist'); } if ( $weblog_data['deleted'] ) { mx_message_die(GENERAL_ERROR, sprintf($lang['Weblog_deactivated'], $weblog_data['weblog_name'])); } // // Check to see if the owner added a user to the blocked list // if ( $userdata['user_weblog'] == $weblog_id && isset($HTTP_POST_VARS['addcontributor']) ) { $contributor_user = htmlspecialchars($HTTP_POST_VARS['contributoruser']); // Now, attempt to find a user with such a username $sql = "SELECT username, user_id FROM " . USERS_TABLE . " WHERE username = '" . str_replace("\'", "''", $contributor_user) . "'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain username information.", "", __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { $user_id = $row['user_id']; } else { mx_message_die(GENERAL_ERROR, $lang['User_not_exist'] . '<br /><br />' . sprintf($lang['Click_return_contributors'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_contributors.$phpEx?" . POST_WEBLOG_URL . "=$weblog_id") . '">', '</a>')); } // See if that contributor hasn't already been added $sql = "SELECT * FROM " . WEBLOG_CONTRIBUTORS_TABLE . " WHERE user_id = $user_id AND weblog_id = $weblog_id"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain contributor information.", "", __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { mx_message_die (GENERAL_ERROR, $lang['Contributor_already_added'] . '<br /><br />' . sprintf($lang['Click_return_contributors'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_contributors.$phpEx?" . POST_WEBLOG_URL . "=$weblog_id") . '">', '</a>')); } if ( $contributor_user == $userdata['username'] ) { mx_message_die (GENERAL_ERROR, $lang['No_contributor_owner'] . '<br /><br />' . sprintf($lang['Click_return_contributors'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_contributors.$phpEx?" . POST_WEBLOG_URL . "=$weblog_id") . '">', '</a>')); } if ( $contributor_user == ANONYMOUS ) { mx_message_die (GENERAL_ERROR, $lang['No_guest_contributors'] . '<br /><br />' . sprintf($lang['Click_return_contributors'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_contributors.$phpEx?" . POST_WEBLOG_URL . "=$weblog_id") . '">', '</a>')); } // Now insert new user to contributor table $sql = "INSERT INTO " . WEBLOG_CONTRIBUTORS_TABLE . " (user_id, weblog_id) VALUES ($user_id, $weblog_id)"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain insert contributor information.", "", __LINE__, __FILE__, $sql); } mx_message_die (GENERAL_MESSAGE, $lang['Contributor_added'] . '<br /><br />' . sprintf($lang['Click_return_contributors'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_contributors.$phpEx?" . POST_WEBLOG_URL . "=$weblog_id") . '">', '</a>')); } else if ( $userdata['user_weblog'] == $weblog_id && isset($HTTP_POST_VARS['removecontributor']) ) { $contributor_user = htmlspecialchars($HTTP_POST_VARS['contributoruser']); // Now, attempt to find a user with such a username $sql = "SELECT username, user_id FROM " . USERS_TABLE . " WHERE username = '" . str_replace("\'", "''", $contributor_user) . "'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain username information.", "", __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { $user_id = $row['user_id']; } else { mx_message_die(GENERAL_ERROR, $lang['User_not_exist'] . '<br /><br />' . sprintf($lang['Click_return_contributors'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_contributors.$phpEx?" . POST_WEBLOG_URL . "=$weblog_id") . '">', '</a>')); } if ( $userdata['username'] == $contributor_user ) { mx_message_die(GENERAL_ERROR, $lang['User_no_remove_selfcontributor']); } // Now, attempt to find a user that is a friend of the owner $sql = "SELECT user_id FROM " . WEBLOG_CONTRIBUTORS_TABLE . " WHERE weblog_id = $weblog_id"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain contributor information.", "", __LINE__, __FILE__, $sql); } if (!( $row = $db->sql_fetchrow($result) )) { mx_message_die(GENERAL_ERROR, $lang['User_not_contributor'] . '<br /><br />' . sprintf($lang['Click_return_contributors'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_contributors.$phpEx?" . POST_WEBLOG_URL . "=$weblog_id") . '">', '</a>')); } // Remove the contributor $sql = "DELETE FROM " . WEBLOG_CONTRIBUTORS_TABLE . " WHERE user_id = $user_id AND weblog_id = $weblog_id"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't delete contributor information.", "", __LINE__, __FILE__, $sql); } mx_message_die (GENERAL_MESSAGE, $lang['Contributor_removed'] . '<br /><br />' . sprintf($lang['Click_return_contributors'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_contributors.$phpEx?" . POST_WEBLOG_URL . "=$weblog_id") . '">', '</a>') ); } $template_dir = get_template_dir ($weblog_data['template_id']); $page_title = $weblog_data['weblog_name'] . ' :: ' . $lang['Contributors']; // // Start output of page // use_weblog_header ( $weblog_data, $template_dir ); $template->set_filenames(array( 'body' => $module_root_path . 'weblogs/templates/' . $template_dir . '/weblog_contributors_body.htm') ); if ( $weblog_data['font'] == '0' ) $font = 'Arial'; else if ( $weblog_data['font'] == '1' ) $font = 'Comic Sans MS'; else if ( $weblog_data['font'] == '2' ) $font = 'Courier New'; else if ( $weblog_data['font'] == '3' ) $font = 'Georgia'; else if ( $weblog_data['font'] == '4' ) $font = 'Verdana'; else if ( $weblog_data['font'] == '5' ) $font = 'Times New Roman'; else if ( $weblog_data['font'] == '6' ) $font = 'Trebuchet'; else $font = 'Verdana'; $template->assign_vars(array( 'BACKGROUND_COLOR' => $weblog_data['background_color'], 'ENTRY_BG_COLOR' => $weblog_data['entry_bg_color'], 'BORDER_COLOR' => $weblog_data['border_color'], 'BACKGROUND_IMAGE' => $weblog_data['background_image'], 'BACKGROUND_IMAGE_FIXED' => ( $weblog_data['background_image_fixed'] ) ? 'fixed' : 'scroll', 'BACKGROUND_REPEAT' => $weblog_data['tile_bg'], 'BACKGROUND_POSITION' => $weblog_data['bg_ypos'] . ' ' . $weblog_data['bg_xpos'], 'SB_FACE_COLOR' => $weblog_data['sb_face_color'], 'SB_HIGHLIGHT_COLOR' => $weblog_data['sb_highlight_color'], 'SB_SHADOW_COLOR' => $weblog_data['sb_shadow_color'], 'SB_3DLIGHT_COLOR' => $weblog_data['sb_3dlight_color'], 'SB_ARROW_COLOR' => $weblog_data['sb_arrow_color'], 'SB_TRACK_COLOR' => $weblog_data['sb_track_color'], 'SB_DARKSHADOW_COLOR' => $weblog_data['sb_darkshadow_color'], 'FONT' => $font, 'FONT_COLOR' => $weblog_data['font_color'], 'FONT_SIZE' => $weblog_data['font_size'], 'NORMAL_LINK_COLOR' => $weblog_data['normal_link_color'], 'NORMAL_LINK_UNDERLINED' => ( $weblog_data['normal_link_underline'] ) ? 'underline' : 'none', 'ACTIVE_LINK_COLOR' => $weblog_data['active_link_color'], 'ACTIVE_LINK_UNDERLINED' => ( $weblog_data['active_link_underline'] ) ? 'underline': 'none', 'HOVER_LINK_COLOR' => $weblog_data['hover_link_color'], 'HOVER_LINK_UNDERLINED' => ( $weblog_data['hover_link_underline'] ) ? 'underline': 'none', 'VISITED_LINK_COLOR' => $weblog_data['visited_link_color'], 'VISITED_LINK_UNDERLINED' => ( $weblog_data['visited_link_underline'] ) ? 'underline': 'none', 'WEBLOG_TITLE_COLOR' => $weblog_data['weblog_title_color'], 'WEBLOG_TITLE_FONT_SIZE' => $weblog_data['weblog_title_font_size'], 'ENTRY_TITLE_COLOR' => $weblog_data['entry_title_color'], 'ENTRY_TITLE_FONT_SIZE' => $weblog_data['entry_title_font_size'], 'DATE_TIME_COLOR' => $weblog_data['date_time_color'], 'DATE_TIME_FONT_SIZE' => $weblog_data['date_time_font_size'], 'BLOCK_TITLE_COLOR' => $weblog_data['block_title_color'], 'BLOCK_TITLE_FONT_SIZE' => $weblog_data['block_title_font_size'], 'BLOCK_BG_COLOR' => $weblog_data['block_bg_color'], 'BLOCK_BORDER_COLOR' => $weblog_data['block_border_color']) ); // // Parse the header // $template->pparse('header'); // // Find the users that are contributors // $sql = "SELECT u.username, u.user_id, c.user_id FROM " . WEBLOG_CONTRIBUTORS_TABLE . " c, " . USERS_TABLE . " u WHERE c.weblog_id = $weblog_id AND u.user_id = c.user_id"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't get contributors information.", "", __LINE__, __FILE__, $sql); } while ( $row = $db->sql_fetchrow($result) ) { $template->assign_block_vars('contribrow', array( 'U_PROFILE' => append_sid($phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']), 'CONTRIBUTOR' => $row['username']) ); } // // Generate page // $template->assign_vars(array( 'L_CONTRIBUTORS' => $lang['Contributors'], 'L_CURRENT_CONTRIBUTORS' => $lang['Current_contributors'], 'L_REMOVE_CONTRIBUTOR' => $lang['Remove_contributor'], 'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']), 'L_WEBLOGS' => $lang['Weblogs'], 'L_ADD_CONTRIBUTOR' => $lang['Add_contributor'], 'U_INDEX' => append_sid($mx_root_path . 'index.'.$phpEx), 'U_WEBLOGS' => append_sid($mx_root_path . "index.$phpEx?page=" . $weblog_config['mx_weblog_list']), 'U_WEBLOG' => append_sid($mx_root_path . "modules/mx_blogs/weblog.$phpEx?" . POST_WEBLOG_URL . "=" . $weblog_data['weblog_id']), 'S_CONTRIBUTOR_ACTION' => append_sid($mx_root_path . "modules/mx_blogs/weblog_contributors.$phpEx?" . POST_WEBLOG_URL . "=$weblog_id"), 'WEBLOG_NAME' => $weblog_data['weblog_name']) ); // // Output the body // $template->pparse('body'); $template->assign_vars(array( 'L_POWERED_BY' => sprintf($lang['Weblog_powered_by'], WEBLOGS_MOD_VERSION)) ); // // Output the footer // use_weblog_footer ( $weblog_data, $template_dir); ?> --- NEW FILE: ljDigitalMultiplex.zip --- (This appears to be a binary file; contents omitted.) --- NEW FILE: weblog_entry.php --- <?php /*************************************************************************** * weblog_entry.php * ---------------------- * begin : Monday, September 5, 2004 * copyright : (C) 2005 Hyperion * email : vi...@ho... * * $Id: weblog_entry.php,v 1.0.0 2004/09/05, 13:17:43 Hyperion 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. * [...1020 lines suppressed...] 'WEBLOG_TITLE_COLOR' => $weblog_entry_data['weblog_title_color'], 'WEBLOG_TITLE_FONT_SIZE' => $weblog_entry_data['weblog_title_font_size'], 'ENTRY_TITLE_COLOR' => $weblog_entry_data['entry_title_color'], 'ENTRY_TITLE_FONT_SIZE' => $weblog_entry_data['entry_title_font_size'], 'DATE_TIME_COLOR' => $weblog_entry_data['date_time_color'], 'DATE_TIME_FONT_SIZE' => $weblog_entry_data['date_time_font_size'], 'BLOCK_TITLE_COLOR' => $weblog_entry_data['block_title_color'], 'BLOCK_TITLE_FONT_SIZE' => $weblog_entry_data['block_title_font_size'], 'BLOCK_BG_COLOR' => $weblog_entry_data['block_bg_color'], 'BLOCK_BORDER_COLOR' => $weblog_entry_data['block_border_color']) ); // // Parse the page and print // $template->pparse('body'); use_weblog_footer ( $weblog_entry_data, $template_dir ); ?> --- NEW FILE: weblog_config.php --- <?php /*************************************************************************** * weblog_config.php * ----------------------- * begin : Monday, September 5, 2004 * copyright : (C) 2005 Hyperion * email : vi...@ho... * * $Id: weblog_config.php,v 1.0.0 2004/09/05, 13:17:43 Hyperion 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. * [...974 lines suppressed...] 'TEMPLATE_SELECT' => make_template_select ( $template_id , 'template_select', $weblog_exists ), 'MOOD_SET_SELECT' => make_mood_set_select ( $weblog_data['mood_set'], 'mood_set_select'), 'WEBLOG_AUTH_SELECT' => make_weblog_auth_select ( $weblog_data['weblog_auth'], 'weblog_auth_select'), 'REPLIES_AUTH_SELECT' => make_weblog_auth_select ( $weblog_data['replies_auth'], 'replies_auth_select'), 'S_WEBLOG_FACEPLATE' => htmlentities($weblog_faceplate), 'S_WEBLOG_BODY' => htmlentities($weblog_body), 'S_FORM_ACTION' => append_sid($HTTP_SERVER_VARS['PHP_SELF'])) ); $template->pparse("body"); $template->assign_vars(array( 'L_POWERED_BY' => sprintf($lang['Weblog_powered_by'], WEBLOGS_MOD_VERSION)) ); //include($phpbb_root_path . 'includes/page_tail.'.$phpEx); include($mx_root_path . 'includes/page_tail.'.$phpEx); ?> --- NEW FILE: weblog_blocked.php --- <?php /*************************************************************************** * weblog_blocked.php * ------------------------ * begin : Monday, September 5, 2004 * copyright : (C) 2005 Hyperion * email : vi...@ho... * * $Id: weblog_blocked.php,v 1.0.0 2004/09/05, 13:17:43 Hyperion 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. * ***************************************************************************/ define('IN_PHPBB', true); define('IN_PORTAL', true); //$phpbb_root_path = './'; $mx_root_path = '../../'; $module_root_path = './'; //include($phpbb_root_path . 'extension.inc'); //include($phpbb_root_path . 'common.'.$phpEx); //include($phpbb_root_path . 'includes/weblogs_common.'.$phpEx); //include($mx_root_path . 'extension.inc'); $phpEx = substr(strrchr(__FILE__, '.'), 1); include($mx_root_path . 'common.'.$phpEx); // // Start session management // //$userdata = session_pagestart($user_ip, PAGE_INDEX); //init_userprefs($userdata); $mx_user->init($user_ip, PAGE_INDEX); // // End session management // include($mx_root_path . 'modules/mx_blogs/includes/weblogs_constants.'.$phpEx); include($mx_root_path . 'modules/mx_blogs/includes/weblogs_common.'.$phpEx); // // Start initial var setup // if( isset($HTTP_GET_VARS[POST_USERS_URL]) || isset($HTTP_POST_VARS[POST_USERS_URL]) ) { $user_id = ( isset($HTTP_GET_VARS[POST_USERS_URL]) ) ? intval($HTTP_GET_VARS[POST_USERS_URL]) : intval($HTTP_POST_VARS[POST_USERS_URL]); } else { $user_id = 0; } $user_exists = FALSE; // // Make sure that the user requested exists, has a weblog, and is not a guest // if ( $user_id != ANONYMOUS ) { $sql = "SELECT w.*, u.* FROM " . WEBLOGS_TABLE . " w, " . USERS_TABLE . " u WHERE w.weblog_id = u.user_weblog AND u.user_id = $user_id"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain weblogs information.", "", __LINE__, __FILE__, $sql); } if ( $weblog_data = $db->sql_fetchrow($result) ) { $user_exists = TRUE; } else { mx_message_die(GENERAL_ERROR, $lang['User_no_weblog']); } } else { mx_message_die(GENERAL_MESSAGE, $lang['User_not_exist']); } // See if user can see this blocked list if ( $user_id != $userdata['user_id'] ) { mx_message_die(GENERAL_ERROR, $lang['Weblog_noaccess_blocked']); } if ( $weblog_data['deleted'] ) { mx_message_die(GENERAL_ERROR, sprintf($lang['Weblog_deactivated'], $weblog_data['weblog_name'])); } // // Check to see if the owner added a user to the blocked list // if ( $userdata['user_id'] == $user_id && isset($HTTP_POST_VARS['blockuser']) ) { $blocked_user = htmlspecialchars($HTTP_POST_VARS['blockeduser']); // Now, attempt to find a user with such a username $sql = "SELECT username, user_id FROM " . USERS_TABLE . " WHERE username = '$blocked_user'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain username information.", "", __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { $blocked_id = $row['user_id']; } else { mx_message_die(GENERAL_ERROR, $lang['User_not_exist'] . '<br /><br />' . sprintf($lang['Click_return_blocked'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_blocked.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>')); } // See if that blocked user hasn't already been added $sql = "SELECT * FROM " . WEBLOG_BLOCKED_TABLE . " WHERE blocked_id = $blocked_id AND owner_id = $user_id"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain blocked user information.", "", __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { mx_message_die (GENERAL_ERROR, $lang['Blocked_already_added'] . '<br /><br />' . sprintf($lang['Click_return_blocked'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_blocked.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>')); } if ( $blocked_id == $user_id ) { mx_message_die (GENERAL_ERROR, $lang['No_block_owner'] . '<br /><br />' . sprintf($lang['Click_return_blocked'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_blocked.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>')); } if ( $blocked_id == ANONYMOUS ) { mx_message_die (GENERAL_ERROR, $lang['No_block_guests'] . '<br /><br />' . sprintf($lang['Click_return_blocked'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_blocked.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>')); } // Now insert new user to blocked table $sql = "INSERT INTO " . WEBLOG_BLOCKED_TABLE . " (owner_id, blocked_id) VALUES ($user_id, $blocked_id)"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain insert blocked user information.", "", __LINE__, __FILE__, $sql); } mx_message_die (GENERAL_MESSAGE, $lang['Blocked_user_added'] . '<br /><br />' . sprintf($lang['Click_return_blocked'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_blocked.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>')); } else if ( $userdata['user_id'] == $user_id && isset($HTTP_POST_VARS['removeuser']) ) { $blocked_user = htmlspecialchars($HTTP_POST_VARS['blockeduser']); // Now, attempt to find a user with such a username $sql = "SELECT username, user_id FROM " . USERS_TABLE . " WHERE username = '$blocked_user'"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain username information.", "", __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { $blocked_id = $row['user_id']; } else { mx_message_die(GENERAL_ERROR, $lang['User_not_exist'] . '<br /><br />' . sprintf($lang['Click_return_blocked'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_blocked.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>')); } if ( $user_id == $friend_id ) { mx_message_die(GENERAL_ERROR, $lang['User_no_remove_selfblocked']); } // Now, attempt to find a user that is a friend of the owner $sql = "SELECT blocked_id FROM " . WEBLOG_BLOCKED_TABLE . " WHERE owner_id = $user_id"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain blocked user information.", "", __LINE__, __FILE__, $sql); } if (!( $row = $db->sql_fetchrow($result) )) { mx_message_die(GENERAL_ERROR, $lang['User_not_blocked'] . '<br /><br />' . sprintf($lang['Click_return_blocked'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_blocked.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>')); } // Remove the friend :-( $sql = "DELETE FROM " . WEBLOG_BLOCKED_TABLE . " WHERE blocked_id = $blocked_id AND owner_id = $user_id"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't delete blocked user information.", "", __LINE__, __FILE__, $sql); } mx_message_die (GENERAL_MESSAGE, $lang['Blocked_user_removed'] . '<br /><br />' . sprintf($lang['Click_return_blocked'], '<a href="' . append_sid($module_root_path . "modules/mx_blogs/weblog_blocked.$phpEx?" . POST_USERS_URL . "=$user_id") . '">', '</a>') ); } $template_dir = get_template_dir ($weblog_data['template_id']); $page_title = $weblog_data['weblog_name'] . ' :: ' . $lang['Blocked_users']; // // Start output of page // use_weblog_header ( $weblog_data, $template_dir ); $template->set_filenames(array( 'body' => $module_root_path . 'weblogs/templates/' . $template_dir . '/weblog_blocked_body.htm') ); if ( $weblog_data['font'] == '0' ) $font = 'Arial'; else if ( $weblog_data['font'] == '1' ) $font = 'Comic Sans MS'; else if ( $weblog_data['font'] == '2' ) $font = 'Courier New'; else if ( $weblog_data['font'] == '3' ) $font = 'Georgia'; else if ( $weblog_data['font'] == '4' ) $font = 'Verdana'; else if ( $weblog_data['font'] == '5' ) $font = 'Times New Roman'; else if ( $weblog_data['font'] == '6' ) $font = 'Trebuchet'; else $font = 'Verdana'; $template->assign_vars(array( 'BACKGROUND_COLOR' => $weblog_data['background_color'], 'ENTRY_BG_COLOR' => $weblog_data['entry_bg_color'], 'BORDER_COLOR' => $weblog_data['border_color'], 'BACKGROUND_IMAGE' => $weblog_data['background_image'], 'BACKGROUND_IMAGE_FIXED' => ( $weblog_data['background_image_fixed'] ) ? 'fixed' : 'scroll', 'BACKGROUND_REPEAT' => $weblog_data['tile_bg'], 'BACKGROUND_POSITION' => $weblog_data['bg_ypos'] . ' ' . $weblog_data['bg_xpos'], 'SB_FACE_COLOR' => $weblog_data['sb_face_color'], 'SB_HIGHLIGHT_COLOR' => $weblog_data['sb_highlight_color'], 'SB_SHADOW_COLOR' => $weblog_data['sb_shadow_color'], 'SB_3DLIGHT_COLOR' => $weblog_data['sb_3dlight_color'], 'SB_ARROW_COLOR' => $weblog_data['sb_arrow_color'], 'SB_TRACK_COLOR' => $weblog_data['sb_track_color'], 'SB_DARKSHADOW_COLOR' => $weblog_data['sb_darkshadow_color'], 'FONT' => $font, 'FONT_COLOR' => $weblog_data['font_color'], 'FONT_SIZE' => $weblog_data['font_size'], 'NORMAL_LINK_COLOR' => $weblog_data['normal_link_color'], 'NORMAL_LINK_UNDERLINED' => ( $weblog_data['normal_link_underline'] ) ? 'underline' : 'none', 'ACTIVE_LINK_COLOR' => $weblog_data['active_link_color'], 'ACTIVE_LINK_UNDERLINED' => ( $weblog_data['active_link_underline'] ) ? 'underline': 'none', 'HOVER_LINK_COLOR' => $weblog_data['hover_link_color'], 'HOVER_LINK_UNDERLINED' => ( $weblog_data['hover_link_underline'] ) ? 'underline': 'none', 'VISITED_LINK_COLOR' => $weblog_data['visited_link_color'], 'VISITED_LINK_UNDERLINED' => ( $weblog_data['visited_link_underline'] ) ? 'underline': 'none', 'WEBLOG_TITLE_COLOR' => $weblog_data['weblog_title_color'], 'WEBLOG_TITLE_FONT_SIZE' => $weblog_data['weblog_title_font_size'], 'ENTRY_TITLE_COLOR' => $weblog_data['entry_title_color'], 'ENTRY_TITLE_FONT_SIZE' => $weblog_data['entry_title_font_size'], 'DATE_TIME_COLOR' => $weblog_data['date_time_color'], 'DATE_TIME_FONT_SIZE' => $weblog_data['date_time_font_size'], 'BLOCK_TITLE_COLOR' => $weblog_data['block_title_color'], 'BLOCK_TITLE_FONT_SIZE' => $weblog_data['block_title_font_size'], 'BLOCK_BG_COLOR' => $weblog_data['block_bg_color'], 'BLOCK_BORDER_COLOR' => $weblog_data['block_border_color']) ); // // Parse the header // $template->pparse('header'); // // Find the users that have been blocked // $sql = "SELECT u.username, u.user_id, b.blocked_id FROM " . WEBLOG_BLOCKED_TABLE . " b, " . USERS_TABLE . " u WHERE b.owner_id = $user_id AND u.user_id = b.blocked_id"; if( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, "Couldn't get blocked user information.", "", __LINE__, __FILE__, $sql); } while ( $row = $db->sql_fetchrow($result) ) { $template->assign_block_vars('blockedrow', array( 'U_PROFILE' => append_sid($phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']), 'BLOCKED_USER' => $row['username']) ); } // // Generate page // $template->assign_vars(array( 'L_BLOCKED_USERS' => $lang['Blocked_users'], 'L_REMOVE_USER' => $lang['Remove_user'], 'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']), 'L_WEBLOGS' => $lang['Weblogs'], 'L_BLOCK_USER' => $lang['Block_user'], 'U_INDEX' => append_sid($mx_root_path . 'index.'.$phpEx), 'U_WEBLOGS' => append_sid($mx_root_path . "index.$phpEx?page=". $weblog_config['mx_weblog_list']), 'U_WEBLOG' => append_sid($mx_root_path . "modules/mx_blogs/weblog.$phpEx?" . POST_WEBLOG_URL . "=" . $weblog_data['weblog_id']), 'S_BLOCK_ACTION' => append_sid($mx_root_path . "modules/mx_blogs/weblog_blocked.$phpEx?" . POST_USERS_URL . "=$user_id"), 'WEBLOG_NAME' => $weblog_data['weblog_name']) ); // // Output the body // $template->pparse('body'); $template->assign_vars(array( 'L_POWERED_BY' => sprintf($lang['Weblog_powered_by'], WEBLOGS_MOD_VERSION)) ); // // Output the footer // use_weblog_footer ( $weblog_data, $template_dir); ?> --- NEW FILE: weblogs.php --- <?php /*************************************************************************** * weblogs.php * ----------------- * begin : Monday, September 5, 2004 * copyright : (C) 2005 Hyperion * email : vi...@ho... * * $Id: weblogs.php,v 1.0.0 2004/09/05, 13:17:43 Hyperion 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. * ***************************************************************************/ define('IN_PHPBB', true); define('IN_PORTAL', true); //$phpbb_root_path = './'; //include($phpbb_root_path . 'extension.inc'); //include($phpbb_root_path . 'common.'.$phpEx); //include($mx_root_path . 'extension.inc'); $phpEx = substr(strrchr(__FILE__, '.'), 1); include($mx_root_path . 'common.'.$phpEx); if( is_object($mx_block)) { $is_block = TRUE; } // // Start session management // //$userdata = session_pagestart($user_ip, PAGE_INDEX); //init_userprefs($userdata); $mx_user->init($user_ip, PAGE_INDEX); // // End session management // //include($phpbb_root_path . 'includes/weblogs_common.'.$phpEx); include($module_root_path . 'includes/weblogs_constants.'.$phpEx); include($module_root_path . 'includes/weblogs_common.'.$phpEx); // // Begin initial var setup // $board_config['avatar_path'] = $phpbb_root_path . $board_config['avatar_path']; $board_config['avatar_gallery_path'] = $phpbb_root_path . $board_config['avatar_gallery_path']; if ( isset($HTTP_GET_VARS['count']) || isset($HTTP_POST_VARS['count']) ) { $count = (isset($HTTP_POST_VARS['count'])) ? intval($HTTP_POST_VARS['count']) : intval($HTTP_GET_VARS['count']); $count = abs($count); } else { $count = $weblog_config['main_blogsperpage']; } if ( !$count ) { $count = 1; } if ( isset($HTTP_GET_VARS['start']) || isset($HTTP_POST_VARS['start']) ) { $start = (isset($HTTP_POST_VARS['start'])) ? intval($HTTP_POST_VARS['start']) : intval($HTTP_GET_VARS['start']); $start = abs($start); } else { $start = 0; } if ( isset($HTTP_GET_VARS['sort']) || isset($HTTP_POST_VARS['sort']) ) { $sort = (isset($HTTP_POST_VARS['sort'])) ? intval($HTTP_POST_VARS['sort']) : intval($HTTP_GET_VARS['sort']); } else { $sort = $weblog_config['main_sorttype']; } if ( isset($HTTP_GET_VARS['order']) || isset($HTTP_POST_VARS['order']) ) { $order = (isset($HTTP_POST_VARS['order'])) ? $HTTP_POST_VARS['order'] : $HTTP_GET_VARS['order']; $order = ( $order == 'asc' || $order == 'desc' ) ? $order : 'desc'; } else { $order = $weblog_config['main_sortorder']; } // // End initial var setup // // // Start page proper // $page_title = $lang['Weblog_index']; include($mx_root_path . 'includes/page_header.'.$phpEx); // // Get the moods data // $sql = "SELECT * FROM " . WEBLOG_MOODS_TABLE . " ORDER BY mood_text"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't obtain mood data from database", "", __LINE__, __FILE__, $sql); } $mood_data = $db->sql_fetchrowset($result); // // Get the actions data // $sql = "SELECT * FROM " . WEBLOG_ACTIONS_TABLE . " ORDER BY action_text"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't obtain action data from database", "", __LINE__, __FILE__, $sql); } $action_data = $db->sql_fetchrowset($result); // // Load the template data // // Get template data and check to see if there is at least one template installed. $sql = "SELECT * FROM " . WEBLOG_TEMPLATES_TABLE . " ORDER BY template_name"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Error querying to find user weblog information', '', __LINE__, __FILE__, $sql); } $template_data = array(); while ( $row = $db->sql_fetchrow($result) ) { $template_data[] = $row; } // // Fetch Weblog Information // $sql = "SELECT w.*, u.* FROM " . WEBLOGS_TABLE . " w, " . USERS_TABLE . " u WHERE w.weblog_id = u.user_weblog AND u.user_id = " . $userdata['user_id']; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query user weblog information', '', __LINE__, __FILE__, $sql); } // See if any rows are returned. If at least one is returned.... if ( $userdata['session_logged_in'] && $row = $db->sql_fetchrow($result) ) { $user_weblog_data = $row; if ( $weblog_config['use_default_faceplates'] ) { $template->set_filenames(array( 'user' =>$module_root_path . 'templates/subSilver/weblog_faceplate_body.tpl') ); } else { // See if the weblog owner's face file is available if ( $user_weblog_data['weblog_advanced'] ) { if ( file_exists("weblogs/faceplate_" . $user_weblog_data['weblog_id'] . ".htm") ) { $template->set_filenames(array( 'user' => $module_root_path . '/weblogs/faceplate_' . $user_weblog_data['weblog_id'] . '.htm') ); } else { // Otherwise show a default face image. $template->set_filenames(array( 'user' => $module_root_path . 'templates/subSilver/weblog_faceplate_body.tpl') ); } } else { $template_dir = get_template_dir ($user_weblog_data['template_id']); $template->set_filenames(array( 'user' => $module_root_path . 'weblogs/templates/' . $template_dir . '/weblog_faceplate_body.htm') ); } } $weblog_id = $user_weblog_data['weblog_id']; $avatar_img = ''; if ( $userdata['user_avatar_type'] && $userdata['user_allowavatar'] ) { switch( $userdata['user_avatar_type'] ) { case USER_AVATAR_UPLOAD: $avatar_img = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0" />' : ''; break; case USER_AVATAR_REMOTE: $avatar_img = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $userdata['user_avatar'] . '" alt="" border="0" />' : ''; break; case USER_AVATAR_GALLERY: $avatar_img = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $userdata['user_avatar'] . '" alt="" border="0" />' : ''; break; } } // Viewer of own weblog presumed to have maximum authentication... $sql = "SELECT * FROM " . WEBLOG_ENTRIES_TABLE . " WHERE weblog_id = " . $userdata['user_weblog'] . " AND entry_deleted <> " . TRUE . " ORDER BY entry_time DESC LIMIT 1"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query user weblog information', '', __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { $last_entry_data = $row; $mood = array(); $mood = find_mood($last_entry_data['entry_mood']); if ( $mood >= 0 ) { $mood = sprintf($lang['Mood:'], '<img src="modules/mx_blogs/images/weblogs/' . $mood['mood_url'] . '" alt="' . $mood_data['mood_text'] . '" style="vertical-align: middle" border="0" />', $mood['mood_text']); } else { $mood = $lang['None']; } // Currently Icons $currently = array(); $currently = find_action($last_entry_data['entry_currently']); if ( $currently > 0 ) { $action = sprintf($lang['Currently:'], '<img src="modules/mx_blogs/images/weblogs/' . $currently['action_url'] . '" alt="' . $currently['action_text'] . ' ' . $last_entry_data['currently_text'] . '" style="vertical-align: middle" border="0" />', $currently['action_text'] . ' ' . $last_entry_data['currently_text']); } else if ( $last_entry_data['currently_text'] && $currently == -2 ) { $action = sprintf($lang['Currently:'], '', $last_entry_data['currently_text']); } else { $action = $lang['None']; } $entry_id = $last_entry_data['entry_id']; $last_entry_time = create_date($board_config['default_dateformat'], $last_entry_data['entry_time'], $board_config['board_timezone']); $last_entry_time .= ' <a href="' . append_sid($mx_root_path . "modules/mx_blogs/weblog_entry.$phpEx?" . POST_ENTRY_URL . "=$entry_id") . '"><img src="' . $phpbb_root_path . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_entry'] . '" title="' . $lang['View_newest_entry'] . '" border="0" /></a>'; $last_entry = $last_entry_time; } else { $last_entry = $lang['No_entries']; $action = $lang['None']; $mood = $lang['None']; } if ( $user_weblog_data['font'] == '0' ) $font = 'Arial'; else if ( $user_weblog_data['font'] == '1' ) $font = 'Comic Sans MS'; else if ( $user_weblog_data['font'] == '2' ) $font = 'Courier New'; else if ( $user_weblog_data['font'] == '3' ) $font = 'Georgia'; else if ( $user_weblog_data['font'] == '4' ) $font = 'Verdana'; else if ( $user_weblog_data['font'] == '5' ) $font = 'Times New Roman'; else if ( $user_weblog_data['font'] == '6' ) $font = 'Trebuchet'; else $font = 'Verdana'; $template->assign_vars(array( 'ID' => 'user', 'BACKGROUND_COLOR' => $user_weblog_data['background_color'], 'ENTRY_BG_COLOR' => $user_weblog_data['entry_bg_color'], 'BORDER_COLOR' => $user_weblog_data['border_color'], 'BACKGROUND_IMAGE' => $user_weblog_data['background_image'], 'BACKGROUND_IMAGE_FIXED' => ( $user_weblog_data['background_image_fixed'] ) ? 'fixed' : 'scroll', 'BACKGROUND_REPEAT' => $user_weblog_data['tile_bg'], 'BACKGROUND_POSITION' => $user_weblog_data['bg_ypos'] . ' ' . $user_weblog_data['bg_xpos'], 'SB_FACE_COLOR' => $user_weblog_data['sb_face_color'], 'SB_HIGHLIGHT_COLOR' => $user_weblog_data['sb_highlight_color'], 'SB_SHADOW_COLOR' => $user_weblog_data['sb_shadow_color'], 'SB_3DLIGHT_COLOR' => $user_weblog_data['sb_3dlight_color'], 'SB_ARROW_COLOR' => $user_weblog_data['sb_arrow_color'], 'SB_TRACK_COLOR' => $user_weblog_data['sb_track_color'], 'SB_DARKSHADOW_COLOR' => $user_weblog_data['sb_darkshadow_color'], 'FONT' => $font, 'FONT_COLOR' => $user_weblog_... [truncated message content] |