Jump to content
MakeWebGames

:(


Recommended Posts

Why is McCodes hated so much online? Outside of this forum finding help is almost useless. 80% of coders wont touch an mccodes script. The others want to charge $100 just to install a mod that was bought from mccodes. I guess you could say the good news is I'm learning more and more about php/mccodes?

Anyways anyone help me with how do I recreate the woocommerce look for my mccodes shop pages? Meaning how they have 4 cells across and then go to the next line, 4 cells, next line etc...?

Closest I have here is the never ending loops -.-

Link to comment
Share on other sites

I take it that in your page you have some sort of loop right? Whether it be a while or a for* loop, it's pretty much the same principle.

 

$i = 0; // start the increment
while($r = $db->fetch_row($query))
{
   print "<div class='container'>";
   print "all your items in this container";
   print "</div>";
   if($i == 3) //3 because we started with 0. 0,1,2,3 = 4
   {
       print "<div class='row'></div>"; // This will be some sort of "line break"
   }
   $i++;
}

Something like that. You will have to make it work with your own stuff. Everything is just an example.

I used entities because the bbcode parser strips out HTML

Edited by KyleMassacre
Link to comment
Share on other sites

ok so

 

  $i = 0; // start the increment while($r = $db->fetch_row($query)) {     print "<div class='container'>";     print "all your items in this container";     print "</div>";     if($i == 3) //3 because we started with 0. 0,1,2,3 = 4     {         print "<div class='row'></div>"; // This will be some sort of "line break"     }     $i++; } 

just put my html for a tr row in the container, and it will print 4 td and break to a new line and repeat on it's own?

That's cool. Mind defining the $i = 0 portions so if I ever need to do this type of thing again I'll know.

Link to comment
Share on other sites

No the first $i needs to be 0 and then you keep repeating. But I did notice I made a booboo.

$i = 0; // start the increment
while($r = $db->fetch_row($query))
{
   print "<div class='container'>";
   print "all your items in this container";
   print "</div>";
   /*
   * 3 because we started with 0. 0,1,2,3 = 4
   * This will check to see if $i is a multiple of 3
   */
   if($i%3 == 0)
   {
       print "<div class='row'></div>"; // This will be some sort of "line break"
   }
   $i++;
}
Edited by KyleMassacre
Dont understand this bbcode crap
Link to comment
Share on other sites

Ok, first row is 4, but then the next are only 3's

here's what I have

 

$i = 0; // start the increment
while($r = $db->fetch_row($qtwo))
{

   print "<td><table class='shopitem'><tr><th>{$r['itmname']}</th></tr><td height='75px'><div id='box' style=background-image:url('css/images/shops/itmpic/" . $r['itmpic'] . "');><div id='overlay'><span id='plus'><a href='iteminfo.php?ID={$r['sitemID']}'><br><img src='css/images/shops/info.png'><br><br></a></span></div></div></td></tr><tr><td><center><b>" . money_formatter($r['itmbuyprice']) . " </b></center></td></tr><tr><td><center><form action='itembuy.php?ID={$r['sitemID']}' method='post'>Qty: <input type='number' name='qty' min='1' max='100' value='1' maxlength='3' /><br><input type='submit' value='Buy' class='storebutton'/></form></center></td></tr></table></td>";

   if($i != 0 && $i % 3 == 0) //3 because we started with 0. 0,1,2,3 = 4
   {
       print "</tr><tr>"; // This will be some sort of "line break"
   }
   $i++;       
}
echo "</tr></table>";
}
Edited by boionfire81
Link to comment
Share on other sites

Why is McCodes hated so much online? Outside of this forum finding help is almost useless. 80% of coders wont touch an mccodes script. The others want to charge $100 just to install a mod that was bought from mccodes. I guess you could say the good news is I'm learning more and more about php/mccodes?

Anyways anyone help me with how do I recreate the woocommerce look for my mccodes shop pages? Meaning how they have 4 cells across and then go to the next line, 4 cells, next line etc...?

Closest I have here is the never ending loops -.-

  • Because your budget implied you were prepared to pay such amount
  • You're paying for someone to work on deprecated code (namely the mysql_* extension and others (purposely being vague, it's been a while since I've touched mccodes))
  • You're paying someone to work with sub-par procedural code
  • You're paying for the persons time
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...