Saturday, December 15, 2007

Joomla modules Install from Directory mode

In some situations, installation fails, and in this instance, we have to use the Install from Directory feature. For this scenario, you will have to Unzip the module package onto your local PC. You shall subsequently FTP the module folder onto your webserver. Next, you shall enter the absolute path to the modules .xml file. For example, /host/home/username/htdocs/Joomla/installer/
modules/mod_transmenu/mod_transmenu.xml. Then select Install

Module_Install

Blogged with Flock

Sunday, December 2, 2007

Untitled

The following is a step by step guide to customizing your Firenzie logo image by replacing the logo text with your own organization or company's name and logo.

In order to utilize the Fireworks Source PNG included with the Firenzie template release, you will need Adobe Fireworks. The 30-day free trial of this software as well as more information is available here at the Adobe website.

Customizing Your Logo

One of the first steps of customizing your new Firenzie template will undoubtedly be altering the logo text to reflect the name of your company / organization. RocketTheme makes this process a simple one by including both the Source PNG for the template, as well as font(s) used.

The most effective way to customize the logo is to use the included Source PNG file. When opened in Adobe Fireworks, this file contains all of the Layers in the design allowing you to tweak and change any of the image elements of the template design. The following steps will help you quickly get your new logo ready to go:

  • Step 1

    First, open the main Source PNG file in Adobe Fireworks (firenzie_source.png). On the right side, you will notice a taskbar named Layers. Inside this column, a list of elements within the source will appear, dividied into folders. The first is Web Layers which controls the green slices on the page that are used to export the images. Click the eye which is immediately left to the folder name Web Layers to make it invisible. This allows use to edit the logo.

  • Step 2Logo

    Next, double click on the logo which should be position in top-left. This will activate the text tool so you can edit the element. Highlight the entire text box with your cursor and type your text instead(such as your company name.)
    Logo

  • Logo


  • We do the same for the text underneath, double click on this text which should be situated below the logo.. This will activate the text tool so you can edit the element. Highlight the entire text box with your cursor and type your text instead(such as your company slogan.)
    Logo
  • Step 3Logo

    Since the new logo text is larger than the slice, we much make the slice larger. Left click and drag on the right corner to the new dimensions. However, you will notice that the slice masthead-bg now overlaps the logo, simple left click and move to the right so it is no longer overlapping. We now must reactive the web layers/slices to be able to export the logo out of Fireworks. Back in the right taskbar, click the empty, white cell next to the web layers folder where the eye was visible before. This will activate the eye icon and the green slices on the source screen.
    Logo

  • Step 4
  • Logo
    Logo
    Right click on the green slice that is situated above your new logo. A popup menu should appear with numerous options. The value we want to deal with is "Export Selected Slice...". As the name suggests, this option will export/save this slice only out of the entire source window. You will be sent to a another window where you need to save the slice onto your local computer.

    Logo

Uploading your Logo

Once you have successfully edited then exported your new logo, you will need to upload it to your server. This process is best done via a FTP client such as Filezilla

  1. Open your FTP client on your local computer.
  2. Login to your web server where Firenzie is installed.
  3. Navigate to the /templates/rt_firenzie/images/style# directory.
  4. Upload logo.png to this directory (You may need to browse on the local panel in the FTP client to find where you have exported your logo).
  5. Clear your browser cache before viewing such as using the keyboard commands on Windows, Ctrl+F5.
Ensure that you are uploading the correct logo to avoid confusion if it does not change. Also take into account hosting permissions. Sometimes, hosters which are not designed for Joomla may have permissions not suited for the setup, thus, the upload will not be complete. In this case, contact your hosting provider.


Blogged with Flock

Jommla Security

1. Kurulu Joomla! eklentilerini kontrol edin, güvenlik riski taşıyanları kaldırın.
2. Gereksiz modül, bileşen ve mambot türü eklentileri kaldırın.
3. Dizin, dosya ve klasörlerinizin CHMOD ayarları kontrol edin ve güvenli olacak şekilde değiştirin.
4. Mümkün olduğunca kullanıcı tarafından yüklemeleri (upload) kapatın veya sınırlandırın. yüklemelerin özel bir klasörde toparlanmasını sağlayın. Tüm yüklemelerin güvenlik uygulamalarıya taranabilmesini sağlayın. (Bunun için virtual private server veya dedicated server gerekecektir!)
5. Maddi imkanınız el veriyorsa dedicated server kiralayın veya kendi sunucunuzu güvenilir bir data center da barındırın!
6. Unix tabanlı bir sunucu tercih edin.
7. Apache ve PHP yapılandırmalarını güveliği sağlayacak şekilde düzenleyin.

Joomla! 1.0.13 kurulu bir siteye index atmak suretiyle saldırı gerçekleştiriliyorsa buna olanak sağlayan 3. parti bir eklenti kullanıyorsunuzdur!

Sunucu kayıtlarını (log) kontrol edin, saldırının yapıldığı tarih ve saatte siteye erişim sağlayan IP leri tespit ederek yasal işlem başlatın


Blogged with Flock

Thursday, November 29, 2007

CSS Cheat Sheet

The CSS cheat sheet is designed to act as a reminder and reference sheet, listing all selectors (as of CSS 2.1) and properties. It includes a visual example of the box model, unit reference for CSS units and the various media types CSS makes allowance for. A description of what is on the cheat sheet follows, or if you are impatient, you can go straight to the full size CSS cheat sheet.


Properties List



Thumbnail highlighting properties list.


The CSS specification includes a lot or properties, many of which are often forgotten or overlooked. Many of these are shorthand properties, defining many properties in one go. The outside columns of the cheat sheet list all available CSS properties.

Syntax


Thumbnail highlighting syntax area.


Syntax is one area in CSS where many people stumble when learning it. Often, designers new to the language can spend a great deal of time trying to work out why a specific style isn't being applied, and many times it is either due to a syntax error or inheritance.

Selectors


Thumbnail highlighting selectors list.


Given the number of possible selectors in CSS, it is no wonder some people often become confuse. Mixing up ID and Class selectors is easy enough, without throwing sibling, child, attribute and language selectors into the mix. This section of the cheat sheet lists selectors and shows which element(s) those selectors would apply to.

Pseudo-Selectors


Thumbnail highlighting pseudo selectors list.


Pseudo-selectors are used when defining styles for elements that either do not exist, or are in a particular state. This section lists various of the pseudo-selectors.

Please note - I have left the :before and :after pseudo-selectors off this list, as I felt generated content was too complex to add to this sheet and still define in a way that made that area of the sheet usable.

Media Types


Thumbnail highlighting media types list.


One of the reasons CSS is so powerful is that it makes allowance for different types of devices accessing the same data. This is controlled through media types, and though they are not used in CSS as much as many would like, the chances are that this will change and media types will become more important. This section lists the various media types defined in CSS 2.1.

Box Model


Thumbnail highlighting box model area.


The box model is one thing that consistently trips up those new to CSS. Apart from major browsers not all supporting it correctly, its definition can be at first confusing. The box model section of the page aims to make this clearer.

Units


Thumbnail highlighting list of units.


CSS allows the author to define dimensions and colours in many different ways, which can be especially useful when combined with media types. This section of the sheet lists the various units in CSS and explains what they mean.

Properties that Inherit



Thumbnail highlighting list of properties that inherit.


Inheritance is another area that trips up new and experienced CSS developers alike. An element within another element can use the same value as its ancestors. For example, if you define a font family for a <div>, and next a <span> within it, the <span> will use the same font family as the <div>, unless explicitly set to be different. Not all properties inherit though, and this section lists (alphabetically) those that do.

So now that you know what it does, please feel free to print out the CSS cheat sheet:



CSS Cheat Sheet - Cheat Sheets - ILoveJackDaniels.com

Dave Child created this excellent guide.
Dave Child bu harika yordami yaratti.

The CSS cheat sheet is designed to act as a reminder and reference sheet, listing all selectors (as of CSS 2.1) and properties. It includes a visual example of the box model, unit reference for CSS units and the various media types CSS makes allowance for. A description of what is on the cheat sheet follows, or if you are impatient, you can go straight to the full size CSS cheat sheet.


Properties List



Thumbnail highlighting properties list.


The CSS specification includes a lot or properties, many of which are often forgotten or overlooked. Many of these are shorthand properties, defining many properties in one go. The outside columns of the cheat sheet list all available CSS properties.

Syntax


Thumbnail highlighting syntax area.


Syntax is one area in CSS where many people stumble when learning it. Often, designers new to the language can spend a great deal of time trying to work out why a specific style isn't being applied, and many times it is either due to a syntax error or inheritance.

Selectors


Thumbnail highlighting selectors list.


Given the number of possible selectors in CSS, it is no wonder some people often become confuse. Mixing up ID and Class selectors is easy enough, without throwing sibling, child, attribute and language selectors into the mix. This section of the cheat sheet lists selectors and shows which element(s) those selectors would apply to.

Pseudo-Selectors


Thumbnail highlighting pseudo selectors list.


Pseudo-selectors are used when defining styles for elements that either do not exist, or are in a particular state. This section lists various of the pseudo-selectors.

Please note - I have left the :before and :after pseudo-selectors off this list, as I felt generated content was too complex to add to this sheet and still define in a way that made that area of the sheet usable.

Media Types


Thumbnail highlighting media types list.


One of the reasons CSS is so powerful is that it makes allowance for different types of devices accessing the same data. This is controlled through media types, and though they are not used in CSS as much as many would like, the chances are that this will change and media types will become more important. This section lists the various media types defined in CSS 2.1.

Box Model


Thumbnail highlighting box model area.


The box model is one thing that consistently trips up those new to CSS. Apart from major browsers not all supporting it correctly, its definition can be at first confusing. The box model section of the page aims to make this clearer.

Units


Thumbnail highlighting list of units.


CSS allows the author to define dimensions and colours in many different ways, which can be especially useful when combined with media types. This section of the sheet lists the various units in CSS and explains what they mean.

Properties that Inherit


Thumbnail highlighting list of properties that inherit.


Inheritance is another area that trips up new and experienced CSS developers alike. An element within another element can use the same value as its ancestors. For example, if you define a font family for a <div>, and next a <span> within it, the <span> will use the same font family as the <div>, unless explicitly set to be different. Not all properties inherit though, and this section lists (alphabetically) those that do.

So now that you know what it does, please feel free to print out the CSS cheat sheet:



Blogged with Flock




Blogged with Flock

Wednesday, November 28, 2007

UTF-8 issues in Joomla 1.0.x series - a guid


Is there a workaround to apply utf-8 in Joomla 1.0.x series?
Yes. Here is a quick guideline to getting Joomla 1.0.x to work with utf-8
- use MySQL version 4.1.2 or newer (older versions don't support utf-8).
- create an empty database manually before installing Joomla. Set the character set to utf8 when creating with some collation (utf8_general_ci is the default and should be OK).
- convert the language files to utf-8 (all language files including for editors, components etc.). Make sure NOT to save with the utf-8 BOM header option.
- Install Joomla using the pre-existing database. After installation check that the database has utf8 encoding for all text fields (just in case Joomla created a new database and is not working on the pre-created one).
- set 'charset=utf-8' in the _ISO define in the language file
- You should uncomment one line of code in the includes/database.php file at about line 102 (second line below)
Code:
$this->_table_prefix = $table_prefix;
//@mysql_query("SET NAMES 'utf8'", $this->_resource);    // THIS IS THE LINE TO UNCOMMENT
$this->_ticker = 0;
$this->_log = array();

Please note that the above does not make Joomla 1.0.x fully utf-8 compatible. All string functions will still be using singlebyte character functions. This works well in most cases (no guarantees). There will be some instances of garbage characters especially with diacritic Latin characters and logical error in searches and filtering features.


Blogged with Flock

Monday, November 26, 2007

Understanding Joomla / Mambo CSS in 5 minutes


Image

2. Where to find this CSS

Each Joomla / Mambo template has a CSS file named " template_css.css" located in
%installdir%/templates/template_name/css folder. Location structure of a template is as follows:

installdir/templates/
|
+- template_name/
|
+- index.php
|
+- template_thumbnail.png
|
+- templateDetails.xml
|
+- css/
| |
| +- template_css.css

3. Break down a little further

By now, you have had an overview of Joomla / Mambo CSS, I list here all the CSS elements of Joomla 1.0.X / Mambo 4.5.X with detail explanation so that you can understand further. This is a blank (no style is set) but totally complete css file of a standard Joomla / Mambo template.

You can highlight and copy then paste into your text editor or download the sample CSS file (right click >> save target as). Most of css files of many templates do not include all Joomla / Mambo CSS elements (even the default ones). So my Mambo standard css file will be a good place for you to start from.

/* STANDARD COMPLETE CSS FOR JOOMLA 1.0.X and MAMBO 4.5.X TEMPLATES */
/* By Dinh Viet Hung (C) http://www.joomlart.com: Free templates and Professional Templates Club */
 
 
/* DEFAULT SETTINGS */
/* Below are default settings are used when no other style has been defined.*/
body {}/*Style for the body tag of your website, controls font family page background, etc.*/
p {} /*formatting all <div> (division) items. This is a catch-all that only applies when no other
style has been defined.*/

td {} /*formatting all
<td> items. This default setting is used when no other style has been defined.*/

tr {} /*formatting all
<tr> items. This default setting is used when no other style has been defined.*/

ul {} /*formatting all UL (unordered list) items. This default setting is used when no other style
has been defined.*/

a:link {} /* general links style*/
a:visited {}
a:hover {}
hr {} /* horizontal line in your template*/
hr.separator {}
 
/* FORMS SETTINGS */
.button {}
.inputbox {}
.search {} /*formatting the <div> which holds search items: inputbox, search button...*/
 
 
/* NAVIGATION/MENU SETTINGS */
 
a.mainlevel{} /* this styling is for the MAIN items in the menu */
a.mainlevel:link {}
a.mainlevel:visited {}
a.mainlevel:hover {}
 
#active_menu {} /* this styling is for the menu item when it is active, even in main/sub position*/
 
ul#mainlevel-nav {}
ul#mainlevel-nav li{}
#mainlevel-nav a:link {}
#mainlevel-nav a:visited{}
#mainlevel-nav a:hover {}
 
a.sublevel{} /* this styling is for menu items that HAS A PARENT */
a.sublevel:link {}
a.sublevel:visited {}
a.sublevel:hover {}
 
.pagenavbar {} /*Sets the style for the footer navigation ("<< Start < Prev Next > End >>")
when they do not appear as hyperlinks (when only a few articles exist).*/

.pagenavbar:link {} /*Style for the footer navigation ("<< Start < Prev Next > End >>") when
they become hyper links*/

.pagenavbar:visited {}
 
.pagenav {} /* as the name implies, this is for formatting texts for those
"<< Start < Previous 1 Next > End >>" links */

a.pagenav:visited {}
a.pagenav:hover {}
 
a.readon:link {} /*Style for the "Read More" link that is displayed for large content items*/
a.readon:hover {}
a.readon:visited {}
 
.back_button {} /*Style for the "BACK" button*/
.pagenav_prev {} /*Style for the PRE button*/
.pagenav_next {} /*Style for the NEXT button*/
 
.latestnews ul {} /*Style for latest news list - by default, latest news is user1 module*/
.latestnews li {}
 
.mostread ul{} /*Style for most popular list - by default, most popular is user2 module*/
.mostread li{}
 
/* CONTENT PAGE SETTINGS */
a.category:link {}
a.category:hover {}
a.category:visited {}
 
.blogsection {} /* Formatting the links in Blog section */
.blog_more {} /*The "More" text in blog section*/
a.blogsection:link {} /* set the link format */
a.blogsection:visited {} /* same as above, but to set the visited link format */
a.blogsection:hover {} /* same as above, but for links with mouse pointer over it */
 
.componentheading {}/* Title of the component being used to display the content.*/
.contentheading {} /* Title of the content, article, etc. being displayed.*/
.contentpane {} /* Table that holds all non-article information (components,
category lists, contact forms, etc).*/

.contentpaneopen {} /* Table that holds the actual text for an article.*/
.contentpagetitle {} /*Title of articles*/
 
a.contentpagetitle:hover {} /*Title of articles when appeare as links */
a.contentpagetitle:link {}
a.contentpagetitle:visited {}
 
.contentdescription {} /* Formating the "DESCRIPTION" of sections, categories
(News/Weblinks/Latest news...) */

table.contenttoc {} /* Formating the table of the Tables of Contents for multiple
pages content or article */

table.contenttoc td {} /* same as above, used to format the td and able cells */
table.contenttoc th {} /* same as above, used to format the th of "Tables of
Content" ( normally Article Index)*/

table.contenttoc td.toclink {} /* same as above, used to format toc link texts*/
a.toclink:link {} /* same as above, used to format toc link text status*/
a.toclink:visited {}
a.toclink:hover {}
 
 
/* JOOMLA - MAMBO SECTIONS LISTINGS */
.sectiontableheader {} /* This is for styling the section table headers on a
SECTION's page. Example: table header of "Date", "Item Title", "Author" and "Hits"? */

.sectiontableentry1 {}
.sectiontableentry2 {}
 
 
/* JOOMLA - MAMBO MODULES FORMATTING */
table.moduletable {} /* Formatting the module table */
table.moduletable th {} /* Formatting the module header, and the module titles */
table.moduletable td {} /* Formatting the table cells of the module table */
 
 
/* MISCELLANEOUS */
 
/* Dates , Authors*/
.createdate {} /* For styling the date the content/articles are created under contents title */
.modifydate {} /* Formating "Last updated on" text at the end of articles/contents */
.small {} /* Formating "Written by:...." text */
.smalldark {}/*Found in poll result page, for " Number of Voters".. text */
 
/* Polls */
.poll {} /* format the td of poll table */
.pollstableborder {} /* set the border properties of the polls voting table */

 
/* Weblinks */
.weblinks{} /* well.. to format the link's titles under the "Weblinks"
section on the frontend */

a.weblinks:hover {} /* same as above, but for link with mouseover */

/* Newsfeeds */
.newsfeedheading {} /* The newsfeed title. NOTE: This will not affect the newsfeed's
news title! */

.newsfeeddate {} /* yeah.. the date on the newsfeed */
.fase4rdf {} /* this is the body text of the newsfeed */

/* Search page */
table.searchintro {} /* This is for formatting the box with "Search Keyword: test
returned 4 matches" box that appears after you have entered a search value.
It appears on the mainbody with the search results */

 
 
/* JOOMLA - MAMBO TABBED FRONTEND ADMIN INTERFACE */
/* The CSS below efines how the frontend admin interface when logged in */

.ontab {}/* For styling of the "Tab" buttons when editing contents through the
frontend as admin.
This .ontab is the styling for the tab when it is active or after its "clicked" */

.offtab {} /* Same as above, used for styling of the "Tab" buttons when editing
contents through the frontend.
This the styling for the tab when it is NOT active or when it is NOT "clicked" */

.tabpadding {} /* this style is used set the size of the tab in the above */
.tabheading {} /* Not too sure what this is used for. Couldn't find anything
related to it yet at the moment */

.pagetext {} /* this style is used to style the content of the editing form
contents (where HTMLArea sits and all its forms + contents) in the frontend
Administration interface */




|
+- images/



4. Joomla / Mambo Template CSS: Tweaking and Tuning

Normally, you tend to make your template look match with your site contents or just want to make it distinguished from the others. Therefore, playing around with your css file is the most popular practice of Joomla / Mambo users. The file you have just download is not filled with any style at all. If you do not want to start from scratch or feel un familiar with css styling, you can open another template_css.css file of any existing templates for css reference, copy and paste, make some changes and refresh to see how they affect your Jooma / Mambo site.

5. Is that all?

template_css.css is just a part of Joomla / Mambo templating job. CSS defines content elements your Joomla / Mambo pages. Layout and modules navigation of your template are also important. Details of Joomla / Mambo layout are also picturized and well explained in this tutorial: Joomla / Mambo layout and navigation guides.


Reading this article will give you:

  • Basic overview of mambo layout.
  • Tricks to well organize your page contents with mambo modules.

2. Joomla / Mambo layout overview.

Mambo Layout
Picture 1: Mambo Layout Overview

3. Layout explained

As you can see from Picture 1, Joomla / Mambo layout looks quite the same as any standardized portal webpages with 5 main parts:

  1. Top: <pathway>, <user3> and <user4> modules.
  2. Left: <left> module.
  3. Center: <banner>, <user1>, <user2> and <mainbody> modules.
  4. Right: <right> module.
  5. Bottom: <footer> module.

This is just a default layout, all modules can be placed anywhere defined in the index.php file of the template. The syntax of loading modules PHP code as follows:

mosLoadModules( $position_name [, $style] )

With Joomla 1.0.1 / Mambo 4.5.2 and older versions, we have 0 (default), -1, 1, -2 or -3? for the $style of Joomla / Mambo. In Joomla / Mambo 4.5.2.1 the value "-3" for the $style was introduced. So what are the differences of using 0, -1, 1, -2 or -3? [ see (c) in Picture 1 ]

  • 0 = (default ). Modules are displayed in a column. The following shows an example of the output:
<!-- Begin : Individual module -->
<table cellpadding="0" cellspacing="0" class="moduletable[suffix]">
<tr>
<th valign="top">Module Title</th>
</tr>
<tr>
<td>
Module output
</td>
</tr>
</table>
<!-- End : Individual module -->
  • 1 = Modules are displayed horizontally. Each module is output in the cell of a wrapper table. The following shows an example of the output:
<!-- Begin : Module wrapper -->
<table cellspacing="1" cellpadding="0" border="0" width="100%">
<tr>
<td align="top">
<!-- Begin : Individual module -->
<table cellpadding="0" cellspacing="0" class="moduletable[suffix]">
<tr>
<th valign="top">Module Title</th>
</tr>
<tr>
<td>
Module output
</td>
</tr>
</table>
<!-- End : Individual module -->
</td>
<td align="top">
<!-- ...the next module... -->
</td>
</tr>
</table>
  • -1 = Modules are displayed as raw output and without titles. The following shows an example of the output:
Module 1 OutputModule 2 OutputModule 3 Output
  • -2 = Modules are displayed in X-Joomla / Mambo format. The following shows an example of the output:
<!-- Begin : Individual module -->
<div class="moduletable[suffix]">
<h3>Module Title</h3>
Module output
</div>
<!-- End : Individual module -->
  • -3 = Modules are displayed in a format that allows, for example, stretchable rounded corners.
<!-- Begin : Individual module -->
<div class="module[suffix]">
<div>
<div>
<div>
<h3>Module Title</h3>
Module output
</div>
</div>
</div>
</div>
<!-- End : Individual module -->

I myself really like features of the new "-3" style. Using the "-3" will help you to create stylish rounded corners template for Joomla / Mambo. Step-by-step on how to create a rounded module is guided in this tutorial.

4. Tricks to hide / display modules wisely.

Obliviously in Joomla / Mambo templating, you have to preserve an area for a module to display. This area is often created with a fixed width block using <table, <td> or <div> tags . And the outcome of of this is when the module you desire to display is unpublished, the block you preserve will still be there, creating an ugly blank area and take the space of other contents. Therefore, a simple solution using if {} condition + mosCountModules syntax will be a perfect workaround. [ See (b) in Picture 1 ]

The sample code you see in Picture 1 is a standard one, a more complex if {} will produce a better result and remove unnecessary HTML codes. For example:

<!-- Begin : set the width for td of user1 and user2  -->
<?php
$numblock = 0;
if (mosCountModules( "user1" )>0 && mosCountModules( "user2" )>0) {
$numblock = 2;
$blockwidth = 50;
}else if (mosCountModules( "user1" )>0 || mosCountModules( "user2" )>0) {
$numblock = 1;
$blockwidth = 100;
}
?>
<!-- End : set the width for td of user1 and user2 -->
 
<!-- Begin : load module user1 and user2 -->
<?php if ($numblock > 0) { ?>
<tr>
<?php if (mosCountModules( "user1" )) { ?>
<td width="<?php echo $blockwidth; ?>%" valign="top">
<div class="colorbox">
<div id="user1" class="roundblock">
<?php mosLoadModules ( "user1", -3 ); ?>
</div>
</div>
</td>
<?php } ?>
<?php if (mosCountModules( "user2" )) { ?>
<td width="<?php echo $blockwidth; ?>%">
<div id="user2" class="roundblock">
<div class="colorbox">
<?php mosLoadModules ( "user2", -3 ); ?>
</div>
</div>
<?php } ?>
</tr>
<?php } ?>
<!-- End : load module user1 and user2 -->

I use above codes in MBT GREY template to organize user1 and user2 modules. Those advanced if {} codes will divide user1 and user2 display areas into 2 equal boxes if both are published [Picture 2]; stretch the box to fit with the main content when one of them is unpublished [Picture 3] and, of course both will be totally removed when they are unpublished.

User 1 and User 2Picture 2: User1 and User2 published
Picture 2: User1 and User2 published
Picture 3: User1 published, User2 unpublished
Picture 3: User1 published, User2 unpublished

Though the above tricks can be applied in all modules (especially left, right, top, users), to some standard modules which are often the "must have" modules of a your site like search (user4) , topmenu (user3), pathway (pathway), and mainbody (mosMainBody) then a simple if {} is enough. [ See (a) in Picture 1 ]

5. Bottom lines.

There are other 2 functions that are quite useful in Joomla / Mambo templates:

  • $mosConfig_sitename: use to display your site title. You can put this code in your header/logo area. For example
<?php echo "$mosConfig_sitename!"; ?>
  • $mosCurrentDate: use to display date
<?php echo mosCurrentDate(); ?>
or:
<?php echo mosFormatDate('2005-01-01 10:00:00'); ?>

Blogged with Flock

Friday, November 23, 2007

Joomla International (Turkish)


Joomlayı kurdunuz ancak bazı karakter sorunlarınız var. Ne yapmalısınız?

1-Öncelikle Joomlanın dilini Türkçe yapmalısınız. Bunun için Site Genel Ayarları ndan Yerel sekmesine gelin:

Dil: Türkçe

Ülke Yereli: tr_TR olmalıdır. Tabi bunun için sürümünüz içinde Türkçe dil dosyası bulunmalıdır.

Bu ayar sonucunda sitenize eklediğiniz tüm bileşenlerde default dil olarak Türkçeyi arayacaktır. Eğer bileşenin Türkçe dil dosyası yoksa ingilizce çalışacaktır.

2- Temanızın index.php dosyasının en üstünde;

<?xml version="1.0" encoding="iso-8859-1"?>  satırını
<?xml version="1.0" encoding="iso-8859-9"?>  ile değiştirin.

3- Türkçe Dil dosyası içindeki turkish.php dosyasının üst satırlarında

<?php header ("Content-Type: text/html; charset=ISO-8859-9"); ?>   satırının olduğundan emin olun.

4-Bileşen, tema veya modüller kurulduktan sonra karakter hataları veriyorsa;
Kurmadan önce zipleri açıp; xml dosyasının en üst satırında:

<?xml version="1.0" encoding="iso-8859-9"?>  olduğundan emin olun.

5- Veritabanı işlemlerinde de her zaman latin_5_turkish_ci  seti kullanmaya dikkat edin.Böylece büyük- küçük harf hassasiyeti olmayan karşılaştırma seti kullanmış olacaksınız.


Blogged with Flock

Tuesday, November 20, 2007

Internationalization Tips For Your Joomla Website -Part One-

Characters not dispaying correctly?

     
The most probable reason for this is that you have an encoding mismatch in your site. This should be checked and possibly corrected before you start changing server default charsets, languages or database collations which usually never need to be touched.

An Encoding Mismatch means that your browser is not using the correct codepage to display special characters (extended ASCII) and they show up as something unexpected.

Alternately you may currently have the correct encoding in your browser but at some time in the past there was an encoding mismatch while data was inserted via a browser. This too will create unexpected results of special characters.

How to check this?

  • Find out what the correct encoding is for the language you are using in your site. As an example let's take Czech which uses iso-8859-2
  • Open a page of your site in your browser and ensure that the browser is set to automatically detect encodings
  • The browser should have detected iso-8859-2 which is also known as "Central European" encoding

If you got this far and and the browser is selecting encoding as expected but there are still bad characters then there are two possible problems:
1. If the corruption is in text that is part of content - this might have been inserted during some mismatch in the past. Try to insert some new text and see if it is OK.
2. If the corruption occurs in User Interface labels, then perhaps the language file you are using is for utf-8 use only. You should change the language file with one that was prepared for singlebyte encodings such as iso-8859-2.

If your browser did not select the correct encoding automatically then please check the following:
  • In your browser click on the menu item that displays the source of the currently displayed page. In the code near the top in the header tags you should find the following line for Czech encoding:
Code:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
  • If you see a different charset value then you need to check your language file define for encoding as this is taken from there. You should open the language file (<lang>.php) in an editor and search for '_ISO'. You should see
Code:
DEFINE('_ISO','charset=iso-8859-2');
  • If the language file define is correct but something else shows up the page source code - then there is a problem with the template that you are u
    The most probable reason for this is that you have an encoding mismatch in your site. This should be checked and possibly corrected before you start changing server default charsets, languages or database collations which usually never need to be touched.

    An Encoding Mismatch means that your browser is not using the correct codepage to display special characters (extended ASCII) and they show up as something unexpected.

    Alternately you may currently have the correct encoding in your browser but at some time in the past there was an encoding mismatch while data was inserted via a browser. This too will create unexpected results of special characters.

    How to check this?

    • Find out what the correct encoding is for the language you are using in your site. As an example let's take Czech which uses iso-8859-2
    • Open a page of your site in your browser and ensure that the browser is set to automatically detect encodings
    • The browser should have detected iso-8859-2 which is also known as "Central European" encoding

    If you got this far and and the browser is selecting encoding as expected but there are still bad characters then there are two possible problems:
    1. If the corruption is in text that is part of content - this might have been inserted during some mismatch in the past. Try to insert some new text and see if it is OK.
    2. If the corruption occurs in User Interface labels, then perhaps the language file you are using is for utf-8 use only. You should change the language file with one that was prepared for singlebyte encodings such as iso-8859-2.

    If your browser did not select the correct encoding automatically then please check the following:
    • In your browser click on the menu item that displays the source of the currently displayed page. In the code near the top in the header tags you should find the following line for Czech encoding:
    Code:
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
    • If you see a different charset value then you need to check your language file define for encoding as this is taken from there. You should open the language file (<lang>.php) in an editor and search for '_ISO'. You should see
    Code:
    DEFINE('_ISO','charset=iso-8859-2');
    • If the language file define is correct but something else shows up the page source code - then there is a problem with the template that you are using. A different, standard, template should be tried
    • Remember that if you wish to use Czech (for example) in your content while still keeping the original English language file for the site User Interface - then you should change the _ISO define in the language file from iso-8859-1 to iso-8859-2
    • For utf-8 related issues please see a separate sticky thread in this board

    ===================================

    If you are still having problems
    - don't start slashing your wrists - just place a post in this board with as much details as possible. Mainly please detail:
    • What language do you wish to display
    • What encoding does the browser select
    • Where are the problematic characters? In content or in User Interface labels?
    • What do you see in the charset value of the page source?
    • What is set in the language file define for '_ISO'?


    sing. A different, standard, template should be tried
  • Remember that if you wish to use Czech (for example) in your content while still keeping the original English language file for the site User Interface - then you should change the _ISO define in the language file from iso-8859-1 to iso-8859-2
  • For utf-8 related issues please see a separate sticky thread in this board

===================================

If you are still having problems
- don't start slashing your wrists - just place a post in this board with as much details as possible. Mainly please detail:
  • What language do you wish to display
  • What encoding does the browser select
  • Where are the problematic characters? In content or in User Interface labels?
  • What do you see in the charset value of the page source?
  • What is set in the language file define for '_ISO'?


Blogged with Flock

Monday, November 19, 2007

Google Analytics Tracking Module

Google Analytics Tracking Module
Google Analytics Tracking Module is a simple module for Joomla! 1.0.x. and Joomla! 1.5 (legacy mode) used for inserting Google Analytics tracking code to the Joomla site as a module.

This module makes it possible to add the tracking code before the closing body tag in template, which is recommended by Google. Module tracks all pages of Joomla cms including 3rd party components.

Module track also Virtuemart transactions. Supported payment methods are at the moment: Paypal, Cash on delivery, credit card and purchase order.

Features

  • The use of ssl is optional
  • subdomain tracking is optional
  • user tracking with __utmSetVar is optional
  • VirtueMart E-commerce Tracking
  • Setting Joomla! registration as a Google Analytics goal is optional

Free Joomla! templates -
 Estime Templates - Modules for Joomla! CMS
FAQs about Google Analytics Tracking Module
No parameters in the module settings
After installation I only have one big block for setting parameters and not the options, like UA tracking code ets." Please check, that you have write permission to your module.
Why this is module and not bot?
Bots are called within head calls, also bots are usually dependent on Joomla functions. Bots are therefore not downloaded for each page call. You can add module positions inside you templates, wherever you want. This makes it possible to add tracking code to every single page of Joomla, since modules are called from template, and template is downloaded for all the pages, yes, even for 3dp components such as virtuemart, docman, simpleboard etc.

Common problems

You don't have position called debug inside your template.

The recommeded position for tracking module is debug position. This is usually at the end of the template. To check, if you actually have position you are trying to use, go to your admin panel. Select Site » template manager » module positions. If you don't have position called debug, it's ok, just select the position you have, like left or right.


How to be sure, that the module is installed correctly?
  1. After installing and configuring the module, go to your site with your favourite browser.
  2. Choose View » Source (Page source) from your browser.
  3. Check, that you have the following code somewhere inside your html source. If you do, installation was succesful, if you don't, check the common problems list.

I don't have position called debug

It's a recommendation to publish the module before closing body tag, it's not a must! You can publish the module where ever you want to as long as you have that module position inside your template. As a Joomla cms administrator, you probably know, that you can list the module positions inside your template in the backend of Joomla by choosing Site > Preview > Inline with positions. Those are the positions your template holds. You shouldn't publish any modules to other places than the ones, you actually have inside template. All templates doesn't have all the default places, such as top, footer, debug, left, right, user3, user1 etc.

You can add as many positions as you like by yourself with the Joomla backend by choosing Site > template manager > module positions. Type your position name in the list. You add the position to template by choosing site > template manager - site templates: select your template and choose edit html. You can add the positions like 'mynewposition' by adding the following code, where you want the module to appear.

site_positions



Blogged with Flock

Sunday, November 18, 2007

character encoding

Why worry about ?

The character encoding associated with a Web page determines how the page renders in a Web browser. One important distinction to understanding the concept is the difference between character encoding and a character set.

Dictionary.com defines a character set as a particular mapping between characters and byte strings (i.e., a set of characters required for a certain language). It is the combination of a particular character encoding (which maps between byte strings and integers) and a particular coded character set. A coded character set is a set of characters for which a unique number has been assigned to each character. Character encoding is how these abstract characters are mapped to bytes for manipulation in a computer. To sum it up, character encoding tells the Web browser what set of characters to use when converting the bits to characters. Here are several reasons you should specify character encoding:

  • You should worry about character encoding since its declaration became a requirement with the HTML 4.01 specification.
  • If a character encoding is not specified in a Web page, the browser will guess at what encoding should be used to render Web page content. This guesswork can result in the wrong encoding scheme being used.
  • Browsers allow users to choose a default character encoding. This choice may not match the setting for a Web page.

A Web page’s character encoding is specified in the first line.

What is available?

The character encoding supported in HTML is defined with the Unicode character set. Unicode supports every alphabet with the capacity to represent millions of characters, including accented characters. Each character is assigned a two byte code value. This goes against the popular ASCII encoding used in the United States, which uses one byte.

Here is a sampling of available character encodings:

  • ISO 8859-1: This is the standard encoding of the Latin alphabet. Also know as Latin1, it includes the Latin-based languages of the world.
  • UTF-8 (8-bit UCS/Unicode Transformation Format): This character encoding is able to represent any character in the Unicode standard. A key difference is the initial encoding of byte codes and character assignments for UTF-8 is backwards compatible with ASCII.
  • UTF-16 (16-bit Unicode Transformation Format): This is a variable-length character encoding for Unicode that is capable of encoding every Unicode character.
  • US-ASCII: This is a subset of UTF-8 that covers the ASCII standard set of characters.

A full listing of character encoding options is available online, but UTF-8 is the recommended and most popular encoding scheme used today.

Choosing a character encoding

The main issue with character encoding selection is the need to use one that covers all the different languages and requirements of the intended audience. Character encoding is critical when dealing with multilingual applications that may use different languages that utilize different character encoding schemes.

When choosing a character encoding scheme, you must be aware of the characters that you will be using, along with the character encoding supported by the browser and any other applications that may be used to work with the files. The standards UTF-8 (which I stick with for my work) and US-ASCII are widely supported by browsers. You should do your research when working with standards other than these two.

Using a character encoding

When accessing a Web application, a Web browser will use the following steps to determine its character encoding:

  • The HTTP Content-Type header sent by the server is the default way to define character encoding. This is the preferred method, and it takes precedence over other items in this list. Here is an example of the Content-Type line sent as part of the HTTP header:
Content-Type: text/html; charset=utf-8

Web developers may specify the Content-Type header for a page via the syntax available to the developer. For example, an ASP.NET developer may use the following line:

&lt;%Response.charset="utf-8"%&gt;

A PHP developer may use this line:

header('Content-type: text/html; charset=utf-8');
  • XHTML docents may use the XML declaration in the first line of the page to specify character encoding. Here is one example:
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  • You can use the HTML/XHTML meta content-type element. It is placed inside the header portion of the page with the character encoding specified in its charset property.
&lt;meta http-equiv="content-type" content="text/html; charset=UTF-8"&gt;

CSS considerations

You may declare the encoding of external CSS style sheets. This step is not necessary with CSS embedded in a page, as the page’s character encoding takes care of it. You may designate the character encoding for a CSS file by adding a line to the top of the CSS file. The following syntax is used:

@charset "utf-8";

In addition, the charset attribute of the link element may be used.



Powered by ScribeFire.