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?

[Solved] News category on a single page

Asked Modified Viewed 2,317 times
A
antinerd
A
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
asked
Junior Member

Hi!
I'm using the seo friendly urls infusion and I can't seem to find the link for a single news category.
I see news_cats.php but I can't go to a single category where I can see all the news in that category on a single page.
Any ideas how can I do that?
Thanks a lot!
Edited by antinerd on 21-06-2014 16:37,
0 replies

14 posts

F
faga
F
faga 10
I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.” - Bill Gates
  • Member, joined since
  • Contributed 158 posts on the community forums.
  • Started 14 threads in the forums
answered
Member

Hello!

SEO-Fusion v1.00 or ?
0 replies
A
antinerd
A
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Junior Member

Yes, it's SEO-Fusion 1.00 - By Ankur Thakur
I appreciate your help!
0 replies
F
faga
F
faga 10
I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.” - Bill Gates
  • Member, joined since
  • Contributed 158 posts on the community forums.
  • Started 14 threads in the forums
answered
Member

In Admin > Settings > News you have Image link: select category and save. Now click on the image that you add to the article and it should redirect you to the category.
0 replies
A
antinerd
A
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Junior Member

Thanks you!
Is there by any chance a way I can show news in a category like the articles are shown in a category?
In a news category, news are shown by links but in articles they're shown by the preview so I can show images and text.
www.mixolix.com/images/show.png
0 replies
F
faga
F
faga 10
I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.” - Bill Gates
  • Member, joined since
  • Contributed 158 posts on the community forums.
  • Started 14 threads in the forums
answered
Member

It can be done, but I think I saw this mode somewhere in the forum.
0 replies
A
antinerd
A
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Junior Member

I searched for it like crazy, I also tried to do it myself bu with no luck.
Does anyone have an idea?
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Hi,

I think you need News Categories Center Panel.
Go to the site in my link in my profile or the link in my sig and search for that panel mentioned above it might be what your looking for.#

www.phpfusionmods.co.uk/downloads/images/news_cats_center_panel_preview.png


Regards
0 replies
A
antinerd
A
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Junior Member

That's exactly what I need Craig. Thank you very much.

But, it doesn't work on my website because I have seo-fusion installed and that mod blocks any center panels to show up. I followed the tutorial to fix this issue from this thread: http://www.php-fusion.co.uk/forum/vie...rowstart=0 but for some reason it doesn't work. I think I'm not doing something right, but I tried everything I could think of.
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Select display panel on all pages and enter in the box the page to include it on.
0 replies
A
antinerd
A
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Junior Member

Awesome that does what I need it to do (almost).

One more question, I hope I'm not pushing it too much.
Can I hide the panel with the news categories? I only what to have links in my sub-header menu to some of the categories (for example http://mixolix.com/news.php?cat_id=19
I want to hide this:
www.mixolix.com/images/test.jpg


Thank you very much for your help, I wanted this modification for some time.
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Hey,

Sure no problem.

Here you go. Just upload and overwrite this to /infusions/news_cats_center_panel/news_cats_center_panel.php...

<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright © 2002 - 2013 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Name:  News Categories Center Panel
| Version: 1.00
| File Name: news_cats_center_panel.php
| Author: PHPFusion Mods UK
| Developers: Craig
| Site: http://www.phpfusionmods.co.uk
| Additional code from PHPFusion V7.02 news.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

if (file_exists(INFUSIONS."news_cats_center_panel/locale/".$settings['locale'].".php")) {
include INFUSIONS."news_cats_center_panel/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."news_cats_center_panel/locale/English.php";
}
include LOCALE.LOCALESET."news_cats.php";

if (isset($_GET['cat_id']) && isnum($_GET['cat_id'])) {
         $result =  dbquery("SELECT * FROM ".DB_NEWS_CATS." WHERE news_cat_id='".$_GET['cat_id']."'");
         $numrows = dbrows($result);
         while ($datab = dbarray($result)) {

            opentable($datab['news_cat_name'].$locale['global_200'].$locale['newscats001']);
            $news_in_this_cat = dbcount("(news_id)", DB_NEWS, "news_cat='".$_GET['cat_id']."' AND ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().") AND news_draft='0'");
            echo " <div style='margin-bottom: 10px; margin-left: auto; margin-right:auto; padding-left: 5px; padding-right: 5px;'><div style='float:left;'>".THEME_BULLET." ".$locale['newscats005'].$datab['news_cat_name'].$locale['newscats006']."
            </div><div style='float:right;'>Total News Items In This Category: ".$news_in_this_cat."</div></div>";
      closetable();
         }
   
$items_per_page = "5";


$rows = dbcount("(news_id)", DB_NEWS, "news_cat='".$_GET['cat_id']."' AND ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().") AND news_draft='0'");
   if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { $_GET['rowstart'] = 0; }
   if ($rows) {
            $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_draft='0' AND news_cat_id='".$_GET['cat_id']."'
         GROUP BY news_id
         ORDER BY news_sticky DESC, news_datestamp DESC LIMIT ".$_GET['rowstart'].",".$items_per_page);
         
      $numrows = dbrows($result);
      while ($data = dbarray($result)) {
   
         $i++;
         $comments = dbcount("(comment_id)", DB_COMMENTS." WHERE comment_type='N' AND comment_hidden='0' AND comment_item_id='".$data['news_id']."'");
         $news_cat_image = "";
         $news_subject = "<a href='".BASEDIR."news.php?readmore=".$data['news_id']."' name='news_".$data['news_id']."' id='news_".$data['news_id']."'>".stripslashes($data['news_subject'])."</a>";
         $news_cat_image = "<a href='".($settings['news_image_link'] == 0 ? "news_cats.php?cat_id=".$data['news_cat']
                                                            : BASEDIR."news.php?readmore=".$data['news_id'] )."'>";
         if ($data['news_image_t2'] && $settings['news_image_frontpage'] == 0) {
            $news_cat_image .= "<img src='".IMAGES_N_T.$data['news_image_t2']."' alt='".$data['news_subject']."' class='news-category' /></a>";
         } elseif ($data['news_cat_image']) {
            $news_cat_image .= "<img src='".get_image("nc_".$data['news_cat_name'])."' alt='".$data['news_cat_name']."' class='news-category' /></a>";
         } else {
            $news_cat_image = "";
         }
         $news_news = preg_replace("/<!?--\s*pagebreak\s*-->/i", "", ($data['news_breaks'] == "y" ? nl2br(stripslashes($data['news_news'])) : stripslashes($data['news_news'])));
         $news_info = array(
            "news_id" => $data['news_id'],
            "user_id" => $data['user_id'],
            "user_name" => $data['user_name'],
            "user_status" => $data['user_status'],
            "news_date" => $data['news_datestamp'],
            "cat_id" => $data['news_cat'],
            "cat_name" => $data['news_cat_name'],
            "cat_image" => $news_cat_image,
            "news_subject" => $data['news_subject'],
            "news_ext" => $data['news_extended'] ? "y" : "n",
            "news_reads" => $data['news_reads'],
            "news_comments" => $comments,
            "news_allow_comments" => $data['news_allow_comments'],
            "news_sticky" => $data['news_sticky']
         );

         echo "<!--news_prepost_".$i."-->\n";
         render_news($news_subject, $news_news, $news_info);
      }
      echo "<!--sub_news_idx-->\n";
      if ($rows > $items_per_page) echo "<div align='center' style='margin-top:5px;'>\n".makepagenav($_GET['rowstart'], $items_per_page, $rows, 3, FUSION_SELF."?cat_id=".$_GET['cat_id']."&amp;")."\n</div>\n";
      echo"<div align='center' style='font-weight: bold; margin-top:10px;'><a class='small' href='".FUSION_SELF."'>".$locale['newscats007']."</a></div>";
   } else {
      redirect(FUSION_SELF);
   }
   
if (!dbrows($result) || !isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) { redirect(FUSION_SELF); }

}
   
?>


Regards
0 replies
A
antinerd
A
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Junior Member

Works perfect but now at appears that my articles don't work.
When I access one category from my articles it goes to articles categories (all of them appear), You can see that here: www.mixolix.com
When you hover the top link named "Stiai" you can see the page's url but when you click it it goes to Articles.
It works perfectly if I disable the news panel.
Do you have any idea why that happens? I whould really like to use this center panel.

Thank you.
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

No idea all I know is it works with PHPFusion V7.02.07 and it is for news Categories not articles so I am not sure what articles has to do in regards to this panel.
0 replies
A
antinerd
A
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Junior Member

Ok, Thank you very much for your help, I'll see what I can do about this problem (not much I assume).
0 replies

Category Forum

Panels and Infusions

Labels

None yet

Statistics

  • Views 0 views
  • Posts 14 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
F
F
faga 10
I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it.” - Bill Gates
  • Member, joined since
  • Contributed 158 posts on the community forums.
  • Started 14 threads in the forums
A
A
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet