Login     Sign up
Template engine etc
Sebastian (@fashawn)
Join date: Aug 31st 2010
Community posts: 17
View Profile
Send Message

Hi,

is been a few days now and i snooped around the code.
I don't want to complain but the code is messy :)
Must of the time I spend cleaning up things and removing unnecessary functions.

My girlfriend is a few days not here, so i have much more time for coding ;) So now to the thread title..

As i said i looked around in the code and my feature request is a more that code and html are separeted from each other.

I don't know how the project members thing about adding a template engine like (the evil ^^) Smarty engine as an example. Because they got a own template system running.

I try to code in a template engine after i did more cleaning and adding small feature. Hope i can get it running.

Greetings
Sebastian

175 months ago
Ian (@eeji)
Join date: Aug 3rd 2010
Community posts: 107
View Profile
Send Message

seperating code from presentation would be a great idea. This is how it works in phpBB and I find it makes things a lot easier when making new themes and editing existing to suit a website

175 months ago
adil (@adil)
Join date: May 9th 2010
Community posts: 202
View Profile
Send Message

try to use raintpl (google for it) it is easy clean engine and I thing you will succeed on that

Adil

175 months ago
Sebastian (@fashawn)
Join date: Aug 31st 2010
Community posts: 17
View Profile
Send Message

[quote=adil]try to use raintpl (google for it) it is easy clean engine and I thing you will succeed on that

Adil [/quote]

Hi,

yeah i know RainTPL i found it great at the first place but they're many feature missing and its buggy. I always tried to avoid Smarty but its good and well its popular.

The thing is with the sourcecode of JCow its messy.. i thing ;)
Many database queries and html code returning. I still love it because i dont have that much time to do my own community script. I tried but the lag of time made me to close the project.

So the next days i will try first to clean the whole sourcecode and then try to add more small things for it.
Like "who visited your profile", "new member tour" etc.

After i did that and figure it out how JCow works i will give it a try and implent Smarty. Wish me luck =)

Greetings
Sebastian

175 months ago
Sebastian (@fashawn)
Join date: Aug 31st 2010
Community posts: 17
View Profile
Send Message

[quote=eeji]seperating code from presentation would be a great idea. This is how it works in phpBB and I find it makes things a lot easier when making new themes and editing existing to suit a website [/quote]

Yeah you're right, with a php and html code seperating the whole theme designing will grow much more. As you see now they're not many, in fact almost to none custom themes.

I thing must people are more into HTML coding and don't know about PHP coding at all.

What is more pleasing for theme design?

Example 1 a snippet from the network statistics:
[code]
$res = sql_query("SELECT count(*) as num from ".tb()."accounts");
$row = sql_fetch_array($res);
$stats['members'] = $row['num'];

<strong>'.$stats['members'].'</strong> '.t('Members').'<br/>
[/code]

Example 2 how i thing it should be:
[code]
<strong>{$total_members}</strong> {$lang_members}<br/>
[/code]

As you see in example 2 we first use Smarty and got an {$lang_members} "what is that?" you maybe ask yourself. Well.. "why do always a database query for one segment of a text?" Store it in an extra file for different languages example: "jcow_en.php" store the values they're almost like the install language file and assign this array or value to Smarty.

175 months ago