Expat Blogs
                   
  Blog in English
 
 

How to show the user pictureHow to show the user picture

Author easyexpat  Date 01 August, 2005 20:07

It is possible for users to select a picture to represent them, as some kind of "avatar". The picture must be selected from the list of pictures currently available in the "resource center".

The picture can be shown anywhere in our templates, and the templates developed by EasyExpat (easyexpat, std_2col, std_rightcol, std_leftcol... etc) show it in header.template or footer.template with the description of the user if you put any:

<!-- Display the personal picture -->

{assign var=blogOwner value=$blog->getOwnerInfo()}
{assign var=userName value=$blogOwner->getUsername()}
<!--<h4>{$userName}</h4>-->
<br />
{if $blogOwner->hasPicture()}
{assign var=picture value=$blogOwner->getPicture()}
<img src="{$url->resourcePreviewLink($picture)}" alt="My picture!" />
<br /><br />
{/if}
{assign var=userDescription value=$blogOwner->getAboutMyself()}
{$userDescription }

<!-- END Display the personal picture -->

If interested in this feature, you can add the following Smarty code anywhere in your favourite template set.

You can find other tips and tricks in the pLog's documentation.

If you are looking for more help on EasyExpat's blogs, do not forget that we have a dedicated forum.




How to add a tag to count visitors (example with Xiti)How to add a tag to count visitors (example with Xiti)

Author easyexpat  Date 01 August, 2005 19:43

In order to add a tag provided by Xiti (or any other javascript tool providing stats), you can just implement the code in between {literal}...{/literal} (smarty code to allow javascript), such as:

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

<tr><td>
<p align="center">
<!-- Xiti -->
{literal}
<script language="JavaScript1.1">
<!--
hsh = new Date();
hsd = document;
hsi = '<a href="http://www.xiti.com/xiti.asp?s=99999"'
hsi += ' TARGET="_top"><img width="39" height="25" border=0 '
hsi += 'src="http://logv19.xiti.com/hit.xiti?s=99999'
hsi += '&p=&hl=' + hsh.getHours() + 'x' + hsh.getMinutes() + 'x' + hsh.getSeconds();
if(parseFloat(navigator.appVersion)>=4)
{Xiti_s=screen;hsi += '&r=' + Xiti_s.width + 'x' + Xiti_s.height + 'x' + Xiti_s.pixelDepth + 'x' + Xiti_s.colorDepth;}
hsd.writeln(hsi + '&ref=' + hsd.referrer.replace('&', '$') + '"></a>');
//-->
</script>
<noscript>
<a href="http://www.xiti.com/xiti.asp?s=99999" TARGET="_blank"><img width="39" height="25" border="0" src="http://logv19.xiti.com/hit.xiti?s=99999&p=&"></a>
</noscript>
{/literal}
<!-- end Xiti -->
</p>
</td></tr>

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

If you are looking for more help on EasyExpat's blogs, do not forget that we have a dedicated forum.




How to add an image in the title barHow to add an image in the title bar

Author easyexpat  Date 01 August, 2005 19:35

In some templates customized by easyexpat (std_2col, std_rightcol, std_leftcol... etc) you just need to replace the file title.jpg (format 775x90) by an image to have it on the title bar.

Download and upload the new customized template with your image.

If you are looking for more help on EasyExpat's blogs, do not forget that we have a dedicated forum.




How to write smarty code and modify the templatesHow to write smarty code and modify the templates

Author easyexpat  Date 01 August, 2005 19:20

A good starting point to learn about Smarty is their crash-course: http://smarty.php.net/crashcourse.php Or if you want more details, a very nice manual is also available: http://smarty.php.net/manual/en/

We give you an example of the template code, in header.template of the easyexpat template:

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

<tr><td class="orange">{$locale->tr("recently";)}</td></tr> {foreach from=$recentposts item=recentpost} <tr class="{cycle values="odd,even"}"><td><a title="{$recentpost->getText()|truncate:150:"..."|strip_tags|escape}" href="{$url->postLink($recentpost)}">{$recentpost->getTopic()}</a><br/> {/foreach}</td></tr>

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

Here we display all the recent posts. We use truncate to put only the begining of the post. You could also use capitalize to make upper case. You can use plenty of other variables, the list is here.

You can also sort differently the arrays (list of post, messages...) inside the templates by using the method described here: Sorting arrays inside templates.

If you are looking for more help on EasyExpat's blogs, do not forget that we have a dedicated forum.




Template PackagesTemplate Packages

Author easyexpat  Date 01 August, 2005 19:19

In order to make the handling of templates easier, templates can be managed from within the administration interface. Templates can also be uploaded as packages with a special format since uploading all the files that make up a template, one by one, would be a too cumbersome process.

The only thing that makes this "template packages" special is that first of all, they are compressed and second of all, that they follow a specific directory structure. Regarding the directory structure, let's assume that our brand new template set is called, very originally indeed, "new-template". The directory structure is very simple and it has to look like this:

  • main.template
  • postandcomments.template
  • error.template
  • posttrackbacks.template
  • commentarticle.template
  • albums.template
  • album.template
  • resource.template
  • searchresults.template

The main thing is that all the files are under a folder which is the identifier that will be used to refer to the template set. Once you have finished the template set and you have the files residing under the right folder, it has to be packed in order to make it easier to upload.

You can then use Control Center->New Blog Template.

You will find more help on how to create and modify templates on the documentation.

If you are looking for more help on EasyExpat's blogs, do not forget that we have a dedicated forum.




How to modify your templateHow to modify your template

Author easyexpat  Date 01 August, 2005 18:33

In order to offer a blog service, EasyExpat has chosen pLog. pLog uses a template system in order to clearly separate what is content from what is the core code. Users can develop their own templates and the template rendering engine uses a simple syntax to change the aspect of their site a little : Smarty.

A good starting point to learn about Smarty is their crash-course: http://smarty.php.net/crashcourse.php Or if you want more details, a very nice manual is also available: http://smarty.php.net/manual/en/

How templates work

As we said above, pLog uses Smarty to render the contents of your journal. That means that you can easily change the way the site looks like just by going to the Administration Interface of your journal (http://<yourname>.blogexpat.com/admin.php) and selecting a new set of templates [Control Center->Blog to choose the template amongs a list). But, how does that work? How can we develop our own set of templates?

 (More)




 
 
Calendar
« August 2005 »
Mo Tu We Th Fr Sa Su
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
 
 
 
Syndicate
RSS
 
blog abroad
 


Copyright EasyExpat Ltd © All rights reserved.

Look for more information with dotExpat network:
Easy Expat  -  Blog Expat  -  EasyExpat Travel  -  Expert Expat
Blog powered by LifeType -  Designed by EasyExpat

Guide for Expatriate Expatriation - International Relocation Portal: Move, Work, Live Abroad
Deutsch  -  English  -  Español  -  Français  -  Italiano  -  Nederlands  -  Polski  -  Português  -  Русский