[ABD] The Blog Mod

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
psychotomus
Registered User
Posts: 207
Joined: Sat Sep 06, 2003 10:42 pm
Contact:

Post by psychotomus » Fri Feb 25, 2005 5:19 am

i managed to get the page to finally load with a temporary fix.

i commented out the sql calls

Code: Select all

/*$sql = "SELECT * FROM " . WEBLOG_FRIENDS_TABLE . " WHERE friend_id = " . $userdata['user_id']; 
if ( !($result = $db->sql_query($sql)) ) 
{ 
message_die(GENERAL_ERROR, 'Error querying to find user weblog friends information', '', __LINE__, __FILE__, $sql); 
} 

$friends_data = array(); 
while ( $row = $db->sql_fetchrow($result) ) 
{ 
$friends_data[] = $row; 
} 

// 
// Preload the blocked users data (for determining if user is blocked in any weblog 
// 
$sql = "SELECT * FROM " . WEBLOG_BLOCKED_TABLE . " WHERE blocked_id = " . $userdata['user_id']; 
if ( !($result = $db->sql_query($sql)) ) 
{ 
message_die(GENERAL_ERROR, 'Error querying to find user weblog blocked information', '', __LINE__, __FILE__, $sql); 
} 

$blocked_data = array(); 
while ( $row = $db->sql_fetchrow($result) ) 
{ 
$blocked_data[] = $row; 
} 
*/

now i get this error

Warning: Missing argument 4 for get_auth_level() in /home/virtual/site205/fst/var/www/html/1/includes/functions_weblog.php on line 527
aim; ninja sim
msn; sim@Po2.net

User avatar
LT206
Registered User
Posts: 55
Joined: Mon Dec 13, 2004 11:02 pm

Hmm

Post by LT206 » Fri Feb 25, 2005 5:20 am

I see the forums are back somewhat. I am betting the problem exists within weblogs_common.php.

psychotomus
Registered User
Posts: 207
Joined: Sat Sep 06, 2003 10:42 pm
Contact:

Post by psychotomus » Fri Feb 25, 2005 6:15 am

i got the problem fixed. ;\
aim; ninja sim
msn; sim@Po2.net

javispedro
Registered User
Posts: 58
Joined: Thu Apr 22, 2004 7:34 pm

Post by javispedro » Fri Feb 25, 2005 1:41 pm

Hi! I'm planning into installing The Blog Mod in my board, however, I would like to ask ... Does the Blog Mod support more than one blog per user?
I'm planning into doing something more that a user-weblog relation, a project-blog combination, so that each blog was owned by one project team. This would require that most people used more than one blog. I wouldn't like to create a new account for each of them..
Does the blog mod support more than one blog per user? If it not, would be easy if I try to code it manually or would it require a heavy core modification? Are you planning to add it to version 3.0?

Cross_+_Flame
Registered User
Posts: 295
Joined: Wed Oct 30, 2002 3:37 pm
Location: Okie-homa!
Contact:

Post by Cross_+_Flame » Fri Feb 25, 2005 4:05 pm

per hyperion's website, found in his sig, he is planning multiple-blogs-per-user for 0.3.0. I'm looking forward to it as well :D

hyperion
Registered User
Posts: 268
Joined: Sun Jul 06, 2003 7:13 pm

Re: Problem maybe?

Post by hyperion » Sun Feb 27, 2005 6:40 am

txt2nite wrote: Hey there, great mod btw.

I will probably install this mod on the weekend. I've been playing about on your Blog Mod Development Forum, and this error came up after I made a post an then clicked on the blog menu on the top menu

Code: Select all

Could not query weblogs information

DEBUG MODE

SQL Error : 1030 Got error 28 from table handler

SELECT w.*, u.*, e.entry_id, e.entry_subject, e.entry_access, e.entry_mood, e.entry_currently, e.entry_time, e.currently_text, e.bbcode_uid, e.entry_text FROM phpbb_users u, phpbb_weblogs w LEFT JOIN phpbb_weblog_entries e ON e.weblog_id = w.weblog_id AND e.entry_deleted = 0 AND e.entry_time <= 1109083928 WHERE w.weblog_id = u.user_weblog AND w.deleted = 0 ORDER BY e.entry_time desc

Line : 739
File : d:\program files\apache group\apache\htdocs\blog\includes\functions_weblog.php


It's fine, it ran out of space (other large files). I've cleared it up quite a bit.

Peter77s: I've solved the problem - I'll post the solution in my demo board.

psychotomus: I'm guessing you were upgrading to 0.2.0. There are some modifications to index.php that I guess you haven't done (they are located in upgrade_020.txt). Reverse your changes and apply mine.

javispedro: Not yet, but it will have that feature for 0.3.0.
The Blog Mod: ( Dev Topic | Demo )
The Blog Mod version 0.2.3 - Released May 18, 2005
Download

Forum Weblogs Mod: (discontinued)

Mini_Dragon
Registered User
Posts: 96
Joined: Sun Sep 19, 2004 2:12 pm

Post by Mini_Dragon » Mon Feb 28, 2005 9:53 pm

Sorry, an error has occured. The file ./weblogs/templates/subSilver/subSilver.cfg is missing or cannot be accessed. Please inform your Board Administrator.


When I try to enter Blog CP

Shanana
Registered User
Posts: 368
Joined: Sat Aug 28, 2004 4:03 am
Location: USA [from London, England]

Post by Shanana » Tue Mar 01, 2005 9:53 pm

Will people be able to make their own design for their blogs?

User avatar
LT206
Registered User
Posts: 55
Joined: Mon Dec 13, 2004 11:02 pm

Post by LT206 » Tue Mar 01, 2005 9:57 pm

Shanana wrote: Will people be able to make their own design for their blogs?


Yes. Hyperion has created a mod that you can customize without any technical knowledge. For those with technical knowledge, the templates become even more customizable.

Check out his web site for more info and templates.

Click here to go to Hyperions site

psychotomus
Registered User
Posts: 207
Joined: Sat Sep 06, 2003 10:42 pm
Contact:

Post by psychotomus » Fri Mar 04, 2005 4:43 am

2 bugs I noticed.

one probally mentioned. you cant use symbols such as '. it will display it as /' or something.

Also when replying to a Post. you can't quote the person. The reply won't be showed.
aim; ninja sim
msn; sim@Po2.net

aops
Registered User
Posts: 45
Joined: Thu Nov 13, 2003 9:00 pm

Spammers filling up referral pages since installing this mod

Post by aops » Tue Mar 08, 2005 6:59 pm

Ever since I installed this mod (which I'm generally very happy with), my site statistics have gone a little wacky since spammers are hitting weblogs.php over and over and over. I tried changing the file name to something else, but they found that and are hitting it over and over. Any suggestions?

cryptoknight
Registered User
Posts: 19
Joined: Tue Sep 23, 2003 11:02 pm

Re: Spammers filling up referral pages since installing this

Post by cryptoknight » Tue Mar 08, 2005 7:41 pm

aops wrote: Ever since I installed this mod (which I'm generally very happy with), my site statistics have gone a little wacky since spammers are hitting weblogs.php over and over and over. I tried changing the file name to something else, but they found that and are hitting it over and over. Any suggestions?


In your ACP change this setting

Default Reply Access Requirements

change it from Guest to Registered.

aops
Registered User
Posts: 45
Joined: Thu Nov 13, 2003 9:00 pm

Post by aops » Tue Mar 08, 2005 7:49 pm

It's already set to that.

I should be a little more clear: the problem isn't bots posting in blogs - it's simply spammers trying to show up in my site statistics by hitting a page over and over. It happens to be this page - apparently they love to go after blogs since bloggers tend to check their referrals a lot.

chyduskam
Registered User
Posts: 110
Joined: Thu Oct 28, 2004 9:33 am
Location: Saint Petersburg, Russia
Contact:

Post by chyduskam » Wed Mar 09, 2005 6:15 am

RSS solution. Requed RSS Feed Mod
More complex and trafficless

Code: Select all

<?php
/***************************************************************************
 *                              weblog_rss.php
 *                           --------------------
 *   begin                : Monday, September 5, 2004
 *   copyright            : (C) 2005 Hyperion
 *   hacked by         : chyduskam
 *
 *   $Id: weblog_rss.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.
 *
 ***************************************************************************/
$ProgName='RSS Blog Feed 1.0.0';
$verinfo='V100';
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
include($phpbb_root_path . 'includes/rss_config.'.$phpEx);
include($phpbb_root_path . 'includes/rss_functions.'.$phpEx);
$count = ( isset($HTTP_GET_VARS['c']) ) ? intval($HTTP_GET_VARS['c']) : DEFAULT_ITEMS;
$count = ( $count == 0 ) ? DEFAULT_ITEMS : $count;
$count = ( $count > MAX_ITEMS ) ? MAX_ITEMS : $count;
$needlogin=( (isset($HTTP_GET_VARS['login'])) or (isset($HTTP_GET_VARS['uid']))) ? true : false;
$no_limit=( isset($HTTP_GET_VARS['nolimit']) ) ? true : false;
if(!defined('PAGE_RSS')) define('PAGE_RSS', PAGE_INDEX);
$deadline=0;
if(isset($HTTP_SERVER_VARS['HTTP_IF_MODIFIED_SINCE']))
{
    $deadline=strtotime($HTTP_SERVER_VARS['HTTP_IF_MODIFIED_SINCE']);
	if(CACHE_TIME>0) if((time()-$deadline)<CACHE_TIME)
	{
        ExitWithHeader("304 Not Modified");
	}
}
//
// Start session management
//
//
// gzip_compression
//
$do_gzip_compress = FALSE;
$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;
if($use_cached && AUTOSTYLED and strpos($useragent,'MSIE'))$use_cached=false;
if ( $board_config['gzip_compress'] )
{
	$phpver = phpversion();
	if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) )
	{
		if ( extension_loaded('zlib') )
		{
			ob_start('ob_gzhandler');
		}
	}
	else if ( $phpver > '4.0' )
	{
		if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') )
		{
			if ( extension_loaded('zlib') )
			{
				$do_gzip_compress = TRUE;
				ob_start();
				ob_implicit_flush(0);
 				header('Content-Encoding: gzip');
			}
		}
	}
}
// end gzip block
// BEGIN Session management
//
// Check user
$user_id=($needlogin)? rss_get_user() : ANONYMOUS;
if($user_id==ANONYMOUS && AUTOLOGIN)
{
	$userdata = session_pagestart($user_ip, PAGE_RSS);
	$user_id=$userdata["user_id"];
}
else $userdata=rss_session_begin($user_id, $user_ip, PAGE_RSS);
init_userprefs($userdata);
$username=$userdata["username"];
//
// End session management
//
include($phpbb_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]);
	$weblog_id = intval($weblog_id);
}

//
// Check if the user has actually sent a forum ID with his/her request
// If not give them a nice error page.
//
if( !empty($weblog_id) )
{
	$sql = "SELECT w.*, u.user_id
		FROM " . WEBLOGS_TABLE . " w, " . USERS_TABLE . " u
		WHERE w.weblog_id = $weblog_id
			AND u.user_weblog = w.weblog_id";
	if( !$result = $db->sql_query($sql) )
	{
		message_die(GENERAL_ERROR, "Couldn't obtain weblogs information.", "", __LINE__, __FILE__, $sql);
	}
}
else
{
	message_die(GENERAL_MESSAGE, $lang['Weblog_not_exist']);
}

//
// If the query doesn't return any rows this isn't a valid forum. Inform
// the user.
//
if( !($weblog_data = $db->sql_fetchrow($result)) )
{
	message_die(GENERAL_MESSAGE, $lang['Weblog_not_exist']);
}

if ( $weblog_data['deleted'] )
{
	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 )
{
	message_die(GENERAL_ERROR, $lang['Weblog_noaccess']);
}

//
// Get the owner's data
//
$sql = "SELECT * FROM " . USERS_TABLE . "
		WHERE user_weblog = " . $weblog_data['weblog_id'];
if( !$result = $db->sql_query($sql) )
{
	message_die(GENERAL_ERROR, "Couldn't get weblog owner information.", "", __LINE__, __FILE__, $sql);
}

$owner_data = array();
if ( $row = $db->sql_fetchrow($result) )
{
	$owner_data = $row;
}
$NotErrorFlag=false;
$sql_limit_time="";
if (!$no_limit and isset($HTTP_SERVER_VARS['HTTP_IF_MODIFIED_SINCE'])) {
		$NotErrorFlag=true;
		$NotModifiedSince=strtotime($HTTP_SERVER_VARS['HTTP_IF_MODIFIED_SINCE']);
		if($NotModifiedSince>0){
			 $sql_limit_time="AND entry_time > ".$NotModifiedSince;
			 }
}
//
// Fetch Entries
//
$sql = "SELECT * FROM " . WEBLOG_ENTRIES_TABLE . "
	WHERE weblog_id = " . $weblog_data['weblog_id'] . "
		AND entry_access <= $auth_level
		AND entry_deleted = 0
		$sql_limit_time
	ORDER BY entry_time DESC
	LIMIT $count";
if(!($result = $db->sql_query($sql)))
{
    ExitWithHeader("500 Internal Server Error","Could not query weblog entry information");
}
$entry_data = $db->sql_fetchrowset($picrow);
if ( count($entry_data) == 0 )
{
    if($NotErrorFlag) ExitWithHeader("304 Not Modified");
    else ExitWithHeader("404 Not Found","No records find");
}

//
// Start output of RSS
//

$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']) . '/' : '';
$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path']));

$basedir = $server_protocol . $server_name . '/' . $server_port . $script_name . '/';

$smilies_path = $board_config['smilies_path'];
$smilies_url = $basedir . $smilies_path;
$smilies_path = preg_replace("/\//", "\/", $smilies_path);

//
// BEGIN Initialise template
//
if(isset($HTTP_GET_VARS['atom']))
{
    $template->set_filenames(array("body" => "atom_body.tpl"));
    $verinfo.="A";
}
else
{
	$template->set_filenames(array("body" => "rss_body.tpl"));
    $verinfo.="R";
}
//
// END Initialise template
//
if(isset($HTTP_GET_VARS['styled']) or (AUTOSTYLED and strpos($useragent,'MSIE')))
{
	$template->assign_block_vars('switch_enable_xslt', array());
}
$user_lang=($board_config['default_lang']=='russian')?'ru':(($board_config['default_lang']=='english')?'en':'');
$user_lang=(($user_lang!='')?"\n<language>".$user_lang."</language>":"");
$template->assign_vars(array(
	'S_CONTENT_ENCODING' => $lang['ENCODING'],
	'BOARD_URL' => $basedir . "weblog.$phpEx?" . POST_WEBLOG_URL . "=$weblog_id",
	'BOARD_TITLE' => htmlspecialchars($weblog_data['weblog_name']),
	'PROGRAM' => $ProgName,
	'BOARD_DESCRIPTION' => htmlspecialchars($weblog_data['weblog_desc']),
	'BOARD_MANAGING_EDITOR' => $owner_data['user_email'],
	'BOARD_WEBMASTER' => $board_config['board_email'],
	'BUILD_DATE' => gmdate('D, d M Y H:i:s').' GMT',
	'ATOM_BUILD_DATE'=>gmdate("Y-m-d\TH:i:s")."Z",
	'READER' => $username,
	'L_AUTHOR' => $lang['Author'],
	'L_POSTED' => $lang['Posted'],
	'LANGUAGE'=>$user_lang,
	'L_POST' => $lang['Post'])
);

//
// 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);
$LastPostTime=0;

for ($i = 0; $i < count($entry_data); $i++)
{
	//
	// Prepare every entry
	//
	If($entry_data[$i]['entry_time']>$LastPostTime) $LastPostTime=$entry_data[$i]['entry_time'];
//	$entry_data[$i]['entry_text'] = htmlspecialchars($entry_data[$i]['entry_text']);

	// BBCode
	if ( $entry_data[$i]['enable_bbcode'] )
	{
		$entry_data[$i]['entry_text'] = bbencode_second_pass($entry_data[$i]['entry_text'], $entry_data[$i]['bbcode_uid']);
	}

	// Smilies
	if ( $entry_data[$i]['enable_smilies'] )
	{
		$entry_data[$i]['entry_text'] = smilies_pass($entry_data[$i]['entry_text']);
		$entry_data[$i]['entry_text'] =preg_replace("/$smilies_path/", $smilies_url, $entry_data[$i]['entry_text']);
	}

	$entry_data[$i]['entry_text'] = make_clickable($entry_data[$i]['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))
		{
			$entry_data[$i]['entry_subject'] = preg_replace($orig_word, $replacement_word, $entry_data[$i]['entry_subject']);
			$entry_data[$i]['entry_text'] = preg_replace($orig_word, $replacement_word, $entry_data[$i]['entry_text']);
		}
	}

	$entry_data[$i]['entry_text'] = nl2br($entry_data[$i]['entry_text']);

	// Mood Icons
	$mood = array();
	$mood = find_mood($entry_data[$i]['entry_mood']);

	if ( $mood >= 0 )
	{
		$mood = '<strong>[</strong>&nbsp;' . sprintf($lang['Mood:'], '<img src="'.$basedir.'images/weblogs/' . $mood['mood_url'] . '" alt="' . $mood['mood_text'] . '" style="vertical-align: middle" border="0" />', $mood['mood_text']) . '&nbsp;<strong>]</strong>
';
	}
	else
	{
		$mood = '';
	}

	// Currently Icons
	$currently = array();
	$currently = find_action($entry_data[$i]['entry_currently']);

	if ( $currently > 0 )
	{
		$action = '<strong>[</strong>&nbsp;' . sprintf($lang['Currently:'], '<img src="'.$basedir.'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']) . '&nbsp;<strong>]</strong>
';
	}
	else if ( $entry_data[$i]['currently_text'] && $currently == -2 )
	{
		$action = '<strong>[</strong>' . sprintf($lang['Currently:'], '', $entry_data[$i]['currently_text']) . '&nbsp;<strong>]</strong>
';
	}
	else
	{
		$action = '';
	}



	$entry_data[$i]['entry_text'] = $mood . $action . $entry_data[$i]['entry_text'];

	$entry_data[$i]['entry_text'] = trim ($entry_data[$i]['entry_text']);

//	if (strlen($entry_data[$i]['entry_text']) > 1000)
//	{
//		$entry_data[$i]['entry_text'] = substr($entry_data[$i]['entry_text'], 0, 957) . '...';
//	}

	// Variable reassignment and reformatting for author
	$entry_author = $owner_data['username'] . ' ' . $owner_data['user_email'];

	$entry_link = $basedir . "weblog_entry.$phpEx?" . POST_ENTRY_URL . "=" . $entry_data[$i]['entry_id'];

	$entry_time = $entry_data[$i]['topic_time'];
    $template->assign_block_vars('post_item', array(
			'POST_URL' => $entry_link ,
			'FIRST_POST_URL' => $entry_link ,
			'REPLY_URL'=>$entry_link,
            'TOPIC_TITLE' =>$entry_data[$i]['entry_subject'],
			'AUTHOR0' => $owner_data['username'],
			'AUTHOR' => $owner_data['username'],
			'POST_TIME' => create_date($board_config['default_dateformat'], $entry_data[$i]['entry_time'], $board_config['board_timezone']).' (GMT ' . $board_config['board_timezone'] . ')',
			'ATOM_TIME'=>gmdate("Y-m-d\TH:i:s", $entry_data[$i]['entry_time'])."Z",
            'ATOM_TIME_M'=>gmdate("Y-m-d\TH:i:s", $entry_data[$i]['entry_time'])."Z",
			'POST_SUBJECT' => "",
			'FORUM_NAME' => htmlspecialchars($weblog_data['weblog_name']),
			'UTF_TIME'=>gmdate('D, d M Y H:i:s O', $entry_data[$i]['entry_time']),
			'POST_TEXT' => htmlspecialchars($entry_data[$i]['entry_text']),
			'USER_SIG' => "",
			'TOPIC_REPLIES' => ""
			)
		);
}
// Check for E-Tag
$MyETag='"A'.gmdate("YmdHis", $LastPostTime).$verinfo.'"';
$MyGMTtime=gmdate("D, d M Y H:i:s", $LastPostTime)." GMT";
if(isset($HTTP_SERVER_VARS['HTTP_IF_NONE_MATCH'])&& ($HTTP_SERVER_VARS['HTTP_IF_NONE_MATCH']== $MyETag)) ExitWithHeader("304 Not Modified");
if(isset($HTTP_SERVER_VARS['HTTP_IF_MODIFIED_SINCE']) && ($HTTP_SERVER_VARS['HTTP_IF_MODIFIED_SINCE'] == $MyGMTtime)) ExitWithHeader("304 Not Modified");
//
// BEGIN XML and nocaching headers (copied from page_header.php)
//
if (!empty($HTTP_SERVER_VARS['SERVER_SOFTWARE']) && strstr($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'Apache/2'))
{
	header ('Cache-Control: no-cache, pre-check=0, post-check=0, max-age=0');
}
else
{
	header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
}
header("Last-Modified: ".$MyGMTtime);
header("Etag: ".$MyETag);
header("Expires: ".gmdate("D, d M Y H:i:s", time())." GMT");
header ('Content-Type: text/xml; charset='.$lang['ENCODING']);
//
// END Output XML page
//
$template->pparse('body');

$gzip_text = ($board_config['gzip_compress']) ? 'GZIP enabled' : 'GZIP disabled';
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$gentime = round(($endtime - $starttime), 4);
if($show_time) {
	echo '<!-- Page generation time: '.$gentime .'s ';
    if(SMARTOR_STATS) {
      	$sql_time = round($db->sql_time, 4);
 		$sql_part = round($sql_time / $gentime * 100);
 		$excuted_queries = $db->num_queries;
		$php_part = 100 - $sql_part;
		echo '(PHP: '. $php_part .'% - SQL: '. $sql_part .'%) - SQL queries: '. $excuted_queries;
     }
    echo  ' - '. $gzip_text.' -->';
}

$db->sql_close();
//
// Compress buffered output if required and send to browser
//
if ( $do_gzip_compress )
{
	//
	// Borrowed from php.net!
	//
	$gzip_contents = ob_get_contents();
	ob_end_clean();

	$gzip_size = strlen($gzip_contents);
	$gzip_crc = crc32($gzip_contents);

	$gzip_contents = gzcompress($gzip_contents, 9);
	$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);

	echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
	echo $gzip_contents;
	echo pack('V', $gzip_crc);
	echo pack('V', $gzip_size);
}
exit;
?>

Eze1
Registered User
Posts: 9
Joined: Wed Mar 09, 2005 4:24 pm

Post by Eze1 » Wed Mar 09, 2005 4:28 pm

While testing the blog system I've discovered that deleting a user removed their profile from the database, but their blog entries still stayed.

This wouldn't necessarily be a problem except that the next person to register for a blog immediately gets the blog entries of the previous owner, and I feel certain at some point a blog will get deleted. Another thing I noticed, and it all comes back to the database... is that the blog link from the view posts/post body/blogs screen also links back to the previous blog owner's posts (with the new owners name now attached) despite that person having deleted it.

While I was tooling around the SQL database I noticed that the blog entries are not tagged for deletion. I'm guessing that the delete blog option isn't tagging the blog entries as well.. I'm not sure about the blog comment since there aren't any in my system yet.

I'm trying to do what I can on my end, but I'm pretty much a novice when it comes to php and sql... if anyone could point me in the right direction, or give me pointers on how to fix this, I'd appreciate it.

thx

Locked

Return to “[2.0.x] MODs in Development”