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?

Articles in the news page?

Asked Modified Viewed 6,083 times
S
Skulz
S
Skulz 10
  • Member, joined since
  • Contributed 76 posts on the community forums.
  • Started 20 threads in the forums
  • Started this discussions
asked
Member

Is there any way to show the articles togheter with the news? I like how the news can be shown in home page with a preview too, can i do the same with the articles?

If it can't be done a preview of any kind would be nice..
Edited by Skulz on 12-03-2014 13:21,
0 replies

16 posts

P
PeaceLaced
P
PHP-Fusion MAIN Support Team
PHP-Fusion USA NSS Admin
  • Member, joined since
  • Contributed 154 posts on the community forums.
  • Started 23 threads in the forums
answered
Member

Need more detail. Are you looking for a panel that shows article categories? Do you want actual article content? Do you want news on top (say 10 showing) then articles under (however many showing.)? Please be more specific in how you want to represent the data so we can help further.

Thanks.
0 replies
S
Skulz
S
Skulz 10
  • Member, joined since
  • Contributed 76 posts on the community forums.
  • Started 20 threads in the forums
  • Started this discussions
answered
Member

Thanks for your help also in this thread brandonblack :).
This is the website: http://www.tapugames.it/news.php

As you see i have a panel with latest articles on top and the news under them. Every news has some content as preview. I would like to do the same with the articles.

Even mix articles and news in the same tab there wouldn't be bad, i write really more articles then news.
Edited by helmuth on 13-03-2014 11:07,
0 replies
P
PeaceLaced
P
PHP-Fusion MAIN Support Team
PHP-Fusion USA NSS Admin
  • Member, joined since
  • Contributed 154 posts on the community forums.
  • Started 23 threads in the forums
answered
Member

Skulz, here is a very quick and ugly script to extract article information (subject, snippet, article) out of your database. It is currently set to ALL articles using the >0 call on article categories. Place the following between the open and close table tags in a center panel and play from there. Happy coding.


$result = dbquery("SELECT * FROM ".DB_ARTICLES." WHERE article_cat>0");

echo "<table>";
while ($data = dbarray($result)) {

   echo "<tr>";
   
   echo "<td>";
   echo $data['article_subject'];
   echo "</td>";
   
   echo "<td>";
   echo $data['article_snippet'];
   echo "</td>";
   
   echo "</tr>";
   
   echo "<tr>";
   echo "<td colspan='2'>";
   echo $data['article_article'];
   echo "</td>";
   echo "</tr>";
   }
echo "</table>";
0 replies
C
Chan
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
answered
Super Admin

Quote

ugly script


it's not. good write.
0 replies
S
Skulz
S
Skulz 10
  • Member, joined since
  • Contributed 76 posts on the community forums.
  • Started 20 threads in the forums
  • Started this discussions
answered
Member

Thanks, i have put it like this:

opentable("test");
echo "

$result = dbquery('SELECT * FROM '.DB_ARTICLES.' WHERE article_cat>0');

echo '<table>';
while ($data = dbarray($result)) {

   echo '<tr>';
   
   echo '<td>';
   echo $data['article_subject'];
   echo '</td>';
   
   echo '<td>';
   echo $data['article_snippet'];
   echo '</td>';
   
   echo '</tr>';
   
   echo '<tr>';
   echo '<td colspan='2'>';
   echo $data['article_article'];
   echo '</td>';
   echo '</tr>';
   }
echo '</table>';


";
closetable();




But nothing happens.
Edited by Skulz on 21-03-2014 15:27,
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

Skulz, do you want Articles layout the same as news?
0 replies
S
Skulz
S
Skulz 10
  • Member, joined since
  • Contributed 76 posts on the community forums.
  • Started 20 threads in the forums
  • Started this discussions
answered
Member

Quote

Jib wrote:

Skulz, do you want Articles layout the same as news?


Yes and I would like to put them together on the home page
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

Well as I see now by looking here...
http://www.tapugames.it/articles.php?article_id=1050

Articles does look the same as news so all you want then is articles to show on news.php in the same order like news.php latest article first and so on yes?
0 replies
S
Skulz
S
Skulz 10
  • Member, joined since
  • Contributed 76 posts on the community forums.
  • Started 20 threads in the forums
  • Started this discussions
answered
Member

Quote

Jib wrote:

Well as I see now by looking here...
http://www.tapugames.it/articles.php?article_id=1050

Articles does look the same as news so all you want then is articles to show on news.php in the same order like news.php latest article first and so on yes?


http://www.tapugames.it/infusions/image_hosting/images/18f2aa3c41de701129cfa3e2bf06b0f6.jpg

Will be easier to explain with an image :). These are the news in home, i want to make the articles appear here too like these. Yep in chronological order.
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

Ok I will get a cool dude we know to code it just now please wait.

Merged on Mar 21 2014 at 15:03:10:
OK you will use this in conjunction with FP News Panel from PHPFusion Mods UK. (Can't link sorry, against the CoC).

Upload FP News Panel to your site.

Now...

You will need to Read this thread about creating a Custom Home page...

http://www.php-fusion.co.uk/forum/viewthread.php?thread_id=29584

Ok made your page now....

Upload the attached articles panel to /root/infusions

Go to Your site >>> Admin >>> System >>> Panels

Add New Center Panel

Select articles_panel from the dropdown.

Inn the Panels Restriction Box enter the name of your new home page like example: /home.php Select Include on this page and then tick the box Display on all pages.

Done.

If you get stuck further just ask me in this thread and I'll assist you. :G
Edited by Jib on 21-03-2014 19:03,
0 replies
S
Skulz
S
Skulz 10
  • Member, joined since
  • Contributed 76 posts on the community forums.
  • Started 20 threads in the forums
  • Started this discussions
answered
Member

Done but there are problems.

The articles are shown entirely not just title plus some words like the news image I posted before but all the entire article.
Also the ads that I put on top/bottom of each article page are reproduced in every article of the home.php.

The news with the FP news panel instead appears bad formatted. The one on left fit well, the one on right no. Anyway I prefer to display news like are displayed atm, 1 at time for line.
Edited by Skulz on 21-03-2014 18:02,
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

Yea but read the FP New Panel READE ME there is a setting to make the layout for news like normal.

Yeah the Articles Panel pagenav does not work either. :(
0 replies
S
Skulz
S
Skulz 10
  • Member, joined since
  • Contributed 76 posts on the community forums.
  • Started 20 threads in the forums
  • Started this discussions
answered
Member

Oh news can be fixed then, articles are still a problem :).

Also I wished to mix them togheter in the same panel but that prolly is too much to ask.
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

Ok here is what you want, I Hope.

This is basically a copy of exactly how news works.

In your theme you will need to make a change to the articles comment link to this...

<a href='".FUSION_SELF."?article_readmore=".$info['article_id']."#comments'>Comments</a>


and for the READ MORE button you will need to change this line in articles_panel.php so its like your news button...

$articlereadmore = "<br /><a class='side small' href='".FUSION_SELF."?article_readmore=".$data['article_id']."'>READ MORE</a>";
Edited by Jib on 21-03-2014 19:40,
0 replies
S
Skulz
S
Skulz 10
  • Member, joined since
  • Contributed 76 posts on the community forums.
  • Started 20 threads in the forums
  • Started this discussions
answered
Member

Almost :D, I really appreciate your help.

1) When I click read more it brings me to the article but it isn't the same page of that article true? I mean the url is different and I don't find all the panels that I have put on the articles. That's not a big deal anyway i can put them on these too prolly.


2) When I click read more and it brings me to the articles i can see this: Posted by TapuAdmin • In Uncategorised

Why it's uncategorised and doesn't use the category set in the articles?

3) This is a big deal, when I click on a news it brings me to the actual news but on top of it there is also the article panel.


P.S. there is no way to put articles and news in the same panel? It feel a bit weird that you have to scroll down to see the last news
Edited by Skulz on 21-03-2014 19:35,
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

Here is a little fix, lets say no Article Snippet is saved, it will then show a short version of the main article instead and with the read more link to the rest of it.

Your problems you need to edit render_articles in your theme.php to get the correct links.

Same panel would make no difference the result would still be the same as it is now.

New Files Attached with changes mentioned above.
Craig attached the following file:
articles_panel.zip [No information available / 294 Downloads]
0 replies

Labels

None yet

Statistics

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

4 participants

P
P
PHP-Fusion MAIN Support Team
PHP-Fusion USA NSS Admin
  • Member, joined since
  • Contributed 154 posts on the community forums.
  • Started 23 threads in the forums
C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
C
C
Chan 0
Lead Developer of PHP-Fusion
  • Super Admin, joined since
  • Contributed 3,842 posts on the community forums.
  • Started 232 threads in the forums
  • Answered 6 questions
S
S
Skulz 10
  • Member, joined since
  • Contributed 76 posts on the community forums.
  • Started 20 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet