Tutorials
Collective: show all
-
Collective: show all
Posted on August 22, 2004
Written by
Sasha (view more by Sasha)
Comments (0)
Filed under Scripts: Flinx, Tutorials
Do you want to have a page that shows every fanlist in your collective, rather than having to click on each category? This tutorial will show you how.
Note: This tutorial is for Flinx Collective, not the normal version!
First, open your editor (even something as simple as Notepad would work for this) - save the new file as showall.php.
Paste all of the following code into it:
<?php
include("config.php");
include($header);
$query = "SELECT * FROM $table_link";
$result = mysql_query($query);
$num = mysql_num_rows($result);
?>
<p>Below you can view all <strong><?php echo $num; ?></strong> listings in this Collective.</p>
<?php
while ($row = mysql_fetch_assoc($result)) {
$title = $row['title'];
$subject = $row['subject'];
$url = $row['url'];
$description = $row['description'];
$date = $row['date'];
$image = $row['image'];
$width = $row['width'];
$height = $row['height'];
if ($width < 10) {
$insert_width = "";
}
else {
$insert_width=" width=\"" . $width . "\"";
}
if ($height < 10) {
$insert_height = "";
}
else {
$insert_height=" height=\"" . $height . "\"";
}
?>
<table align="center" width="<?php echo $desc_width; ?>">
<tr>
<td>
<a href="<?php echo $url; ?>" class="pic"><img border="0" src="<?php echo $base_url; ?><?php echo $image; ?>" alt="<?php echo $name; ?>"<?php echo $insert_width; ?><?php echo $insert_height; ?>></a>
</td>
</tr>
<tr>
<td>
<strong>Title:</strong> <?php echo $title; ?><br />
<strong>Subject:</strong> <?php echo $subject; ?><br />
<strong>Opened:</strong> <?php echo $date; ?><br />
<em><?php echo $description; ?></em>
</td>
</tr>
</table>
<?php
}
include($footer); ?>
Edit any of the table attributes to your own liking, to fit in with your layout.
Save the file in your collective website (make sure it’s in the same folder as your FlinxCollective config.php!), upload it, and voila! A page that shows every list in your collective, alphabetically.
Comments
Comments are closed for this entry.