Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Tick the most widely read in descending News

Asked Modified Viewed 1,133 times
K
Kvido
K
Kvido 10
Linux-Ubuntu 09.03.60, Linux/Ubuntu, PHP5, HTML5, Mozilla-Firefox 3.6.3, Opera 10.51, IE 8.0.6
https://www.nekecamweb.cz
  • Senior Member, joined since
  • Contributed 524 posts on the community forums.
  • Started 108 threads in the forums
  • Started this discussions
asked
Senior Member

Hi all!

1 / V administration, editing News (Content Admin / Add News), I want to remove the check mark, "Automatic Line-Breaks".

2 / I want to replace the checkmark for the current date: "Sort news by Most read news".

It should go about editing the file administration / news.php

This will display news added in the last 24 hours, sorted according viewed.

 $result = dbquery(
         "SELECT tn.*, tc.*, tu.user_id, tu.user_name, tu.user_status
         FROM ".DB_NEWS." tn
         LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
         LEFT JOIN ".DB_NEWS_CATS." tc ON tn.news_cat=tc.news_cat_id
         WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().")
            AND (news_end='0'||news_end>=".time().") AND (news_datestamp < ".time()." && news_datestamp > ".(time()-86400).") AND news_draft='0'
         GROUP BY news_id
         ORDER BY news_reads DESC LIMIT ".$_GET['rowstart'].",".$items_per_page
      );



However, I do not know how to implement the administration / news.php
Can anyone help me. Thank you.
0 replies

4 posts

F
Falk
F
Falk 148
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 12 questions
answered
Super Admin

Hi,
In Administration/news.php

Find
$news_breaks = " checked='checked'";


Change to
$news_breaks = "";


I news.php find
      $result = dbquery("SELECT tn.*, tc.*, tu.user_id, tu.user_name, tu.user_status, tu.user_avatar , tu.user_level, tu.user_joined
         FROM ".DB_NEWS." tn
         LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
         LEFT JOIN ".DB_NEWS_CATS." tc ON tn.news_cat=tc.news_cat_id
         ".(multilang_table("NS") ? "WHERE news_language='".LANGUAGE."' AND" : "WHERE")." ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().")
            AND (news_end='0'||news_end>=".time().") AND news_draft='0'
         GROUP BY news_id
         ORDER BY news_sticky DESC, news_datestamp DESC LIMIT ".$_GET['rowstart'].",".$items_per_page);

Try something like
      $result = dbquery("SELECT tn.*, tc.*, tu.user_id, tu.user_name, tu.user_status, tu.user_avatar , tu.user_level, tu.user_joined
         FROM ".DB_NEWS." tn
         LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
         LEFT JOIN ".DB_NEWS_CATS." tc ON tn.news_cat=tc.news_cat_id
         ".(multilang_table("NS") ? "WHERE news_language='".LANGUAGE."' AND" : "WHERE")." ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().")
            AND (news_end='0'||news_end>=".time().") AND news_draft='0'
         GROUP BY news_id
         ORDER BY news_reads DESC LIMIT ".$_GET['rowstart'].",".$items_per_page);
0 replies
K
Kvido
K
Kvido 10
Linux-Ubuntu 09.03.60, Linux/Ubuntu, PHP5, HTML5, Mozilla-Firefox 3.6.3, Opera 10.51, IE 8.0.6
https://www.nekecamweb.cz
  • Senior Member, joined since
  • Contributed 524 posts on the community forums.
  • Started 108 threads in the forums
  • Started this discussions
answered
Senior Member

Meanwhile, Your recommendation is not displayed screen is black.
All modifications I made.

The most read work with this code...

$result = dbquery(
 "SELECT tn.*, tc.*, tu.user_id, tu.user_name, tu.user_status
         FROM ".DB_NEWS." tn
         LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
         LEFT JOIN ".DB_NEWS_CATS." tc ON tn.news_cat=tc.news_cat_id
WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().")
AND (news_end='0'||news_end>=".time().") AND (news_datestamp < ".time()." && news_datestamp > ".(time()-86400).") AND news_draft='0'
         GROUP BY news_id
         ORDER BY news_reads DESC LIMIT ".$_GET['rowstart'].",".$items_per_page);


... but only News of the day in other days are not displayed.

You can see this change is now on ...http://www.pc-politika.cz
0 replies
F
Falk
F
Falk 148
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 12 questions
answered
Super Admin

When I look at your first page it does what the code says, sorting by most views.
You need to tinker some with it. I did notice that your pagenav is broken, so I could not check the other pages.
What PHPFusion version are you using and what SEO engine do you use?
0 replies
K
Kvido
K
Kvido 10
Linux-Ubuntu 09.03.60, Linux/Ubuntu, PHP5, HTML5, Mozilla-Firefox 3.6.3, Opera 10.51, IE 8.0.6
https://www.nekecamweb.cz
  • Senior Member, joined since
  • Contributed 524 posts on the community forums.
  • Started 108 threads in the forums
  • Started this discussions
answered
Senior Member

I use SEO:
Infusion: SEO Friendly URLs for PHPFusion
| Filename: seo_friendly_urls_panel_admin.php
| Author: Ankur Thakur
| Version: 1.00

PHPFusion: 7.02.07

Theme: /theme/Modish/includes/render_news_articles.php
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 4 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

F
F
Falk 148
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 12 questions
K
K
Kvido 10
Linux-Ubuntu 09.03.60, Linux/Ubuntu, PHP5, HTML5, Mozilla-Firefox 3.6.3, Opera 10.51, IE 8.0.6
https://www.nekecamweb.cz
  • Senior Member, joined since
  • Contributed 524 posts on the community forums.
  • Started 108 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet