MyBB Community Forums

Full Version: Show 5 images above forum? from a forum
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
That I can use in my index postbit template that would call the last 5 thumbnail images posted into a paticular forum? I'm not sure but I think the datafield that holds that info would be photos>thumbfile? I wanted to show thumbs. But I'd like the thumbs to only come from one forum or subforum and for the 5 showing they'd need to be the last ones downloaded into that forum or subforum. Any help greatly appreciated, thank you.
this is the code i use on my board you could change it abit to what you want

the code could be better but did it easyer way

$picwow=$db->query("SELECT * FROM mybb_posts WHERE fid=152");
while($picwow1 = $db->fetch_array($picwow))
{
$picwow2=$db->query("SELECT * FROM mybb_attachments WHERE pid=$picwow1[pid] ORDER BY pid ASC LIMIT 1");
while($picwow3 = $db->fetch_array($picwow2))
{
eval("\$picwow4 .= \"".$templates->get("picwow")."\";");	
if($altbg == "trow1")
		{
			$altbg = "trow2";
		}
		else
		{
			$altbg = "trow1";
		}
}
}

this is part of the new gallery mod i am making
Awesome Massacre Smile Couple of questions, does this code go into the index postbit or does it go into the index.php file and get called up thru the index template with a variable? Thanks again Massacre.

And your buiding a photo gallery? My Dean scream, or is that Dukes of Hazzard(Scratchs head) yeeee haaaaaw! LOL. I cant wait, now that's some good news.

That's a nice lookin site you have there Massacre. Smile
I'm not a php coder please understand, but what I done is take that code above, put my forum id inplace of the one Massacre used, loaded the code into my index.php under this part here

if($mybb->settings['showwol'] != "no" && $mybb->usergroup['canviewonline'] != "no")
{

<---------Inserted Massacre code with changed fid to my own number


Then I tried to call picwow thru my template. I'm sure I'm a mile off, someone please enlighten?


Anyone care to help?
Been banging my head at this long enough, a week for help? Should I wait another week? Or am I being to impatient? Really!
when you make the picwow template


you have to add

$picwow4 in to the index template where you want it to be