Help - Search - Members - Calendar
Full Version: [Add-on] list 30th last uploads
CyberiaPC.com Community > Technical Zone > Zenith Picture Gallery > Feature Requests, Add-ons and Mods
CharlyG
show title of 30th last upload in the form of links (ex: pic_details.php?pid=10794 )

CODE
$host = "localhost";
$login = "your_login";
$pass = "your_pass";
$base = "your_zenith_base";


$connect = mysql_connect($host,$login,$pass);
mysql_select_db($base, $connect);
       $sql = "SELECT pid,title, approved, counter FROM zenith_pictures WHERE approved=1 ORDER BY date DESC LIMIT 30";
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());



while($data = mysql_fetch_array($req))

{

echo '<a href="pic_details.php?pid='.$data['pid'].'">';

echo '<b>'.stripslashes($data['title']).'</a</b></br>';

}


dance.gif
MD9 Studio
ahhh thx a lot, finally biggrin.gif
MD9 Studio
what do i have to add before that for it to work?

<php?> ... something like that

thx for the help
MD9 Studio
ahh ok got it, great, just one request, can it show horizontally, and possibly scroll?

this is wat i got so far, i want to to scroll horizontally in that same area:

www.slam3.com/graphics/index1.php

thx a lot in advance
MD9 Studio
anyone?
CharlyG
ok !

Look here for an example:
http://jazzlor.jexiste.fr/zenith/index.php

1. create a new file named list.php (or other ....)
CODE
<?php
//colonne de droite - 30 derniers ajouts      


$connect = mysql_connect($sql_host,$sql_user,$sql_pass);
mysql_select_db($dbname, $connect);
       $sql = "SELECT pid,title,date, approved, description, counter FROM zenith_pictures WHERE approved=1 ORDER BY date DESC LIMIT 30";
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
$hier='0';


while($data = mysql_fetch_array($req))

{
   $Date = $data['date'];
   $time = substr ("$Date", -5);
   $rest = substr ("$Date", 0, 10);
   list ($year, $month, $day) = split ("-", $rest);
   $ajd = ("$day"."/"."$month"."/"."$year");

if ($hier != $ajd)
     {     print "<br><b><u>$ajd : </u></b><br>";
     }
echo '<a href="pic_details.php?pid='.$data['pid'].'">';

echo '<b>'.stripslashes($data['title']).'</a> <font color=#CC0033>('.stripslashes(nl2br($data['description'])).')</b></font><br>';
$hier=$ajd;
}

?>


This script posts the last 30 additions and the class by date.
The date is also posted to separate the additions.
Each name of addition is in the form of link.

2. insert that where you want it

CODE
echo     "<td width='374' height='237' bgcolor='#FFFFCC' align='center'><br><b><u>the last 30 additions </u> :</b><br><br><br>";
echo "<marquee direction='up' scrollamount='2' height='200' width=200 onmouseover='this.stop()' onmouseout='this.start()'>";

require('list.php');

echo "</marquee>";

echo        "<br></td>";


This code allows a run to the top the other run are also possible. it is enough to replace: marquee direction='up'

top downwards : marquee direction='down'
of right-hand side on the left : marquee direction='left'
of left on the right : marquee direction='right'

Have fun!!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.