Wednesday, 22 April 2015 08:06

Removing unnecessary fields in the Frontend K2, are allowed to add article to Favorites to moderators Kunena

Written by
Rate this item
(1 Vote)

Hi People! If you like I need to get rid of annoying and unnecessary ordinary mortal fields in the front, here's what to do:

Need to go to find it /you_template/com_k2/default/itemform.php lines relating to these items and immediately remove it! :) And to think better and make for a smart ...

Those who have also installed Kunena forum and they want to make access to the facility and hut Published - can add a condition to check for moderatorstvo calling helper Kunena, like so:

<?php if($this->mainframe->isAdmin() || ($this->mainframe->isSite() && $this->permissions->get('publish'))): ?>
								
	<?php	
		$kuser = KunenaUserHelper::getMyself () ;   
		if ($kuser->moderator) { 
	?>
	<tr>

		<td class="adminK2LeftCol">
			<?php echo JText::_('K2_IS_IT_FEATURED'); ?></label>
		</td>
		<td class="adminK2RightCol">
			<?php echo $this->lists['featured']; ?>
		</td>
	</tr>
	<? } ?>
	<tr>
		<td class="adminK2LeftCol">
			<label><?php echo JText::_('K2_PUBLISHED'); ?></label>
		</td>
		<td class="adminK2RightCol">
			<?php echo $this->lists['published']; ?>
		</td>
	</tr>
<?php endif; ?>

What do you do on your site?

Read 1268 times Last modified on Wednesday, 22 April 2015 08:23
Admin

Live and Be Free

Related items

  • Free download kunena 5 theme - BlueEagle5

    If you want download free theme for Kunena5 Forum - do it.

    If you like Theme Parketdoska.ua/forum then you can download latest version from GitHub https://github.com/ut4utc/WoodEagle5/archive/master.zip

    or direct from this site

  • Unset Joomla Scripts from Template (k2 and other)
    in PHP
    // Unset unwanted Scripts - by name
    $unset_scripts = array(
    	'k2',
    	'...',
    );
    
    foreach($this->_scripts as $name=>$script)
    {
    	if (!preg_match('#(' . implode('|', $unset_scripts) . '#i', $name))
    	{
    		continue;
    	}
    
    	unset($this->_scripts[$name]);
    }

    or if you use joomla v3.8.1 you can try this php code:

    <?php
    	$doc = JFactory::getDocument();
    	unset($doc->_scripts[JURI::root(true) . '/media/system/js/mootools-more.js']);
    	unset($doc->_scripts[JURI::root(true) . '/media/system/js/mootools-core.js']);
    	unset($doc->_scripts[JURI::root(true) . '/media/system/js/core.js']);
    	unset($doc->_scripts[JURI::root(true) . '/media/system/js/modal.js']);
    	unset($doc->_scripts[JURI::root(true) . '/media/system/js/caption.js']);
    	unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery.min.js']);
    	unset($doc->_scripts[JURI::root(true) . '/media/jui/js/jquery-noconflict.js']);
    	unset($doc->_scripts[JURI::root(true) . '/media/jui/js/bootstrap.min.js']);
    ?>

    if you wand disable all js & css scripts - use code:

    $doc->_scripts     = null;
    $doc->_script      = null;
    $doc->_styleSheets = null;

     

  • [solved] How you can remove copyright Powered by 'Kunena' in Kunena 4x

    In new version Kunena 4x copyright location in root_folder/libraries/kunena/view.php

    Find function on line 729 and replace it with my version or comments line 9 and 20:

    // line 749
    final public function poweredBy()
    	{
    		if ($this->inLayout)
    		{
    			throw new LogicException(sprintf('HMVC template should not call %s::%s()', __CLASS__, __FUNCTION__));
    		}
    
    		/* In here we are comment credits
    		$credits = '<div style="text-align:center">';
    		$credits .= JHtml::_('kunenaforum.link', 'index.php?option=com_kunena&view=credits', JText::_('COM_KUNENA_POWEREDBY'), '', '', 'follow', array('style'=>'display: inline; visibility: visible; text-decoration: none;'));
    		$credits .= ' <a href="https://www.kunena.org" rel="follow" target="_blank" style="display: inline; visibility: visible; text-decoration: none;">'.JText::_('COM_KUNENA').'</a>';
    
    		if ($this->ktemplate->params->get('templatebyText'))
    		{
    			$credits .= ' :: <a href ="'. $this->ktemplate->params->get('templatebyLink').'" rel="follow" target="_blank" style="text-decoration: none;">' . $this->ktemplate->params->get('templatebyText') .' '. $this->ktemplate->params->get('templatebyName') .'</a>';
    		}
    
    		$credits .= '</div>';
    		*/
    		$credits = '';
    	}
    // end in line 749

    Its work well!

  • [ solved ] k2 joomla - fix Tags, when K2 remove spaces and Dashes

    If you save K2 article and K2 remove from the Tags spases and dashes - we need fix this in function check (). Open administrator\components\com_k2\tables\k2tag.php. Pleace find line 30 and replase this code

    // Oldest line 30
    $this->name = JString::str_ireplace('-', '', $this->name);

    Replase old line in this code:

    // approve - and space
    $this->name = JString::str_ireplace('-', '&mdash;', $this->name);
    $this->name = JString::str_ireplace(' ', '&nbsp;', $this->name);
  • How to Replace a tag to K2 to another via phpMyadmin?

    To replace Teg you should run a query UPDATE. First you need to go to K2-> Tags and find out under what id is required tags. Next in phpMyadmin we insert sql query code like this:

    -- If we want to replace the tag id 6 wherever there is tag with id 12, the request will be so
    UPDATE `you_prefix_k2_tags_xref` SET `tagID` = '6' WHERE `you_prefix_k2_tags_xref`.`tagID` =12;