<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : [HELP][WIP] Plugin: User Comments</title>
		<link>https://www.cotonti.com</link>
		<description>Last topic posts</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Tue, 05 May 2026 02:45:18 -0000</pubDate>

		<item>
			<title>musiconly</title>
			<description><![CDATA[Thanks Koradhil for a great explanation <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/smile.gif" alt=":)" /> Now I finally get that sed_import part (I always wondered where it's used).  <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/confused.gif" alt=":/" /> <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/grin.gif" alt=":D" /><br />
<br />
I'm not a PHP programmer (C++ is my playground), but I forced myself to learn it because of some mods/plugs that I'll need for my website.<br />
<br />
If I get stuck on another thing, I'll post it here <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/smile.gif" alt=":)" />]]></description>
			<pubDate>Sun, 25 Oct 2009 19:30:16 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=3428&d=0#post18164]]></link>
		</item>
		<item>
			<title>GHengeveld</title>
			<description><![CDATA[You need to import the $ui variable from GET, otherwise your query won't work. Also it's better to cast or check any variables used in an SQL query. Integers should be cast using (int)$variable and strings need to be prepped using sed_sql_prep(). Another minor detail is that you shouldn't put quotes around an integer, since that would require it to be converted from string to integer.<br />
Try this:<br />
<br />
<div class="highlight"><pre class="php">$ui = sed_import('ui', 'G', 'INT');
$sql2 = sed_sql_query(&quot;SELECT * FROM $db_com WHERE com_authorid=&quot;.(int)$ui);</pre></div>
<br />
For the rest of it, it's looking good, keep it up. Glad to see my guide gets used too <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/smile.gif" alt=":)" />]]></description>
			<pubDate>Sun, 25 Oct 2009 05:58:41 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=3428&d=0#post18158]]></link>
		</item>
		<item>
			<title>musiconly</title>
			<description><![CDATA[I caught some god damn cold and I'm stuck at home on saturday night <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/sad.gif" alt=":(" /> Anyways, I decided to use it for a learning session.<br />
<br />
I'm <strong>trying</strong> to create a plugin which I called User Comments.<br />
<br />
<span style="color:#CC0000">Features:</span><br />
<ul>
Show user comment count on user profile(hook: users.details.main)<br />
Show last X comments on user profile(hook: users.details.main)<br />
Show all comments from this user(standalone)<br />
Top commentators(probably standalone)<br />
</ul>
<br />
I got stuck!!!<br />
<br />
<div style="margin:4px 0px 4px 0px"><input type="button" value="usercomments.user.php" onclick="if(this.parentNode.getElementsByTagName('div')[0].style.display != '') { this.parentNode.getElementsByTagName('div')[0].style.display = ''; } else { this.parentNode.getElementsByTagName('div')[0].style.display = 'none'; }" /><div style="display:none" class="spoiler">
<div class="highlight"><pre class="php">
&lt;?PHP
/* ====================
&#091;BEGIN_SED_EXTPLUGIN&#093;
Code=usercomments
Part=user
File=usercomments.user
Hooks=users.details.tags
Tags=users.details.tpl:{USERS_DETAILS_COMCOUNT}
Order=10
&#091;END_SED_EXTPLUGIN&#093;
==================== */

/**
 * Part of plug UserComments
 *
 * @package Cotonti
 * @version 0.6.4
 * @author MusicOnly
 * @copyright All rights reserved. 2008-2009
 * @license BSD
 */

defined('SED_CODE') or die('Wrong URL');

/*----------------------------
----Comment Count-------
----------------------------*/

	$sql1 = sed_sql_query(&quot;SELECT * FROM $db_com WHERE com_authorid = $id&quot;);
	$noc = sed_sql_numrows($sql1);
	
/*-----------------------------------------
-----Display all user comments------
----------------------------------------*/	
	
	$sac = &quot;&lt;a href='https://www.cotonti.com/plug.php?e=usercomments&amp;ui=$id'&gt;&quot;.$noc.&quot;&lt;/a&gt;&quot;;
	

	
	$t-&gt;assign('USERS_DETAILS_COMCOUNT', $sac );

?&gt;
</pre></div>
</div></div>
<br />
<div style="margin:4px 0px 4px 0px"><input type="button" value="usercomments.php" onclick="if(this.parentNode.getElementsByTagName('div')[0].style.display != '') { this.parentNode.getElementsByTagName('div')[0].style.display = ''; } else { this.parentNode.getElementsByTagName('div')[0].style.display = 'none'; }" /><div style="display:none" class="spoiler">
<div class="highlight"><pre class="php">
&lt;?PHP
/* ====================
&#091;BEGIN_SED_EXTPLUGIN&#093;
Code=usercomments
Part=main
File=usercomments
Hooks=standalone
Tags=
Order=
&#091;END_SED_EXTPLUGIN&#093;
==================== */

/**
 * List of all user comments ever made
 *
 * @package Cotonti
 * @version 0.6.4
 * @author MusicOnly
 * @copyright Copyright (c) Cotonti Team 2008-2009
 * @license BSD
 */

defined('SED_CODE') &amp;&amp; defined('SED_PLUG') or die('Wrong URL');
	
	$t = new XTemplate(sed_skinfile('usercomments', true));
	
	$sql2 = sed_sql_query(&quot;SELECT * FROM $db_com WHERE com_authorid = '$ui'&quot;);

	while($row = sed_sql_fetcharray($sql2))
	{
	$t-&gt;assign(array(
		'UC_ROW_CID' =&gt; $row&#091;'com_id'&#093;,
		'UC_ROW_CC' =&gt; $row&#091;'com_code'&#093;,
		'UC_ROW_CAI' =&gt; $row&#091;'com_authorid'&#093;,
		'UC_ROW_CA' =&gt; $row&#091;'com_author'&#093;,
		'UC_ROW_CT' =&gt; $row&#091;'com_text'&#093;,
		'UC_ROW_CD' =&gt; $row&#091;'com_date'&#093;
	));
		$t-&gt;parse('MAIN.UC_ROW');
	}

?&gt;
</pre></div>
</div></div>
<br />
<div style="margin:4px 0px 4px 0px"><input type="button" value="usercomments.tpl" onclick="if(this.parentNode.getElementsByTagName('div')[0].style.display != '') { this.parentNode.getElementsByTagName('div')[0].style.display = ''; } else { this.parentNode.getElementsByTagName('div')[0].style.display = 'none'; }" /><div style="display:none" class="spoiler">
<div class="highlight"><pre class="php">
&lt;!-- BEGIN: MAIN --&gt;
&lt;div id=&quot;fullpage&quot;&gt;
You look like you did before
&lt;/div&gt;

&lt;!-- BEGIN: UC_ROW --&gt;
{UC_ROW_CID} - {UC_ROW_CC} - {UC_ROW_CAI} - {UC_ROW_CA} - {UC_ROW_CT} - {UC_ROW_CT} - {UC_ROW_CD} &lt;br /&gt;
&lt;!-- END: UC_ROW --&gt;

&lt;!-- END: MAIN --&gt;
</pre></div>
</div></div>
<br />
I got the count part working <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/grin.gif" alt=":D" /> It shows total count of user comments and when you click on that number it takes you to /plug.php?e=usercomments&amp;ui=USERID.<br />
I can only see the content of div &quot;You look like you did before&quot;, but no ROW data?<br />
<br />
What did I miss?<br />
I'm reading Koradhil's tutorial on plugins <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/smile.gif" alt=":)" /><br />
Thanks]]></description>
			<pubDate>Sun, 25 Oct 2009 04:38:00 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=3428&d=0#post18155]]></link>
		</item>
	</channel>
</rss>