Skip to main content
SMACK it Blog
K2 Upload Hack

K2 Upload Hack

Blog geschreven door Pieter op 16 april

K2 is een mooie applicatie binnen Joomla, alleen voor velen is de mediamanager bijna onbruikbaar omdat je hem vanaf de frontend niet kunt gebruiken voor image uploading. hier is een hack die dat oplost. (geschreven in engels)

if you really like to add this feature (like i did)

open file: /administrator/ components/ com_k2/ controllers/ media.php

search for: (around line 71)


// Read only access for front-end. Full access for administration section.
switch($attr)
{
case 'read' :
return true;
break;
case 'write' :
return ($mainframe->isSite()) ? false : true;
break;
case 'locked' :
return ($mainframe->isSite()) ? true : false;
break;
case 'hidden' :
return false;
break;
}

}

if ($mainframe->isAdmin())
{
$permissions = array(
'read' => true,
'write' => true
);
}
else
{
$permissions = array(
'read' => true,
'write' => false
);

</code>



Change to:


// Read only access for front-end. Full access for administration section.
switch($attr)
{
case 'read' :
return true;
break;
case 'write' :
return ($mainframe->isSite()) ? true : true;
break;
case 'locked' :
return ($mainframe->isSite()) ? true : true;
break;
case 'hidden' :
return false;
break;
}

}

if ($mainframe->isAdmin())
{
$permissions = array(
'read' => true,
'write' => true
);
}
else
{
$permissions = array(
'read' => true,
'write' => true
);

Remember, this is a hack, i have not checked anything in safety and security, use it for your own risk.
Pieter Bos
Eigenaar SMACK it Creations

Deel dit artikel

Vorige Blog

16 april
This hack enables Jsitemap to crawl to all your K2 Simple Image Gallery photos, and gives your image crawling an amazing boost  open  /plugins/content/jw_sigpro/jw_sigpro/tmpl/YOURSIGTEMPLATE/default.php (check the SIG settings for Layout template for image galleries) find (around line 24) <img class="sigProImg" src="/%3C?php_echo_%24transparent%3B_%3F%3E=" alt="<?php echo JText::_('JW_SIGP_LABELS_08').' '.$photo->filename; ?>" title="<?php echo JText::_('JW_SIGP_LABELS_08').' '....