cotonti.com : MVC in comments https://www.cotonti.com Последние сообщения в теме Cotonti en Thu, 27 Nov 2025 21:44:59 -0000 pieter What do you want to do?

]]>
чт, 19 фев 2015 10:20:47 -0000
smithjon  I only want to show a picture and a comment count, this sed_build_comments() is overkill.
e.g. In the news plugin (we could use a lighter function for just getting af gsdfgvsd f

]]>
чт, 19 фев 2015 09:16:23 -0000
ez BUT, you are right, you have to know how those Sprites work.
Still it improves performance.

Here are some documents (for the interested)

Articles:
http://www.alistapart.com/articles/sprites/
http://www.websiteoptimization.com/speed/tweak/css-sprites/

General website optimizing:
http://developer.yahoo.com/performance/rules.html]]>
сб, 13 фев 2010 02:51:32 -0000
Trustmaster пт, 12 фев 2010 23:13:57 -0000 ez I am working on that right now.. (That's how i came to the hardcoded comments link :( )

It reduces the number off request to the server !! (And thats a good thing)]]>
пт, 12 фев 2010 20:29:48 -0000
Trustmaster customizable resource files in Siena.

Yes, current coments/ratings is rubbish. In Siena we are going to make them plugins, with TPL files.]]>
пт, 12 фев 2010 20:21:41 -0000
ez
functions.php::sed_build_comments()

	$res = '<a href=https://www.cotonti.com/"' . $url . '#comments" class="comments_link"><img src=https://www.cotonti.com/"skins/' . $usr['skin']
		. '/img/system/icon-comment.gif" alt="" />';

I think this should be in a TPL, not hardcoded...
Please remove it from the low level functions...

thnx,
Leo

p.s. What a monster function is this one...

If I only want to show a picture and a comment count, this sed_build_comments() is overkill.
e.g. In the news plugin (we could use a lighter function for just getting a count.

And the function below is Lightweight and also TPL friendly (this is just an idea)

function sed_get_comments_count($code)
{
	global $db_com, $cfg, $usr;
	list($usr['auth_read_com'], $usr['auth_write_com'], $usr['isadmin_com']) = sed_auth('comments', 'a');
	sed_block($usr['auth_read_com']);
	if ($cfg['disable_comments'] || !$usr['auth_read_com']) return ("");
	$ret="";
	if ($cfg['countcomments'])
	{
		if (isset($totalitems)) $nbcomment = $totalitems;
		else $nbcomment = sed_sql_result(sed_sql_query("SELECT COUNT(*) FROM $db_com where com_code='$code'"), 0, 0);
		$ret = (string)$nbcomment;
	}

	return($ret);
}


Added 1 hour 4 minutes later:

I have made this for the NEWS plugin on a test site, and it works like a charm.. also
this is more MVC, because I can do everything in the TPL's.

And I think the speed is better (must test this somewhat further)

Hope you all think about implementing this.... :)]]>
пт, 12 фев 2010 16:54:02 -0000