Archive for the ‘Joomla’ Category

Div is jumping in joomla on IE

The weirdest thing you could ever see in joomla (and which I havnt seen somewhere else yet)

is the DIV jumping and it caused me to change the whole theme. then I realized after few work that the problem presisted again.

I tried to google and I read smething like if the Div jumps (when you open internet explorer and waiting for one second) it means something is tight and isnt fitting well.

Well I didn’t want to believe at first but then I tried to make the container div wider and voala! it worked.

Hope this will work for you too.

CSS can be a pain or a real pain espiceally for those who use IE

Registering Component to Database

using phpmyadmin add this query.

this will add the component to the backend list too

INSERT INTO jos_components (name, link, admin_menu_link, admin_menu_alt, ‘option’, admin_menu_img, params) VALUES (‘Reviews’, ‘option=com_reviews’, ‘option=com_reviews’, ‘Manage Reviews’, ‘com_reviews’, ‘js/ThemeOffice/component.png’, ”);

Disabling Tips on Joomla

Kinda cheesy but there is no direct way to disable tips on the site.

to remove tips you have to delete the current sentence from the document you want
JHTML::_(‘behavior.tooltip’);

now to remove tips from edit icons go to

component\com_content\helpers\icon.php and remove the JHTML::_(‘behavior.tooltip’); from there

Jlog in Php

//we will need joomla log system
jimport(‘joomla.error.log’);

$log = & JLog::getInstance();
// write variable int log
$log->addEntry(array(“level” => 0,”status”=> 1, “comment” => “helloworld :”.$ret));

Joomla Creating Functions

· To add any function you should add it to the controller of the component

class UserController extends JController

{

function display()

{

> parent::display();

}

}

· to call function in default.php

defined(‘_JEXEC’) or die(‘Restricted access’);

define(‘JPATH_BASE’, dirname(__FILE__) );

require_once (JPATH_COMPONENT.DS.’controller.php’);

UserController::functionName ();

· Make Ajax Call

index.php?option=com_user&format=raw&view=register&task=cities

· to make database connection inside a function

$database = JFactory::getDBO();

$lists = array();

$query = “SELECT * FROM #__country”;

$database->setQuery($query);

$myQuery=$database->query();

$i=0;

while($myRow = mysql_fetch_array($myQuery)){

$country[$i]['Code'] = $myRow['Code'];

$country[$i]['Name'] = $myRow['Name'];

$i++;

}

· To create a list box from the Database array result

$lists['country'] = JHTML::_(’select.genericList’,

$country, ‘country’, ‘class=”inputbox” onChange=”getCity(this.value)” style=”width:200px”‘. ”, ‘Code’,

‘Name’, $row->country);

echo $lists['country'];

Fixing TinyMCE width for joomla 1.5

I was trying to fix the TinyMCE for joomla 1.5 in all ways. None worked. I even went into the core files and tried to change them. Finally I found the sloution by adding those lines to my template CSS

.mceToolbarTop * {
float:left;
}

.mceToolbarTop select {
width:auto!important;
}

.mceToolbarTop option {
float:none;
}

Cheat Sheet

Using the rhuk_milkyway template as an example, here is a brief summary of the priniciples we’ve looked at.

Customise the Component Output

To override a component layout (for example the default layout in the article view), copy:

/components/com_content/views/article/tmpl/default.php

to:

/templates/rhuk_milkyway/html/com_content/article/default.php

Read more about component output.

Customise the Module Output

To override a module layout (for example the Latest News module using the rhuk_milkyway template), copy:

/components/mod_latest_news/default.php

to:

/templates/rhuk_milkyway/html/mod_latest_news/default.php

Read more about module output.

Add New Module Styles

To add new module styles (chrome), add them to the following file:

/templates/rhuk_milkyway/html/modules.php

Read more about module styles.

Customise the Pagination Links

To customise the way the items-per-page selector and pagination links display, edit the following file:

/templates/rhuk_milkyway/html/pagination.php

Read more about pagination.

Overriding joomla Menu module

To override joomla menu module (whether its left or right or upper one ) you have to copy the following file :

/templates/system/html/modules.php

to your template

/templates/yourtemplate/html/modules.php

and overright the function you want.

ofcourse you can also create your own menu module just you add a function to modules.php

/*
 * Module chrome that wraps the module in a definition list
 */
function modChrome_dlist($module, &$params, &$attribs)
{ ?>
	<dl class="<?php echo $params->get('moduleclass_sfx'); ?>">
	<?php if ($module->showtitle != 0) : ?>
		<dt>
			<?php echo $module->title; ?>
		</dt>
	<?php endif; ?>
		<dd>
			<?php echo $module->content; ?>
		</dd>
	</dl>
	<?php
}
 

then you can add this when calling the menu module

<jdoc:include type="modules" name="left" style="dlist" />

the default styles are :
  • table (was 0 and is the default)
  • horz (was 1)
  • none (was -1)
  • xhtml (was -2)
  • rounded (was -3)
  • outline (new – used to preview module positions – see screenshot above)

was before :

  • 0 (the default) displayed modules in a vertical table
  • 1 displayed them in a horizontal table
  • -1 displayed the raw module output
  • -2 displayed the modules in a XHTML compatible format with the title in a H3 tag.
  • -3 displayed modules in a set of nested DIVs that allowed for rounded-corner techniques

            

Integrating phpbb3 with Joomla

talking about integrating phpbb3 users to joomla.
I’ve tried JFUSION and darn its the worst module I have ever used (its so messed up and complicated more than expected)
I’ve tried to find another and hopelessly, I found nothing that can help me to do that COMPLICATED job (being sarcastic if you havnt figured that yet) honestly I was starting to make one on my own but wait wait there is a great one out there called rokbridge, or ROKBRIDGE.
And yes its the best it creates a non-invasive bridge solution for the fantastic new phpBB3 forum package.
you can check it here :

http://www.rocketwerx.com/products/rokbridge/

Joomla Upload Images Problem

The first problem faced me while trying to upload is not being able to upload using Media manager at all.

to solve this problem I’ve added those two lines to .httaccess

SecFilterEngine Off
SecFilterScanPOST Off

Now the second problem was not being able to upload in front end, and to solve this problem did the following :

Go to admin panel -> Site Menu -> Global Configuration -> System -> Enable Flash Uploader (Set to no)

and thats it!

Return top

INFORMATION

Change this sentence and title from admin Theme option page.