Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,353 members, 7,822,674 topics. Date: Thursday, 09 May 2024 at 02:52 PM

PHP - How Does Nairaland's Frontpage Works - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / PHP - How Does Nairaland's Frontpage Works (1866 Views)

/ [PHP] How Can I Use REQUIRE For A Footer That Exist In Another Folder? / Php: How To Display A Message To A Specific User ID Or User Name (2) (3) (4)

(1) (Reply) (Go Down)

PHP - How Does Nairaland's Frontpage Works by ArewaTech1(m): 4:25pm On Feb 10, 2017
I'm currently writing some software and I'm trying to code the front page.

I'm thinking of 2 things.

1. after user successfully logged in, on the FrontPage he gets list of top(popular, trending, something like that) posts based on the topics(tags, categories he's following).
and
2. the Nairaland style. which is why I want to know, are the posts moved manually by Admins or is there any scheduling script or cron job done.

gurus in the house your thoughts needed.
Re: PHP - How Does Nairaland's Frontpage Works by Donald3d(m): 5:08pm On Feb 10, 2017
ArewaTech1:
I'm currently writing some software and I'm trying to code the front page.

I'm thinking of 2 things.

1. after user successfully logged in, on the FrontPage he gets list of top(popular, trending, something like that) posts based on the topics(tags, categories he's following).
and
2. the Nairaland style. which is why I want to know, are the posts moved manually by Admins or is there any scheduling script or cron job done.

gurus in the house your thoughts needed.
Front page post are moved manually

1 Like

Re: PHP - How Does Nairaland's Frontpage Works by ezechinwa2: 7:04pm On Feb 10, 2017
ArewaTech1:
I'm currently writing some software and I'm trying to code the front page.

I'm thinking of 2 things.

1. after user successfully logged in, on the FrontPage he gets list of top(popular, trending, something like that) posts based on the topics(tags, categories he's following).
and
2. the Nairaland style. which is why I want to know, are the posts moved manually by Admins or is there any scheduling script or cron job done.

gurus in the house your thoughts needed.

This can be achieved by designing your database properly
1. When you query the database for maybe the most viewed content, it returns a list of topics with the highest means it's the trending topic.. That's just one of the simplest ways in achieving that.. Google works with more complex tagging approach.
In summary, you have to use Php or any preferred server side scripting language to count the number of viewers on every topic, you can also add more parameter like most replied topics.. Those stats gives you on what's trending.

2. This could be achieved using your database design, for instance.
Let's assume a table name topics
Topics has fields
Id number
Title string
Date date/time
Time date/time
Frontpage boolean or string


Now an admin panel will be created to have access to this table
Let's assume you have two topics uploaded in your table
It looks like
1. Is buhari dead, 23/2/2099, 4am, false
2. Am I stupid, 24/3/2099,5pm, false...



Now if the admin wishes to make topic with the ID of 1 to make front page, all he needs to do is to run an UPDATE query to change the field called frontpage which was set to false by default, now change it to true.


Finally on the front page, you simply another query to display only topics where their frontpage is true...


I hope you understand my little tutorial.

Also before I forget,, it always has to be paginated as your data will always get bigger in future.. DONT worry Jquery can easily do this for you.

2 Likes

Re: PHP - How Does Nairaland's Frontpage Works by ArewaTech1(m): 7:22pm On Feb 10, 2017
ezechinwa2:


This can be achieved by designing your database properly
1. When you query the database for maybe the most viewed content, it returns a list of topics with the highest means it's the trending topic.. That's just one of the simplest ways in achieving that.. Google works with more complex tagging approach.
In summary, you have to use Php or any preferred server side scripting language to count the number of viewers on every topic, you can also add more parameter like most replied topics.. Those stats gives you on what's trending.

2. This could be achieved using your database design, for instance.
Let's assume a table name topics
Topics has fields
Id number
Title string
Date date/time
Time date/time
Frontpage boolean or string


Now an admin panel will be created to have access to this table
Let's assume you have two topics uploaded in your table
It looks like
1. Is buhari dead, 23/2/2099, 4am, false
2. Am I stupid, 24/3/2099,5pm, false...



Now if the admin wishes to make topic with the ID of 1 to make front page, all he needs to do is to run an UPDATE query to change the field called frontpage which was set to false by default, now change it to true.


Finally on the front page, you simply another query to display only topics where their frontpage is true...


I hope you understand my little tutorial.

Also before I forget,, it always has to be paginated as your data will always get bigger in future.. DONT worry Jquery can easily do this for you.
Thanks man, you made me happy this evening. God Bless You.

2 Likes

Re: PHP - How Does Nairaland's Frontpage Works by directonpc(m): 1:42am On Feb 11, 2017
ArewaTech1:

Thanks man, you made me happy this evening. God Bless You.
though won't work with just triggering 1 and 0 if I were u.
Re: PHP - How Does Nairaland's Frontpage Works by peerol(m): 3:08am On Feb 11, 2017
Hi all,

I think this information can be useful for you. If you plan to get your website, here is one good free web hosting provider to choose - 000webhost.com

They provide hosting absolutely free, there is no catch. You get 1500 MB of disk space and 100 GB bandwidth. They also have cPanel control panel which is amazing and easy to use website builder. Moreover, there is no any kind of advertising on your pages.

You can register here: https://www.000webhost.com/943036.html
Re: PHP - How Does Nairaland's Frontpage Works by ArewaTech1(m): 4:32pm On Feb 11, 2017
directonpc:
though won't work with just triggering 1 and 0 if I were u.
Could you please be more specific
Re: PHP - How Does Nairaland's Frontpage Works by 0luwatope(m): 11:44am On Feb 13, 2017
ArewaTech1:

Could you please be more specific
I am a programmer that loves doing things automatically and as a matter of fact, my website runs by itself with just little monituring. if you ever want to do something like this, dont make front page post by just the number of views or comment, instead, add a front page reccommendation button to every post so as soon as the number of front page rec6mmendation exceed the required number and it has quite enough views comments already, it will automatically move to fp... I know you dont wanna see dumb posts that has hundreds of views on fp, just saying. Op
Re: PHP - How Does Nairaland's Frontpage Works by ArewaTech1(m): 3:37pm On Feb 13, 2017
0luwatope:
I am a programmer that loves doing things automatically and as a matter of fact, my website runs by itself with just little monituring. if you ever want to do something like this, dont make front page post by just the number of views or comment, instead, add a front page reccommendation button to every post so as soon as the number of front page rec6mmendation exceed the required number and it has quite enough views comments already, it will automatically move to fp... I know you dont wanna see dumb posts that has hundreds of views on fp, just saying. Op
Great, I'm also thinking of a way in which the FP populates itself depending on what Boards/Categories the user follows, but the thing is that each and every user will have a different FP(it makes me think otherwise).

But I'll finally choose the one I thinks suits best, depending on recommendations here by websmasters and gurus
Re: PHP - How Does Nairaland's Frontpage Works by Nobody: 6:43pm On Feb 14, 2017
The Nairaland Featuring system is quite simple, and this is how I think it works.

It is a simple blog-like system, that accepts PostTitle, PostUrl, FeaturedTime, and probably logs the ModName.

The PostTitle accepts bbcodes, the PostUrl can be altered too, the FeaturedTime is shown only when paginated, and the (Logged) mod name can be seen only by the superMods.

1 Like

Re: PHP - How Does Nairaland's Frontpage Works by directonpc(m): 12:38am On Feb 15, 2017
TOmmyJidex:
The Nairaland Featuring system is quite simple, and this is how I think it works.

It is a simple blog-like system, that accepts PostTitle, PostUrl, FeaturedTime, and probably logs the ModName.

The PostTitle accepts bbcodes, the PostUrl can be altered too, the FeaturedTime is shown only when paginated, and the (Logged) mod name can be seen only by the superMods.
gbam! Ope there is your answer. No rocket science in it.
Re: PHP - How Does Nairaland's Frontpage Works by trytillmake(m): 11:01am On Feb 16, 2017
TOmmyJidex:
The Nairaland Featuring system is quite simple, and this is how I think it works.

It is a simple blog-like system, that accepts PostTitle, PostUrl, FeaturedTime, and probably logs the ModName.

The PostTitle accepts bbcodes, the PostUrl can be altered too, the FeaturedTime is shown only when paginated, and the (Logged) mod name can be seen only by the superMods.

I think you hit the nail, if u check the topics on the front page compare to the url when u hover on it,it shows there is a mechanical system involved probably for seo purposes, i believe alll topics have a front page button attached to it also with an ability to alter to the heading.
Re: PHP - How Does Nairaland's Frontpage Works by semasir: 3:12am On Feb 17, 2017
Quite easy, I use something similar to this script via the LASU Forum link on my signature and it works by mods or supermods suggesting the post to be moved to FP then it will be confirmed by the Supermods

ArewaTech1:
I'm currently writing some software and I'm trying to code the front page.

I'm thinking of 2 things.

1. after user successfully logged in, on the FrontPage he gets list of top(popular, trending, something like that) posts based on the topics(tags, categories he's following).
and
2. the Nairaland style. which is why I want to know, are the posts moved manually by Admins or is there any scheduling script or cron job done.

gurus in the house your thoughts needed.
Re: PHP - How Does Nairaland's Frontpage Works by stevenson007: 10:35am On Feb 18, 2017
My brother Frontpages are not automated,,,,,those ogbolo mods moved anything they like to the frontpage...

(1) (Reply)

How To Get A Free Brand New Laptop As A Programmer / How To Design An Antivirus Software Using Virus Signature Defination / C++0x: The Future Of C++

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 35
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.