A plugin that allows Joom!Fish to work with articles

More
16 years 5 days ago #3124 by ckan
Create the following files:

plugins/system/autoselectlang.php
Code:
<?php // Check to ensure this file is included in Joomla! defined( '_JEXEC' ) or die( 'Restricted access' ); $mainframe->registerEvent('onAfterRoute', 'botAutoSelectLang'); function botAutoSelectLang( $args ) { if (JRequest::getVar('option') == 'com_flexicontent') { if ($aid = JRequest::getInt('id', 0)) { global $mainframe; $lang = $mainframe->getUserState('application.lang'); $db =& JFactory::getDBO(); $query = 'SELECT j.id, ie.language' . ' FROM #__content AS i' . ' INNER JOIN #__content AS j ON i.alias = j.alias AND i.catid = j.catid AND i.state = 1' . ' LEFT JOIN #__flexicontent_items_ext AS ie ON ie.item_id = j.id' . ' WHERE i.id = ' .(int) $aid ; $db->setQuery($query); $items = $db->loadObjectList(); foreach($items as $item) { if(substr($item->language, 0, 2) == substr($lang, 0, 2)) { JRequest::setVar('id', $item->id); break; } } } } } ?>
plugins/system/autoselectlang.xml
Code:
<?xml version="1.0" encoding="UTF-8"?> <install version="1.5.0" type="plugin" group="content"> <name>Auto Language Selection</name> <author>Caesar KAN</author> <creationDate>January 2010</creationDate> <copyright>Copyright (C) 2010 Orderly Software. All rights reserved.</copyright> <license></license> <authorEmail>ckan@as05.com</authorEmail> <authorUrl></authorUrl> <version>1.0.0</version> <description>Displays Flexicontent article of the current language.</description> <files> <filename plugin="autoselectlang">autoselectlang.php</filename> </files> <params> </params> </install>
Register the plugin:
INSERT INTO `jos_plugins` (`id`, `name`, `element`, `folder`, `access`, `ordering`, `published`, `iscore`, `client_id`, `checked_out`, `checked_out_time`, `params`) VALUES
(68, 'System - Auto language Selection', 'autoselectlang', 'system', 0, 0, 1, 0, 0, 0, '0000-00-00 00:00:00', '')

Comment out the following lines in components/com_flexicontent/views/items/view.html.php:
Code:
//special to hide the joomfish language selector on item views //$css = '#jflanguageselection { visibility:hidden; }'; //$document->addStyleDeclaration($css);
Create different language versions of the same article using the same alias. (IMPORTANT!!)

Please Log in or Create an account to join the conversation.

More
15 years 11 months ago #3339 by KingoftheRoad
Hi there,

With this plugin, Can Flexicontent Item work with Joomfish module? I found Joomla language selection module disappears in item view ( www.flexicontent.org/forum/index ... =viewtopic ).

Can this plugin solve this problem?

Many thanks.

Seth

Please Log in or Create an account to join the conversation.

More
15 years 11 months ago #3353 by ckan
Yes, that is exactly what this plugin designed for!

To show the Joom!Fish language selection module, you can comment out the following lines in components/com_flexicontent/views/items/view.html.php:

//special to hide the joomfish language selector on item views
$css = '#jflanguageselection { visibility:hidden; }';
$document->addStyleDeclaration($css);

Please Log in or Create an account to join the conversation.

More
15 years 11 months ago #3355 by KingoftheRoad
Thank you so much! Hope this feature can be added in the stable release..

Seth

Please Log in or Create an account to join the conversation.

More
15 years 11 months ago #3531 by vistamedia
Clever ;-)
I'll add the ability to show/hide the language selector (in item views) as a parameter.
Thanks a lot for this plugin,
Emmanuel.

FLEXIcontent lead developer.
www.vistamedia.fr web agency and custom development.
www.joomla.fr co-administrator.
Please no PM for support request, use the forum for that!!!

Please Log in or Create an account to join the conversation.

More
15 years 8 months ago #6915 by nico65
yeah, this plugin makes flexicontent work like expected!
I just have this problem:
On my localhost installation, everything works fine without errors. And on my webspace I got this error:

Warning: Missing argument 1 for botAutoSelectLang() in /hermes/web01/xxx/xxx/mydomain.de/plugins/system/autoselectlang.php on line 7

is there a way I can fix it (beside php_flag display_errors off)

nico

Please Log in or Create an account to join the conversation.

More
15 years 8 months ago #7075 by rmb185
Hey Nico,

In case you haven't figured this out yet, I changed this line:

function botAutoSelectLang( $args )

to this:

function botAutoSelectLang( $args=null )

Also, for anyone else having problems with getting the content item to show up, be sure the default display setting in the JoomFish parameters is set to "The original content." Pulled my hair out for three days trying to figure that one out.

Please Log in or Create an account to join the conversation.

More
15 years 8 months ago #7145 by donkeyslo
Thank you for this plugin! You're a lifesaver ;)

Please Log in or Create an account to join the conversation.

More
15 years 8 months ago #7226 by micker
it's possible to do a installable zip ?
with the last version

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
15 years 5 months ago #9605 by startpoint
The solution worked with configuration Joomla 1.5.15 and Flexicontent 1.5.3c, but after updating to Joomla 1.5.18 or 1.5.20, I could not log into the admin panel. After deleting autoselectlang.php file I could go.
Please help with another solution.

This comes after login:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at D:\xampp\htdocs\site\plugins\system\autoselectlang.php:1) in D:\xampp\htdocs\site\libraries\joomla\session\session.php on line 539

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\xampp\htdocs\site\plugins\system\autoselectlang.php:1) in D:\xampp\htdocs\site\libraries\joomla\session\session.php on line 539

Notebooks, computers and software in Varna - startpointbg.com

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save