...

View Full Version : Archived post



shinko_metsuo
09-04-2005, 05:16 PM
I have a page with post. I have it show the 5 newest post. I want to keep it like that but I also want users to see ther other post with out having to view a page with 86,047 post or having a really long nav. Please help.

Thanks advanced,
Metsuo

Kurashu
09-04-2005, 08:39 PM
Use pagination.

http://www.google.com/search?rls=en&rls=en&q=pagination+%2B+PHP&sourceid=opera&ie=utf-8&oe=utf-8

shinko_metsuo
09-05-2005, 12:11 AM
That only works for PHP5 I need this to work for PHP4

Kurashu
09-05-2005, 06:40 AM
Pagination is software independent. PHP5, PHP4, ASP, Perl, C, Ruby, I bet Javascript can do it with some clever scripting.

shinko_metsuo
09-06-2005, 04:16 AM
Pagenation is ****ed up. All I want to do is archive my post.

missing-score
09-07-2005, 04:43 AM
No need to get upset...

What you are looking for im sure is pagination of some kind... If you just want to archive posts other than the first 5 then you can simply make another page that selects all but the first 5 results, and displays them... of course, there could be several results other than the first 5, so you would need to split them into pages hence pagination.

The links shown on google there look all ok, none of them require PHP 5. (at least none that I found)... Pagination is not a PHP module or technology, its just a name given to the sequential numbering of pages. (This forum use pagination on the forum view and thread views).

Take a better look at the google link provided for you there, its all in there!

shinko_metsuo
09-08-2005, 03:53 AM
The only thing I found that I could use was this.


<?php
// Pagination script

/* This simple script automates the creation of navigation links for the datas extracted from
the database.Pls Feel free to modify it and mailme back.Thanx
Author: Sam George; ocptime@rediffmail.com
Licence: GPL.
*/

// No Files are included and stylesheets and other config files can be
// included according to your wish.
// Uses ADO_DB for database abstraction and no documentation as the script is fairly straight forward


$sqlCount="SELECT count(u.id) FROM msg_mail as m, user as u
WHERE m.userTo='$userId'
AND m.status <> 'trash'";

$rsCount = $db->Execute($sqlCount);

$totalrows = $rsCount->fields[0];


$limit=5;

if(empty($page)){
$page = 1;
}

$limitvalue = ($page - 1) * $limit;

$sql = "SELECT m.mailId, m.userTo, m.userFrom, ".$db->substr."(m.subject,1,25) as subject, m.status, u2.name, u.userName, m.date
FROM msg_mail as m, user as u
WHEREm.userTo='$userId'
AND m.status <> 'trash'
ORDER BY m.date DESC LIMIT $limitvalue, $limit";

$rs = $db->Execute($sql);

if($rs->RecordCount()>0){

while($row = $rs->FetchRow()){

$userTo=$row['userTo'];
$userFrom=$row['name'];
$mailId=$row['mailId'];
$subject=$row['subject'];
$message=$row['message'];

//put uer <td> and <tr> here to fill the data
}



if($page > 1){
$pageprev = $page-1;
echo("<a href=\"mypage.php?page=$pageprev\">PREV</a>&nbsp;");
}

$numofpages = ceil($totalrows / $limit);

for($i = 1; $i <= $numofpages; $i++){
if($page == $i){
echo($i."&nbsp;");
}else
echo("<a href=\"mypage.php?page=$i\">$i</a>&nbsp;");
}

if($page < $numofpages){
$pagenext = ($page + 1);
echo ("<a href=\"mypage.php?page=$pagenext\">NEXT</a>");
}

?>
That gives me an idea of how to do my own.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum