DataLife Engine English Support Site » DatalifeEngine Add-ons » Changing how the popular news display
Welcome,. Enter Username, or register.
Login: password:  



ApadanaGroup's Hosting Services available now with Unbelievable LOW PRICES,
Unlimited SPACE AND Unlimited Transfer ....Check it out !!!
http://unlimitpackage.net/

Changing how the popular news display

Author Tak, Category DatalifeEngine Add-ons10 September 2006.
Taken from russian and translated...

This is a way to change how the news are displayed, we can make it so the popular news top item will be the most highly rated article you have.
Open topnews.php and find:

$sql_result = $db->query("SELECT id, title, date, alt_name FROM " . PREFIX . "_post WHERE approve='1' ORDER BY rating DESC, comm_num DESC, news_read DESC, date DESC LIMIT 0,10");


replace it with:

$sql_result = $db->query("SELECT id, title, date, alt_name FROM " . PREFIX . "_post
WHERE approve='1' ORDER BY rating / vote_num DESC, comm_num DESC, news_read DESC, date DESC
LIMIT 0,10");


But is it possible to somehow make so that in 15 days from publication, any news, with whatever rating it has, disappears from the topnews forever?


$sql_result = $db->query("SELECT id, title, date, alt_name FROM ". PREFIX . "_post WHERE approve='1' and TO_DAYS(now()) - TO_DAYS(date) <= X ORDER BY rating / vote_num DESC, comm_num DESC, news_read DESC, date DESC LIMIT 0,10");


where the mysterious symbol X is equal to the necessary quantity of days.
 
Your are currently a guest on this site. Please click here to register
  • views: 800
  •  Print
    • 68
     (Votes #: 2)
  
  • Readmore (For News) with AJAX
  • Last new news in the block
  • Allow rating from the short articles
  • Vulnerability from 18.08.2006
  • Date Functions



  • Information

    Members of Guest cannot leave comments.


    Your Ad Here

    Vote

    Datalife Engine is
    Excellent
    Good
    Fair
    Poor
    Bad

    Get Chitika eMiniMalls

    The information

    Online Now:
    Users: 0
    Not Online.

    Robots: 3
    GooglebotWebAlta Crawler
    Alexa

    Guests: 12
    Total: 15

    Last Online Users:
    Users: 20
    abdouaniba admin7
    alnoah bethuy
    bitto dato_var4
    funning17 g-mic
    javad kyoko
    MaCeLMp4 Magid
    Motor name_less
    pakio sanalreis
    sma_eslami topsoftware
    whosthis.ee zigmuntt

    Tgs Cloud

    4support, Added, After, Appointmentmodule, BBcode, CHMOD, Cache, Clear, Cropping, Datalifeengine, Description, Dle, EMail, ENGINE_DIRincparseclassphp, Length, Uberat, access, according, adding, additional, administrator, attention, categories, certain, changes, closing, comments, corrected, creation, directly, domain SUPPORT, editing, enginecachesystemStart, errors, everything, files, folder, forum, friends, indispensable, install, installation, installphp, issue, itsinstructions, language, large, listof, moved, myFAQ, notice, opening, opublikovanye, patterns, player, possible, published, question, received, record, referring, registration, removal, responses, roach, script, server, submit, support, system, titla, upgrade, useful, users, using, version, versions, visitors, which, worry

    To show all tags