TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,234
  • Total Topics: 21,353
  • Online today: 739
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 549
  • Total: 549

Article overview

Started by taucher, July 09, 2007, 02:40:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

taucher

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.

evulness

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...

This website is proudly hosted on Crocweb Cloud Website Hosting.