2011-04-06, 03:40 PM
Pages: 1 2
2011-04-06, 03:47 PM
(2011-04-06, 03:38 PM)euantor Wrote: [ -> ]That's what I changed too pavemen
by 4 minutes. if I didn't spend the time eating those two Twinkies for breakfast, I would have it posted first
2011-04-06, 03:51 PM
(2011-04-06, 03:08 PM)Yaldaram Wrote: [ -> ]Try this;
<?php /* $Id blogs.php */ define('IN_MYBB', 1); $templatelist ="blogs,bloglist"; require "./global.php"; add_breadcrumb("Blogs", "blogs.php"); $query=$db->query("SELECT * FROM ".TABLE_PREFIX."blogs"); $bloglist = ""; while ($blog = $db->fetch_array($query)) { $bloguid = $blog['uid']; $bloguname = $blog['username']; $blogid = $blog['bid']; $blogtopic = $blog['topic']; eval("\$bloglist .= \"".$templates->get("bloglist")."\";"); } eval("\$blogs = \"".$templates->get("blogs")."\";"); output_page($blogs); ?>
And I posted this same thing minutes ago
2011-04-06, 04:02 PM
(2011-04-06, 03:47 PM)pavemen Wrote: [ -> ](2011-04-06, 03:38 PM)euantor Wrote: [ -> ]That's what I changed too pavemen
by 4 minutes. if I didn't spend the time eating those two Twinkies for breakfast, I would have it posted first
May I ask though, what on earth is a "Twinkie"? haha
(2011-04-06, 03:51 PM)Yaldaram Wrote: [ -> ](2011-04-06, 03:08 PM)Yaldaram Wrote: [ -> ]Try this;
<?php /* $Id blogs.php */ define('IN_MYBB', 1); $templatelist ="blogs,bloglist"; require "./global.php"; add_breadcrumb("Blogs", "blogs.php"); $query=$db->query("SELECT * FROM ".TABLE_PREFIX."blogs"); $bloglist = ""; while ($blog = $db->fetch_array($query)) { $bloguid = $blog['uid']; $bloguname = $blog['username']; $blogid = $blog['bid']; $blogtopic = $blog['topic']; eval("\$bloglist .= \"".$templates->get("bloglist")."\";"); } eval("\$blogs = \"".$templates->get("blogs")."\";"); output_page($blogs); ?>
And I posted this same thing minutes ago
He said that yours "didn't work" though for some reason. Also, may I ask why you did all that
$bloguid = $blog['uid'];
$bloguname = $blog['username'];
$blogid = $blog['bid'];
$blogtopic = $blog['topic'];
? Seems useless to me.
2011-04-06, 05:52 PM
(2011-04-06, 04:02 PM)euantor Wrote: [ -> ] May I ask though, what on earth is a "Twinkie"? haha
I realize you are not in the US, but you've never seen the ZombieLand movie?
http://en.wikipedia.org/wiki/Twinkie
2011-04-06, 05:57 PM
(2011-04-06, 04:02 PM)euantor Wrote: [ -> ]Also, may I ask why you did all that
$bloguid = $blog['uid']; $bloguname = $blog['username']; $blogid = $blog['bid']; $blogtopic = $blog['topic'];
? Seems useless to me.
No, its better to assign variables inside the while loop if you want to evaluate a template. However it should work with the other way as well.
2011-04-06, 06:58 PM
(2011-04-06, 05:52 PM)pavemen Wrote: [ -> ](2011-04-06, 04:02 PM)euantor Wrote: [ -> ] May I ask though, what on earth is a "Twinkie"? haha
I realize you are not in the US, but you've never seen the ZombieLand movie?
http://en.wikipedia.org/wiki/Twinkie
Nope, never seen it. Those do look good though :O
(2011-04-06, 05:57 PM)Yaldaram Wrote: [ -> ](2011-04-06, 04:02 PM)euantor Wrote: [ -> ]Also, may I ask why you did all that
$bloguid = $blog['uid']; $bloguname = $blog['username']; $blogid = $blog['bid']; $blogtopic = $blog['topic'];
? Seems useless to me.
No, its better to assign variables inside the while loop if you want to evaluate a template. However it should work with the other way as well.
I've actually never heard that. I like to keep variable definitions to a minimum, but fair enough.
/off topic
Pages: 1 2