Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 09-02-2009, 01:17 AM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 8,381
Fireballchad
Default Layout question [Answered]

Hey there I am having a horrible time trying to make my pets be in collums,
PHP Code:
//Loop out code
$i=0;
while (
$i $num) {

$aid=@mysql_result($result,$i,"aid"); //The adoptable's ID
$currentlevel=@mysql_result($result,$i,"currentlevel");
$type=@mysql_result($result,$i,"type");
$name=@mysql_result($result,$i,"name");

$aid1=@mysql_result($result,$i,"aid"); //The adoptable's ID
$currentlevel1=@mysql_result($result,$i,"currentlevel");
$type1=@mysql_result($result,$i,"type");
$name1=@mysql_result($result,$i,"name");
// Our code to determine if we show the table or not...


$article_content $article_content."<center><table><tr>";



// Output the table information...
// Get the current adoptable's image

$image getcurrentimage($aid);

$article_content $article_content."<td><div align='center'><p>".$name."</p><p><a href='myadopts.php?act=manage&id=".$aid."'><img src='".$image."' border=0></a></p><p>
<b><a href='myadopts.php?act=manage&id="
.$aid."'>Manage</a></b></p></div></td>";


$image1 getcurrentimage($aid1);

$article_content $article_content."<td><div align='center'><p>".$name1."</p><p><a href='myadopts.php?act=manage&id=".$aid1."'><img src='".$image1."' border=0></a></p><p>
<b><a href='myadopts.php?act=manage&id="
.$aid1."'>Manage</a></b></p></div></td>";

$article_content $article_content."</tr></table></center><br>"
it keeps repeating the same adopt on the same line, ive been messing with the $i var and others to try to get it to "jump" one ahead to put it there but then the next line it falls back...

I want
pet-a | pet-b
pet-c | pet-d
I am getting when i mess with it
pet-a | pet-b
pet-b | pet-c

Ive read this but its not working
Reply With Quote
  #2  
Old 09-03-2009, 10:37 AM
Seapyramid Seapyramid is offline
Premium Member
 
Join Date: Feb 2009
Posts: 373
Gender: Female
Credits: 15,779
Seapyramid
Default RE: php question

I accomplished this in MG through the use of CSS look at http://mysticgrove.net/grove/profile_hall.php?user=Sea
Reply With Quote
  #3  
Old 09-04-2009, 01:18 AM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 8,381
Fireballchad
Default RE: php question

Ah, ok thanks for the tip. I forgot to update that I went with another route, when you hover the link it shows what it will look like, because my template is much more narrow that it would be goofy even with 2 next to each other. I was trying to make the page shorter is what I was after.
Reply With Quote
  #4  
Old 02-09-2010, 04:36 PM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 8,381
Fireballchad
Default RE: php question

Ok I am going to bump this instead of making a new post.

As of right now I am using CSS li {display:inline;}
PHP Code:
$article_content $article_content."<ul><li>";



// Output the table information...
// Get the current adoptable's image

$image getcurrentimage($aid);

$article_content $article_content."<p>".$name."</p><p><a href='myadopts.php?act=manage&id=".$aid."'><img src='".$image."' border=0></a></p><p>
<b><a href='myadopts.php?act=manage&id="
.$aid."'>Manage</a></b></p>";


$article_content $article_content."</li>"
Yet it put them in a diagonal line down the screen. Not Side To Side.
A
...B
.....C
Instead of
A B C
Reply With Quote
  #5  
Old 02-09-2010, 05:10 PM
Seapyramid Seapyramid is offline
Premium Member
 
Join Date: Feb 2009
Posts: 373
Gender: Female
Credits: 15,779
Seapyramid
Default RE: php question

It is because of the <p></p> each time it is used for one it goes to the next line & then when you make the next loop it starts at the next line down & continues the diagonal

Sea
Reply With Quote
  #6  
Old 02-09-2010, 09:06 PM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 8,381
Fireballchad
Default RE: php question

Quote:
Originally Posted by Seapyramid
It is because of the <p></p> each time it is used for one it goes to the next line & then when you make the next loop it starts at the next line down & continues the diagonal

Sea
Hmm still doesnt work... ugh shouldnt be this hard lol
Reply With Quote
  #7  
Old 02-10-2010, 12:09 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 21,567
Arianna will become famous soon enough
Default RE: php question

This might not help you totally, because it's for my own script (not for this adoptables script), and it's for a shop, but it has a table which is made, making a new line every four columns.
PHP Code:
        $page .= "This is the item shop. Here you can buy a multitude of items for your pet to play with or use.<br />";
        
$query "SELECT * FROM ".$prefix."itemkinds WHERE kind='shop'";
        
$result mysql_query($query);
        
$num mysql_numrows($result);
        
$i=0;
        
$page .="<table style='border:0px;'><tr>";
        while (
$i<$num) {
            
// `id` , `name` , `desc` , `cost` , `kind` , `img`
            
$id=@mysql_result($result,$i,"id");
            
$name=@mysql_result($result,$i,"name");
            
$desc=@mysql_result($result,$i,"desc");
            
$cost=@mysql_result($result,$i,"cost");
            
$kind=@mysql_result($result,$i,"kind");
            
$img=@mysql_result($result,$i,"img");
            if (((
$i+1)%4)!=0) {
                
$page .= "<td style='width:25%;'><a href='shop.php?shop=item&buy={$id}'><img src='{$img}'></a><br />{$cost}</td>";
            }
            else {
                
$page .= "<td style='width:25%;'><a href='shop.php?shop=item&buy={$id}'><img src='{$img}'></a><br />{$cost}</td></tr><tr>";
            }
            
$i++;
        }
        if (
$i%4!=0) {
            
$page .= "</table>";
        }
        else {
            
$page .= "</tr></table>";
        } 
Reply With Quote
  #8  
Old 02-10-2010, 05:27 PM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 8,381
Fireballchad
Default RE: php question

Thank you soooo much, that was bugging the crap out of me!!! I got it to work after a bit of realizing some things i needed to delete :D!
Reply With Quote
  #9  
Old 02-11-2010, 12:04 AM
Arianna's Avatar
Arianna Arianna is offline
Dev Staff
 
Join Date: Sep 2009
Posts: 334
Gender: Female
Credits: 21,567
Arianna will become famous soon enough
Default RE: php question

That's great! :D Could I see the code, if I may?
Reply With Quote
  #10  
Old 02-11-2010, 08:40 PM
Fireballchad Fireballchad is offline
Member
 
Join Date: Aug 2009
Posts: 49
Credits: 8,381
Fireballchad
Default RE: php question

Quote:
Originally Posted by Arianna
That's great! :D Could I see the code, if I may?
PHP Code:
if ((($i+1)%5)!=0) {
$article_content $article_content."<td width='20%'><center><p><b>".$name."</b></p><p><a href='myadopts.php?act=manage&id=".$aid."'><img src='".$image."' border=0></a></p><p>
<b><a href='myadopts.php?act=manage&id="
.$aid."'>Manage</a></b></p></center></td>";
}
            else {
                
$article_content $article_content."<td width='20%'><center><p><b>".$name."</b></p><p><a href='myadopts.php?act=manage&id=".$aid."'><img src='".$image."' border=0></a></p><p>
<b><a href='myadopts.php?act=manage&id="
.$aid."'>Manage</a></b></p></center></td></tr>";
}
            
$i++;
}
        if (
$i%5!=0) {
$article_content $article_content."</table>";
   }
        else {
            
$article_content $article_content."</tr></table>";
            } 
Sure there ya go (it is set up for a row of 5). But on another note I CAN not get it work in my adopt/shop page it blows it up every time >.< will post an example here when i take another crack at it if i can get it to work.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
My Layout x3 Rozel Questions and Supports 17 04-21-2011 02:35 PM
xD I screwed up the layout~ Rozel Questions and Supports 0 03-21-2011 10:33 PM
Trying to fix up adopting layout Kyris Questions and Supports 4 01-28-2011 10:23 AM
Alt outcome question [Answered] Fireballchad Questions and Supports 2 02-10-2010 08:00 PM
How do i make a new layout? RipJawWolfFang Questions and Supports 1 04-10-2009 08:39 AM


All times are GMT -5. The time now is 05:13 AM.

Currently Active Users: 834 (0 members and 834 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636