5uperMario Posted February 15, 2010 Share Posted February 15, 2010 Hey I already searched, had help, checked google, ect.... No one helped me..... I am currently making a cms type site, and so far I had zero problems. But the html of the site was hardcorded into the php files. So, if I ever release this some day, it'd be hard to change the template. So I decided to go with XTemplate, to have .tpl template files, that way its easier to change the skin of the site. So far, its perfect, except the while loop parts. Anywhere I get to a while loop, where it displays more then one thing, it only shows one result. EG, for the chat script, instead of displaying all the shouts like it was doing before, it only shows one shout. I have no clue as to why its doing this, and tried many ways to fix this, as well as help from some other people but they stopped helping :'( This is a sample of the chat script: $w = blog_query("SELECT * FROM chat"); while ($chat2 = blog_fetcharray($w)) { $timer = substr($chat2[3],12,4).''; if (isset($_SESSION['admin'])) { $chat_adminone = "<a href='chat.php?i=del&id=".$chat2[0]."'>X</a>" ; } $text = str_replace($bbcode_pattern, $bbcode_replace, $chat2[1]); $chat_text = "<a href='profile.php?action=view&id=".$chat2[2]."'>".$chat2[2]."</a> [".$timer."]: ".$text."<br />"; } $t->assign(array( "CHAT_ERROR_TITLE" => $error_title, "CHAT_ERROR_NOTE" => $error_note, "CHAT_DIE" => $error_die, "CHAT_ERROR_TITLE" => $error_not, "CHAT_ERROR_NOTE" => $error_note2, "CHAT_TITLE" => $chat_title, "CHAT_NOTE" => $chat_note, "CHAT_NOTEUSE" => $chat_use, "CHAT_ADMIN_ALL" => $chat_adminall, "CHAT_ADMIN_ONE" => $chat_adminone, "CHAT_TEXT" => $chat_text )); $t->parse("CHAT"); $t->out("CHAT"); require("inc/footer.php"); ?> This happens with all the while loops in my site, such as the news post, or comments. Can anyone help me please? Thank you. Link to comment https://forums.phpfreaks.com/topic/192086-xtemplate-while-loop-not-wrking/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.