Jump to content

PHP archive


dafallenangel

Recommended Posts

Greetings Mates,

 

        I might butcher this but yeah lol.. not sure what to say on subject either.

 

I am greating ready to do a News Script and im going to have it display 10 news post's for each page and was wondering If its possible to make a script that once it gets 10 pages it either archives the old news posts or puts them into another table and creates a link called Old News?

 

at the bottom of the page it will show page numbers like

 

Previous | 1 2 3 4 5 6 7 8  | Next

 

can someone tell me if this is possible and maybe help me out in the right direction please

 

Thank you

DaFallenAngel

Link to comment
Share on other sites

Thanx for the tutorial but thats not what i wanted lol. i know how to make different pages up and stuff..

 

but what i want is a code or tutorial or something that when say like i have 10 pages of News that when new news is added the old post if it goes onto page 11 it will get transfered to a different table in database? sorry its been a long week for me lol..

 

basically i don't want the news to go over 10 pages of 10 posts on each.. can this be done?

Link to comment
Share on other sites

What is the point of transferring it to another database?  Why not just limit your pagination display to 100 posts, of 10 per page?

 

You could easily make a link/page that says "view archives" that will show post #101->onward...

 

Is there a reason you want to "archive" them, or are you rather just looking for a way to "not show them unless asked" ?

Link to comment
Share on other sites

Thanx for the tutorial but thats not what i wanted lol. i know how to make different pages up and stuff..

 

but what i want is a code or tutorial or something that when say like i have 10 pages of News that when new news is added the old post if it goes onto page 11 it will get transfered to a different table in database? sorry its been a long week for me lol..

 

basically i don't want the news to go over 10 pages of 10 posts on each.. can this be done?

 

If you actually bothered to read the link he gave you, you'd immediately realize that the tutorial does exactly what you're asking for.

Link to comment
Share on other sites

Well i don't want to have 100 news on one page and I don't have a real good reason why to show it like that its just way i want it. lol..

 

And DarkWater  I did read through it and I didn't see anything about what i wanted i seen that they done like something like pages like <... 8 9 10 11 ...> and stuff but thats not what i wanted..

 

I don't want to transfer it to a new database i want it on the same one just on a different table the reason for it being on the different table is so incase I have to go into the database for something in the news section to add something new or something I don't wanna edit million and one posts so it fits right.. all i would have to edit would be 100 posts which would be simple.

Link to comment
Share on other sites

Well i don't want to have 100 news on one page and I don't have a real good reason why to show it like that its just way i want it. lol..

 

And DarkWater  I did read through it and I didn't see anything about what i wanted i seen that they done like something like pages like <... 8 9 10 11 ...> and stuff but thats not what i wanted..

 

I don't want to transfer it to a new database i want it on the same one just on a different table the reason for it being on the different table is so incase I have to go into the database for something in the news section to add something new or something I don't wanna edit million and one posts so it fits right.. all i would have to edit would be 100 posts which would be simple.

 

Then clearly you didn't read it carefully enough.  It completely shows you how to do what you wanted.

Link to comment
Share on other sites

Well i don't want to have 100 news on one page and I don't have a real good reason why to show it like that its just way i want it. lol..

 

And DarkWater  I did read through it and I didn't see anything about what i wanted i seen that they done like something like pages like <... 8 9 10 11 ...> and stuff but thats not what i wanted..

 

I don't want to transfer it to a new database i want it on the same one just on a different table the reason for it being on the different table is so incase I have to go into the database for something in the news section to add something new or something I don't wanna edit million and one posts so it fits right.. all i would have to edit would be 100 posts which would be simple.

 

Then clearly you didn't read it carefully enough.  It completely shows you how to do what you wanted.

 

You must be seeing a page im not I am looking throught the 12 pages and all im reading about is Putting page numbers down as like << < 5 6 7 [8] 9 10 11 > >>  This is not what im wanting to do... I already have my numbering pages done...

 

 

and if you are talking about limits to 10 for each page i have that done as well i already knew that but thats not what i want..

Link to comment
Share on other sites

As i couldn't edit the other post..

 

I'm going try making this alittle simpler so you understand what i'm wanting to do..

 

As i stated before I have a News script that will allow 10 news postings on each page and shows all the page numbers at the bottom and stuff like that..

 

Now what i want to do is when say 10 pages of news is filled up the old posts say post 1 from lets say May 05, 2008 would be put on 11th page well it will pull out that post and post it into a new table on the same database and delete it from the old one.

 

or i guess i could go with making the insert script to post in both and once it hits 11th page it deletes that one?  maybe that would be a easier way to go about doing what i want?

 

or create a cron job script that will run every 12 to 24 hours that will check to see if the pages exceed 10 pages

Link to comment
Share on other sites

* Upon insert, do a count of the records.

* If there are 101, then select the first post, ordered by date ascending, and get all the data out of it

* Insert the data from that row into a different table

* Go back to the first table and delete that row.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.