TinyPortal

Development => Support => Topic started by: taucher on July 09, 2007, 02:40:47 PM

Title: Article overview
Post by: taucher on July 09, 2007, 02:40:47 PM
I took this code from some code-snippets on tp-site:

// ÃÅ"bersicht Tauchplätze österreich
global $db_prefix, $scripturl;

$category = 29; // Tauchplatzkategorie

$query = db_query(
    "SELECT id, subject
     FROM {$db_prefix}tp_articles
     WHERE category = $category
     AND off = 0
     AND approved = 1
     ORDER BY subject", __FILE__, __LINE__);
echo '<div style="overflow: auto; width: 100%;">';
while ($row = mysql_fetch_assoc($query))
  echo '<a href="' . $scripturl . '?page=' . $row['id'] . '">' . $row['subject'] . '</a><br />'; 
echo '</div>';


this lists the articles of a defined categorie like this:

article1
article2
article3
article4
article5
article6

Is ist possible to change the code that the artickle overview ist listet like that:

article1    article2    article3
article4    article5    article6

?

I would need hat, because I have to list now 40 articles and i think it will be more than 100 in the near futere, so the list is much to long.

this is a cross post, because i could get no help in the german forum.
Title: Re: Article overview
Post by: evulness on February 26, 2008, 10:48:49 PM
How would you pull cat list, with sub cats? ex:
->catagory
->catagory
->->sub-cat
->->sub-cat
->catagory
->->sub-cat

etc...
i know how to display, i just don't know the proper query string... sry i'm not THAT good with mysql yet...