<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Parsing HTML in custom module question</title>
		<link>https://www.cotonti.com</link>
		<description>Laatste forum onderwerpen</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Sun, 12 Apr 2026 22:07:06 -0000</pubDate>

		<item>
			<title>lukgoh</title>
			<description><![CDATA[<p>
	Thanks Xerora!</p>
]]></description>
			<pubDate>Thu, 02 Feb 2012 22:42:38 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6750&d=0#post33018]]></link>
		</item>
		<item>
			<title>Xerora</title>
			<description><![CDATA[<blockquote>
	<p>
		<span style="color:rgb(68,68,68);font-family:sans-serif;font-size:13px;line-height:20px;text-align:left;background-color:rgb(238,238,238);">Is this a safe method: 604800 + time()</span><br />
		 </p>
</blockquote>
<p>
	Yup, that's exactly it</p>
]]></description>
			<pubDate>Thu, 02 Feb 2012 20:08:54 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6750&d=0#post33016]]></link>
		</item>
		<item>
			<title>lukgoh</title>
			<description><![CDATA[<p>
	I have a new question:</p>
<p>
	I am trying to set a start and end date for a page in my custom module (not an actual page in the page module). To set the date the page is submitted I am using this: (int)$sys['now'] which is working just fine. What I would like to know is how to automatically add 1 week to that value and set it as the end date?</p>
<p>
	Thanks,</p>
<p>
	Luke.</p>
<p><strong>Added 8 minutes later:</strong></p><p>
	Is this a safe method: 604800 + time()</p>
]]></description>
			<pubDate>Thu, 02 Feb 2012 19:20:46 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6750&d=0#post33015]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[<p>
	This piece of code checks file extension, runs cot_file_check() to check if file contents is secure and uses cot_safename() to generate safe filename for storage:</p>
<pre class="brush:php;">
$gd_supported = array('jpg', 'jpeg', 'png', 'gif');
$file_ext = strtolower(end(explode(".", $file['name'])));
$fcheck = cot_file_check($file['tmp_name'], $file['name'], $file_ext);
if(in_array($file_ext, $gd_supported) &amp;&amp; $fcheck == 1)
{
	$file['name']= cot_safename($file['name'], true);
	$filename_full = $usr['id'].'-'.strtolower($file['name']);</pre>
]]></description>
			<pubDate>Thu, 26 Jan 2012 18:00:56 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6750&d=0#post32947]]></link>
		</item>
		<item>
			<title>lukgoh</title>
			<description><![CDATA[<p>
	Oh, okay and then checks to make sure the uploaded file is supported as an image file?</p>
]]></description>
			<pubDate>Thu, 26 Jan 2012 16:41:25 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6750&d=0#post32946]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[<p>
	Basicly it's just old plain <a href="http://www.php.net/manual/en/features.file-upload.post-method.php" rel="nofollow">PHP file uploads</a>.</p>
]]></description>
			<pubDate>Thu, 26 Jan 2012 14:48:05 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6750&d=0#post32945]]></link>
		</item>
		<item>
			<title>lukgoh</title>
			<description><![CDATA[<p>
	Was looking in completely the wrong place, thanks once again Trustmaster. </p>
<p><strong>Added 5 minutes later:</strong></p><p>
	Although, this is a little over my head as I am knew to php, everything I have learnt so far is from backwards engineering what I can understand from the core files...</p>
]]></description>
			<pubDate>Thu, 26 Jan 2012 13:41:19 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6750&d=0#post32943]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[<p>
	That's in <a href="https://github.com/Cotonti/Cotonti/blob/master/plugins/userimages/userimages.profile.update.php" rel="nofollow">userimages.profile.update.php</a></p>
]]></description>
			<pubDate>Thu, 26 Jan 2012 13:34:02 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6750&d=0#post32942]]></link>
		</item>
		<item>
			<title>lukgoh</title>
			<description><![CDATA[<p>
	Thank you Trustmaster, seems to of fixed it! I have another question, about how Cotonti uploads files to the avatar folder. I need something similar for my module. </p>
<p>
	I am trying to see how I can upload images to a certain folder the same way Cotonti does. I have been looking through the core files but I cant seem to find where this happens.</p>
<p>
	Luke.</p>
]]></description>
			<pubDate>Thu, 26 Jan 2012 10:41:46 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6750&d=0#post32941]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[<p>
	If the problem is that it shows you page source after you submit it, it might be because of 2 things.</p>
<p>
	First, make sure you allow HTML upon variable import, so use HTM filter instead of TXT:</p>
<pre class="brush:php;">
$form['jobs_info'] = cot_import('jobs_info', 'P', 'HTM');</pre>
<p>
	Then, make sure you don't apply htmlspecialchars to it. So the output is something like this:</p>
<pre class="brush:php;">
'MY_TEXT' =&gt; cot_parse($form['jobs_info']),</pre>
<p>
	About the editor selection question, that is done by site administrator, not by user. Administrator picks a default parser and associates an editor with it. It is Cotonti's duty then to display that editor in modules. You can use a different parser in your module though, that is achieved by setting $sys['parser'] variable and passing it as a 3rd parameter to cot_parse().</p>
]]></description>
			<pubDate>Thu, 26 Jan 2012 06:02:24 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6750&d=0#post32940]]></link>
		</item>
		<item>
			<title>lukgoh</title>
			<description><![CDATA[<p>
	Yeah, I couldnt get the other editors working at all for some reason. Followed all the instructions but CKEditor is the only one that will work. I guess I want to use it exactly how it used in the forums here, just not for the forums.</p>
<p><strong>Added 1 minute later:</strong></p><p>
	I am assigning it to a tag by the way, like this: </p>
<pre class="brush:php;">
cot_textarea('jobs_info', $form['jobs_info'], 24, 120, '', 'input_textarea_editor'),</pre>
]]></description>
			<pubDate>Wo, 25 Jan 2012 22:38:34 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6750&d=0#post32939]]></link>
		</item>
		<item>
			<title>ez</title>
			<description><![CDATA[<p>
	You cannot this is default ck.... I think</p>
<p>
	you can prevent it using shift enter in stead of enter</p>
<p>
	this thing really bugs me too, i always tend to edit in pure html when ck is used</p>
<p>
	but other less skillfull users cannot do this, i never give my clients ck unless they really really ask for it</p>
]]></description>
			<pubDate>Wo, 25 Jan 2012 22:33:53 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6750&d=0#post32938]]></link>
		</item>
		<item>
			<title>lukgoh</title>
			<description><![CDATA[<p>
	Hey guys!</p>
<p>
	I'm writing a new module for my website and it requires user input via the text editor (I am using CKEditor) the text it outputs shows html, for example &lt;p&gt; the paragraph tags. I was wondering how to fix this.</p>
<p>
	Thanks in advance,</p>
<p>
	Luke.</p>
]]></description>
			<pubDate>Wo, 25 Jan 2012 22:12:32 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=6750&d=0#post32937]]></link>
		</item>
	</channel>
</rss>