Author |
Message |
Topic: Is there something to get total records of mysql query? |
master_kaos
Replies: 8
Views: 14985
|
Forum: General Posted: Mon Jan 07, 2008 3:40 pm Subject: Is there something to get total records of mysql query? |
you could cut it down to one line by
$smarty->assign('rating_info_total', mysql_num_rows($handle));
Unless of course you need the variable in your PHP code |
Topic: supress smarty error |
master_kaos
Replies: 1
Views: 4728
|
Forum: General Posted: Fri Dec 14, 2007 1:53 pm Subject: supress smarty error |
I have a skin system going on. so in my index i have something like
{include file="#skin#/$section.tpl"}
Now if section is not in the skin directory, I do not want the error to show.
is t ... |
Topic: foreach only last record? |
master_kaos
Replies: 7
Views: 34550
|
Forum: General Posted: Thu Dec 13, 2007 3:08 pm Subject: foreach only last record? |
yup, can do
{foreach from=$posts.title item=title key=i name="posts"}
{if $smarty.foreach.posts.last}
Display record
{/if}
{/foreach} |
Topic: xajax and smarty problem- invalid content type? |
master_kaos
Replies: 4
Views: 9185
|
Forum: General Posted: Wed Dec 12, 2007 5:09 pm Subject: xajax and smarty problem- invalid content type? |
Someone said they had the same problem it was an apache rewrite problem that caused it. |
Topic: Sweet function replacement for html_options |
master_kaos
Replies: 0
Views: 4525
|
Forum: General Posted: Wed Dec 12, 2007 4:42 pm Subject: Sweet function replacement for html_options |
I was just about to create my own html_options function that allows you to pass in an array of objects for which you could choose the key and value
for example
class test
{
var id;
... |
Topic: One-to-many tables relationship |
master_kaos
Replies: 4
Views: 9069
|
Forum: General Posted: Tue Dec 11, 2007 5:07 pm Subject: One-to-many tables relationship |
I have never really worked on an application that has high load, so (extreme) performance tweaks was never really an issue.
One thing you could do however, is take out the $products variable, and ... |
Topic: smaty with xajax |
master_kaos
Replies: 6
Views: 13879
|
Forum: General Posted: Tue Dec 11, 2007 3:47 pm Subject: smaty with xajax |
Yes xajax and smarty are my 2 most used libraries for PHP
I don't know what I would do without either.
ALso in the php ajax functions I use $smarty->fetch alot so I can output templates th ... |
Topic: One-to-many tables relationship |
master_kaos
Replies: 4
Views: 9069
|
Forum: General Posted: Tue Dec 11, 2007 3:45 pm Subject: One-to-many tables relationship |
I am actually working on exactly this this morning (just taking my morning break)
this is how I am doing it (sqlFunctions is my own SQL helper class)
class category
{
var $id = null;
... |
Topic: Query strings and varying includes |
master_kaos
Replies: 2
Views: 7184
|
Forum: General Posted: Tue Dec 04, 2007 3:27 pm Subject: Query strings and varying includes |
I always do it the first way, build the query string in the template, but the other solution can be fine to. I think that is more of a personal preference.
Same with your second question.
I rarely ... |
Topic: Separate admin templates and frontend templates. |
master_kaos
Replies: 3
Views: 10483
|
Forum: General Posted: Tue Dec 04, 2007 3:23 pm Subject: Separate admin templates and frontend templates. |
when you do a display do something like this
$this->template_dir = CORE_ROOT . '\\themes\\';
if($admin}
$smarty->display('admin\\' . $theme . '\\example.tpl');
else
$ ... |
Topic: Where do Smarty Files Come From? (Frustrated Beginner :() |
master_kaos
Replies: 1
Views: 5525
|
Forum: General Posted: Tue Dec 04, 2007 3:14 pm Subject: Where do Smarty Files Come From? (Frustrated Beginner :() |
Smarty code is in a template file so something.tpl
It could be stored anywhere so ask your developer where the directory is.
To change actual php you will need the developer to do it(or if that is ... |
Topic: Validate contact form with Smarty |
master_kaos
Replies: 6
Views: 17525
|
Forum: General Posted: Tue Dec 04, 2007 3:10 pm Subject: Validate contact form with Smarty |
well for an example here is a simple form
<script type='text/javascript'>
function validateForm(form)
{
error = "";
if(form.name.value == "" ... |
Topic: Basic Forum |
master_kaos
Replies: 9
Views: 13645
|
Forum: General Posted: Tue Dec 04, 2007 2:58 pm Subject: Basic Forum |
You can definitely create your own forum, but it will be a fair bit of work.
You could just download phpBB and look at the source code, but you will find it highly unlikely to get anyone here to mak ... |
Topic: Having trouble with getting array value in an object |
master_kaos
Replies: 3
Views: 6963
|
Forum: General Posted: Tue Dec 04, 2007 2:54 pm Subject: Having trouble with getting array value in an object |
try this
{foreach from=$modules item=m}
<tr>
{assign var=type value=$m->type}
<td>{$m->types[$type]}</ ... |
Topic: Headers alreay sent |
master_kaos
Replies: 9
Views: 13114
|
Forum: General Posted: Tue Nov 27, 2007 7:06 pm Subject: Headers alreay sent |
a common problem to this is u may have 1 space or 1 enter key before a <?php tag which counts as output |
|