Mibew Messenger Community

Contributions => Plugins, tips, and tricks => Topic started by: Inspirer on June 13, 2010, 09:10:22 AM

Title: How to create a new style
Post by: Inspirer on June 13, 2010, 09:10:22 AM
Template language

It is an extremely simple one. If you are familiar with php take a look at libs/expand.php (120 lines of code). It consists of:

A number of predefined variables:
${webimroot}, ${jsver}, ${tplroot}, ${styleid}, ${pagination}, ${errors}

Access to localized messages:
${msg:<idofstring>}, example ${msg:typing.remote}

Access to variables passed to the page from the PHP code:
${page:<idofvar>}, example: ${page:predefinedAnswers}

Access to form variables (to have proper initial values):
<input .... value="${form:email}"/>

Include other .tpl file:
${include:chat.tpl}

Conditional clauses:
${if:varname}  ${endif:varname}
${ifnot:varname}  ${endif:varname}
${if:varname} ${else:varname}  ${endif:varname}

(available variables: user, agent, historyParams, canChangeName, canpost, sslLink, neediframesrc, errors)

Editing/testing .tpl

Use "Settings -> Themes preview" page to check your templates in test environment.
Title: Re: How to create a new style
Post by: Korund on September 07, 2010, 05:45:36 PM
Hi!
Excuse me, may be this theme offtop. But, I must know.
I  create "new style" for chat. Where send my job for publication. ???
Title: Re: How to create a new style
Post by: logos010 on August 02, 2011, 12:24:00 AM
helpfull information, thanks
Title: Re: How to create a new style
Post by: doc123 on August 03, 2012, 01:40:08 PM
Hi Friends,

From where I find out new styles if anybody has something kindly provide me. We started mibew for our dbametrix (http://www.dbametrix.com) site. It is really superb and working fine. I am also looking for buttons. If any one has idea of new buttons (online,offline blinking) then kindly guide me.
Title: Re: How to create a new style
Post by: sushi on October 29, 2013, 05:54:24 PM
Hello,

I add a PHP variable in source and i need to display this content in the template.

I try ${page:my_var} but it's doesn't work!

I hope you will be able to help me!

Sorry for my bad english i'm not english.

Regards,

sushis
Title: Re: How to create a new style
Post by: faf on October 29, 2013, 06:46:25 PM
I try ${page:my_var} but it's doesn't work!

In Mibew Messenger 1.6.x if you want to use in template something like ${page:my_var} you will have to set in controller the value of $page['my_var'].
Title: Re: How to create a new style
Post by: sushi on October 29, 2013, 07:21:21 PM
Thanks for fast answer!

$page is a global variable?

i try in this file client.php and it's doesn't work.

When i do var_dump($page), $page is null.

I display the var_dump in global scope.

Regards,

sushis
Title: Re: How to create a new style
Post by: faf on October 29, 2013, 07:36:27 PM
Yes, $page is global variable.

And if you want to find out where is your trouble, you should show up the code.
Title: Re: How to create a new style
Post by: sushi on October 29, 2013, 07:40:22 PM
it's work!

I added my code in the header page and after $page is redifined ( $page = array() ), so i add $page['my_var'] = $my_var and it's work!

Thx for your fast answer!
Title: Re: How to create a new style
Post by: faf on October 29, 2013, 07:48:29 PM
You're welcome.