<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : cross plugin code or data</title>
		<link>https://www.cotonti.com</link>
		<description>Neueste Themenbeiträge</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Fri, 17 Apr 2026 12:30:47 -0000</pubDate>

		<item>
			<title>ez</title>
			<description><![CDATA[<p>
	LOL... i am still working Genoa... so didnt see that</p>
]]></description>
			<pubDate>So, 02 Okt 2011 08:20:33 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=6537&d=0#post30878]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[<p>
	In Siena you just do this:</p>
<pre class="brush:php;">
require_once cot_incfile('module_name', 'module');</pre>
<p>
	or to reuse plugin functions:</p>
<pre class="brush:php;">
require_once cot_incfile('plugin_name', 'plug');
</pre>
<p>
	You can also detect if that module or plugin is loaded on site:</p>
<pre class="brush:php;">
if (cot_plugin_active('plugin_name'))
{
    require_once cot_incfile('plugin_name', 'plug');
    // ...
}

if (cot_module_active('module_name'))
{
    require_once cot_incfile('module_name', 'module');
    // ...
}</pre>
]]></description>
			<pubDate>So, 02 Okt 2011 08:09:10 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=6537&d=0#post30877]]></link>
		</item>
		<item>
			<title>ez</title>
			<description><![CDATA[<p>
	I sometimes need code or data that is cross plugin, so i want to use functions or I want to get data that come from other plugins.<br />
	And because I want all code for a plugin in one place, I made the 'custom' function below:</p>
<p>
	You can make what I call modules and they must be in the modules folder of any plugin.</p>
<p>
	 </p>
<pre class="brush:php;">
/*======================================================================
	Function:   cf_load_module
	
		With this function we can load any code (called modules) from other plugins.
		In this way we can get/set any value from any plugin via functions that
		belong to that specific plugin.
		There can be separate modules that we can use... so we can devide functionality
	
		parameters:
						pluginname		should be the pluginname
						modulename		empty will load the default
											pluginname.module.php
										value will load
											pluginname.module.&lt;value&gt;.php
		
		return values:
						false if the file was not found or the plugin is inactive
						true if the file was found and loaded
		
======================================================================*/	
function cf_load_module($pluginname='',$modulename='') {
    global $cfg,$sed_plugins;
    $ret=false;
    $pluginactive=false;
    
    if ($pluginname!="") {
        // check if plugin is active
        if (is_array($sed_plugins))
        {
            foreach($sed_plugins as $i =&gt; $k)
            {
                if($k['pl_code']==$pluginname)
                {
                    $pluginactive=true;
                    break;
                }
            }
        }
        if (!$pluginactive) {
            // plugin is not installed
            return false;
        }
    
    
        if ($modulename!='') {
            $filename = $cfg['plugins_dir'].'/'.$pluginname.'/modules/'.$pluginname.'.module.'.$modulename.'.php';
        } else {
            $filename = $cfg['plugins_dir'].'/'.$pluginname.'/modules/'.$pluginname.'.module.php';
        }        
        if (file_exists($filename)) {
            require_once($filename);
            $ret=true;
        }
    }    
    return $ret;
}
</pre>
<p>
	 </p>
<p>
	How to use it:</p>
<pre class="brush:php;">
	if (cf_load_module("myproject","users")) {
		// 0 = current logged in user
		$ret=mod_mpr_users_getProjectRights('STRING',$userid,$projectid);
	}	
</pre>
<p>
	<br />
	In this example it loads the 'users' part from the myproject plugin (i am working on)</p>
<p>
	Hope somebody can use the idea :D</p>
]]></description>
			<pubDate>So, 02 Okt 2011 07:46:53 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/de/forums?m=posts&q=6537&d=0#post30876]]></link>
		</item>
	</channel>
</rss>