Tutorials
Latest fanlistings joined
-
Latest fanlistings joined
Posted on September 11, 2003
Written by
Louise (view more by Louise)
Comments (0)
Filed under Scripts: Flinx, Tutorials
This very little, very simple code will show the last fanlistings you joined.
First of all, open your HTML editor (such as notepad), and paste the following code into it.
<?php $numtoshow = 10;
require 'config.php'
$query = mysql_query('SELECT * FROM `' . $table_link . '` ORDER BY `linkID` DESC LIMIT ' . $numtoshow;
while($row = mysql_fetch_assoc($query)) {
if ($row['width'] < 10) $insert_width = '';
else $insert_width = ' width="' . $row['width'] . '"';
if ($row['height'] < 10) $insert_height = '';
else $insert_height = ' height="' . $row['height'] . '"';
?>
<a href="<?php echo $row['url']; ?>"><img border="0" src="<?php echo $base_url; $row['image']; ?>" alt="<?php echo $row['name']; ?>"<?php echo $row['insert_width']; $row['insert_height']; ?>></a>
<?
} ?>
Now, save it as whatever you want, as long as it has a php extension. For this tutorial, we’ll call it latest.php
Next, decide how many codes do you want to show. Right now it’s set to show the last 10 fanlistings you joined, but you can change the number to whatever number you want. All you have to do is change the first line, setting $numtoshow to whatever value you want. So, if you only want to show the latest 5 fanlistings you joined, edit the first line like this:
<?php $numtoshow = 5;
Upload this file to the same folder as flinx.
And finally, all you have to do now is include this file wherever you want the latest fanlistings you joined to show, with something like this:
<?php include "path/to/flinx/folder/latest.php" ?>
Comments
Comments are closed for this entry.