Yuav Ua Li Cas Rau Nruab Rss Pub

Cov txheej txheem:

Yuav Ua Li Cas Rau Nruab Rss Pub
Yuav Ua Li Cas Rau Nruab Rss Pub

Video: Yuav Ua Li Cas Rau Nruab Rss Pub

Video: Yuav Ua Li Cas Rau Nruab Rss Pub
Video: Yuav ua li cas rau nruab chav ua mov dab dej 2024, Kaum ib hlis
Anonim

RSS noj pub rau ntawm koj lub xaib yuav ua rau txhua tus neeg siv txaus siab nyob rau hauv cov ntaub ntawv koj muab kom tau txais cov xov xwm tshiab. Niaj hnub no kev tswj fwm txheej tshuab twb muaj tshwj xeeb RSS kev koom ua ke, tab sis yog tias lawv tsis tuaj, kev teeb tsa phau ntawv muaj peev xwm ua tau.

Yuav ua li cas rau nruab rss pub
Yuav ua li cas rau nruab rss pub

Cov Lus Qhia

Kauj ruam 1

Txhawm rau nruab rss pub rau ntawm koj tus kheej lub vev xaib, ua cov hauv qab no. Txuas lub plugin hu ua RssFeed rau koj tus xaib xaib. Tom qab ntawd tsim daim ntawv rss.php, qhov twg muab cov kab tso rau hauv kab ntawv ntawm kab ntawv txuas https://narod.ru/disk/44880181001/rssfeed.txt.html. Hauv PHP code kev tshaj tawm, nco ntsoov teeb tsa cov haujlwm tas li - ntu. Yuav tsum ceev faj rau qhov tsis tseem ceeb ntawm NEWSTABLE thiab DATECOLUMN - qhov no yog lub npe ntawm cov ntawv qhia hloov tshiab thiab cov npe ntawm cov kev xaiv tso saib hnub tim, raws li. Yog tias qhov kawg taw tes ploj, ces nws yuav tsum tau kho dua (cov ntawv ntawm RSS pub yuav tsum muaj hnub tim).

Kauj ruam 2

Tom qab txhais tau qhov xwm txheej tas mus li thiab txuas rau lub hauv paus, tsim tawm txhua kab ntawv hauv.xml hom. Txhawm rau ua qhov no, siv kab ntawv sau muaj kab ntawm PHP code los ntawm rub tawm ntawm qhov txuas https://narod.ru/disk/44880199001/rssfeed1.txt.html. Nws yuav tsum raug sau tseg tias nyob rau hauv cov cai no koj tuaj yeem hloov kho tsuas yog cov npe ntawm cov liaj teb hauv cov ntaub ntawv rau nplooj ntawv, npe thiab piav qhia. Nyob rau hauv qhov xwm txheej uas cov kab no tau tsim raws li tus qauv sib txawv, kho qhov tsim nyog kho.

Kauj ruam 3

Tam sim no koj yuav tsum tau kuaj xyuas yog tias qhov chaw teeb tsa tau ua haujlwm. RSS pub rau nyob rau ntawm site.ru/rss.php. Yog tias cov ntawv xov xwm los ntawm koj lub xaib tsis los ntawm qhov txuas tshwj xeeb, tom qab ntawd muaj teeb meem hauv cov chaw. Siv FeedValidator lossis lwm lub zog siv tau los sim koj cov ntawv thov XML. Ua kom qhov chaw nyob pub yooj yim thiab nkag siab tau rau cov neeg rau npe, nws yog qhov zoo uas yuav tau siv kev nkag mus rau hauv daim ntawv /latest-news.xml es tsis /rss.php. Txhawm rau ua qhov no, kho cov ntaub ntawv.htaccess (yog tias koj lub vev xaib siv apache). Txij ntawm no, cov txheej txheem kev teeb tsa rau RSS pub ua tiav. Teem lub pob kom luv los sau npe cov neeg siv rau lub xaib thiab tos rau thawj cov neeg siv khoom.

Pom zoo: