Categories > TinyButStrong general >

clarification and ?s

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: burden
Date: 2004-03-15
Time: 02:49

clarification and ?s

I stumbled across this script a few days ago. read into it. and have a general understanding of how it works and what it does. lemme just tell ya. it rawks! but i'd like to clarify a few things here and there that i may not be understanding right:

first off the goal i had in mind at first was to have 1 template for the entire site. and that doesn't look like it'll quite happen. as it is i just cut up my design and include() them with php. so i don't see the convenience of keeping track of 2 files per page. that seems ridiculous to me. is there something i'm missing? i'm planning to get pretty heavy with blocks. and stuff. and i figure i can use conditionals to display which block goes where, and when. but  there's the issue of the main content in the middle always changing. sometimes i might need to use the nav bar, othertimes i just plan to pull stuff out of a database. othertimes it might just be static text and stuff. so i guess what i'm asking is, if there's a way to use just ONE template file for my whole site with the class. because i probably will end up with different "themes" for my site. and it'd be cool if i can use this. i'm lovin' it.

also another questions regarding the navigation bar. is it neccesary to use a multi-dimensional array with blocks, and the nav bar? just for testing purposes and to get a handle on what i'm doing i took a large list of proxies and wrote a php script to grab the proxies and put them into an array. and then display them. i got it working. but it's pretty sloppy:
$n = 0;
while($n <= count($arr_proxies) -1){
$temp_prox = explode (":", $arr_proxies[$n]);
@$temp_prox2 = explode("|", $temp_prox[1]); //@ = just in case of inconsistancy
@$proxy[] = array('ip'=>$temp_prox[0], 'port'=>$temp_prox2[0], 'ping'=>$temp_prox2[1], 'http'=>$temp_prox2[3], 'gate'=>$temp_prox2[4], 'connect'=>$temp_prox2[6], 'socks4'=>$temp_prox2[7], 'socks5'=>$temp_prox2[8]);
$n++;
}

also, is there a way to get html to not be converted to specialchars in the block? cause i'd like make "yes" and "ok" green and "no" and "not ok" red. follow me? hehe, well i'm sure i have more questions i just can't think of them. so if anyone wants to give some suggestions that'd be much appreciated.
By: RwD
Date: 2004-03-15
Time: 10:57

Re: clarification and ?s

You ask if it is possible to use one template for the entire site and I say yes.

But this will make your site terribly and unneeded complicated.

I just finished a site with tbs, and it works perfectly, contents and php are completely seperated now!

I can show you the website, but you'll have to wait untill this evening before I post the link, because the girl whom I made it for will not enable the website untill everything looks good (and in that I think she is absolutely right :))

The website basically has a static header and footer, then a menu, then a main block and onm the sides small blocks the blocks (big & small) all use the same template. changing them + the static header + css style sheet changes the appearance of the website completely!!

so just three files, that isn't so bad is it?

But I'll post the link here this evening!!
By: RwD
Date: 2004-03-15
Time: 14:56

Re: clarification and ?s

hmm, for the navbar you do not need any array :S

just specify nr of pages, current page, nr of things per page and the navbar can be build. if you need extra info passed, then you may need an array, or may not...

when you look trough the performances of a band for example all I needed was page nr and perfomer_id, just counting the performances in the order the appear. performer_id won't change throughout the multi paged bit, so that was a {var.performer_id}
By: burden
Date: 2004-03-16
Time: 01:34

Re: clarification and ?s

Yeah, but for all that, what's not to say i simply use a php include() instead? lol anyways... here's the story. sometimes i'll have a side bar. sometimes not. the problem is the design changes accordingly. and say for a download section, i'll have links to ebooks, and tutorials, and stuff. then you go over to the guestbook, and you have "view" and "sign" links in that bar. but then you go to the about section and that bar doesn't even exist. the problem i'm facing is the fact that most pages will have php in them. and not simple stuff like "include" this "include that" I mean like code to parse files or something. i'm working on a script to zip up some files on request. and sometimes i'll need to put different tbs commands in different templates. i'm sure everyone's more confused that myself. i should draw a diagram. haha
    [header]
     [menu]
[nav] [content]
     [footer]
the content will be very dynamic. everything from a multipage download. to multipage tutorial. all the way to just static html with contact info, or a quick mission statement. the idea is i don't want to have an html page for according php page.

i don't want a download_emu.php and download_emu.html i want to be able to load up template_nobar.html and be able to stuff some dynamic content in the middle of that template. *sigh* i guess i'm just stuck copy/pasting templates.
By: RwD
Date: 2004-03-16
Time: 07:24

Re: clarification and ?s

www.metalpics.ch

Yes well, this site looks similar to what you ask, the design I made can take bars on the left and the right allthough they are only shown to the right here

I think you mis the point of a template engine.
Sure you can use an include, but then your html will still be mixed with php. So that's one point, phpcode within html gives less flexible files (really, after a few months of templates I cannot see why I ever not used it)

I have my php files encrypted, but the sites appearance can still be changed because that's done in the template files

In between working on my tamplates I can look in a browser for the result.

An include (use require it throws you errors!!) cannot replace tags, or build up tables for you (take the image gallery as an example (for the link I posted))


Anyway, there are a million reasons why to use templates, and what you want to make should go into multiple pages.

www.metalpics.ch (also visit the orange link in the links section!!!)