So I wanted to show some themes to clients that just want to use a free theme and wanted an easier way to look through the themes so I came up with this:
<?php
$themes = list_themes($refresh = FALSE);
echo "<table>";
foreach ($themes as $name => $object) {
if ($object->status == 1) {
$name = $object->name;
$info = $object->info;
$screenshot = $info['screenshot'];
// make a new if the remainder of $i divided by 3 == 0
if($i % 3 == 0)
{
echo "<tr>";
}
echo "<td width=125><strong>$name</strong><br/><a href='http://YOURSITE.com/node?theme=$name'><img src='http://YOURSITE.com/$screenshot'/></a> <br/><br/></td>\n";
// add an extra <td></td> if there are not enough columns to complete the table
// only test if $i is on the last item of the array
if($i == ($count - 1))
{
// keep adding blank cells till it's at the end
while(($i + 1) % 3 != 0)
{
echo "<td> </td>\n";
$i++;
}
}
// end table row if the remainder of $i+1 divided by 3 is 0
if(($i + 1) % 3 == 0)
{
echo "</tr>";
}
$i++;
}
}
echo "</table>";
?>
Thought this might be something that could be added to switchtheme. Or someone can use it just like I did and just through it in a node.
Comments
Comment #1
sunThanks for taking the time to report this issue.
However, marking as duplicate of #149198: Add page with theme thumbnails to choose theme. You can follow up on that issue to track its status instead. If any information from this issue is missing in the other issue, please make sure you provide it over there.
If you are new to drupal.org, it would help us if you would search for existing issues before submitting a new one. We strongly advise you search using the drupal.org search facility, because it really is very good. NOT a third party search engine (e.g. Google) as you may well not find what you are looking for.